PDA

View Full Version : Lich -- 1030 Script



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?

Belathus
02-16-2007, 08:54 PM
You need to add the string, "Sing ?" to your "until kills = matchfindexact() == 'Roundtime'" line. It isn't matching the roundtime and is therefore stuck in the matchfind, hence, no looting.


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", "Sing ?")) == "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

Belathus
02-16-2007, 09:00 PM
And, now that I think about it... the kills variable is completely superfluous. You can abbreviate that until loop to just this:


until matchfindexact("twitching ?", "? goes still", "begins to dissolve ?", "gurgling ?", "? dies", "emits ? hollow scream", "Sing ?") == "Roundtime"
loot += 1
end

Danical
02-17-2007, 02:14 PM
cool, I changed the code around but I can't seem to get the bugger to exit . . . I've tried putting the exit line in a number of places; no dice.



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 matchfindexact("twitching ?", "? goes still", "begins to dissolve ?", "gurgling ?", "? dies", "emits ? hollow scream", "Sing ?") == "Roundtime"
loot += 1
while loot > 1
put "loot"
loot -= 1
end
end
exit
else
exit
end
end

Danical
02-17-2007, 09:10 PM
got it working

thanks.