[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Trigger Trouble

Trigger Trouble

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


Posted by Tsinghahla   Sweden  (14 posts)  [Biography] bio
Date Sun 17 Apr 2005 05:18 PM (UTC)

Amended on Sun 17 Apr 2005 05:30 PM (UTC) by Tsinghahla

Message
Hi,

I've stumbled upon a few problems trying to trigger certain things, one thing is that my prompt mess the trigger up.

If the text I want to trigger comes out like this;

H:233 M:340 E:1381 W:1600 <eb> You are taken by a sudden and overwhelming affection for Kanthari.


It will execute my alias, but it also works if I just say it out
You say," -trigger text-".


I've tried with regular expressions, but it is somewhat hard to comprehend.

What I want to do, is to have the triggers go off if they come on a new line or my prompt comes up in the same line, and not when I say it or
"someone tells you," -trigger text-".


Is there a way to do this?
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #1 on Sun 17 Apr 2005 05:41 PM (UTC)
Message
Well, Regexps are definately the way to go. However, if you wanted to have a completely regexp free method, you could have a bunch of triggers (for you say * or * tells you *) with low sequence (so they fire first) and then not have them keep evaluating.
Of course, this is unweildy and breaks under certain conditions (and makes it so you couldnt naturally match on tell/say lines, unless you change THAT sequence).

So the obvious way to go is a regexp.
You'll need to figure out the prompt regexp, and then include it in your trigger (to save against prompt changes, you could store it in a variable and then expand it in the trigger, that will allow you to change it in the future with only having to edit one thing, of course, your prompt might not be changable).
^H:\d+ M:\d+ E:\d+ W:d\+ will match the number parts on the beginning of a line. Does the eb change? I imagine it does. What are the possibilities?

And what are the triggers you already have for the lines?

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Tsinghahla   Sweden  (14 posts)  [Biography] bio
Date Reply #2 on Sun 17 Apr 2005 06:08 PM (UTC)

Amended on Sun 17 Apr 2005 06:38 PM (UTC) by Tsinghahla

Message
My prompt can and will change, (eb) is for Equilibrium and Balance, if I don't have balance, for example it will look like this (e-) and there can be more to it, (eb)dbp for example (deaf, blind,prone).

I tried just to have it going like this first;

* You are taken by a sudden and overwhelming affection for *.


But that would trigger anything before and after the actual line I want to trigger, of course it works. But it would mess up too much just to have it that way.

I looked at someones plugin for Aetolia/Achaean games,
where the man behind the plugin was using regexp, but I'm having some major problems just to understand it all.

^(.*?)You are taken by a sudden and overwhelming affection for \.$


The above code is simply a regexp that that author of the plugin was using a lot. I understant that the ^ will match the trigger if it -starts- with the text, but the prompt will mess that up. And, testing that a bunch of times, changing the regexp aswell has been somewhat useless, either it won't trigger at all, or it will trigger on everything before and after the actual text I want to trigger.

I'm reading the help files for regexp all the time, and trying to understand, but it's still hard.

Edit Start: Would it work if I had the trigger like this...

* You are taken by a sudden and overwhelming affection for$


So it would end at 'for'? Then it wouldn't care what text shows up before, but it won't work if anything shows up after 'for'? Or the $ would work so that is something comes up after 'for' it won't trigger at all?
...if that makes any sense..

Edit end.
[Go to top] top

Posted by Tsunami   USA  (204 posts)  [Biography] bio
Date Reply #3 on Sun 17 Apr 2005 06:50 PM (UTC)
Message
If you are playing an IRE game, then the affliction line showing up on the same line as the prompt is actually a small error. With v 3.66, you can select the world option interpret GA EOR (or something) as newline. THis will corectly place the affliction message on the next line, and let your triggers match it correctly.

Then the regexp you could use is for example:

^You are taken by a sudden and overwhelming affection for \w+\.$

I hope that helps.
[Go to top] top

Posted by Tsinghahla   Sweden  (14 posts)  [Biography] bio
Date Reply #4 on Mon 18 Apr 2005 09:38 AM (UTC)
Message
Thanks to both of you, it seems to work as it should now.
[Go to top] top

Posted by tobiassjosten   Sweden  (79 posts)  [Biography] bio
Date Reply #5 on Fri 22 Apr 2005 11:28 PM (UTC)
Message
I couldn't find that GA EOR setting, nor could I find v3.66 (only 3.65). Point me in the right direction, please?

Simplicity is Divine | http://nogfx.org/
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #6 on Sat 23 Apr 2005 04:44 AM (UTC)
Message
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=5423
is 3.66.

The front page version only gets updated sporatically (when we get all the bugs worked out), while other updates may be available. Those updates are only available through the forum (theory is, if you've found the forum, you'll come back if something doesn't work right and ask, rather than just thinking it's broken). And if you need to check for the newest updates, you can always check the 'news and updates' forum (since nick is the only one who can post there, you won't have to weed through help posts, etc).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by tobiassjosten   Sweden  (79 posts)  [Biography] bio
Date Reply #7 on Sat 23 Apr 2005 05:21 AM (UTC)
Message
Now it works, to some extent. Only problem is that MC seems to add an extra linefeed, making it all ~50% extra spammy. Is there any option/fixes for this? What I want is the emulation to be like zMUD (bear with me, I'm pondering a switch after nine years) which only adds one linebreak.

---- MUSHclient currently ----
H:315 M:206 E:1479 W:1102 <eb> 

The sun climbs to its apex, scattering darkness, illuminating the land with its
holy light.
H:315 M:206 E:1479 W:1102 <eb> 

The bright sun shines down upon you.
H:315 M:206 E:1479 W:1102 <eb>

Simplicity is Divine | http://nogfx.org/
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #8 on Sat 23 Apr 2005 07:38 AM (UTC)
Message
You can set up a trigger to match on the empty line, and omit it. Depending on what's sent, you'll either match on (as a regexp) ^$ or ^ $ (the second one is if the line contains a space). If it is the former, You'll need to let the regexp match on an empty line (in global preferences, check the box).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by tobiassjosten   Sweden  (79 posts)  [Biography] bio
Date Reply #9 on Sat 23 Apr 2005 07:59 AM (UTC)

Amended on Sat 23 Apr 2005 08:05 AM (UTC) by tobiassjosten

Message
Ahh, good thinking. But when I tried it out.. Didn't work. This is what I have so far:
<triggers>
  <trigger
   enabled="y"
   match="^ $"
   omit_from_log="y"
   omit_from_output="y"
   regexp="y"
   sequence="100"
  >
  </trigger>
  <trigger
   enabled="y"
   match="^$"
   omit_from_log="y"
   omit_from_output="y"
   regexp="y"
   sequence="100"
  >
  </trigger>
</triggers>


EDIT: Missed the part with the global config, sorry. It's working great now. Thanks alot!

Simplicity is Divine | http://nogfx.org/
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #10 on Sat 23 Apr 2005 08:05 AM (UTC)

Amended on Sat 23 Apr 2005 08:09 AM (UTC) by Flannel

Message
No, the omit is it. Your trigger must not be matching. Did you enable 'match on empty line' in global preferences?

And, one or the other will work, you can delete the extra one (whichever it may be for your server).

Edit: Aye, the one with the space can be deleted (most likely) then (since it would have matched without the global change if the line had a space), if you find you need it, add it in later, I doubt you will though.
It can only cause (potential) conflicts later and by that time, you'll have forgotten about this trigger.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] 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.


29,462 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]