| www.ClassicTW.com https://mail.black-squirrel.com/ |
|
| Timer Countdown https://mail.black-squirrel.com/viewtopic.php?f=15&t=21721 |
Page 1 of 1 |
| Author: | Thrawn [ Wed Mar 25, 2009 12:49 pm ] | ||
| Post subject: | Timer Countdown | ||
I'm curious to know if a countdown timer can be created and have it display in a window. For example, I have our ScoreKeeper script that runs the scores and then the TWGS Online activity script. I've written the ScoreKeeper so that when it loads, a menu comes up for the SysOp to enter in some information, such as what game letters to run scores on, path to write the score html files, path and filename of the TWGS Online activity html file, their site name, and timezone. I also recently added the feature to have 3 choices for the timer- 15 minutes, 30 minutes, or 60 minutes. When the script is activated, I have a window that opens up giving me the status of the ScoreKeeper. In the window it displays the game letters I've chosen, the timer choice (ex: 15 minutes), my paths for the files. I also have put the ability to press the ~ key to return to the ScoreKeeper menu and make changes. When the script activates and when the time is reached, the scores for the game letters chosen are run, and returns back to the timer again. What I am looking to do is, in the window where it has the line "15 minutes", show how much time is remaining. I've attached a screenshot of the window. This is the code I am using for the menu portion of the timer: Code: elseif ($menuChoice = 2) echo ansi_10 "*Select the timer delay in minutes to run scores:" echo ansi_11 "*(3) 15 minutes, (4) 30 minutes, (5) 60 minutes" getConsoleInput $timer singlekey if ($timer = 3) setVar $timer "15" saveVar $timer elseif ($timer = 4) setVar $timer "30" saveVar $timer elseif ($timer = 5) setVar $timer "60" saveVar $timer end
|
|||
| Author: | LoneStar [ Wed Mar 25, 2009 6:17 pm ] |
| Post subject: | Re: Timer Countdown |
Updating a Status-Window every second would creat alot of overhead. Have you considered sync'n the 'Timer' to your PC Clock, so you can just look at the time and know how long till the next update? Example. 30min Timer, Started at 5:10pm. 5:30pm Timer fires and syncs, and fires every 30mins thereafter (6:00pm, 6:30pm, etc etc) Or 15min Timer set at 5:06pm 5:15pm Timer fires and now Fires every 15mins (5:30pm, 5:45pm, 6:00pm, etc etc) |
|
| Author: | Thrawn [ Wed Mar 25, 2009 6:35 pm ] |
| Post subject: | Re: Timer Countdown |
I think you are right, and that would be simpler. I could add the message "Started at 05:10" or whatever the pc time was when the script activated and place it right beside the "15 minutes". Makes it a lot simpler then and still has the effect I want. Thanks for the idea LoneStar. I am coding that in now. |
|
| Author: | Thrawn [ Wed Mar 25, 2009 7:41 pm ] | ||
| Post subject: | Re: Timer Countdown | ||
Ok I have done it now and I think what I've got will work perfectly. Thanks LoneStar for the idea. I've attached the new screenshot of what I did.
|
|||
| Page 1 of 1 | All times are UTC - 5 hours |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|