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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Help me write Pursue Triggers

Help me write Pursue Triggers

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


Posted by Pattkinson   (2 posts)  Bio
Date Sun 13 Jun 2004 05:13 PM (UTC)
Message
Hello.

I have 4 things I tried to code but have failed at because they are mutiple line triggers:

1. Pursue trigger:

MUD Output:
Nick flees head over heels! (yellow text)
Nick flies west. (white text)

MUSHclient Send:
west
murder 0.Nick

Note:
On the 'Nick flies west.' line, the direction will change
and needs to be reflected on the pursue direction. The
'flies' changes, and needs to be a closed 1-word field variable because it can be 'flies, floats, walks, etc'.
And finally, we need to do 'Nick flies somewhere' and have that send 'enter' for the direction.

2. Set/Off Switch.

MUSHclient Switch:
pursue Nick (turns on triggers for nick)
pursue off (turns triggers off)

When 'pursue Nick' is set I'd like it to turn on #3 and #4
but when switch is 'Pursue off' I'd like #3 and #4 turned off.
-------------------------------------------------------
3.

MUD Output
Nick flies in from the west. (white)

MUSHclient Send:
murder 0.Nick

(and the 'nick' needs to be set by the Pursue switch.
'flies' and 'west' both need to be 1-word variables will change but do not affect trigger output.)

-------------------------------------------------------
4.

MUD Output
Nick flies west. (white)

MUSHclient Send:
west
murder 0.nick

('nick' needs to be set with the Pursue switch. 'west' will change and needs to be sent as output direction.)
--------------------------------------------------------

This has always been a very fun idea and will put me closer
to my goals of writing pursue triggers for an ARENA-PK
vampire.

Thanks for any ideas or code you guys can offer:

Pattkinson
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #1 on Sun 13 Jun 2004 11:07 PM (UTC)
Message
From my experience, pursue triggers don't work because you're lagging when the other person flees, and they come back before you can leave and you get all messed up. You'd be better off writing pursue aliases for the keypad. I have ctrl+<direction key> do a <direction><murder target>.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Pattkinson   (2 posts)  Bio
Date Reply #2 on Mon 14 Jun 2004 12:56 AM (UTC)
Message
assmuning they work poro, what is the best way to write somthin like that? Do a plug-in with a toggle switch to simplify the code? and if that is can you help me write one?

Pattkinson
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #3 on Mon 14 Jun 2004 03:00 AM (UTC)

Amended on Mon 14 Jun 2004 03:05 AM (UTC) by Nick Gammon

Message

  1. The pursue trigger could look like this:

    
    <triggers>
      <trigger
       enabled="y"
       expand_variables="y"
       group="pursue"
       lines_to_match="2"
       match="^(@victim) flees head over heels!\n\1 \b\w+\b (?P&lt;dir&gt;.*)\.\Z"
       multi_line="y"
       regexp="y"
       sequence="100"
      >
      <send>%&lt;dir&gt;
    murder 0.@victim
    
    </send>
      </trigger>
    </triggers>
    


    This uses the "victim" variable to define who we are chasing.

    To cater for the the "somewhere" case you could do it with scripting, or have a second trigger with lower sequence (ie. executed sooner). Like this:

    
    <triggers>
      <trigger
       enabled="y"
       expand_variables="y"
       lines_to_match="2"
       match="^(@victim) flees head over heels!\n\1 \b\w+\b somewhere\.\Z"
       multi_line="y"
       regexp="y"
       sequence="90"
      >
      <send>enter
    murder 0.@victim
    </send>
      </trigger>
    </triggers>
    


  2. To turn them on and off:

    
    <aliases>
      <alias
       match="pursue (?P&lt;who&gt;.+)"
       enabled="y"
       regexp="y"
       send_to="12"
       sequence="100"
      >
      <send>if "%&lt;who&gt;" = "off" then
      EnableGroup "pursue", 0
      ColourNote "white", "blue", "Pursuit turned off"
    else
      EnableGroup "pursue", 1
      ColourNote "white", "blue", "Pursuit for %&lt;who&gt; now ON"
      SetVariable "victim", "%&lt;who&gt;"
    end if
                 
    </send>
      </alias>
    </aliases>
    


  3. To do "Nick flies in from the east." ...

    
    <triggers>
      <trigger
       custom_colour="1"
       enabled="y"
       expand_variables="y"
       group="pursue"
       match="^@victim \b\w+\b in from the \b\w+\b\.$"
       regexp="y"
       sequence="100"
      >
      <send>murder 0.@victim</send>
      </trigger>
    </triggers>
    


  4. I'll leave you to work out the 4th one from the other examples. :)



- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


14,010 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.