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
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Thu Jan 19, 2006 6:53 pm   

Count down window? - short paragraph.... =]
 
Aiight... Here's the gist of it. The mud I play, there are certain skills called "prevents". Basically, when you use that skill, there is a time restriction before you can use it again. For the most part, the prevention time is the same amount for each skill. Now, my time is usually a sliver of a second off from the muds time. I understand this, and thats fine. What I want to do is have a window, or part of another window, with a real-time countdown for each skill. For example: Striking Fist is a.... 3 minute prevent, lets say. I use the skill, the trigger for the skill used starts the countdown in a window. So... In the window, I see it go from [ Striking fist: UP ] To... [ Striking fist: 3:59 ] And... if you type "prevent" it shows a list of all your skills that are currently down. And I would want to get an update to the countdown triggered off of that list. Make sense? I've tried playing around with %time, but I can't get it to go backwards.... Any help is MUCH appreciated!!!

Thanks ya'll!!!
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Thu Jan 19, 2006 7:10 pm   
 
http://forums.zuggsoft.com/phpbb/viewtopic.php?t=5403&highlight=%25time
Troubadour wrote:
Better yet, save them as a record variable:

#var lastevent {yyyy=%time(yyyy)|mm=%time(mm)|dd=%time(dd)|hh=%time(hh)|nn=%time(nn)|ss=%time(ss)}

The doing the math is just a matter of comparing the components.

#MATH dsecs {%time(ss) - @lastevent.ss}


Troubadour <img src=icon_smile_cool.gif border=0 align=middle>
Reply with quote
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Thu Jan 19, 2006 7:42 pm   
 
Hrmm... Ok, makes sense...

Whats a record variable tho?

An... Wouldn't you have to trigger off of something to make the countdown refresh with the new time? Or is there a way to make it work every second?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Jan 19, 2006 11:11 pm   
 
You will need to trigger off of something to update and initialize your data, but not to enact a countdown. That'd be an #ALARM, and they don't trigger off of anything but your computer clock. Your basic countdown alarm will look something like this:

#ALARM "tCountdown" *1 {#if (@CountVariable > @CountMinimum) {#add CountVariable -1} {#T- tCountDown}}
_________________
EDIT: I didn't like my old signature
Reply with quote
shaun.murray
Magician


Joined: 23 Jul 2005
Posts: 334
Location: Chicago

PostPosted: Sun Jan 22, 2006 8:31 pm   
 
Oh wow.... That worked like a CHAMP! Opened a WHOLE new door! Finally, I'm going to be able to put a check in my scripts, for when they get fubard, and don't do anything after X amount of time.... To restart... Yummy! Thankx yall!!!
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