您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Get some coins!
// ==UserScript== // @name Insert Coins for GridGamingIO on Twitch // @namespace http://tampermonkey.net/ // @version 0.2 // @description Get some coins! // @author Sleepypan // @match https://www.twitch.tv/gridgamingio // @grant none // @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js // @require https://gf.qytechs.cn/scripts/2199-waitforkeyelements/code/waitForKeyElements.js?version=6349 /* globals jQuery, $, waitForKeyElements */ // ==/UserScript== var $ = window.$; var isFirstRun = true; var latestTime, startTime, waitingToInsert = false; waitForKeyElements(".simplebar-scrollbar", waitForIt); function waitForIt() { setTimeout(hitIt, 5000); } function hitIt() { if(isFirstRun) { isFirstRun = false; } else { return; } console.log('go'); setInterval(checkIt, 10000); } function checkIt() { console.log('checking'); if ($(".chat-line__message:contains('tickets to Sleepypan')").length > 0) { //cooldown after getting in here latestTime = new Date(); if(waitingToInsert) { var diff = latestTime - startTime; if(diff > 612345) { waitingToInsert = false; } return; } startTime = new Date(); waitingToInsert = true; // wait random number of seconds to insert the coins var secondsToWait = getRandomInt(5,120) * 1000 console.log('waiting to insert for ' + secondsToWait + 'ms'); setTimeout(sendInsertMessage, secondsToWait); } } function sendInsertMessage() { sendChatMessage('!insertall'); } function sendChatMessage(message) { console.log(message); $("textarea[data-a-target='chat-input']")[0].focus(); $("textarea[data-a-target='chat-input']")[0].click(); var input_field = $("textarea[data-a-target='chat-input']")[0]; /* Fill Textarea value, Tricks the React listener override */ var nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, "value").set; nativeInputValueSetter.call(input_field, message); var ev2 = new Event('input', { bubbles: true}); input_field.dispatchEvent(ev2); $("button[data-a-target='chat-send-button']").click(); } function getRandomInt(min, max) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min + 1)) + min; }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址