您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically clicks the claim button on NightCafe
当前为
// ==UserScript== // @name site nightcafe - Claim Button Clicker // @namespace http://greasyfork.org // @version 2024.07.16.2311 // @description Automatically clicks the claim button on NightCafe // @author hg42 // @license MIT // @match https://creator.nightcafe.studio/*claim* // @grant none // @run-at document-end // @require http://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js // ==/UserScript== (function() { 'use strict'; const checkInterval = 3; // hour const interval = checkInterval / 3; function clickClaimButton() { const claimButton = $("button:has(:contains('Claim'))"); if (claimButton) { claimButton.click(); console.log("Claim button clicked!"); } else { console.log("Claim button not found."); } } function check() { const now = new Date(); const lastCheck = localStorage.getItem('lastCheck'); if (lastCheck) { //const lastCheckDate = new Date(lastCheck); //const hoursDiff = (now - lastCheckDate) / (60 * 60 * 1000); //if (hoursDiff >= checkInterval) { clickClaimButton(); localStorage.setItem('lastCheck', now); //} else { // console.log(`Last check was ${hoursDiff} hours ago. Checking again in 3 hours.`); //} } else { clickClaimButton(); localStorage.setItem('lastCheck', now); } setInterval(check, interval * 60 * 60 * 1000); } setInterval(check, 10000); })();