// ==UserScript==
// @name Fiu Gartic.io Remove Cooldown 2026 (Fix)
// @name:en Fiu Gartic.io Remove Cooldown 2026 (Fix)
// @name:tr Fiu Gartic.io Bekleme Süresi Kaldırma 2026 (Düzeltme)
// @name:es Fiu Gartic.io Eliminar Cooldown 2026 (Corrección)
// @name:pt Fiu Gartic.io Remover Cooldown 2026 (Correção)
// @name:az Fiu Gartic.io Gözləmə Müddətini Sil 2026 (Düzəliş)
// @name:vi Fiu Gartic.io Xóa Cooldown 2026 (Sửa lỗi)
// @name:ru Fiu Gartic.io Удалить Cooldown 2026 (Исправление)
// @namespace fiugarticiofix
// @version 1.1
// @description Fiu
// @description:en Fiu
// @description:tr Fiu
// @description:es Fiu
// @description:pt Fiu
// @description:az Fiu
// @description:vi Fiu
// @description:ru Fiu
// @author Fiu & Qwyua
// @icon data:image/svg+xml,
// @match *://gartic.io/*
// @match https://gartic.io/
// @match gartic.io/*
// @run-at document-body
// @grant GM_setValue
// @grant GM_getValue
// @grant unsafeWindow
// @license MIT
// @downloadURL https://update.greasyfork.icu/scripts/575769/Fiu%20Garticio%20Remove%20Cooldown%202026%20%28Fix%29.user.js
// @updateURL https://update.greasyfork.icu/scripts/575769/Fiu%20Garticio%20Remove%20Cooldown%202026%20%28Fix%29.meta.js
// ==/UserScript==
/gartic\.io$/.test(location.host)&&(()=>{
const onElementAdded2 = (s,c,m=1)=>{
const f=()=>{document.querySelectorAll(s).forEach(c);o.observe(document.body,{childList:1,subtree:1})};
const o=new MutationObserver(r=>{for(let x of r)for(let n of x.addedNodes)if(n.nodeType==1&&(n.matches(s)||n.querySelector(s))){n.matches(s)&&c(n);n.querySelectorAll(s).forEach(c);if(!m)return o.disconnect()}});
document.body?f():new MutationObserver((_,b)=>document.body&&(b.disconnect(),f())).observe(document.documentElement,{childList:1})
};
const TTL=27e4;
const mode = location.search.includes('farms') ? 'token' : 'gartic';
const app = {
gartic: () => {
onElementAdded2("body", b => {
if(!document.getElementById("token_farmer")) {
const frm = document.createElement("iframe");
frm.id = "token_farmer";
frm.src = "/?farms=1";
frm.style.display = "none";
b.appendChild(frm);
}
}, 0);
new class{
constructor(){
const w=unsafeWindow;
this._owner=w._owner||(w._owner={});
Object.defineProperty(this._owner,"self",{value:this,enumerable:0,configurable:1,writable:1});
const T=typeof unsafeWindow!=='undefined'?unsafeWindow:window,s={render:(...a)=>{
return (a[1]?.callback||typeof a[1]==='function'&&a[1])?.('turnstile')
},remove:()=>{}};
const l=()=>{
try{ Object.defineProperty(T,'turnstile',{value:s,writable:0,configurable:0,enumerable:1}); return }catch(e){}
try{ const d=Object.getOwnPropertyDescriptor(T,'turnstile'); d?.configurable&&Object.defineProperty(T,'turnstile',{value:s,writable:0,configurable:0,enumerable:1}); return }catch(e){}
try{ Object.defineProperty(T,'turnstile',{configurable:1,enumerable:1,get:()=>s,set:()=>{throw 0}}); return }catch(e){}
};
l(); setTimeout(l,0);
onElementAdded2("div#content",e=>{
let d=[50,100,200,400],i=0,f=()=>{
const k=Object.getOwnPropertyNames(e).find(x=>x.startsWith("__react"));
const r=k&&e[k];
if(r){
try {
this._owner._play=r.pendingProps.children[1]._owner.stateNode._play;
const injectCode = `
const p=_owner._play;
p._lastConnectTry = 0;
p.start=(...a)=>{
p._data=CACHE_DATA;
p._room=a[1];
p._data.user||=window.CACHE_DATA.user;
p._getServer();
p._setPopup(10)
};
const j=p._join;
p._join=(...a)=>{
a[4]?.forEach?.(x=>x?.nick&&(x.nick=_owner.self.escapeInvisibles(x.nick)));
return j.apply(p,a)
};
p._connect=()=>{
const now = Date.now();
if(now - p._lastConnectTry < 2000) {
setTimeout(p._connect, 2000);
return;
}
p._lastConnectTry = now;
const t=CACHE_DATA,e=t.user||CACHE_DATA.user,c=e.logado?0:e.avatar;
p._reconnections=0;
const token = _owner.self.getToken();
if(p._viewer){
p._socket.emit(12,{v:2e4,platform:0,sala:p._room?.substr(2)});
} else if(p._room){
if(p._room===!0){
p._socket.emit("2",{v:2e4,token:token,nick:e.nome,avatar:c,platform:0,idioma:e.language,tipo:t.subject,limite:t.players,meta:t.points,visivel:t.visible,criado:t.created});
} else {
p._socket.emit("3",{v:2e4,token:token,nick:e.nome,avatar:c,platform:0,sala:p._room.substr(2)});
}
} else {
p._socket.emit("1",{v:2e4,token:token,nick:e.nome,avatar:c,platform:0,idioma:e.language});
}
p._socket.removeAllListeners("connect");
};
`;
eval(injectCode);
return;
} catch(err) {}
}
if(d[i]) setTimeout(f,d[i++]);
};
f()
},0);
onElementAdded2("div#screenRoom",e=>{
let g,w=n=>{
if(n&&!g){
if(n.tag==1&&(g=this._owner._game=n.stateNode?.props?.children?.[0]?._owner?.stateNode?._game)) this.joinedRoom(g);
!g&&w(n.child);
}
};
for(let k in e) if(/^__r/.test(k)) w(e[k]);
},1)
}
gT=()=>{
let c="Zx1Yp8Qr7Wv6Ut5Os4Nm3Lk2Jh0GfAeBdCvHqIjKlMnOpQrStUvWxYz0123456789_-.",r=n=>Array.from({length:n},()=>c[Math.random()*c.length|0]).join(""),s=3+Math.random()*3|0;return"1."+Array.from({length:s},()=>r(80+Math.random()*120|0)).join(".")
}
antiAFK=()=>{
const o=this._owner,g=o?._game,e=g?._events;
if(!e) return;
e.avisoInativo=()=>{
g._ativo=Date.now();
g._socket.io.engine.transport.ws.send(`42[42,${g._codigo}]`);
}
}
escapeInvisibles=s=>{
return s.replace(/\p{C}/gu,c=>`\\u${c.codePointAt(0).toString(16).toUpperCase().padStart(4,'0')}`)
}
joinedRoom=()=>{
addEventListener("keydown",e=>{
if(e.code==="Escape"){
this._owner?._game?.exit();
delete this._owner._game;
}
},{passive:1,once:1});
Object.defineProperty(this._owner._game,'_tempoVotekick',{get:()=>0,set:()=>{}});
this.antiAFK();
}
getToken=()=>{
const now=Date.now()
let tokens=GM_getValue("Tokens")||[]
let valid=tokens.filter(t=>!t.used && now-t.time(TTL-(now-b.time))<(TTL-(now-a.time))?b:a)
tok.used=1
GM_setValue("Tokens",tokens)
return tok.token
}
}
},
token: () => {
const w = unsafeWindow;
onElementAdded2("body", b => b.style.opacity = '0');
const run = () => {
if (!w.turnstile) return setTimeout(run, 500);
const tkDiv = document.createElement('div');
document.body.appendChild(tkDiv);
try {
w.turnstile.render(tkDiv, {
sitekey: '0x4AAAAAABBPKaIbNwnPEfSo',
size: 'invisible',
callback: t => {
const now = Date.now();
const all = GM_getValue('Tokens') || [];
const clean = all.filter(x => now - x.time < TTL);
clean.push({token: t, time: now});
GM_setValue('Tokens', clean);
setTimeout(() => {
try { w.turnstile.reset(); } catch(e) {}
}, 2000 + Math.random() * 2000);
}
});
} catch(e) {}
};
run();
}
};
app[mode]();
})();