// ==UserScript== // @name Gartic IO Word Collector with Auto Skip // @namespace http://tampermonkey.net/ // @version 2025-03-06 // @description Collects words presented during the game, saves them to a file, and auto-skips // @author anonimbiri // @license MIT // @match https://gartic.io/* // @icon https://www.google.com/s2/favicons?sz=64&domain=gartic.io // @run-at document-start // @grant none // @downloadURL https://update.greasyfork.icu/scripts/529007/Gartic%20IO%20Word%20Collector%20with%20Auto%20Skip.user.js // @updateURL https://update.greasyfork.icu/scripts/529007/Gartic%20IO%20Word%20Collector%20with%20Auto%20Skip.meta.js // ==/UserScript== (function() { 'use strict'; // Modify appendChild to intercept and alter the game's script Node.prototype.appendChild = new Proxy(Node.prototype.appendChild, { apply: function(target, thisArg, argumentsList) { const node = argumentsList[0]; if (node.nodeName.toLowerCase() === 'script' && node.src && node.src.includes('room')) { console.log('Hedef script algılandı:', node.src); fetch(node.src) .then(response => response.text()) .then(scriptContent => { let modifiedContent = scriptContent .replace( 'r.created||c?Rt("input",{type:"text",name:"chat",className:"mousetrap",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",value:i,placeholder:this._lang.chatHere,maxLength:100,enterKeyHint:"send",onChange:this.handleText,ref:this._ref}):Rt("input",{type:"text",name:"chat",className:"mousetrap",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",value:this._lang.loginChat,maxLength:100,ref:this._ref,disabled:!0})', 'Rt("input",{type:"text",name:"chat",className:"mousetrap",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",value:i,placeholder:this._lang.chatHere,maxLength:100,enterKeyHint:"send",onChange:this.handleText,ref:this._ref})' ) .replace( 'this._timerAtivo=setInterval((function(){Date.now()-e._ativo>15e4&&(O(Object(f.a)(n.prototype),"emit",e).call(e,"avisoInativo"),e._ativo=Date.now())}),1e3)', 'this._timerAtivo=setInterval((function(){Date.now()-e._ativo>15e4&&e.active()}),1e3)' ) .replace( 'e.unlock()}', 'e.unlock();window.game=e;setInterval(()=>{window.game=e},1000);}' ); let blob = new Blob([modifiedContent], { type: 'application/javascript' }); let blobUrl = URL.createObjectURL(blob); node.src = blobUrl; node.textContent = ''; return target.apply(thisArg, [node]); }) .catch(error => { console.error('Failed to fetch/modify script:', error); return target.apply(thisArg, argumentsList); }); return node; } return target.apply(thisArg, argumentsList); } }); // Define wordList globally on window object window.wordList = { "custom": [], "General (en)": [], "General (tr)": [], "Anime (en)": [] }; // Function to save wordList to a file function saveWordListToFile() { const theme = window.game && window.game._dadosSala && window.game._dadosSala.tema ? window.game._dadosSala.tema : "custom"; const words = window.wordList[theme].join('\n'); const blob = new Blob([words], { type: 'text/plain;charset=utf-8' }); const url = URL.createObjectURL(blob); const link = document.createElement('a'); link.href = url; link.download = `${theme}_words.txt`; document.body.appendChild(link); link.click(); document.body.removeChild(link); URL.revokeObjectURL(url); } // Inject UI for the word collector (right side, vertical) const collectorHTML = `
Collects words and skips turn