Apologies if this question seems self-explanatory, I'm struggling to grasp how multi-line triggers work.
My objective is to parse a number of lines subsequent to the line that fires the trigger, sounds simple enough?
Here's what the output from my MUD looks like (I typed "scan" to generate this):
Code: Select all
< 1353h/1353H 209v/213V Pos: standing >
scan
<>
You quickly scan the area.
An elite Tharnadian warrior who is rather far off to your east.
An elite Tharnadian warrior who is rather far off to your east.
A noble white steed who is rather far off to your east.
Meldar the Tharnadian Marshall who is rather far off to your east.
A Town Guardian who is close by to your west.
A Town Guardian who is close by to your west.
An elite guard who is not far off to your west.
A religious zealot who is a brief walk away to your west.
A militia guard who is in the distance to your west.
A militia guard who is in the distance to your west.
< 1353h/1353H 211v/213V Pos: standing >
<>
My trigger code currently looks like this:
Code: Select all
found = false
Ogres = 0
Drows = 0
Trolls = 0
ThriKreens = 0
Orcs = 0
Duergars = 0
Goblins = 0
Kobolds = 0
while not string.find(line, "<") do
moveCursor(0,getLineNumber()+1)
if string.find(line, "Ogre") then
Ogres = Ogres + 1
found = true
elseif string.find(line, "Drow") then
Drows = Drows + 1
found = true
elseif string.find(line, "Orc") then
Orcs = Orcs + 1
found = true
elseif string.find(line, "Troll") then
Trolls = Trolls + 1
found = true
elseif string.find(line, "Thri-Kreen") then
ThriKreens = ThriKreens + 1
found = true
elseif string.find(line, "Duergar") then
Duergars = Duergars + 1
found = true
elseif string.find(line, "Kobold") then
Kobolds = Kobolds + 1
found = true
elseif string.find(line, "Kobold") then
Goblins = Goblins + 1
found = true
end
end
if (found == true) then
outString = "gcc -<Eikel>- SCAN: "
send(outString)
end
return 0
I've tried adding echo("Debug: ") statements to show me where the problem is but they never get outputted, the program hangs, and then crashes.
Any help is much appreciated!
--Eikel.