Results 1 to 10 of 10

Thread: Rollover

  1. #1
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    454

    Default Rollover

    I've been looking around for an ash command that will return what time rollover happens.

    MrEdge73's script has "MinutesToRollover()", but I know that command doesn't work anymore. He also has the command "WaitMinutes()", and I know that doesn't work either.

    I can type /rollover into the CLI, and get an accurate time, but can't use that in a script. Is there something I'm missing, or was this just taken out?
    Scripts I have written:
    Unlock Dread A Script to save you a bunch of clicks.
    Standard Rollover Bonus A Script that shows best items to pull/equip for bonus turns.
    Standard PVP Bonus A Script that shows the best items to pull/equip for bonus PVP Fights.
    Rollover Management A Script that does all the daily deeds you might have forgotten, or might have missed.
    Chatbot A Chatbot script. Simple start for those who want/need one for their clan.
    Zap Wand A Dungeon of Doom ZAP WAND getting script.

  2. #2
    Senior Member Crowther's Avatar
    Join Date
    Nov 2006
    Posts
    1,444

    Default

    The functions you need are rollover(), gameday_to_int(), and wait() or waitq(). You can make what you need out of that. Note, the first two return milliseconds and the last two take seconds.

  3. #3
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    454

    Default

    The functions you need are rollover(), gameday_to_int(), and wait() or waitq(). You can make what you need out of that. Note, the first two return milliseconds and the last two take seconds.
    Originally Posted by Crowther View Post
    rollover() spits out the same number, regardless of the time of day for me. I tried it over a few minutes. Here's the output I get when I use the rollover() function.

    Code:
    print(rollover() + " milliseconds to rollover");
    print(rollover() / 6000 + " seconds to rollover");
    print(rollover() / 60000 + " minutes to rollover");
    print(rollover() / 3600000 + " hours to rollover");
    print(time_to_string() + " My local time");
    Which spits this out:
    1549164601 milliseconds to rollover
    258194 seconds to rollover
    25819 minutes to rollover
    430 hours to rollover
    12:12:35 EST My local time

    I'm sure I can figure out a way to use time_to_string() and the actual time of rollover to do what I need.
    Scripts I have written:
    Unlock Dread A Script to save you a bunch of clicks.
    Standard Rollover Bonus A Script that shows best items to pull/equip for bonus turns.
    Standard PVP Bonus A Script that shows the best items to pull/equip for bonus PVP Fights.
    Rollover Management A Script that does all the daily deeds you might have forgotten, or might have missed.
    Chatbot A Chatbot script. Simple start for those who want/need one for their clan.
    Zap Wand A Dungeon of Doom ZAP WAND getting script.

  4. #4
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,297

    Default

    You probably want to divide milliseconds by 1000 to convert to seconds :-)

    I'm not sure rollover is working. Maybe I'll get a chance to check.

  5. #5

    Default

    I'm not sure rollover is working. Maybe I'll get a chance to check.
    Originally Posted by fronobulax View Post
    It returns the value of "rollover" provided by api.php.

  6. #6
    Senior Member
    Join Date
    Apr 2009
    Posts
    1,827

    Default

    1549164601
    Originally Posted by Pazleysox View Post
    That's unix timestamp of GMT: Sunday, February 3, 2019 3:30:01 AM
    which is the time of (currently) next closest rollover.

  7. #7
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    454

    Default

    So how can that be converted into a readable number?
    Scripts I have written:
    Unlock Dread A Script to save you a bunch of clicks.
    Standard Rollover Bonus A Script that shows best items to pull/equip for bonus turns.
    Standard PVP Bonus A Script that shows the best items to pull/equip for bonus PVP Fights.
    Rollover Management A Script that does all the daily deeds you might have forgotten, or might have missed.
    Chatbot A Chatbot script. Simple start for those who want/need one for their clan.
    Zap Wand A Dungeon of Doom ZAP WAND getting script.

  8. #8
    Developer
    Join Date
    Aug 2009
    Posts
    2,904

    Default

    Dumb question: why can't you just use gametime_to_int() by itself?

    MinutesToRollover can then be defined as
    Code:
    int MinutesToRollover() {
      return 1440 - gametime_to_int() / 1000 / 60;
    }
    (where 1440 is mins in a day)

    This should be resilient against DST because rollover happens at the same time UTC each day.

    (WaitMinutes() should just be wait(60*num).)

  9. #9
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,297

    Default

    So how can that be converted into a readable number?
    Originally Posted by Pazleysox View Post
    It is readable to me :-)

    Being a Unix timestamp (which I had missed before so thanks) it is the number of seconds since Jan 01 1970. (UTC). So you can look for routines which convert it into time format that you can work with. Since you are interested in time to rollover you could also get the current time in Unix format, subtract it from the rollover time and that gives you time until rollover in seconds.

    But heeheehee's solution is good too :-)
    You just vehemently agreed with me
    Originally Posted by Veracity View Post
    I agree with frono.
    Originally Posted by Veracity View Post

  10. #10
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    454

    Default

    Dumb question: why can't you just use gametime_to_int() by itself?

    MinutesToRollover can then be defined as
    Code:
    int MinutesToRollover() {
      return 1440 - gametime_to_int() / 1000 / 60;
    }
    (where 1440 is mins in a day)

    This should be resilient against DST because rollover happens at the same time UTC each day.

    (WaitMinutes() should just be wait(60*num).)
    Originally Posted by heeheehee View Post
    I will have to try this. Thank you.
    Scripts I have written:
    Unlock Dread A Script to save you a bunch of clicks.
    Standard Rollover Bonus A Script that shows best items to pull/equip for bonus turns.
    Standard PVP Bonus A Script that shows the best items to pull/equip for bonus PVP Fights.
    Rollover Management A Script that does all the daily deeds you might have forgotten, or might have missed.
    Chatbot A Chatbot script. Simple start for those who want/need one for their clan.
    Zap Wand A Dungeon of Doom ZAP WAND getting script.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •