Genshin Impact daily check-in rewards
Leave a tab open with the Genshin Impact daily check-in rewards page and this script will collect them for you in the following scenarios:
- When you start up your browser or visit the webpage
- If you leave a tab open in the background and the reward refresh timer passes + a few random minutes. The page will be refreshed, re-running the script from the beginning, collecting any rewards available.
This script does not require you to share your credentials or anything like that, it simply observes an already logged in page and clicks a button if it appears (With some extra checks here and there). Feel free to take a short look at the content of the script if you feel nervous and want to double check.
Tested in Chrome-based browsers and uses somewhat "modern" functions here and there. No attempts at supporting legacy browsers have been made. Use at your own risk.
The browser tab running in the background must not be put to sleep, if you are using any extensions/add-on for that type of functionality.
I recommend you verifying that this script is collecting the rewards as expected periodically, as there may bugs and edge cases that the script does not take into account.
If you find any bugs, feel free to report it.
First piece of Javascript code I've written. Could probably be written more efficiently and the problem otherwise solved more elegantly. Publish your version if you have a better solution :D
How to use
- Install the script
- Open up the rewards page
- If you are not logged in, log in.
- Leave it alone
If there is a reward available: The script will normally wait ten (10) seconds, and should then click and collect the reward.
The script lets the pop-up/confirmation box alone, as a reminder for you. The rewards have already been sent when the box appears.
If no rewards are available, the script will schedule a refresh of the tab after the reward reset (By default midnight at UTC+8). The refresh will occur a random minute number after the midnight, to make the request seem somewhat random.
Compatibility issues
If you have any troubles getting the script working for you for some reason, maybe try a modified and a leaner version of my script written by Bunta 2:
http://greasyfork.icu/en/scripts/428958-genshin-impact-daily-check-in-rewards
It has been slimmed down to the bare essentials and will instead refresh every 4 hours, bypassing a lot of complexity and dependencies and should work better for you if you encounter any reliability issues.
Changelog
Version 1.2
- Fixed a potential bug in how early the script observation period terminates.
Version 1.1
- Fixed a bug that prevented the script from collecting the first reward in a month.
License
CC BY 4.0
Disclaimer
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.