WeaveAche / hanime-auto-coins-collector

Coin collector for hanime mobile app.
28 stars 17 forks source link

Changing UTC to any other timezone #4

Closed sneazy-ibo closed 2 years ago

sneazy-ibo commented 2 years ago

First of all tysm for the macro, I've used it for only two days now and it works fluently. I automated it with a simple batch script so that it grinds automatically on a rdp, it would be cool if you can also add a batch script to the rep which runs the getcoins.py automatically after 3 hours, so that other pple can automate it too without any coding. My real question is how to change the timezone, I don't have much experience with python bc I only use batch scripts and ahk for personal things. So it would be nice if anyone can teach me what to edit in the sc so that it shows the time in my timezone (CEST atm)

WeaveAche commented 2 years ago

Hi, for the timezone you can change the line 105 in getcoins.py from,

print(f"[*] Last clicked on {parser.parse(info['last_clicked']).ctime()} UTC")

to

print(f"[*] Last clicked on {parser.parse(info['last_clicked']).astimezone().strftime('%Y-%m-%d %H:%M:%S')}")

This will show the time in your system's timezone. If you want, you can also change the formatting by changing the string inside strftime().

WeaveAche commented 2 years ago

For the automation scripts, I didn't include them because they depend on the os/user preferences. Also such a script would just contain a single line and shouldn't be that hard to figure out.

One thing I could do is just add a while loop inside main, which runs the getCoins function every 3 hours. But I didn't like the idea of keeping a python script running in the background, sleeping for 3 hours.

sneazy-ibo commented 2 years ago

For the automation scripts, I didn't include them because they depend on the os/user preferences. Also such a script would just contain a single line and shouldn't be that hard to figure out.

One thing I could do is just add a while loop inside main, which runs the getCoins function every 3 hours. But I didn't like the idea of keeping a python script running in the background, sleeping for 3 hours.

Ah I see, I have not taken this into consideration and yes you're right, pple can find a way to automate it by themselfs since it's pretty easy.

sneazy-ibo commented 2 years ago

This will show the time in your system's timezone. If you want, you can also change the formatting by changing the string inside strftime().

Tysm for the help, the ability of formating it by myself is also perfect for me