Greasy Fork is available in English.
Genshin Impact Auto Daily Check-In. Pin daily tab and collect rewards every day you open your browser.
当前为
// ==UserScript==
// @name Genshin Impact Auto Daily Check-In
// @namespace Genshin
// @description Genshin Impact Auto Daily Check-In. Pin daily tab and collect rewards every day you open your browser.
// @author NightLancerX
// @match https://webstatic-sea.mihoyo.com/ys/event/signin-sea/*
// @icon https://webstatic-sea.mihoyo.com/favicon.ico
// @version 1.2
// @license MIT License
// @grant none
// @run-at document-end
// @noframes
// ==/UserScript==
(function(){
'use strict';
let badge;
setTimeout(function(){
badge = document.querySelector('[class^=components-home-assets-__sign-content_---badge]');
if (badge) badge.click()
else console.log('No badge item');
}, 3000 + Math.random()*2000);
setTimeout(function(){
//let xpath = "//div[text()='ОК' or text()='OK']";
//let okBtn = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
let okBtn = document.querySelector('[class*=components-common-common-dialog-__index_---btn__left]');
if (badge && okBtn){
okBtn.click();
console.log('Checked');
}
else console.log('No OK button');
}, 6000 + Math.random()*1500);
//var date = new Date();
//if (date.getUTCHours() < 8) setTimeout(location.reload(), ((8 - date.getUTCHours())*60 - date.getUTCMinutes() + 5)*60*1000);
})();