您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
multibox after 2023 patch
当前为
- // ==UserScript==
- // @name Multibox script
- // @namespace http://tampermonkey.net/
- // @version 2
- // @description multibox after 2023 patch
- // @author Mi300#4401
- // @match https://diep.io/*
- // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
- // @license MIT
- // @grant GM_getValue
- // @grant GM_setValue
- // ==/UserScript==
- let WTF = setInterval (function() {
- if (!document.querySelector('d-base').shadowRoot.children[0].shadowRoot.getElementById('username-input')) {
- return;
- }
- clearInterval (WTF)
- let canRespawn = false;
- let worldPosition = [0, 0];
- let overlay;
- let mouseOffset = [0, 0];
- let gui = true;
- let gamepadConnected = false;
- let gamepadAxes = [0, 0, 0, 0]
- let gamepadButtons = [
- ...Array(17)].map((x) => {
- return { pressed: false };
- });
- const fetchGamepad = () => {
- return {
- axes: gamepadAxes,
- buttons: gamepadButtons,
- mapping: 'standard',
- }
- }
- navigator.getGamepads = new Proxy(navigator.getGamepads, {
- apply (target, thisArg, args) {
- if (gamepadConnected) return [fetchGamepad()];
- return Reflect.apply(target, thisArg, args);
- },
- });
- const canvas = document.getElementById ('canvas');
- function hook (target, callbackFunc) {
- CanvasRenderingContext2D.prototype[target] = new Proxy (CanvasRenderingContext2D.prototype[target], {
- apply (method, thisArg, args) {
- callbackFunc (method, thisArg, args);
- return Reflect.apply (method, thisArg, args)
- }
- });
- }
- let dgg = 'i';
- function hookMinimapArrow () {
- let drawInstructions = 0;
- let minimapArrowVertex = [];
- hook ('beginPath', (method, thisArg, args) => {
- drawInstructions = 1;
- minimapArrowVertex = [];
- });
- hook ('moveTo', (method, thisArg, args) => {
- drawInstructions = 2;
- minimapArrowVertex.push ( args );
- });
- hook ('lineTo', (method, thisArg, args) => {
- if (drawInstructions >= 2 && drawInstructions <= 5) {
- drawInstructions ++;
- minimapArrowVertex.push ( args );
- } else {
- drawInstructions = 0;
- }
- });
- hook ('fill', (method, thisArg, args) => {
- if (thisArg.fillStyle != '#000000') {
- return;
- }
- if (drawInstructions === 4) {
- const pos = getAverage (minimapArrowVertex);
- worldPosition = getWorldPosition (pos);
- }
- });
- }
- let minimapPosition = [0, 0];
- let minimapDim = [0, 0];
- function hookMinimap () {
- hook ('strokeRect', (method, thisArg, args) => {
- const transform = thisArg.getTransform ();
- minimapPosition = [transform.e, transform.f];
- minimapDim = [transform.a, transform.d];
- });
- }
- function getWorldPosition (position) {
- const ret = [
- parseFloat((((position[0] - minimapPosition[0] - minimapDim[0] / 2) / minimapDim[0] * 100) * 460).toFixed (3)),
- parseFloat((((position[1] - minimapPosition[1] - minimapDim[1] / 2) / minimapDim[1] * 100) * 460).toFixed (3)),
- ]
- return ret;
- }
- const Mi = '';
- function getAverage (points) {
- let ret = [0, 0];
- points.forEach (point => {
- ret[0] += point[0];
- ret[1] += point[1];
- });
- ret[0] /= points.length;
- ret[1] /= points.length;
- return ret;
- }
- let dgh = 'M';
- const getDist = (t1, t2) => {
- const distX = t1[0] - t2[0];
- const distY = t1[1] - t2[1];
- return [Math.hypot(distX, distY), distX, distY];
- };
- function moveBot () {
- const dangerRadius = Boolean(parseInt(localStorage.followCursor)) ? 750 : 250
- gamepadButtons[7].pressed = Boolean(parseInt(localStorage.autoShoot))
- if (Boolean(parseInt(localStorage.autoRespawn))) {
- if (canRespawn) {
- input.trySpawn (localStorage.name)
- }
- }
- if (input.should_prevent_unload()) {
- canRespawn = true;
- }
- let masterMouse = GM_getValue('multiboxMouse');
- let masterMove = GM_getValue ('multiboxWorld');
- if (Boolean(parseInt(localStorage.followCursor))) {
- masterMove = masterMouse;
- }
- const distanceMouse = getDist (masterMouse, worldPosition);
- const distanceMove = getDist (masterMove, worldPosition);
- if (!masterMouse[0] || !masterMouse[1] || !masterMove[0] || !masterMove[1]) {
- return;
- }
- if (Boolean(parseInt(localStorage.copyMovement))) {
- if (distanceMove[0] > dangerRadius) {
- gamepadAxes[0] = masterMove[0] + distanceMove[1] * 100;
- gamepadAxes[1] = masterMove[1] + distanceMove[2] * 100;
- } else {
- gamepadAxes[0] = -(masterMove[0] + distanceMove[1] * 100);
- gamepadAxes[1] = -(masterMove[1] + distanceMove[2] * 100);
- }
- } else {
- gamepadAxes[0] = worldPosition[0];
- gamepadAxes[1] = worldPosition[1];
- }
- if (Boolean(parseInt(localStorage.copyMouse))) {
- gamepadAxes[2] = masterMouse[0] + distanceMouse[1] * 100;
- gamepadAxes[3] = masterMouse[1] + distanceMouse[2] * 100;
- }
- gamepadConnected = true;
- }
- function frame () {
- overlay.innerHTML = `
- <h1>MULTIBOX</h1>
- <br> <br>
- World position: <br> ${Math.round(worldPosition[0]) + ', ' + Math.round(worldPosition[1])}
- <br> <br>
- Master Tab: ${Boolean (document.hasFocus ())}
- <br> <br>
- [F] Multibox Enabled: ${Boolean (parseInt (localStorage.multiboxEnabled))}
- <br> <br>
- [G] Copy Movement: ${Boolean (parseInt (localStorage.copyMovement))}
- <br> <br>
- [J] Copy Mouse: ${Boolean (parseInt (localStorage.copyMouse))}
- <br> <br>
- [R] Follow Cursor: ${Boolean (parseInt (localStorage.followCursor))}
- <br> <br>
- [Q] Toggle Gui: true
- <br> <br>
- [Z] Auto Respawn: ${Boolean (parseInt (localStorage.autoRespawn))}
- <br> <br>
- [,] Always Shoot: ${Boolean (parseInt (localStorage.autoShoot))}
- <br> <br>
- `
- if (Boolean (document.hasFocus ())) {
- gamepadConnected = false;
- GM_setValue('multiboxWorld', worldPosition);
- GM_setValue('multiboxMouse', [
- worldPosition[0] + mouseOffset[0] * 4,
- worldPosition[1] + mouseOffset[1] * 4,
- ]);
- } else if (localStorage.multiboxEnabled === '1') {
- moveBot ();
- } else {
- gamepadConnected = false;
- }
- window.requestAnimationFrame (frame);
- }
- document.addEventListener ('keydown', e => {
- if (e.key === 'f') {
- localStorage.multiboxEnabled = Number (!Boolean (parseInt (localStorage.multiboxEnabled)))
- }
- if (e.key === 'g') {
- localStorage.copyMovement = Number (!Boolean (parseInt (localStorage.copyMovement)))
- }
- if (e.key === 'j') {
- localStorage.copyMouse = Number (!Boolean (parseInt (localStorage.copyMouse)))
- }
- if (e.key === 'r') {
- localStorage.followCursor = Number (!Boolean (parseInt (localStorage.followCursor)))
- }
- if (e.key === 'q') {
- gui = !gui;
- overlay.style.display = gui ? 'block' : 'none'
- }
- if (e.key === ',') {
- localStorage.autoShoot = Number (!Boolean (parseInt (localStorage.autoShoot)))
- }
- if (e.key === 'z') {
- localStorage.autoRespawn = Number (!Boolean (parseInt (localStorage.autoRespawn)))
- }
- })
- document.addEventListener ('mousemove', e => {
- const aimRatioX = 1 - (e.x / canvas.width);
- const aimRatioY = 1 - (e.y / canvas.height);
- if (Boolean (document.hasFocus ())) {
- localStorage.aimRatioX = aimRatioX;
- localStorage.aimRatioY = aimRatioY;
- }
- mouseOffset = [
- e.x - canvas.width / 2,
- e.y - canvas.height / 2,
- ]
- });
- function terminate () {
- if (!localStorage.multiboxEnabled) {
- localStorage.multiboxEnabled = 0;
- }
- if (!localStorage.copyMovement) {
- localStorage.copyMovement = 1;
- }
- if (!localStorage.copyMouse) {
- localStorage.copyMouse = 1;
- }
- if (!localStorage.followCursor) {
- localStorage.followCursor = 0;
- }
- if (!localStorage.autoRespawn) {
- localStorage.autoRespawn = 0;
- }
- if (!localStorage.autoShoot) {
- localStorage.autoShoot = 0;
- }
- overlay = document.createElement('div');
- overlay.style.position = 'fixed';
- overlay.style.top = '1px';
- overlay.style.left = '1px';
- overlay.style.fontFamily = 'Lucida Console, Courier, monospace';
- overlay.style.fontSize = '12px';
- overlay.style.color = '#ffffff';
- overlay.style.pointerEvents = 'none';
- overlay.style.userSelect = 'none';
- overlay.style.fontSize = '14px';
- overlay.style.backgroundColor = 'gray';
- overlay.style.height = '450px';
- overlay.style.width = '250px';
- overlay.style.borderRadius = '1px'
- overlay.style.borderStyle = 'solid'
- overlay.style.borderColor = '#404040'
- overlay.style.borderWidth = '5px'
- overlay.style.textAlign = 'center';
- document.body.appendChild(overlay);
- frame ();
- hookMinimapArrow ();
- hookMinimap ();
- }
- terminate ();
- },400);
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址