Genshin Impact daily check-in rewards

A script to collect Genshin Impact daily check-in rewards at startup and on an open tab at a random interval after reward reset. As long as you leave a tab with the page in the on startup and in the background, it will be collected.

< Відгуки до Genshin Impact daily check-in rewards

Відгук: OK - script works, but has bugs

§
Опубліковано: 06.07.2021

Thanks for this!
I had some problems with this working for me (not sure if it's because I'm on firefox or not) so I made a new version that is now working fine.
Firstly the observer only loaded sometimes so I took it out of the on load function and just created it directly.
Secondly the outerText attribute didn't exist on the mutation.addedNodes so I modified that to use outerHTML.
Thirdly, I removed the reliance on the moment import and just set the page to reload every ~4 hours.

My version is here and is in an unpublished state currently.
https://greasyfork.dpdns.org/en/scripts/428958-genshin-impact-daily-check-in-rewards

§
Опубліковано: 11.07.2021

Still had some issues with the mutation observer loading the right parts after a page refresh so I simplified my version right down to just using a timer. Works a lot more reliably that way.

NoxPiАвтор
§
Опубліковано: 01.08.2021
Edited: 01.08.2021
Thanks for this!
I had some problems with this working for me (not sure if it's because I'm on firefox or not) so I made a new version that is now working fine.
Firstly the observer only loaded sometimes so I took it out of the on load function and just created it directly.
Secondly the outerText attribute didn't exist on the mutation.addedNodes so I modified that to use outerHTML.
Thirdly, I removed the reliance on the moment import and just set the page to reload every ~4 hours.

My version is here and is in an unpublished state currently.
https://greasyfork.dpdns.org/en/scripts/428958-genshin-impact-daily-check-in-rewards

Hi,
Thanks for the review and for improving it! The changes makes sense and removes bloat plus unnecessary checks.

I made this script as a first-ever attempt at writing in Javascript both to solve a problem, but also as a learning experience. Thus the overly complicated solutions etc. I did contemplate using simple timers, but a part of me want the process to be somewhat deterministic (I've been burned on this in other projects), though in this case, it should be more than enough if you make the timer long enough, as you did.

Your modifications makes the script far more compatible as well, so it kind of makes sense, to make sure it reaches as many as possible.

The design goal of the script was to make the "footprint" on Mihoyo's service as small as possible, as to keep the use of the script as uncontroversial as possible (From their point of view, as little as possible anyway).

Feel free to publish your version as well, and I will link to your version in the README for those that find mine first and can't get it working.

Cheers,
NoxPi

Опублікувати відповідь

Sign in to post a reply.

长期地址
遇到问题?请前往 GitHub 提 Issues,或加Q群1031348184

赞助商

Fishcpy

广告

Rainyun

注册一下就行

Rainyun

一年攒够 12 元