Danical
02-15-2007, 04:46 PM
So, I'm trying to write a script that does open 1030 and loots the number of times given the number of death lines. It seems to be a bit wonky and I really can't figure out why for the life of me. Double loots when shouldn't and doesn't exit.
--- Lich: armageddon active.
[armageddon]^prep 1030
[armageddon]^cast
>
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.
The dull golden nimbus surrounding a triton radical suddenly begins to glow brightly and then disappears.
CS: +517 - TD: +388 + CvA: +25 + d100: +64 == +218
Warding failed!
A triton radical reels under the force of the sonic vibrations!
Sound waves disrupt for 106 damage!
... 90 points of damage!
The triton radical's shoulder joint explodes, severing shield arm.
CS: +517 - TD: +365 + CvA: +20 + d100: +42 == +214
Warding failed!
A siren reels under the force of the sonic vibrations!
Sound waves disrupt for 104 damage!
... 95 points of damage!
The siren's neck explodes launching her head into the air.
The siren gives a plaintive wail before she slumps to her side and dies.
The brilliant luminescence fades from around a siren.
The bright luminescence fades from around a siren.
The silvery luminescence fades from around a siren.
Sing Roundtime 3 Seconds.
>
[armageddon: The siren gives a plaintive wail before she slumps to her side and]
[armageddon: 1]
[armageddon: The siren gives a plaintive wail before she slumps to her side and]
[armageddon: 2]
loot = 0
while true
put "prep 1030"
put "cast"
line = waitfor("Roundtime", "Your armor prevents the song from working correctly", "wait (1|2|3)", "Warding failed")
if line =~ /Your armor prevents the song from working correctly/
next
elsif line =~ /wait/
sleep 1
next
elsif line =~ /Warding failed/i
until (kills = matchfindexact("twitching ?", "? goes still", "begins to dissolve ?", "gurgling ?", "? dies", "emits ? hollow scream")) == "Roundtime"
if kills
loot += 1
echo kills
echo loot
else
exit
end
end
while loot > 0
put "loot"
loot -= 1
echo loot
end
exit
else
exit
end
end
I've also tried using "if kills.to_i == 0" instead of "if kills" but I get similar results. Any advice?
--- Lich: armageddon active.
[armageddon]^prep 1030
[armageddon]^cast
>
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.
The dull golden nimbus surrounding a triton radical suddenly begins to glow brightly and then disappears.
CS: +517 - TD: +388 + CvA: +25 + d100: +64 == +218
Warding failed!
A triton radical reels under the force of the sonic vibrations!
Sound waves disrupt for 106 damage!
... 90 points of damage!
The triton radical's shoulder joint explodes, severing shield arm.
CS: +517 - TD: +365 + CvA: +20 + d100: +42 == +214
Warding failed!
A siren reels under the force of the sonic vibrations!
Sound waves disrupt for 104 damage!
... 95 points of damage!
The siren's neck explodes launching her head into the air.
The siren gives a plaintive wail before she slumps to her side and dies.
The brilliant luminescence fades from around a siren.
The bright luminescence fades from around a siren.
The silvery luminescence fades from around a siren.
Sing Roundtime 3 Seconds.
>
[armageddon: The siren gives a plaintive wail before she slumps to her side and]
[armageddon: 1]
[armageddon: The siren gives a plaintive wail before she slumps to her side and]
[armageddon: 2]
loot = 0
while true
put "prep 1030"
put "cast"
line = waitfor("Roundtime", "Your armor prevents the song from working correctly", "wait (1|2|3)", "Warding failed")
if line =~ /Your armor prevents the song from working correctly/
next
elsif line =~ /wait/
sleep 1
next
elsif line =~ /Warding failed/i
until (kills = matchfindexact("twitching ?", "? goes still", "begins to dissolve ?", "gurgling ?", "? dies", "emits ? hollow scream")) == "Roundtime"
if kills
loot += 1
echo kills
echo loot
else
exit
end
end
while loot > 0
put "loot"
loot -= 1
echo loot
end
exit
else
exit
end
end
I've also tried using "if kills.to_i == 0" instead of "if kills" but I get similar results. Any advice?