Triggering off of multiple lines

Posted by Dagaswolf on Wed 25 Feb 2009 06:37 PM — 4 posts, 21,325 views.

USA #0
ok... to start i want to apologize in advance for my ignorance...

here is what i got... when i start a quest, this is the information that is produced by the mud-server.


You ask A QuestoR for a quest.
A QuestoR tells you 'Thank you, brave Dagas!'
A QuestoR tells you 'An enemy of mine, a marbled salamander, is making vile'
A QuestoR tells you 'threats against Ayla! This threat must be eliminated!'
A QuestoR tells you 'Seek a marbled salamander out somewhere in the vicinity'
A QuestoR tells you 'of Before a Cave Entrance which is in the general area'
A QuestoR tells you 'of The Forest of Li'Dnesh.'
A QuestoR tells you 'Good luck Dagas. Return safely!'
A QuestoR tells you 'You have 51 minutes to complete your quest.'


what i am trying to do is to set off a trigger that will then in turn call my perspective script.

the first section that i want to grab is the name of the mob, the room its in, and then the area of that room. so it is lines 4, 5, and 6... so what i want to do is the following, but it is not passing the wildcards to the script.


* tells you 'Seek * out somewhere in the vicinity'$* tells you 'of * which is in the general area'$* tells you 'of *.'


then in my script i am doing:

	local mob_name = wildcards[2]
	local mob_room = wildcards[4]
	local mob_area = wildcards[6]


and what i get are empty variables... any suggestions?



Dagaswolf
Amended on Wed 25 Feb 2009 08:30 PM by Nick Gammon
USA #1
http://www.gammon.com.au/forum/?id=8814
USA #2
all that is, is a questing script that has already been converted into XML... i don't want that... i don't want a whole script / plugin written for me. i would like to do it myself.

and i don't think you understood my question... i guess i was basically just asking, is the "newline" terminator the "$" for a trigger?

i don't like to use others scripts / plugins because i would like to make sure that i understand whats going on before i use something like that.

Amended on Wed 25 Feb 2009 06:50 PM by Dagaswolf
USA #3
Make a trigger a regular expression, and then match on:
increase the number of lines to 2.

^A QuestoR tells you '(.*)'\nA QuestoR tells you '(.*)'$

\n is the line separator. You may find it easier to trigger on:

You ask A QuestoR for a quest.
to do
Questspam = ""

and then

a non-multiline trigger to match:

^A QuestoR tells you '(.+)'$
to do
Questspam = Questspam .. "%1"


The issue you'll find is that because mob names and room names vary, you can't count on there always being X number of lines.