您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Select a random or nth map in your map selector with a simple shortcut.
// ==UserScript== // @name Bonk.io - Picky // @namespace http://tampermonkey.net/ // @version 0.1.0 // @description Select a random or nth map in your map selector with a simple shortcut. // @author danik0011 // @match https://*.bonk.io/* // @match https://*.bonkisback.io/* // @license MIT // ==/UserScript== document.addEventListener('keydown',e=>{ if(document.getElementById('ingamechatinputtext')===document.activeElement || document.getElementById('newbonklobby_chat_input')===document.activeElement) return; // not run while in chat if(e.repeat || !e.altKey) return; // not be loud if holding and not run if alt isnt held const maps = document.querySelectorAll('.maploadwindowmapdiv'); // get an array of all "map" boxes if(!maps.length) return; let map; if(e.code.startsWith('Digit')) map = maps[+e.code.slice(5)]; // pick nth map if(e.code == 'ShiftRight') map = maps[Math.floor(Math.random()*maps.length)]; // pick random map const button = map.querySelector('.maploadwindowtextmode_picks, .maploadwindowtextmode'); // additional compat with sal's hostmod - changes mode to the one suggested in map if(button) { button.click(); return } if(map) map.click(); })