🏠 Home 

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.

< Feedback on Genshin Impact daily check-in rewards

Review: OK - script works, but has bugs

§
Posted: 2021-07-06

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.org/en/scripts/428958-genshin-impact-daily-check-in-rewards

§
Posted: 2021-07-11

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.

NoxPiAuthor
§
Posted: 2021-08-01
Edited: 2021-08-01
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.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

Post reply

Sign in to post a reply.