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 ➜ Getting Started ➜ Making a simple trigger

Making a simple trigger

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


Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Sun 05 Aug 2007 08:12 AM (UTC)

Amended on Tue 30 Dec 2014 09:46 PM (UTC) by Nick Gammon

Message

Let's look at making a simple trigger. Say we want to detect when we are getting thirsty, and automatically drink something. The most reliable way of making a trigger is to wait for the message to appear:

Thirsty message

Now, Shift+Double-click to select the entire matching line:

Selected line

Press Ctrl+C to copy that line to the Clipboard, and then press Alt+Enter to open the world configuration dialog, select Triggers, and click on Add. (Pressing Shift+Ctrl+8 also opens the world configuration and takes you directly to the triggers list).

Trigger list

Paste the message we want to match on into the Trigger box. Type in what to do when we are thirsty into the Send box (you can make multiple lines if necessary).

Trigger edit

That is all you need to do. Click OK to close the trigger dialog, and Close to close the world configuration dialog.


We can do more, though. Perhaps it would help to colour the matching line in a more distinctive colour. Whilst editing the trigger we can choose one of the custom colours from the drop-down list, or choose "Other" colour, and then click on the two colour swatches to make any foreground and background colour.

Trigger colouring

It might help to have an audible notification. If you want one, click on the Sound "Browse" button, and choose a suitable sound. There are thousands of sounds available over the Internet, or on CDROMs you can purchase in shops:

Browse for sound

Once you have chosen a sound its name is shown in the main trigger window. You can click the Test button to make sure that you have chosen the sound you want.

Test sound

You can always go back to the trigger list, find the trigger you want to change, and amend the way it behaves.


- 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.


15,234 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.