BBC BASIC for Windows
IDE and Compiler >> Tools and Utilities >> WOW Garrison Resource counter
http://bb4w.conforums.com/index.cgi?board=addins&action=display&num=1467988233

WOW Garrison Resource counter
Post by michael on Jul 8th, 2016, 2:30pm

NOTE: This program was modified after later comment.. It now will run cool.
Thanks for the tip. I knew better... just wanted to get the idea out.. But you never know someone might copy my bad loop with no WAIT and then bad stuff could happen..
The garrison resource counter. Now you always will know how fast your resources are growing on each toon (as long as you clear each toons garrison resources at around the same time and keep the program running.

(this program has been modified to count resources as you play the game)
I will improve this program as time passes
Code:
   
      coun%=0
      resource%=0
      OFF
      REPEAT
        t$=TIME$
        rt$=RIGHT$(t$,8)
        * REFRESH OFF
        CLS
        REM Technically we could easily make it wait for 1 second for an alarm clock
        REM and that should give enough time to do other small calculations.
        REM COOL CPU
        WAIT 100
        coun%=coun% +1
        IF coun%=600 THEN coun%=0:resource%=resource%+1
        PRINT "Garrison resources increase by 1 every 10 minutes "
        PRINT rt$
        PRINT "Current Garrison Resources :" resource%
        * REFRESH
      UNTIL FALSE
   
 

Re: CLOCK isolating the time for alarm day managem
Post by Zaphod on Jul 8th, 2016, 11:07pm

Can I make some suggstions:
Look at Datelib.bbc if you need to manipulate date and time
Don't write closed loops without time delays EVER! You just slow everything else down and waste CPU power.
If you want to stop flicker just write only if it changes.
Or use ON TIME interrupts to run the loop once a 100 ms or so.