Help me write Pursue Triggers

Posted by Pattkinson on Sun 13 Jun 2004 05:13 PM — 4 posts, 18,504 views.

#0
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
Greece #1
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>.
#2
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
Australia Forum Administrator #3
  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. :)