Greasy Fork

Snake.io cheat (beta)

Cheats for snake.io

目前为 2024-12-02 提交的版本。查看 最新版本

// ==UserScript==
// @name         Snake.io cheat (beta)
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Cheats for snake.io
// @author       idk just not you
// @license      MIT
// @match        https://snake.io/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=snake.io
// @grant        none
// ==/UserScript==

(function() {
    let cheatMenuHTML = `
    <div id="cheatMenu" style="position: absolute; top: 30px; left: 20px; z-index: 9999; background: white; padding: 10px; border: 1px solid black;"><li style="background:#000000;">
         <section><label>Canvas width:</label><input type="range" min="1" max="3264" value="1332" id="WS"></section>
        <section><label id="WV">1332</label></section>
        <section><label>Canvas height:</label><input type="range" min="1" max="3264" value="764" id="HS"></section>
        <section><label id="HV">764</label></section>
        </div>
    `;
    function get(x) { return document.getElementById(x);}
    let cheatMenu = document.createElement('div');
    cheatMenu.innerHTML = cheatMenuHTML;
    document.body.appendChild(cheatMenu);
    let acc = get("accordian"),box = get ("cheatMenu");
    document.body.appendChild(cheatMenu);
    document.addEventListener('keydown', (event) => {if (event.keyCode == 89) {
    let opac = box.style.opacity; if(opac == 1) {
    box.style.opacity = "0";}else {box.style.opacity = "1"}}})
let CanvasWidth = document.getElementById('WS')
let showWidth = document.getElementById('WV')
CanvasWidth.oninput = function() {
  showWidth.innerHTML = this.value;
  document.getElementById('unity-canvas').width = this.value;
}
let CanvasHeight = document.getElementById('HS')
let showHeight = document.getElementById('HV')
CanvasHeight.oninput = function() {
  showHeight.innerHTML = this.value;
  document.getElementById('unity-canvas').height = this.value;
}})();