Multiline trigger

Posted by Madrox on Wed 21 Feb 2007 12:55 AM — 5 posts, 23,873 views.

#0
Alright, so i've searched documentation, toyed with this for about an hour. Couldn't figure it out. I'm really bad with regex for some reason. Anyway, I searched the forums, and all the multiline trigger threads I found usualy reverted them to use two seperate triggers. I don't see how that's possible with this as I have it keep evaluating because of a script I run off them, So, how would I make this multiline with Serenity as a "wildcard" in regex

You suddenly perceive the vague outline of an aura of rebounding around
Serenity.

Australia Forum Administrator #1
Can you give more detail? Multi-line triggers are notorious to get right, for the simple reason that it is hard to get a match for exactly what you want.

For example, if you made a multi-line trigger that matched "something ... Serenity", then it could match:


You suddenly perceive the vague outline of an aura of rebounding around 
Nick.
Serenity leaves the room.


This is multiple lines, and Serenity is in those lines.
#2
That is the trigger. It's

"You suddenly perceive the vague outline of an aura of rebounding around
Serenity."

here is another example.

You suddenly perceive the vague outline of an aura of rebounding around
Avataire.



it word wraps on the mud, so serenity is spossed to be on the line, but as her name is over 7 chars long. It's on the new line. So how would i trigger it.. also, with regex you can't use * so how would i define the wildcard? Cause what I'm trying to do is make a system that keeps track if a person i'm targeting has shield up. Not allies. So i throw in an if check like if shieldtar = tar then blah blah blah. Any ideas?
USA #3
First off, in regex, you define wildcards within parenthases. (d+) will put any number into a wildcard, and d+ will just match a number and discard it.

Second, if the mud wraps the text like that, just have two triggers. One trigger tripping on all of the first line, which activates a second one time trigger to grab the second line.

I've personally never used multiline triggers. I tried to once, and realized it was much simpler to go with triggers activating/deactivating each other. But that won't cover every case.
USA #4
IRE game Im assuming:

I just have two triggers for this

<triggers>
  <trigger
   expand_variables="y"
   ignore_case="y"
   keep_evaluating="y"
   make_italic="y"
   match="^You suddenly perceive the vague outline of an aura of rebounding around (@!target)\.$"
   regexp="y"
   send_to="12"
   sequence="80"
  >
  <send>world.SetVariable("en_reb","yes")</send>
  </trigger>
  <trigger
   expand_variables="y"
   ignore_case="y"
   lines_to_match="2"
   keep_evaluating="y"
   match="^You suddenly perceive the vague outline of an aura of rebounding around(.*?)\n(@!target)\.$\Z"
   multi_line="y"
   regexp="y"
   send_to="12"
   sequence="80"
  >
  <send>world.SetVariable("en_reb","yes")</send>
  </trigger>
</triggers>

Substitute the (@!target) with what your target variable is for those to work.

** EDIT **
Might also have to remove the 'world.' in the front of those scripting calls.