One trigger, two different functions?

Posted by forral on Tue 16 Feb 2010 05:54 PM — 3 posts, 17,350 views.

USA #0
Hey all

I am trying to modify a script I had written for portal to adapt to mush. Very simply, its just capturing various lines of string and outputing the result to a notepad window while sailing, to keep track of ships sunk, gold-ingots recovered, etc.

My issue arises when I have the trigger:

The *(ship) to your *(direction) seems to have changed direction to intercept you.

I want this 1 trigger to have 2 different commands associated with it:

1)ship rigging combat
ship target attacker
ship speed slow

2) world.AppendToNotepad "Sailing Log", "Under attack from the %1 by a %2" + vbcrlf


The world.AppendtoNotepad would be sent to script, obviously, whereas the other one would be sent to the world itself.

Is this possible? I tried having duplicate triggers but it does #1, not #2. I tried putting the #2 code into the trigger but that sends to world, which isn't what I need.

Any advice on this is greatly appreciated

Sincerely,
Forral
USA #1
Send to Script, and use Send("command") to send the commands in (1) to the MUD.

world.Send "ship rigging combat"
world.Send "ship target attacker"
world.Send "ship speed slow"
world.AppendToNotepad "Sailing Log", "Under attack from the %1 by a %2" + vbcrlf


MUSHclient would be pretty pathetic if it couldn't send commands from a script. :D
Netherlands #2
You can also have two different triggers, for example because you need to put them in different plugins or want to enable/disable them seperately. Make sure they both have 'Keep Evaluating' set on, that way the first won't block the second from firing. Using the Sequence box you can additionally specify the order in which they fire, a lower number will fire first. By default they'll have the same value, meaning the first one to fire is not strictly defined (but usually the same one).