Trying to make a trigger.

Posted by Lensie on Fri 29 Jun 2007 05:53 PM — 11 posts, 33,101 views.

#0
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?
USA #1
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.
#2
How would I match these lines in one trigger, it says line breaks are not permitted?
USA #3
You can just make a multi-line trigger. Example:
http://www.gammon.com.au/forum/bbshowpost.php?id=6666
#4
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.
USA #5
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.'
#6
I tried it and it didn't get detected.
USA #7
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.
#8
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.
Australia Forum Administrator #9
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>

Amended on Fri 29 Jun 2007 09:34 PM by Nick Gammon
#10
Nick Gammon, you are the man!

It works perfectly.