Advertisement
PrestonBin

Splix.io mod

Jan 30th, 2018
928
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.53 KB | None | 0 0
  1. [-- Must Have Tampermonkey to get this work.
  2. and must create a new tampermonkey UserScriptto this to work.
  3. --]
  4.  
  5. --[ script here ]--
  6.  
  7. // ==UserScript==
  8. // @name Splix.io Mods,Hacks,Cheats
  9. // @description Splix.io extension (no ads,zoom,play with friends,stop player)
  10. // @version 2.0
  11. // @author Slithere.com
  12. // @match http://splix.io
  13. // @run-at document-start
  14. // @grant GM_xmlhttpRequest
  15. // @connect splix.io
  16. // @website https://slithere.com
  17. // @namespace https://greasyfork.org/users/57018
  18. // ==/UserScript==
  19.  
  20. (function() {
  21.  
  22. window.addEventListener("load", function(){
  23.  
  24. var game = {};
  25.  
  26. setTimeout(function(){
  27.  
  28. MAX_ZOOM = 10000;
  29. //BLOCKS_ON_SCREEN = 10000;
  30. USERNAME_SIZE = 6;
  31. }, 2000);
  32.  
  33.  
  34.  
  35. var mouseWheelEvt= ((/Firefox/i.test(navigator.userAgent))? "DOMMouseScroll" : "mousewheel");
  36.  
  37. document.body.addEventListener(mouseWheelEvt, WheelHandler, true);
  38.  
  39. function WheelHandler(event) {
  40. var zoom = BLOCKS_ON_SCREEN * Math.pow(0.93, event.wheelDelta / 120 || -event.detail || 0);
  41. if(zoom < 100) BLOCKS_ON_SCREEN = 100;
  42. else if(zoom > 16000) BLOCKS_ON_SCREEN = 16000;
  43. else BLOCKS_ON_SCREEN = zoom;
  44. }
  45.  
  46.  
  47. var leaderboard = document.getElementById("leaderboard");
  48. leaderboard.style.top = "48px";
  49. var myCssText = "color:white; font-weight: 700; position:fixed; right: 13px; top: 8px; z-index:100; padding: 5px 10px; opacity: .7; transform-orign: right top;";
  50.  
  51. var myDiv = document.createElement("div");
  52. myDiv.className = "greenBox";
  53. myDiv.style.cssText = myCssText;
  54. myDiv.innerHTML = "SLITHERE.COM - IOGAMESLIST.ORG";
  55.  
  56.  
  57. leaderboard.parentNode.insertBefore(myDiv, leaderboard.nextSibling);
  58.  
  59. uiElems.push(myDiv);
  60.  
  61.  
  62. var paused = false;
  63. var loop = setInterval(function(){
  64. if(paused) {
  65. sendDir((myPlayer.dir + 1)%4);
  66. }
  67. }, 100);
  68.  
  69. window.addEventListener("keyup", function(e){
  70. if(e.keyCode == 80) paused ^= true;
  71. });
  72.  
  73. var nameForm = document.getElementById("nameForm");
  74. var myBox = document.createElement("div");
  75. var br = document.createElement("br");
  76.  
  77.  
  78. nameForm.insertAdjacentHTML("beforeEnd", "<br><select style='float:left; margin-top: 20px; background:#bdf7c4' id='_servers' class='fancyBox'><option selected value='#'>Loading servers...</option></select>");
  79.  
  80.  
  81. var interval;
  82.  
  83. var hashes = [];
  84.  
  85. window.searchServersRecursive = function(obj, ping){
  86. if(obj && obj.hash) {
  87. hashes.push({hash: obj.hash, ping: ping});
  88. return;
  89. }
  90. if(Array.isArray(obj)) for(var i=0; i<obj.length; i++) searchServersRecursive(obj[i], ping);
  91. else {
  92. var arr = Object.getOwnPropertyNames(obj);
  93. if(arr[0] == "0") return;
  94. for(var i=0; i<arr.length; i++) {
  95. if(Array.isArray(obj[arr[i]])) searchServersRecursive(obj[arr[i]], ping);
  96. }
  97. }
  98. };
  99.  
  100.  
  101. function no0(){
  102. for (var i=0; i<window.servers.length; i++){
  103. if(window.servers[i].avgPing === 0) return false;
  104. }
  105. return true;
  106. }
  107.  
  108. interval = setInterval(function(){
  109. if(window.servers.length > 0 && no0()) {
  110. clearInterval(interval);
  111. var no = 1 ;
  112. var options = "<option>Select server</option>";
  113.  
  114. for(var i=0; i<servers.length; i++) searchServersRecursive(servers[i], servers[i].avgPing);
  115.  
  116. hashes.sort(function(a, b){return a.ping - b.ping });
  117.  
  118. for(var i=0; i<hashes.length; i++)
  119. options += "\n<option value='#"+hashes[i].hash+"'>"+(no++)+". #" + hashes[i].hash + " ( " + hashes[i].ping + " )</option>";
  120.  
  121. document.getElementById("_servers").innerHTML = options;
  122. if(window.location.hash.indexOf("#") != -1) document.getElementById("_servers").value = window.location.hash;
  123. }
  124.  
  125. },100);
  126.  
  127. var myStyle = (function() {
  128. var style = document.createElement("style");
  129. style.appendChild(document.createTextNode(""));
  130. document.head.appendChild(style);
  131. return style;
  132. })();
  133.  
  134. var cssRules = document.styleSheets[0]["cssRules"];
  135. for(var i=0; i<cssRules.length; i++){
  136.  
  137. if(cssRules[i].cssText.indexOf("#nameInput")!=-1) {
  138.  
  139. var rule = "#_servers" + cssRules[i].cssText.match(/{.*}/)[0];
  140. rule = rule.replace("-webkit-appearance: none;", "");
  141. myStyle.sheet.insertRule(rule, 0);
  142. }
  143. }
  144.  
  145.  
  146.  
  147. document.getElementById("_servers").onchange = function(){
  148. window.location.assign(document.getElementById("_servers").value);
  149. };
  150.  
  151.  
  152.  
  153. var _showBegin = showBegin;
  154. var _hideBegin = hideBegin;
  155.  
  156.  
  157. window.showBegin = function(){
  158. if(window.location.hash.indexOf("#") != -1) document.getElementById("_servers").value = window.location.hash;
  159. _showBegin();
  160. };
  161.  
  162.  
  163. ga('create', 'UA-78233995-2', 'auto', 'ter');
  164. ga('ter.send', 'pageview', '/tamper');
  165.  
  166.  
  167.  
  168.  
  169. });
  170. })();
  171.  
  172. [-- Must Have Tampermonkey to get this work.
  173. and must create a new tampermonkey UserScriptto this to work.
  174. --]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement