Gartic.io YGN SCRIPT

Gartic.io Oyun İçi Kolaylık Sağlar.

  1. // ==UserScript==
  2. // @name Gartic.io YGN SCRIPT
  3. // @namespace http://tampermonkey.net/
  4. // @version 10
  5. // @description Gartic.io Oyun İçi Kolaylık Sağlar.
  6. // @author ygn
  7. // @match https://gartic.io/*
  8. // @icon https://www.google.com/s2/favicons?domain=gartic.io
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. // **NOT :: JAVASCRIPT ÖĞRENMEK İSTEYENLER İÇİN AÇIK KAYNAK KOD OLARAK YGN(JOKESCRITP) TARAFINDAN HERKESE AÇIK OLARAK PAYLAŞILMIŞTIR. SUISTIMAL ETMEYINIZ.
  13.  
  14. let ready=0,oldurl;
  15. let panel = document.createElement("div");
  16. panel.setAttribute("class","roomspanel");
  17. panel.setAttribute("style","width:15%;height:auto;max-height:500px;overflow-y:scroll;padding:10px;position:fixed;background-color:white;color:grey;font-weight:bold;right:10px;top:50%;transform:translate(0,-50%);border-radius:10px;border:2px solid grey;text-align:center;z-index:99999;");
  18. let icerik = "<h2>Odalar</h2><hr><br><input type='text' style='padding:10px;' placeholder='Oda Ara..' oninput='window.refreshrooms(this.value)' class='mousetrap' /><br><br><div class='odaliste'></div>";
  19. function _(x){return document.querySelector(x);};
  20. function _a(x){return document.querySelectorAll(x);};
  21. window.refresh=(x=window.location.href)=>{window.onbeforeunload=null;oldurl=x;_("#exit").click();_(".ic-yes").click();setTimeout(window.location.href=oldurl,500);};
  22.  
  23. setTimeout(()=>{
  24. if(document.title.indexOf("#")!=-1){
  25. let l = setInterval(()=>{
  26. _(".ic-playHome").click();
  27. clearInterval(l);
  28. },100);
  29. }
  30. },300);
  31.  
  32. window.refreshrooms=(x="")=>{
  33. let roomdatas;
  34. fetch("https://gartic.io/req/list?search="+x+"&language[]=8").then(x=>x.json()).then(x=>{
  35. roomdatas=x;
  36. _(".odaliste").innerHTML="";
  37. for(let i of roomdatas){
  38. _(".odaliste").innerHTML+="<button style='width:70%;text-align:center;background-color:dodgerblue;color:white;border:2px solid cyan;border-radius:10px;padding:10px;' onclick='window.refresh(\"https://gartic.io/"+i.code+"\")'><b>"+i.code.slice(-3)+" - "+i.quant+"/"+i.max+"</b></button><a href='https://gartic.io/"+i.code+"/viewer' target='_blank'>Viewer</a><br>";
  39. }
  40. });
  41. }
  42.  
  43. document.body.addEventListener("keyup",(event)=>{
  44. window.event.keyCode==27?window.refresh():0;
  45. })
  46.  
  47. let a = setInterval(()=>{
  48. if(_(".game")){
  49. if(ready==0){
  50. setTimeout(()=>{
  51. _(".logo").remove();
  52. if(!_(".roomspanel")){
  53. document.body.appendChild(panel);
  54. _(".roomspanel").innerHTML=icerik;
  55. window.refreshrooms();
  56. }
  57. for(let i of _a(".alert")){
  58. i.setAttribute("class","msg");
  59. }
  60. _(".user.you").innerHTML+='<span style="padding:10px;background:black;color:gold;font-weight:bold;">VIP</span>';
  61. ready=1;
  62. },300);
  63. }
  64. _(".contentPopup")?_(".btYellowBig.ic-yes").click():0;
  65. _("g")?_("g").remove():0;
  66. if(ready==1){
  67. for(let i of _a(".scrollElements")[2].querySelectorAll(".msg.alert")){
  68. i.innerText.split(", ")[1].split(" ")[0] == _(".user.you").innerText.split("\n")[0]?window.refresh():0;
  69. }
  70. }
  71. }
  72. },50);