Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ MUSHclient ➜ Lua ➜ Triggering off of multiple lines

Triggering off of multiple lines

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Dagaswolf   USA  (9 posts)  Bio
Date Wed 25 Feb 2009 06:37 PM (UTC)

Amended on Wed 25 Feb 2009 08:30 PM (UTC) by Nick Gammon

Message
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

Dagaswolf -- The Super-Hytech-Redneck...
Top

Posted by WillFa   USA  (525 posts)  Bio
Date Reply #1 on Wed 25 Feb 2009 06:45 PM (UTC)
Message
http://www.gammon.com.au/forum/?id=8814
Top

Posted by Dagaswolf   USA  (9 posts)  Bio
Date Reply #2 on Wed 25 Feb 2009 06:49 PM (UTC)

Amended on Wed 25 Feb 2009 06:50 PM (UTC) by Dagaswolf

Message
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.


Dagaswolf -- The Super-Hytech-Redneck...
Top

Posted by WillFa   USA  (525 posts)  Bio
Date Reply #3 on Wed 25 Feb 2009 07:01 PM (UTC)
Message
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.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


15,717 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.