PDA

View Full Version : SageScript Healdown v1



WRoss
11-27-2009, 04:57 AM
Being a beta tester of the new Psinet, I'm going to try to provide a few examples of some scripts so that when it is released, there are some working scripts people can look at or just use. I'll be working with Jamus and hopefully someone else in the near future to modify this into a full blown heal script. I'll try and post in here to explain the progression.

Notes: This eliminates the screen scroll caused by the traditional heal script that is floating around. What I mean by that is that it does not require constant checks of the HEAL command. There is no mana check, yet. It does not heal in order of necessity, exp, or areas that are bleeding, yet.



*************************




while(%me.health < %me.maxhealth){
put prep 1101
waitfor You focus
put cure
pause 3
}

while(%me.body.rightleg.wound > 0) {
put prep 1102
waitfor You concentrate
put cure right leg
pause 3
}

while(%me.body.leftleg.wound > 0) {
put prep 1102
waitfor You concentrate
put cure left leg
pause 3
}

while(%me.body.rightarm.wound > 0) {
put prep 1102
waitfor You concentrate
put cure right arm
pause 3
}

while(%me.body.righthand.wound > 0) {
put prep 1102
waitfor You concentrate
put cure right hand
pause 3
}

while(%me.body.leftarm.wound > 0) {
put prep 1102
waitfor You concentrate
put cure left arm
pause 3
}

while(%me.body.lefthand.wound > 0) {
put prep 1102
waitfor You concentrate
pure cure left hand
pause 3
}

while(%me.body.nerves.wound > 0) {
put prep 1103
waitfor You concentrate
put cure nerves
pause 3
}

while(%me.body.head.wound > 0) {
put prep 1104
waitfor You concentrate
put cure head
pause 3
}

while(%me.body.neck.wound > 0) {
put prep 1104
waitfor You concentrate
put cure neck
pause 3
}

while(%me.body.righteye.wound > 0) {
put prep 1105
waitfor You concentrate
put cure right eye
pause 3
}

while(%me.body.lefteye.wound > 0) {
put prep 1105
waitfor You concentrate
put cure left eye
pause 3
}

while(%me.body.chest.wound > 0) {
put prep 1105
waitfor You concentrate
put cure chest
pause 3
}

while(%me.body.abdomen.wound > 0) {
put prep 1105
waitfor You concentrate
put cure abdomen
pause 3
}

while(%me.body.back.wound > 0) {
put prep 1105
waitfor You concentrate
put cure back
pause 3
}

while(%me.body.rightleg.scar > 0) {
put prep 1111
waitfor You concentrate
put cure right leg
pause 3
}

while(%me.body.leftleg.scar > 0) {
put prep 1111
waitfor You concentrate
put cure left leg
pause 3
}

while(%me.body.rightarm.scar > 0) {
put prep 1111
waitfor You concentrate
put cure right arm
pause 3
}

while(%me.body.righthand.scar > 0) {
put prep 1111
waitfor You concentrate
put cure right hand
pause 3
}

while(%me.body.leftarm.scar > 0) {
put prep 1111
waitfor You concentrate
put cure left arm
pause 3
}

while(%me.body.lefthand.scar > 0) {
put prep 1111
waitfor You concentrate
put cure left hand
pause 3
}

while(%me.body.nerves.scar > 0) {
put prep 1112
waitfor You concentrate
put cure nerves
pause 3
}

while(%me.body.head.scar > 0) {
put prep 1113
waitfor You concentrate
put cure head
pause 3
}

while(%me.body.neck.scar > 0) {
put prep 1113
waitfor You concentrate
put cure neck
pause 3
}

while(%me.body.righteye.scar > 0) {
put prep 1114
waitfor You concentrate
put cure right eye
pause 3
}

while(%me.body.lefteye.scar > 0) {
put prep 1114
waitfor You concentrate
put cure left eye
pause 3
}

while(%me.body.chest.scar > 0) {
put prep 1114
waitfor You concentrate
put cure chest
pause 3
}

while(%me.body.abdomen.scar > 0) {
put prep 1114
waitfor You concentrate
put cure abdomen
pause 3
}

while(%me.body.back.scar > 0) {
put prep 1114
waitfor You concentrate
put cure back
pause 3
}

phantasm
11-27-2009, 05:01 AM
That is beautiful.

SpiffyJr
11-27-2009, 04:07 PM
Seems awfully long.

WRoss
11-27-2009, 06:27 PM
Since I am the only one toying with this and I never have done any programming, I am sure it is not the best it could be. Eventually I will break it into multiple scripts and import them to make it shorter.

Right now, I feel like I know algebra and I'm teaching myself calculus.

WRoss
11-30-2009, 05:09 PM
Ok. I added in a mana check and a fail spell. Next up, priority healing (ie bleeders then head/nerves). The transferring is going to be a bit more tricky. I need to figure out how to make a table. Other than that, this should be a pretty good example for you all.




start:

if(%me.health < %me.maxhealth){
goto blood
}else if(%me.body.righthand.wound > 0) {
$z = "right hand"
$x = %me.body.righthand.wound
goto limbwound
}else if(%me.body.rightarm.wound > 0) {
$z = "right arm"
$x = %me.body.rightarm.wound
goto limbwound
}else if(%me.body.lefthand.wound > 0) {
$z = "left hand"
$x = %me.body.lefthand.wound
goto limbwound
}else if(%me.body.leftarm.wound > 0) {
$z = "left arm"
$x = %me.body.leftarm.wound
goto limbwound
}else if(%me.body.leftleg.wound > 0) {
$z = "left leg"
$x = %me.body.leftleg.wound
goto limbwound
}else if(%me.body.rightleg.wound > 0) {
$z = "right leg"
$x = %me.body.rightleg.wound
goto limbwound
}else if(%me.body.nerves.wound > 0) {
$z = "nerves"
$x = %me.body.nerves.wound
goto nervewound
}else if(%me.body.head.wound > 0) {
$z = "head"
$x = %me.body.head.wound
goto headwound
}else if(%me.body.neck.wound > 0) {
$z = "neck"
$x = %me.body.neck.wound
goto headwound
}else if(%me.body.lefteye.wound > 0) {
$z = "left eye"
$x = %me.body.lefteye.wound
goto organwound
}else if(%me.body.righteye.wound > 0) {
$z = "right eye"
$x = %me.body.righteye.wound
goto organwound
}else if(%me.body.chest.wound > 0) {
$z = "chest"
$x = %me.body.chest.wound
goto organwound
}else if(%me.body.abdomen.wound > 0) {
$z = "abdomen"
$x = %me.body.abdomen.wound
goto organwound
}else if(%me.body.back.wound > 0) {
$z = "back"
$x = %me.body.back.wound
goto organwound
}else if(%me.body.righthand.scar > 0) {
$z = "right hand"
$x = %me.body.righthand.scar
goto limbscar
}else if(%me.body.rightarm.scar > 0) {
$z = "right arm"
$x = %me.body.rightarm.scar
goto limbscar
}else if(%me.body.lefthand.scar > 0) {
$z = "left hand"
$x = %me.body.lefthand.scar
goto limbscar
}else if(%me.body.leftarm.scar > 0) {
$z = "left arm"
$x = %me.body.leftarm.scar
goto limbscar
}else if(%me.body.leftleg.scar > 0) {
$z = "left leg"
$x = %me.body.leftleg.scar
goto limbscar
}else if(%me.body.rightleg.scar > 0) {
$z = "right leg"
$x = %me.body.rightleg.scar
goto limbscar
}else if(%me.body.nerves.scar > 0) {
$z = "nerves"
$x = %me.body.nerves.scar
goto nervescar
}else if(%me.body.head.scar > 0) {
$z = "head"
$x = %me.body.head.scar
goto headscar
}else if(%me.body.neck.scar > 0) {
$z = "neck"
$x = %me.body.neck.scar
goto headscar
}else if(%me.body.lefteye.scar > 0) {
$z = "left eye"
$x = %me.body.lefteye.scar
goto organscar
}else if(%me.body.righteye.scar > 0) {
$z = "right eye"
$x = %me.body.righteye.scar
goto organscar
}else if(%me.body.chest.scar > 0) {
$z = "chest"
$x = %me.body.chest.scar
goto organscar
}else if(%me.body.abdomen.scar > 0) {
$z = "abdomen"
$x = %me.body.abdomen.scar
goto organscar
}else if(%me.body.back.scar > 0) {
$z = "back"
$x = %me.body.back.scar
goto organscar
} else exit

blood:
if(%me.mana < 5){
goto start
} else {
put prep 1101
waitfor You focus
put cure
waitfor You concentrate.
pause 3
waitrt
goto start
}

limbwound:
if(%x >= 2) {
if(%me.mana < 7) {
goto start
} else {
put prep 1102
waitfor You concentrate
put cure %z
waitfor You concentrate.
pause 3
waitrt
goto start
}
}
if(%x == 1) {
if(%me.mana < 2) {
goto start
} else {
put prep 1102
waitfor You concentrate
put cure %z
waitfor You concentrate.
pause 3
waitrt
goto start
}
}
if(%x == 0) {
goto start
}

nervewound:
if(%x >= 2) {
if(%me.mana < 8) {
goto start
} else {
put prep 1103
waitfor You concentrate
put cure %z
waitfor You concentrate.
pause 3
waitrt
goto start
}
}
if(%x == 1) {
if(%me.mana < 3) {
goto start
} else {
put prep 1103
waitfor You concentrate
put cure %z
waitfor You concentrate.
pause 3
waitrt
goto start
}
}
if(%x == 0) {
goto start
}

headwound:
if(%x >= 2) {
if(%me.mana < 9) {
goto start
} else {
put prep 1104
waitfor You concentrate
put cure %z
waitfor You concentrate.
pause 3
waitrt
goto start
}
}
if(%x == 1) {
if(%me.mana < 4) {
goto start
} else {
put prep 1104
waitfor You concentrate
put cure %z
waitfor You concentrate.
pause 3
waitrt
goto start
}
}
if(%x == 0) {
goto start
}

organwound:
if(%x >= 2) {
if(%me.mana < 10) {
goto start
} else {
put prep 1105
waitfor You concentrate
put cure %z
waitfor You concentrate.
pause 3
waitrt
goto start
}
}
if(%x == 1) {
if(%me.mana < 5) {
goto start
} else {
put prep 1105
waitfor You concentrate
put cure %z
waitfor You concentrate.
pause 3
waitrt
goto start
}
}
if(%x == 0) {
goto start
}

limbscar:
if(%x >= 2) {
if(%me.mana < 15) {
goto start
} else {
put prep 1111
waitfor You concentrate
put cure %z
waitfor You concentrate.
pause 3
waitrt
goto start
}
}
if(%x == 1) {
if(%me.mana < 11) {
goto start
} else {
put prep 1111
waitfor You concentrate
put cure %z
waitfor You concentrate.
pause 3
waitrt
goto start
}
}
if(%x == 0) {
goto start
}

nervescar:
if(%x >= 2) {
if(%me.mana < 16) {
goto start
} else {
put prep 1112
waitfor You concentrate
put cure %z
waitfor You concentrate.
pause 3
waitrt
goto start
}
}
if(%x == 1) {
if(%me.mana < 12) {
goto start
} else {
put prep 1112
waitfor You concentrate
put cure %z
waitfor You concentrate.
pause 3
waitrt
goto start
}
}
if(%x == 0) {
goto start
}

headscar:
if(%x >= 2) {
if(%me.mana < 17) {
goto start
} else {
put prep 1113
waitfor You concentrate
put cure %z
waitfor You concentrate.
pause 3
waitrt
goto start
}
}
if(%x == 1) {
if(%me.mana < 13) {
goto start
} else {
put prep 1113
waitfor You concentrate
put cure %z
waitfor You concentrate.
pause 3
waitrt
goto start
}
}
if(%x == 0) {
goto start
}

organscar:
if(%x >= 2) {
if(%me.mana < 18) {
goto start
} else {
put prep 1114
waitfor You concentrate
put cure %z
waitfor You concentrate.
pause 3
waitrt
goto start
}
}
if(%x == 1) {
if(%me.mana < 14) {
goto start
} else {
put prep 1114
waitfor You concentrate
put cure %z
waitfor You concentrate.
pause 3
waitrt
goto start
}
}
if(%x == 0) {
goto start
}

SpiffyJr
11-30-2009, 05:20 PM
I'm sure you guys could port some Lich scripts over easily enough. If you're interested let us know what you need and we can give you a few samples.

Shaelun
12-05-2009, 08:12 AM
Just a suggestion... you probably really want a pause in there:



start:
pause 0.1
if(%me.health < %me.maxhealth){
goto blood

...

blood:
if(%me.mana < 5){
goto start

...

The way it's set up, you're going to max out your CPU and possibly cause yourself a lot of lag (depending on the details of how Jamus is handling executing scripts, of course.)

Also, you'd be surprised how useful it is to virtually never hardcode number values (i.e. instead of using if (%me.mana < 18), use if ( %me.mana < (%minMana + %x * 4) ) and just stick the $minMana = 10 line at the top of the script so you can change the whole thing with one easy edit. Do take note that I'm not an empath and just skimmed the script once, so I dunno if 4 extra mana per wound rank is appropriate or not. Just how it looks in that snippet. You get the idea though.

Pretty slick script for someone who's never programmed before, BTW.

Bobmuhthol
12-05-2009, 08:19 AM
Every time I see a heal script I get nostalgic. :( I miss the library Tayre and I used in the glory days.