|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: 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!!! |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: 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> |
|
|
|
|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: 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? |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
shaun.murray Magician
Joined: 23 Jul 2005 Posts: 334 Location: Chicago
|
Posted: 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!!!
|
|
|
|
|
|