Snake.io cheat (Zoom Hack)

Cheats for snake.io (Zoom hack)

  1. // ==UserScript==
  2. // @name Snake.io cheat (Zoom Hack)
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description Cheats for snake.io (Zoom hack)
  6. // @author idk just not you
  7. // @license MIT
  8. // @match https://snake.io/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=snake.io
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. function get(x) { return document.getElementById(x); }
  15.  
  16. let cheatMenu = document.createElement("div");
  17. cheatMenu.id = "cheatMenu";
  18. cheatMenu.style.position = "absolute";
  19. cheatMenu.style.top = "30px";
  20. cheatMenu.style.left = "20px";
  21. cheatMenu.style.zIndex = "9999";
  22. cheatMenu.style.background = "white";
  23. cheatMenu.style.padding = "10px";
  24. cheatMenu.style.border = "1px solid black";
  25.  
  26. cheatMenu.innerHTML = `
  27. <section><label>Canvas width:</label><input type="range" min="1" max="3264" value="1332" id="WS"></section>
  28. <section><label id="WV">1332</label></section>
  29. <section><label>Canvas height:</label><input type="range" min="1" max="3264" value="764" id="HS"></section>
  30. <section><label id="HV">764</label></section>
  31. <section><label>Zoom (Working only on snake.io site):</label><input type="range" min="0.5" max="15" value="1" step="0.01" id="ZOOM"></section>
  32. <section><label id="ZM">1</label></section>
  33. `;
  34.  
  35. document.body.appendChild(cheatMenu);
  36.  
  37. let box = get("cheatMenu");
  38.  
  39. document.addEventListener("keydown", (event) => {
  40. if (event.keyCode == 89) { // Нажатие "Y" скрывает/показывает меню
  41. box.style.opacity = (box.style.opacity == "1") ? "0" : "1";
  42. }
  43. });
  44.  
  45. let CanvasWidth = get("WS");
  46. let showWidth = get("WV");
  47. CanvasWidth.oninput = function() {
  48. showWidth.innerHTML = this.value;
  49. let gameCanvas = get("unity-canvas");
  50. gameCanvas.style.width = this.value + "px";
  51. };
  52.  
  53. let CanvasHeight = get("HS");
  54. let showHeight = get("HV");
  55. CanvasHeight.oninput = function() {
  56. showHeight.innerHTML = this.value;
  57. let gameCanvas = get("unity-canvas");
  58. gameCanvas.style.height = this.value + "px";
  59. };
  60.  
  61. let ZoomVS = get("ZOOM");
  62. let ShowZoomVS = get("ZM");
  63. ZoomVS.oninput = function() {
  64. let zoomValue = parseFloat(this.value);
  65. let gameCanvas = get("unity-canvas");
  66. let gameContainer = get("unity-container");
  67.  
  68. ShowZoomVS.innerHTML = this.value;
  69.  
  70. gameContainer.style.transform = "scale(" + zoomValue + ")";
  71. gameContainer.style.transformOrigin = "center";
  72.  
  73. gameCanvas.style.transform = "scale(" + zoomValue + ")";
  74. gameCanvas.style.transformOrigin = "center";
  75.  
  76. gameContainer.style.position = "absolute";
  77. gameContainer.style.top = "50%";
  78. gameContainer.style.left = "50%";
  79. gameContainer.style.transform = "translate(-50%, -50%)";
  80. gameContainer.style.overflow = "hidden";
  81. document.getElementById("otherKooApps").style.opacity = 0;
  82. };
  83. })();