Author Topic: Countdown timer w/ menu  (Read 1977 times)

0 Members and 1 Guest are viewing this topic.

Offline J4bberTopic starter

  • Newbie
  • *
  • Posts: 6
  • Activity:
    0%
  • Reputation Power: 1
  • J4bber has no influence.
  • Gender: Male
  • Half Century Scripter
  • Respect: 0
  • Referrals: 0
    • View Profile
Countdown timer w/ menu
« on: May 28, 2022, 02:08:15 PM »
0
Before I even attempt to write this, someone surely (don't call me surely  :P ) has this already.  I need a countdown display.  So lets say I do something, then want to display a countdown timer until the next instance.   

Example:  I donate something and I can't do it again for 10 minutes.  I want to display a countdown timer in a simple menu until the 10 minutes are up, updated roughly every second...

Anyone already have this, or at least the counter logic?

Thanks
-J4

Offline Gaderian

  • Elite
  • *
  • *
  • Posts: 486
  • Activity:
    0%
  • Reputation Power: 10
  • Gaderian barely matters.Gaderian barely matters.
  • Respect: +50
  • Referrals: 3
    • View Profile
Re: Countdown timer w/ menu
« Reply #1 on: May 28, 2022, 10:28:29 PM »
0
What would work really well is a separate script that keeps track of the timer based on namespace global variables. Use that to display the value in a menu.
This allows your script to set the by changing into the namespace, set the value, and exit the namespace. This is easy to implement into a script without affecting its other logic.

Gaderian
"Go ahead ask me: 'Should I use hard waits or timers?'"
You say:"Should I"
Gaderian:"Timers!"
You Say:"use hard waits or timers?"

The serious side of timer use is illustrated here: http://www.scriptuo.com/index.php?topic=12094.msg101926#msg101926

However, every time I go back and look at this [AutoLooter] script, I realize I had wrote it in my zen state of EUO scripting - so it makes my brain hurt.

Offline J4bberTopic starter

  • Newbie
  • *
  • Posts: 6
  • Activity:
    0%
  • Reputation Power: 1
  • J4bber has no influence.
  • Gender: Male
  • Half Century Scripter
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: Countdown timer w/ menu
« Reply #2 on: May 29, 2022, 03:57:55 AM »
0
Oh, good idea.  why didn't I think of that :)

Tags: