![]() |
|
[Shell] Countdown Timer - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Shell] Countdown Timer (/showthread.php?tid=4839221) |
Countdown Timer - Nakamoto. - May 27, 2015 To be honest I don't think I have ever seen a visual countdown timer, had to write this the other day for a tournament. Due to the lack of time to write it I borrowed the numbers from White Lights clock (thats a lot to type out). Anyway if anyone ever needs a timer here you go Code @echo offEDIT: Thanks to boosted fixing what I was to lazy to, it is now more accurate and does a full minute instead of losing 1 second off of every minute. * - b00st3d - May 27, 2015 Looks good. Simple and effective just the way I like it. * - Nakamoto. - May 29, 2015 (May 27, 2015 03:17 PM)b00st3d Wrote: Looks good. Simple and effective just the way I like it. Not sure how accurate it is, it may be losing a second from every minute so if you set if for an hour you may only be getting 59 minutes. * - Advertisement - May 30, 2015 (May 29, 2015 10:35 PM)RenRioku™ Wrote: Not sure how accurate it is, it may be losing a second from every minute so if you set if for an hour you may only be getting 59 minutes. Didn't really read the code but if you could you could use a real timer, not bat no offence and use it for hour and if your guess is right use some sort of Code set /a SecondsVariableThing=%SecondsVariableThing% - 1* - Nakamoto. - May 30, 2015 (May 30, 2015 04:32 AM)RekkiNoobsAndGrabbinBoobs Wrote: Didn't really read the code but if you could you could use a real timer, not bat no offence and use it for hour and if your guess is right use some sort of I could but the purpose I wrote it for it isnt required to be super accurate, so I see no sense for me to sit for an hour to test it. * - b00st3d - May 30, 2015 I didn't see it at first but this should be set at 60 rather than 59 because it immediately changes from 0 to 59 then waits a sec to change to 58. You could also check if %sectime% LSS 0 and leave the below line the same. Code set /a mintime=%mintime%-1* - Crez - May 30, 2015 Looks really awesome :) Sadly I had to exchange the unicode chars because my Windows already supports Unicode in Batch scripts, that's why I just saw a bunch of weird chars at the first time starting it. Great job man! I would +rep you if I could :-/ (English is not my native english, that's why most posts contain some mistakes. Thank you for understanding.) * - Nakamoto. - Jun 1, 2015 (May 30, 2015 07:14 AM)b00st3d Wrote: I didn't see it at first but this should be set at 60 rather than 59 because it immediately changes from 0 to 59 then waits a sec to change to 58. You could also check if %sectime% LSS 0 and leave the below line the same. Changing the LEQ to LSS doesn't work, it break the script and I don't like seeing a 60 there for a second, doesn't seem clocky. * - b00st3d - Jun 1, 2015 (Jun 1, 2015 12:56 PM)RenRioku™ Wrote: Changing the LEQ to LSS doesn't work, it break the script and I don't like seeing a 60 there for a second, doesn't seem clocky. It does work. You just need to change if %sectime% gtr 0 to GEQ. see below for an updated mainloop Code :mainloop* - Nakamoto. - Jun 1, 2015 (Jun 1, 2015 01:21 PM)b00st3d Wrote: It does work. You just need to change if %sectime% gtr 0 to GEQ. see below for an updated mainloopDidn't cross my mind to change both but I guess it does work lol. On a side note although I tried to make it idiot proof I didn't think to cover every base of someone that might try to break it like myself. if you enter a number followed by a letter it sets the mintime to the number then starts the sec time at 0 goes to 59 and goes a whole minute before mintime changes at all. Example 4a makes it read 4:00 a second later its 4:59, no real reason to try and fix it, not a pressing matter. * - Austerity - Jun 1, 2015 Very nice work, this works perfectly. * - xxv2012 - Aug 6, 2015 very good timer thanks for sharing ^_^ |