PDA

View Full Version : Lich -- Wonky Script



Danical
02-10-2007, 03:29 PM
I've created a script that casts 1030 a single time on a target but sometimes, and only sometimes, it keeps trying to cast again even if the creature died or cast successfully. What's the problem?

Example . . .
>;boom
--- Lich: boom active.
[boom]^incant 1030
You change your tune slightly, adding the element for Song of Sonic Disruption to your song...
Your spellsong is ready.
You weave another verse into your harmony, directing the sound of your voice at a triton executioner.
CS: +517 - TD: +337 + CvA: +25 + d100: +10 == +215
Warding failed!
A triton executioner reels under the force of the sonic vibrations!
Sound waves disrupt for 105 damage!
... 95 points of damage!
The triton executioner's shoulder joint explodes, severing shield arm.

Sing Roundtime 3 Seconds.
>
[boom]^incant 1030
...wait 1 seconds.




while true
fput "incant 1030"
line = waitfor("Your armor prevents the song from working correctly", "twitching for a moment before", "gurgles once and goes still", "begins to dissolve from the bottom up", "gurgling once with a", "he siren gives a plaintive wail before she slumps to her side and dies", "emits a hollow scream as ribbons of essence", "Sing Roundtime", "You do not currently have a target", "wait (1|2|3)", "FUMBLE")
if line =~ /Your armor prevents the song from working correctly|wait|FUMBLE/
redo
elsif line =~ /gurgles once and goes still|begins to dissolve from the bottom up|gurgling once with a|he siren gives a plaintive wail before she slumps to her side and dies|emits a hollow scream as ribbons of essence|twitching for a moment before/
fput "loot"
exit
else
exit
end
end

Shaelun
02-12-2007, 03:26 AM
... weird. I don't know. Try putting a line that echoes what the script saw right after the `waitfor' (e.g., `echo line') so you know what line it matched when it doesn't behave as expected; if the answer isn't obvious to you then, ask again -- that's about all I can say w/o more info.

Danical
02-12-2007, 04:26 PM
I added the echo lines . . . but it's still wonky.



while true
fput "incant 1002"
line = waitfor("Your armor prevents the song from working correctly", "twitching for a moment before", "gurgles once and goes still", "begins to dissolve from the bottom up", "gurgling once with a", "he siren gives a plaintive wail before she slumps to her side and dies", "emits a hollow scream as ribbons of essence", "Sing Roundtime", "You do not currently have a target", "wait (1|2|3)", "FUMBLE")
if line =~ /Your armor prevents the song from working correctly|wait|FUMBLE/
echo line
redo
elsif line =~ /gurgles once and goes still|begins to dissolve from the bottom up|gurgling once with a|he siren gives a plaintive wail before she slumps to her side and dies|emits a hollow scream as ribbons of essence|twitching for a moment before/
echo line
fput "loot"
exit
elsif line =~ /Sing Roundtime/
echo line
exit
else
exit
end
end



>;vib
--- Lich: vib active.
[vib]^incant 1002
You change your tune slightly, adding the element for Vibration Chant to your song...
Your spellsong is ready.
You weave another verse into your harmony, directing the sound of your voice at a siren.
CS: +517 - TD: +335 + CvA: +20 + d100: +39 == +241
Warding failed!
You focus your voice on a siren's scallop shell shield with perfect resonance, causing it to shatter into thousands of tiny pieces.
... 45 points of damage!
Every bone in the right arm shattered and scattered about!
The siren is stunned!
Sing Roundtime 3 Seconds.
>
[vib]^incant 1002
...wait 2 seconds.
>
[vib]^incant 1002
You change your tune slightly, adding the element for Vibration Chant to your song...
Your spellsong is ready.
You weave another verse into your harmony, directing the sound of your voice at a siren.
CS: +517 - TD: +335 + CvA: +25 + d100: +29 == +236
Warding failed!
You focus your voice on the siren causing her to vibrate a little.
Sing Roundtime 3 Seconds.
>
[vib: Sing Roundtime 3 Seconds.]
--- Lich: vib has exited.

Shaelun
02-12-2007, 05:11 PM
It just plain shouldn't be doing that.

Instead of redo, use next. I'm grasping at straws, but redo means redo the loop, which is different than going to the next iteration. And instead of fput, use put.

And judging from the way your sent-messages are displaying (it shows as "[vib]>incant 1002" now instead of "[vib]^incant 1002"), you're using something older than v3.44 (latest one is v3.47). I can't remember every change I make, and I could've fixed a bug that's causing this -- so try updating as well.

And if you want to track down the cause of it, run the echo.lic script when you run vib and boom so that it's obvious exactly what scripts are seeing.

Try updating before you do all this, though.

Danical
02-14-2007, 07:46 PM
Seems to be working now.

Much appreciated.