Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Aeleanth
Newbie


Joined: 12 Jan 2005
Posts: 8

PostPosted: Fri Feb 04, 2005 12:51 pm   

#alarm,#timer...help pls!
 
hi, i tried to make 2 triggers of 2 commands using alarm and timer...they work just a bit.
I have a command that i can't only use every 20 secs, so I used the following trigger:
#trigger {You get shock!} {#timer 1 shock
#TS 20}
and shock is an alias:
#show YOU CAN SHOCK AGAIN
#color blink,bold,magenta
#timer 0

So if I use the comand shock, 20 secs later the 'YOU CAN SHOCK AGAIN' message is shown.

I also have an alarm for the saving command:
#alarm +1200 {
#show -=THERE IS A SAVE!=-
#color blink,bold,cyan
}

So every 20 minutes, when there is a save, the '-=THERE IS A SAVE!=-' message is shown.

But between 2 saves, I dont know the time remaining as in the case of shock (it's shown with the tick timer).
So if I want to know the time remaining for the next save i have to put #alarm in prompt.

This is no very useful, so I want to know if its possible to have 2 different tick timers shown at the same time,in the same window, or anything that shows me in the status bar the time left for another save, but just in the status bar.
THX!
Reply with quote
Vorax
Apprentice


Joined: 29 Jun 2001
Posts: 198
Location: USA

PostPosted: Fri Feb 04, 2005 3:11 pm   
 
#ALARM "SaveAlarm" *20:00 {#SHOW -=THERE IS A SAVE!=-;#COLOR blink,bold,cyan}
#FUNCTION TimeRemaining {%concat(%eval( (%alarm( %1)/1000)/60)," Minute(s), ", %mod( %eval( %alarm( %1)/1000), 60), " Second(s)")}
#STATUS {Time till next save: @TimeRemaining(SaveAlarm)}

This saves every 20 minutes and allows you to see how many minutes and seconds are left in the timer "SaveAlarm". You can also use the function to check on how much time is left in other alarms as well, provided you name them. The + in your origial alarm creates a temporary alarm which fires once and deletes itself. The *20:00 in the above alarm will fire every 20 minutes.

The #STATUS line may or may not work. I tested it in offline mode and it wouldn't update the status bar. Confused
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Feb 04, 2005 3:29 pm   
 
Quote:
The #STATUS line may or may not work. I tested it in offline mode and it wouldn't update the status bar.

The status bar doesn't update when system variables change. It only updates when user variables change. Most people use enough variables that this is not a problem online. If desired, a variable can be created for the sole purpose of ensuring frequent status line updates.
Code:
#ALA *5 {#IF @status {#VAR status 0} {#VAR status 1}}

This also applies to status windows.
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net