Results 1 to 4 of 4

Thread: Syncing up a script with a neopets clock

  1. #1
    Xanice's Avatar
    Joined
    Dec 2011
    Posts
    295
    Userbars
    5
    Thanks
    47
    Thanked
    138/90
    DL/UL
    3/0
    Mentioned
    46 times
    Time Online
    1d 4h 57m
    Avg. Time Online
    N/A

    Syncing up a script with a neopets clock

    Hey all!

    So I have made a ton of progress on some of my more fun endeavors and actually completed the original program i was working on! I've now moved on to testing my knowledge by trying to make a script perform timed events. In example, if you know that a shop will refresh at a specific time (say 3:00 PM Neo time), what would be some ways I could get the time from any neopets page and keep my script on the same schedule?

    If you have some ideas and would like details, please pm me! I prefer to keep my projects more private for the time being!

    Thanks!


    Cause someday I'll be OVER 9,000... Rep!


  2. #2
    *squeak*
    Bat's Avatar
    Joined
    Nov 2012
    Posts
    4,036
    Userbars
    152
    Thanks
    2,147
    Thanked
    46,602/3,559
    DL/UL
    34/1
    Mentioned
    1,761 times
    Time Online
    644d 29m
    Avg. Time Online
    3h 41m
    The Neopets clock is set to Pacific time, so offsetting your local time by that timezone will get you close to the current time on the webpage. You can also retrieve the current time by loading a webpage with the Neopets clock on it, but the delay between the server completing the request and you receiving the full response may be enough to mess up the timing in such a way that you may be off by a few seconds. That's not important for full day refresh cycles, but something particularly finicky like the petpet care portion of the Altador plot would be impacted by the misalignment.

  3. The Following User Says Thank You to Bat For This Useful Post:

    Xanice (04-20-2023)

  4. #3
    Xanice's Avatar
    Joined
    Dec 2011
    Posts
    295
    Userbars
    5
    Thanks
    47
    Thanked
    138/90
    DL/UL
    3/0
    Mentioned
    46 times
    Time Online
    1d 4h 57m
    Avg. Time Online
    N/A
    Quote Originally Posted by Bat View Post
    The Neopets clock is set to Pacific time, so offsetting your local time by that timezone will get you close to the current time on the webpage. You can also retrieve the current time by loading a webpage with the Neopets clock on it, but the delay between the server completing the request and you receiving the full response may be enough to mess up the timing in such a way that you may be off by a few seconds. That's not important for full day refresh cycles, but something particularly finicky like the petpet care portion of the Altador plot would be impacted by the misalignment.

    Hey Bat, thanks again for the help as always! I will test it out using an alignment with pacific time. I was just worried that if the server lags or delays it would potentially mess up the clock synchronization, but to be fair - the method of attempting to scrape it off the page is probably both harder and more likely to be off by a few seconds (which is the same worry i had for aligning it with an external clock).

    I really appreciate the help! Right now my prototype of that tool we discussed is functional despite the fact im still running it from a notebook! I'd love to get some feedback from you some time after I get through with busy work week and the core functionality of this new project.

    Hope you have a great night and cheers!


    Cause someday I'll be OVER 9,000... Rep!


  5. #4
    *squeak*
    Bat's Avatar
    Joined
    Nov 2012
    Posts
    4,036
    Userbars
    152
    Thanks
    2,147
    Thanked
    46,602/3,559
    DL/UL
    34/1
    Mentioned
    1,761 times
    Time Online
    644d 29m
    Avg. Time Online
    3h 41m
    Quote Originally Posted by Xanice View Post
    Hey Bat, thanks again for the help as always! I will test it out using an alignment with pacific time. I was just worried that if the server lags or delays it would potentially mess up the clock synchronization, but to be fair - the method of attempting to scrape it off the page is probably both harder and more likely to be off by a few seconds (which is the same worry i had for aligning it with an external clock).

    I really appreciate the help! Right now my prototype of that tool we discussed is functional despite the fact im still running it from a notebook! I'd love to get some feedback from you some time after I get through with busy work week and the core functionality of this project.

    Hope you have a great night and cheers!
    Bad timing is unavoidable on Neopets in its current state, so all you can do is either approximate or compensate. If you can generally assume that the time on the local computer is accurate, then you'd add the variables ((nh * 3600000) + (nm * 60000) + (ns * 1000)) (and make sure to watch out for military versus standard time on nh!) from the Neopets page response together, then subtract the result from the computer's current time in milliseconds since midnight. From that you'd get an offset that you can add to future local wait timers in order to better align yourself with the Neopets clock.

    Hit me up whenever you'd like!
    Last edited by Bat; 04-20-2023 at 07:33 PM.

Posting Permissions

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