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

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  One trigger, two different functions?
Home  |  Users  |  Search  |  FAQ
Register forum user name
Forgotten password?

One trigger, two different functions?

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

Posted by forral   USA  (79 posts)  [Biography] bio
Date Tue 16 Feb 2010 05:54 PM (UTC)
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

[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #1 on Tue 16 Feb 2010 06:17 PM (UTC)
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

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #2 on Tue 16 Feb 2010 07:07 PM (UTC)
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).
[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.


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.


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 FutureQuest]