您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Press Esc twice to toggle the menu
当前为
// ==UserScript== // @name Diep.style // @namespace http://tampermonkey.net/ // @version 0.01 // @description Press Esc twice to toggle the menu // @author sbk2015 // @match http://*diep.io/* // @grant none // ==/UserScript== (function() { 'use strict'; (function init() { keyListen(); tempInit(); styleInit(); // togglePanel(true); function keyListen() { var input = ''; document.addEventListener('keyup', function(evt) { if (this.settingOn == undefined) this.settingOn = false; var e = window.event || evt; var key = e.which || e.keyCode; input += key; if (input.indexOf('2727') >= 0) { input = ''; this.settingOn = !this.settingOn togglePanel(this.settingOn); } if (input.length > 10) input = input.substring(input.length - 10); }); } function tempInit() { var title = `<div>Diep.Style Ver 0.01 </div>`; var descr = `<div>Press Esc twice to toggle this setting.</div>` var body = ` <div class="table"> <div class="row"> <div class="cell">Grid base alpha <br><span class="grid_base_value">0.3</span></div> <div class="cell"><input type="range" name="grid_base_alpha" value="30"></div> </div> <div class="row"> <div class="cell">Show Outline</div> <div class="cell"><input type="checkbox" name="stroke_soft_color"></div> </div> <div class="row"> <div class="cell">Show Fps</div> <div class="cell"><input type="checkbox" name="fps"></div> </div> <div class="row"> <div class="cell">Dark Mode</div> <div class="cell"><input type="checkbox" name="background"></div> </div> <div class="row backRed"> <div class="cell">Chaotic Mode</div> <div class="cell"><input type="checkbox" name="chaotic"></div> </div> </div>`; var temp = `<div id="styleSetting"> ${title} ${body} ${descr} </div>` document.querySelector('body').insertAdjacentHTML('afterend', temp); var it = document.querySelector('input[name="grid_base_alpha"]').addEventListener('input', function(e) { var value = (e.target.value - e.target.value % 2) / 100 input.set_convar("ren_grid_base_alpha", value); document.querySelector('.grid_base_value').innerHTML = value; }); it = document.querySelector('input[name="stroke_soft_color"]').addEventListener('change', function(e) { input.set_convar("ren_stroke_soft_color", !e.target.checked); }); it = document.querySelector('input[name="fps"]').addEventListener('change', function(e) { input.set_convar("ren_fps", e.target.checked); }); it = document.querySelector('input[name="background"]').addEventListener('change', function(e) { input.set_convar("ren_background", !e.target.checked); }); it = document.querySelector('input[name="chaotic"]').addEventListener('change', function(e) { if (e.target.checked) { input.execute('net_replace_color 2 0xf14e54'); //you ffa input.execute('net_replace_color 15 0xf14e54'); //other ffa input.execute('net_replace_color 3 0xf14e54'); //blue input.execute('net_replace_color 4 0xf14e54'); //red input.execute('net_replace_color 5 0xf14e54'); //purple input.execute('net_replace_color 6 0xf14e54'); //green } else { input.execute('net_replace_color 2 0x00b1de'); //you ffa input.execute('net_replace_color 15 0xf14e54'); //other ffa input.execute('net_replace_color 3 0x00b1de'); //blue input.execute('net_replace_color 4 0xf14e54'); //red input.execute('net_replace_color 5 0xc396e9'); //purple input.execute('net_replace_color 6 0x11d578'); //green } }); } function styleInit() { addGlobalStyle(`#styleSetting{padding: 0.2em; margin:0.2em; position: absolute;top: 0;right: 0;width: 30%; background-color: rgba(200,200,200,0.8);display:none;}`); addGlobalStyle(".table{ display: table; text-align: center; width: 100%;}"); addGlobalStyle(".row{ display: table-row; }"); addGlobalStyle(`.cell{ display: table-cell; padding: 0px 0.3em;border: 1px solid black;}`); addGlobalStyle(`.backRed{background-color:#f14e54}`) function addGlobalStyle(css) { var head, style; head = document.getElementsByTagName('head')[0]; if (!head) { return; } style = document.createElement('style'); style.type = 'text/css'; style.innerHTML = css; head.appendChild(style); } } })(); function togglePanel(tf) { tf ? document.querySelector('#styleSetting').style.display = "block" : document.querySelector('#styleSetting').style.display = "none"; } })();