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
➜ Multiline substitution
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| tobiassjosten
Sweden (79 posts) Bio
|
Date
| Mon 25 Apr 2005 09:49 AM (UTC) Amended on Mon 25 Apr 2005 09:50 AM (UTC) by tobiassjosten
|
Message
| I'm trying to trigger a couple of rows, but it just wont work for me. What I want is to shorten down this text:
You close your eyes momentarily and extend the range of your vision, seeking
out the presence of Xxx.
It might be followed by either of these:
Though too far away to accurately perceive details, you see that Xxx is in the
Xxx Xxx.
.. or:
You see that Xxx is at Xxx Xxx.
The result should be something like:
(Farsee) Xxx is in the Xxx Xxx
.. or:
(Farsee) Xxx is at Xxx Xxx
So far, I'm having problem with getting a trigger that will react to that first part. It might be my regexp syntaxt, but I think it looks good. How can I go about doing this in MC?
So far:
<triggers>
<trigger
enabled="y"
match="^You close your eyes momentarily and extend the range of your vision\, seeking\nout the presence of (\w+)\."
name="subFarsee"
omit_from_log="y"
omit_from_output="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>world.Note ("Triggered!")</send>
</trigger>
</triggers>
|
Simplicity is Divine | http://nogfx.org/ | Top |
|
Posted by
| tobiassjosten
Sweden (79 posts) Bio
|
Date
| Reply #1 on Mon 25 Apr 2005 10:57 AM (UTC) |
Message
| Got it working. Forgot that Rapture adds a trailing space after lines it wraps.. I had to check the multiline option for it to react which disabled the omit-option, how do I gag it now? |
Simplicity is Divine | http://nogfx.org/ | Top |
|
Posted by
| Larkin
(278 posts) Bio
|
Date
| Reply #2 on Mon 25 Apr 2005 06:11 PM (UTC) |
Message
| Since you got it working, I can assume you added the options "multi_line='y'" and "lines_to_match='2'" to your trigger. If it doesn't gag it, it may be because it's multi-line. Try making separate triggers to gag each line and see if that works for you.
You could do it in a plugin, but then you'd be gagging it before the text even reached the triggers, if I understand correctly. | Top |
|
Posted by
| tobiassjosten
Sweden (79 posts) Bio
|
Date
| Reply #3 on Mon 25 Apr 2005 06:19 PM (UTC) |
Message
| Wouldn't be a problem, a sub-plugin does sound neat. Any suggestions as to how I could do this?
And yes, that's the changes I did to make it work. And that's the changes that stoped the trigger from gaging.. |
Simplicity is Divine | http://nogfx.org/ | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #4 on Mon 25 Apr 2005 07:54 PM (UTC) Amended on Mon 25 Apr 2005 07:55 PM (UTC) by Flannel
|
Message
| Mutli line triggers cannot be gagged.
Since, it wouldn't make sense that after 20 lines showed up in the buffer, they magically disappeared (and your output scrolled down suddenly).
Are you sure you want a newline after seeking? Is it a hard newline sent by the server? or is it just wrapping?
Do you want to always gag the first line? The close eyes, etc? You will probably need to fall back to a series of triggers that turn each other on/off and gag.
He was talking about plugins and packets and stuff. Which, with something this big (this much text), wouldn't be feasible. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| tobiassjosten
Sweden (79 posts) Bio
|
Date
| Reply #5 on Mon 25 Apr 2005 08:54 PM (UTC) |
Message
| Ahh, and for that I could do world.TriggerOn("trigger-name") or something? Would need to set some sort of temporary variable to be sure that the first line has triggered, or else it -could- fsck something else up.. Unless there's some other way of making sure these lines follow eachother(?), I'll check this solution out. Thanks. |
Simplicity is Divine | http://nogfx.org/ | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #6 on Mon 25 Apr 2005 08:58 PM (UTC) Amended on Mon 25 Apr 2005 09:00 PM (UTC) by Flannel
|
Message
| Enabletrigger "triggername", (1/0) (1 for on, 0 for off)
You just have the second trigger disabled for the majority of the time, and then only enable it when the first line has triggered. And then a third trigger that matches on something else (like a prompt, or something) or a timer, that disables the second trigger (just incase the line doesn't come).
It's the old way of doing multiline triggers. So you can search for multiline trigger, or multiple lines trigger or something, and once you wade through the newer stuff, youll see lots of this. I remember a lot of 'who list' questions, so search for that too. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| tobiassjosten
Sweden (79 posts) Bio
|
Date
| Reply #7 on Mon 25 Apr 2005 09:06 PM (UTC) |
Message
| Sweet! Sounds like stuff I used to do in old zMUD, before the different trigger-types came. Once again, thanks. |
Simplicity is Divine | http://nogfx.org/ | 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,511 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top