Countdown Timer Help

Justme

Active Member
I cannibalized a script and figured out how to start an xml file with the following:

Code:
ui -reload "xml/timerhud.xml"
The following will make my timer work in the console, but I really need a display to let me know how much time is left, as in the Harvest Bot timer script. That would be perfect if I could figure it out and use that separately. So far, this is what I have found:

Code:
objectdef timer
{
  variable uint EndTime
 
  method Set(seconds)
  {
     EndTime:Set[${seconds}+${Script.RunningTime}]
  }
  member:uint TimeLeft()
  {
     if ${Script.RunningTime}>=${EndTime}
        return 0
     return ${Math.Calc[${EndTime}-${Script.RunningTime}]}
  }
} 

variable timer EggTimer

function main()
{
	ui -reload "xml/timerhud.xml"
   EggTimer:Set[1234]
   ;Note: Above time is in ms - so the above is 1.234 seconds
   echo ${EggTimer.TimeLeft} remaining
   wait 99999 !${EggTimer.TimeLeft}
   echo Time's up!
}
Any help or point to a script I could possibly modify somehow would be great.
 
Last edited:
Top Bottom