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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Trying to make a trigger.

Trying to make a trigger.

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


Posted by Lensie   (6 posts)  Bio
Date Fri 29 Jun 2007 05:53 PM (UTC)
Message
I want to make a trigger to relay quest information to my group when I request one.

A wise Old Man says to you 'A horde of '*' is terrorizing *.'

A wise Old Man says to you 'This horde consists of * members.'

A wise Old Man says to you 'You have * minutes to destroy this horde.'

I want to tell this information to the group in one line, but because they are all on separate lines, I don't know how. I messed around with variables and it didn't work.

Any help, please?
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Fri 29 Jun 2007 06:02 PM (UTC)
Message
After matching those lines in one trigger, here is what you can send: (if gtell is the command to tell the group):
gtell Horde of %1 is terrorizing %2; horde is made up of %3 members and we have %4 minutes to destroy this horde.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Lensie   (6 posts)  Bio
Date Reply #2 on Fri 29 Jun 2007 06:03 PM (UTC)
Message
How would I match these lines in one trigger, it says line breaks are not permitted?
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #3 on Fri 29 Jun 2007 06:25 PM (UTC)
Message
You can just make a multi-line trigger. Example:
http://www.gammon.com.au/forum/bbshowpost.php?id=6666

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Lensie   (6 posts)  Bio
Date Reply #4 on Fri 29 Jun 2007 06:30 PM (UTC)
Message
I don't want to sound ignorant or anything, it's just I'm not very wise on all those symbols and such, could someone write an example script for me to try out?

If it works I'll tweak it and such.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #5 on Fri 29 Jun 2007 06:39 PM (UTC)
Message
That is regex, I don't think you need to use it in this case. I don't know if there are one or two linebreaks between each line. This should match on one linebreak:
A wise Old Man says to you 'A horde of '*' is terrorizing *.'\nA wise Old Man says to you 'This horde consists of * members.'\nA wise Old Man says to you 'You have * minutes to destroy this horde.'

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Lensie   (6 posts)  Bio
Date Reply #6 on Fri 29 Jun 2007 06:49 PM (UTC)
Message
I tried it and it didn't get detected.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #7 on Fri 29 Jun 2007 06:54 PM (UTC)
Message
Change each \n to a \n\n in that case. Other than that, I don't know the exact match. I'm not at home so I can't test things out.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Lensie   (6 posts)  Bio
Date Reply #8 on Fri 29 Jun 2007 07:00 PM (UTC)
Message
Example of an exact match:

You ask A wise Old Man for a quest for your group.
A wise Old Man says to you 'A horde of 'a frog' is terrorizing Bard's College Ruins.'
A wise Old Man says to you 'This horde consists of 26 members.'
A wise Old Man says to you 'You have 37 minutes to destroy this horde.'

That was my last quest. Still can't work it.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #9 on Fri 29 Jun 2007 09:33 PM (UTC)

Amended on Fri 29 Jun 2007 09:34 PM (UTC) by Nick Gammon

Message
This seems to work for me:


<triggers>
  <trigger
   enabled="y"
   group="Multi Line"
   lines_to_match="5"
   keep_evaluating="y"


match="You ask A wise Old Man for a quest for your group.\nA wise Old Man says to you 'A horde of '(.*)' is terrorizing (.*)\.'\nA wise Old Man says to you 'This horde consists of (.*) members.'\nA wise Old Man says to you 'You have (.*) minutes to destroy this horde.'\Z"


   multi_line="y"
   regexp="y"
   send_to="2"
   sequence="100"
  >
  <send>gtell Horde of '%1' is terrorizing %2; horde is made up of %3 members and we have %4 minutes to destroy this horde.</send>
  </trigger>
</triggers>


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Lensie   (6 posts)  Bio
Date Reply #10 on Tue 03 Jul 2007 11:28 AM (UTC)
Message
Nick Gammon, you are the man!

It works perfectly.
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.


23,172 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.