[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Triggering off of multiple lines
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Triggering off of multiple lines

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


Posted by Dagaswolf   USA  (9 posts)  [Biography] 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...
[Go to top] top

Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Reply #1 on Wed 25 Feb 2009 06:45 PM (UTC)
Message
http://www.gammon.com.au/forum/?id=8814
[Go to top] top

Posted by Dagaswolf   USA  (9 posts)  [Biography] 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...
[Go to top] top

Posted by WillFa   USA  (525 posts)  [Biography] 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.
[Go to top] 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.


3,280 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]