Timers and triggers

From Discworld MUD Wiki
Jump to: navigation, search

Timers and triggers are useful for many things. While triggers that input to the MUD are illegal, (see "help automation"), passive triggers are not. They can do many useful things:

  • Reminding you when you have full GP.
  • Recoloring specific messages from the MUD.
  • Playing sounds.

A note of warning around sound triggers: keep in mind that you should keep paying attention to the game. If a liaison tries to get your attention while you're watching television and just running an alias whenever your client beeps, it looks exactly like a trigger/timer, and you may end up suspended / having skills removed.

Note that if your client doesn't support these, you can use the in-game memo command for a similar effect to a timer.

MUSHclient

MUSHclient is a free client which allows you to set up timers and triggers. You can find it here. (Some of these triggers assume that you haven't changed the script from Lua, the default. (You can change it under File-->World Properties, in "Scripts".))

Making a new trigger

You can set up triggers by going to File-->World Properties and clicking on the "triggers" section, or by clicking the "triggers" icon in the toolbar. Click "add" to create a new trigger. Then, enter the expression for the line you want to match in the box at the top marked "Trigger:". You can use regular expressions for this if you're familiar with them, or you can simply take some phrase that should be in every instance of that line and put a * before and after it (or anywhere there's text that can vary), like so:

*as its bond with the ritual*

Colour triggers

The simplest way to make a colour trigger is by using the shortcut ctrl+alt+h and entering the word or phrase you want to use for the trigger. This will cause the words you enter to be highlighted in the colour you choose, but not the entire line. (If you want to delete or edit them later, you can find the triggers with the others, in the automatically-created "Highlighted Words" group.)

The other way is to create a new trigger in the usual way (you can leave the send box empty for this). Then, choose something from the "Change colour and style to" drop-down menu and click OK. The entire line will be turned that colour.

Sound triggers

To make a sound play, make a new trigger, then click "Browse..." underneath the "Change colour and style to" drop-down menu and pick a sound file.

Timers

Making a timer in MUSH is also fairly easy. Go to File-->World Properties and click the "timers" section (or click the "timers" icon in the toolbar"), then click "Add" to make a new one. Enter the message you want to appear on your screen in the "Send" box, and then choose "output" from the "Send to:" drop-down menu ("world" is the default, and sends whatever's in the "Send" box directly to the MUD. Don't do this). If you want to refer to it elsewhere on MUSHclient, give it a name in the "Label" box.

Since you probably don't want your timer to be on all the time, you need a quick way to turn it off. A good way to do this is to make a trigger that activates for the phrase "timer off" or something like that. Choose "script" from the "Send to:" drop-down menu, and in the "Send" box, put this:

EnableTimer("gptimer", false)

(This is assuming that your timer is named gptimer. Obviously you should replace gptimer with whatever the name of yours (in its "Label:" box) actually is.)

Then, you can just frimble your trigger phrase to deactivate the timer. You can use something similar to reactivate it:

EnableTimer("gptimer", true)

If you want to reset the timer, you can use:

ResetTimer("gptimer")

If you want your timer to play a sound when it goes off, instead of just displaying a message, choose "script" from the "Send to:" drop-down menu instead of "output", and in the send box put something like this:

DoAfterSpecial (1, "Sound ('ding.wav')",  sendto.script)

1 is the number of seconds to wait to play the sound. 'ding.wav' is one of the Windows default noises. If you want the timer to display a message as well as playing a sound, add another line in the send box:

DoAfterSpecial (1, "some message", sendto.output)

One-Shot Timers

If you have different aliases that use different amounts of GP, you can utilize one-shot timers. Let's say a particular alias ends with you having 100 of 400 gp, so you want something to tell you when you've regenerated that 300 gp. With 4 GP regen this takes 150 seconds. First, add a frimble to the end of your alias (e.g. "frimble wait for 300"). Then, set up a trigger to respond to the frimbled phrase. From the "Send to:" drop-down menu choose "script", and in the "Send" box enter:

DoAfterSpecial (150, "300 gp back", sendto.output)

This will display the message "300 gp back" on your screen 150 seconds after MUSHclient sees the trigger phrase. Make one of these triggers for each alias, changing the values accordingly. This is better than a plain timer for some things, because it only sends the message once instead of every x seconds, so you don't have to do anything special to turn it off when you're done idling.

zMUD

zMUD is a good MUD client which gives you a lot of possibilities for triggers. It's not free however, and can be purchased at Zuggsoft.com. You can also download a very early version for free.

Colour Triggers

Colour triggers are simple. So simple in fact that it is included in the simple trigger wizard. Go to Actions-->Simple Trigger Wizard and select 'Highlight the entire line containing certain words', then enter what you want to be recolored, making sure that it doesn't contain a variable. Then select your colours, and you're done.

One-Shot Timers

I find this is the best way to inform you of when you need to fire your alias. Firstly, add a unique frimble to the start of your alias(es) (e.g. Start of Idle Alias) then go to Actions-->Make Trigger. Select the Pattern tab and copy your frimble to the Pattern field. Now copy the following into the value field:

#ALARM +4:00 {#ECHO Full GP!}

Change '4:00' and 'Full GP!' to the amount of time it will take for your GP to return to full after the frimble and your own message to see on the screen, respectively.


JMC (Jaba Mud Client)

Fast, easy and free.

Previously downloaded from http://www.geocities.com/jmc_client, but there seems to be some problem with the site currently.

Colour Triggers

#highlight {<colour>, <bold / background colour>}{<Sentence to highlight>}{<optional group>}
Eg. #highlight {red, bold}{#10 SECONDS TO TICK}
Eg. #highlight {white, b cyan}{#10 SECONDS TO TICK}{idlechasing}

Tickers

#tickon
Turns on the tick timer

#ticksize <seconds>
Sets how long per tick, and also resets the timer at the same time
Eg. #ticksize 150

#tickset
Resets the timer

#tickoff
Turns the tick timer off

Sound Triggers

#bell will cause a sound to be played.

#action {<trigger line>}{#bell}
Eg. #action {#TICK}{#bell}

Sample Setup

#var t him
#alias {t}{#var t}
#alias {idlenpc}{score brief;#ticksize 145;va bracelet;va shirt;case $t;rif $t;
plant 2 pennies on $t;filch penny from $t;steal penny from $t;palm quota from cloak;
conceal it;slip quota into cloak;ambush;hide;unhide;p $t;consider covert $t}
#hotkey {F12}{idlenpc}
#action {#TICK}{#bell}

Note that in addition to changing the commands, the "#ticksize 145" also has to be
changed to however long it takes for you to regenerate the gp. 

With the above, you would start with "t <target>" (eg. t cabbage), "F12" key, then
just keep pressing the "F12" key whenever you see "#TICK" or hear the sound.

XP Counters

Player-made XP counters are useful for finding out your hourly XP rate, total XP earned and various other things.

XP Counter for MUSHclient

XP Counter for zMUD

See also