|
chelleNYC Newbie
Joined: 29 May 2008 Posts: 5 Location: nyc
|
|
|
|
Progonoi Magician
Joined: 28 Jan 2007 Posts: 430
|
Posted: Thu May 29, 2008 9:29 pm |
Code: |
#alarm "30second_timer" {*30} {do command}
|
This makes a named alarm called 30second_timer which activates after every 30 seconds and does the command. Once done it 'does the command' again after another 30 seconds have past. You can disable it by #t- 30second_timer and enable it by #t+ 30second_timer.
Prog |
|
_________________ The Proud new owner of CMud.
--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
-------------------------------- |
|
|
|
chelleNYC Newbie
Joined: 29 May 2008 Posts: 5 Location: nyc
|
Posted: Thu May 29, 2008 10:35 pm |
i truly appreciate it. how can i modify the trigger so that it only sends the command once?
|
|
|
|
Progonoi Magician
Joined: 28 Jan 2007 Posts: 430
|
Posted: Thu May 29, 2008 10:44 pm |
You mean send it once after 30 seconds and then never again until you re-enable it?
Just add the #t- 30second_timer at the end of command part.
Code: |
#alarm "30second_timer" {*30} {do command;#t- 30second_timer}
|
You can make an alias respectively which turns the alarm on whenever you'd need it again.
Code: |
#alias alarmOn {#t+ 30second_timer}
|
|
|
_________________ The Proud new owner of CMud.
--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
-------------------------------- |
|
|
|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: Fri May 30, 2008 12:22 am |
If you want to make a one-off timer, that is, a timer that only fires onces and then vanishes.
Code: |
#ALARM a30second_timer {+30} {#echo this is a one-off timer} |
The ID, if one is entered, should start with a letter to ensure ZMUD doesn't confuse it for the timer pattern, a la a30second_timer |
|
_________________ -Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style." |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri May 30, 2008 5:12 am |
See also #alarm. If you've found the #wait command, I'll say right now that the only time you should use it is to slow down a loop, like:
#loop 50 {dance;#wait 5000}
The #wait command in zMUD can cause problems if you use it in triggers or aliases. You should use #alarm instead. |
|
|
|
PsyberMind Newbie
Joined: 20 Jun 2008 Posts: 1
|
Posted: Fri Jun 20, 2008 12:54 am |
Could something like this be utilized in a status window? For example.. I have a command I want to send every 5 seconds or so that updates my sensor reports (TrekMUSH)
Now I know I can do this as a simple trigger, but it would clutter up my display. It would be more efficient to put it into a Status Window I could have docked somewhere. |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Fri Jun 20, 2008 1:28 am |
You can of course send the output to another window. Using :windowname:cmd
|
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri Jun 20, 2008 10:50 am |
And you can display a variable in the status window that you update with a new value to be displayed whenever you like. Just use an alarm to change the variable.
|
|
|
|
|
|