Hey BC... very cool and yes... its a mix of C and C++ now that I look back at it.
Back in the days of Qbasic I use to mix Basic with QBasic too as it had legacy Basic support.
Thanks for pointing out
clrscr() function instead of system("cls")
I got lazy trying to remember the clear screen function and said ok just use a system call to cls
Very cool use of iomanip for the leading zero correction. I forgot about iomanip's ability to format this way. Back in college I used it mainly for dealing with money where I'd be programming up point of sale type of programs and the get_money and put_money was used with iomanip. Going to add your correction to my program to get rid of the alternate IF logic for alt output when value less than 10.
As far as use of std::clock(); ... I actually avoided use of it because I thought it might be more difficult to get the precision for time delay and it looks like it taxes the CPU whereas sleep is less on the CPU. I read up on this article below on troubles with its use in which mainly depending on how powerful or weak of a CPU your running, the results will vary in how fast or slow the time delay is. So I figured a safer approach might be to just go with sleep() and set that to 1000ms and this way I am right in the ballpark at the get go and might just need to reduce from 1000ms to another lesser value after running it along side a clock or stop watch to see if the second intervals are somewhat sync. Running it today I see that its out of sync and might be as far out of whack as 1.2 seconds per 1 second. With this count down timer being slower (taking longer) to count down from 6 minutes.
http://stackoverflow.com/questions/35439992/stdclock-and-clocks-per-secTo have an idea of how long it takes for time delay and the macro process, in the batch file I had added appending of date/time stamp into a log file so i see when the timer starts, when the timer ended, and when the macro ended before the timer starts again.
The system that I have running this is a weak electron sipper Intel Atom N280 single-core with Hyperthreading 1.66Ghz running Windows XP SP3 on 2GB RAM which runs consuming just 13 watts of power. Its barely able to run the flash game and is so laggy that no one in their right mind would ever have the patience to game with it, but the automated process is not painful for a human to endure and so i gave this otherwise modern flash game crippled netbook a purpose and its holding up well to it.
Other system I am running for the automated farming with a keyboard/mouse macro is the Sempron 3850 1.3Ghz Quadcore 4GB DDR3 running Windows 7 64-bit which runs on about 43 watts of power.
So the programming methods have to be as CPU friendly as I can make them. The 1.3Ghz Quadcore holds up really well, but the clock of 1.3Ghz for single-threaded program means that while this system is generally better than the Intel Atom, the Intel Atom might actually be faster at the single-threaded C++ program execution due to the 1.66Ghz clock.
Thats really cool that you found a purpose for the program you made 7 years ago for your work. If I had a bunch of different macros triggering at different times, then something like that would be cool to see what was last to run and whats next to run etc.
Hopefully when I share code its not painful as nails to a chalk board to see abstract or blended coding methods.
My college professor told me once that they should have a Rube Goldberg award to issue once a year to the most oddest of programming programmers, because he would have given it to me. Compiled the program runs as intended and without flaws and most wouldnt know how strangely constructed it was. But another programmer looking at the source code they generally are like
and
ha ha ha ... I do try to better my programming methods though and so I welcome all feedback. Thank you for your help and suggestions.
I think some of my problems with coding is that I have dabbled in so many different languages as programming as a hobby and at times there becomes a blend. Such as the C within the C++ etc. Since if it compiles without any issues... And runs as intended, then all is good