w35l3y / userscripts

Public userscripts to be used with Greasemonkey
http://gm.wesley.eti.br
GNU General Public License v3.0
45 stars 23 forks source link

Timezones in the Snowager Script #56

Open Lutarisco opened 6 years ago

Lutarisco commented 6 years ago

Browser: Safari 11.0.2
Plugin: Tampermonkey 4.5.5661
Script: Neopets : The Snowager [Silent version] 3.1.1

Hi there! By looking at the code... I think that this script actually gets the user's timezone for checking the Snowager. Shouldn't it be the Neopian Standard Time (NST)? I could be wrong, as I don't have a big experience with JS, but I noticed something was going wrong when the Snowager was asleep and the script didn't realize it.

Another thing: what should this script really do? Show you a "Snowager is asleep!" alert? Stealing treasures automatically while the user is idle anywhere at Neopets? That gives me an idea: it'd be cool if all of these scripts were really well documented. I understand this requires a lot of effort, but if we make it as a community, our community will grow stronger.

Thanks.

w35l3y commented 6 years ago

This is one of many other scripts that were created years ago.

You are right. At that time, it was verified that Snowager would be asleep once every 8 hours, independently of timezone. I don't know whether it keeps this behavior or not.

This script grabs the treasure automatically every 8 hours while the user is idle.

And you are right again that documentation would be great, but you are the first person in 8 years that seems interested in it. Do you have any ideas on how we could accomplish this task?

Thanks for your interest.

birdgofly commented 6 years ago

There are two places in the script that have this bit of code ((2 + h) % INTERVAL) - lines 82 and 84

I had to change (2 + h) to (h - 1) for my eastern standard time zone, otherwise the script was visiting the Snowager at 2pm EST instead of 2pm NST.

The crazy thing was (to me at least) that the script was actually visiting the Snowager, even though he was blatantly awake, so at 2pm EST each day, all of my pets' health would tank to zero. Took me a minute to figure out what was going on lol.

I also had to roll my computer's clock back a minute or two, because it was a little ahead of neopian time, and that was also causing poorly timed visits to the snowager and all of my pets getting blasted.

I'm pretty sure it's working now, but I don't have very good snowager luck!

Hope that helps!