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 ➜ VBscript ➜ Multiline trigger

Multiline trigger

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


Posted by Madrox   (40 posts)  Bio
Date Wed 21 Feb 2007 12:55 AM (UTC)
Message
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.

Top

Posted by Nick Gammon   Australia  (23,120 posts)  Bio   Forum Administrator
Date Reply #1 on Wed 21 Feb 2007 09:21 PM (UTC)
Message
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.

- Nick Gammon

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

Posted by Madrox   (40 posts)  Bio
Date Reply #2 on Thu 22 Feb 2007 07:29 PM (UTC)
Message
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?
Top

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #3 on Fri 23 Feb 2007 01:44 AM (UTC)
Message
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.

It is much easier to fight for one's ideals than to live up to them.
Top

Posted by Rakon   USA  (123 posts)  Bio
Date Reply #4 on Sat 24 Feb 2007 09:42 AM (UTC)

Amended on Sat 24 Feb 2007 11:28 AM (UTC) by Rakon

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


Yes, I am a criminal.
My crime is that of curiosity.
My crime is that of judging people by what they say and think, not what they look like.
My crime is that of outsmarting you, something that you will never forgive me for.
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.


18,177 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.