View unanswered posts | View active topics It is currently Wed Apr 22, 2026 4:52 am



Reply to topic  [ 4 posts ] 
 Timer Countdown 
Author Message
Commander
User avatar

Joined: Fri Aug 20, 2004 2:00 am
Posts: 1801
Location: Outer Rims
Unread post 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



Attachments:
ScoreKeeper001.jpg
ScoreKeeper001.jpg [ 28.78 KiB | Viewed 2698 times ]

_________________
-Thrawn

But risk has always been an inescapable part of warfare.

--

Knight to Queen's Bishop 3
Wed Mar 25, 2009 12:49 pm
Profile
Commander
User avatar

Joined: Fri Jun 09, 2006 2:00 am
Posts: 1401
Location: Canada
Unread post 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)

_________________
----------------------------
-= QUANTUM Computing 101: 15 = 3 x 5 ... 48% of the time.


Wed Mar 25, 2009 6:17 pm
Profile ICQ YIM
Commander
User avatar

Joined: Fri Aug 20, 2004 2:00 am
Posts: 1801
Location: Outer Rims
Unread post 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.

_________________
-Thrawn

But risk has always been an inescapable part of warfare.

--

Knight to Queen's Bishop 3


Wed Mar 25, 2009 6:35 pm
Profile
Commander
User avatar

Joined: Fri Aug 20, 2004 2:00 am
Posts: 1801
Location: Outer Rims
Unread post 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.


Attachments:
ScoreKeeper002.jpg
ScoreKeeper002.jpg [ 32.5 KiB | Viewed 2628 times ]

_________________
-Thrawn

But risk has always been an inescapable part of warfare.

--

Knight to Queen's Bishop 3
Wed Mar 25, 2009 7:41 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 30 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by wSTSoftware.