Multibox script UPDATED

multibox after 2023 patch

当前为 2023-10-01 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Multibox script UPDATED
  3. // @namespace http://tampermonkey.net/
  4. // @version 500
  5. // @description multibox after 2023 patch
  6. // @author Mi300#4401
  7. // @match https://diep.io/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @license dont copy
  10. // @grant GM_getValue
  11. // @grant GM_setValue
  12. // ==/UserScript==
  13. (function() {
  14. var delay = 1000;
  15. (function loop() {
  16. setTimeout(() => {
  17. localStorage.removeItem("rivet:token")
  18. loop();
  19. }, delay);
  20. })();
  21. })();
  22.  
  23.  
  24. let WTF = setInterval (function() {
  25. if (!document.querySelector('d-base').shadowRoot.children[0].shadowRoot.getElementById('username-input')) {
  26. return;
  27. }
  28. clearInterval (WTF)
  29.  
  30.  
  31. const p = CanvasRenderingContext2D.prototype
  32.  
  33. const _fill = p.fill,
  34. _beginPath = p.beginPath,
  35. _lineTo = p.lineTo,
  36. _moveTo = p.moveTo,
  37. _getGamepads = window.navigator.getGamepads,
  38. _strokeRect = p.strokeRect,
  39. _toString = Function.prototype.toString;
  40.  
  41.  
  42. let fill,
  43. beginPath,
  44. lineTo,
  45. moveTo,
  46. getGamepads,
  47. strokeRect;
  48.  
  49. let canRespawn = false;
  50. let worldPosition = [0, 0];
  51. let overlay;
  52. let mouseOffset = [0, 0];
  53. let gui = true;
  54. let test = 1;
  55.  
  56. let gamepadConnected = false;
  57. let gamepadAxes = [0, 0, 0, 0]
  58. let gamepadButtons = [
  59. ...Array(17)].map((x) => {
  60. return { pressed: false };
  61. });
  62.  
  63. const fetchGamepad = () => {
  64. return {
  65. axes: gamepadAxes,
  66. buttons: gamepadButtons,
  67. mapping: 'standard',
  68. }
  69. }
  70.  
  71. getGamepads = function(...args) {
  72. if (gamepadConnected) {
  73. return [fetchGamepad()]
  74. }
  75. return false;
  76. }
  77.  
  78.  
  79. let cameraZoom = 0.5;
  80.  
  81. const canvas = document.getElementById ('canvas');
  82.  
  83. let dgg = 'i';
  84.  
  85. function hookMinimapArrow () {
  86.  
  87. let drawInstructions = 0;
  88. let minimapArrowVertex = [];
  89. beginPath = function(...args) {
  90. drawInstructions = 1;
  91. minimapArrowVertex = [];
  92. _beginPath.call(this, ...args);
  93. }
  94. moveTo = function(...args) {
  95. drawInstructions = 2;
  96. minimapArrowVertex.push (args);
  97. _moveTo.call(this, ...args)
  98. }
  99. lineTo = function(...args) {
  100. if (drawInstructions >= 2 && drawInstructions <= 5) {
  101. drawInstructions ++;
  102. minimapArrowVertex.push (args);
  103. } else {
  104. drawInstructions = 0;
  105. }
  106. _lineTo.call(this, ...args)
  107. }
  108. fill = function(...args) {
  109. if (this.globalAlpha != 1) {
  110. _fill.call(this, ...args)
  111. return;
  112. }
  113. if (this.fillStyle != '#000000') {
  114. _fill.call(this, ...args)
  115. return;
  116. }
  117. if (drawInstructions === 4) {
  118. const pos = getAverage (minimapArrowVertex);
  119. worldPosition = getWorldPosition (pos);
  120. }
  121. _fill.call(this, ...args)
  122. }
  123. }
  124. let minimapPosition = [0, 0];
  125. let minimapDim = [0, 0];
  126.  
  127. function hookMinimap () {
  128. strokeRect = function(...args) {
  129. const transform = this.getTransform ();
  130. minimapPosition = [transform.e, transform.f];
  131. minimapDim = [transform.a, transform.d];
  132. _strokeRect.call(this, ...args)
  133. }
  134. }
  135.  
  136. function getWorldPosition (position) {
  137. const ret = [
  138. parseFloat((((position[0] - minimapPosition[0] - minimapDim[0] / 2) / minimapDim[0] * 100) * 460).toFixed (3)),
  139. parseFloat((((position[1] - minimapPosition[1] - minimapDim[1] / 2) / minimapDim[1] * 100) * 460).toFixed (3)),
  140. ]
  141. return ret;
  142. }
  143. const Mi = '';
  144.  
  145. function getAverage (points) {
  146. let ret = [0, 0];
  147. points.forEach (point => {
  148. ret[0] += point[0];
  149. ret[1] += point[1];
  150. });
  151. ret[0] /= points.length;
  152. ret[1] /= points.length;
  153.  
  154. return ret;
  155. }
  156. let dgh = 'M';
  157.  
  158.  
  159. const getDist = (t1, t2) => {
  160. const distX = t1[0] - t2[0];
  161. const distY = t1[1] - t2[1];
  162.  
  163. return [Math.hypot(distX, distY), distX, distY];
  164. };
  165.  
  166. function moveBot () {
  167. input.execute('game_stats_build 565656565656567878787878784478422')
  168. const dangerRadius = Boolean(parseInt(localStorage.followCursor)) ? 750 : 250
  169. gamepadButtons[7].pressed = Boolean(parseInt(localStorage.autoShoot))
  170.  
  171. if (Boolean(parseInt(localStorage.autoRespawn))) {
  172. if (canRespawn) {
  173. input.try_spawn (localStorage.name)
  174. }
  175. }
  176. if (input.should_prevent_unload()) {
  177. canRespawn = true;
  178. }
  179. let masterMouse = GM_getValue('multiboxMouse');
  180. let masterMove = GM_getValue ('multiboxWorld');
  181.  
  182. if (Boolean(parseInt(localStorage.followCursor))) {
  183. masterMove = masterMouse;
  184. }
  185.  
  186. const distanceMouse = getDist (masterMouse, worldPosition);
  187. const distanceMove = getDist (masterMove, worldPosition);
  188.  
  189. if (!masterMouse[0] || !masterMouse[1] || !masterMove[0] || !masterMove[1]) {
  190. return;
  191. }
  192.  
  193.  
  194.  
  195. if (Boolean(parseInt(localStorage.copyMovement))) {
  196. gamepadAxes[0] = masterMove[0] + distanceMove[1] * 100;
  197. gamepadAxes[1] = masterMove[1] + distanceMove[2] * 100;
  198. } else {
  199. gamepadAxes[0] = worldPosition[0];
  200. gamepadAxes[1] = worldPosition[1];
  201. }
  202. gamepadAxes[2] = masterMouse[0] + distanceMouse[1] * 100;
  203. gamepadAxes[3] = masterMouse[1] + distanceMouse[2] * 100;
  204. gamepadConnected = true;
  205. }
  206.  
  207.  
  208.  
  209. function frame () {
  210. overlay.innerHTML = `
  211. <h1>MULTIBOX</h1>
  212. <br> <br>
  213. World position: <br> ${Math.round(worldPosition[0]) + ', ' + Math.round(worldPosition[1])}
  214. <br> <br>
  215. Master Tab: ${Boolean (document.hasFocus ())}
  216. <br> <br>
  217. [F] Multibox Enabled: ${Boolean (parseInt (localStorage.multiboxEnabled))}
  218. <br> <br>
  219. [G] Copy Movement: ${Boolean (parseInt (localStorage.copyMovement))}
  220. <br> <br>
  221. [R] Follow Cursor: ${Boolean (parseInt (localStorage.followCursor))}
  222. <br> <br>
  223. [Q] Toggle Gui: true
  224. <br> <br>
  225. [Z] Auto Respawn: ${Boolean (parseInt (localStorage.autoRespawn))}
  226. <br> <br>
  227. [,] Always Shoot: ${Boolean (parseInt (localStorage.autoShoot))}
  228. <br> <br>
  229. `
  230.  
  231. if (Boolean (document.hasFocus ())) {
  232. gamepadConnected = false;
  233.  
  234.  
  235. const pos1 = mouseOffset[0] / Math.abs(mouseOffset[0])
  236. const pos2 = mouseOffset[1] / Math.abs(mouseOffset[1])
  237. GM_setValue('multiboxWorld', worldPosition);
  238. GM_setValue('multiboxMouse', [
  239. worldPosition[0] + ( (mouseOffset[0] * (4 - (mouseOffset[0] / Math.abs(mouseOffset[0])))) * (1 - (cameraZoom)) * 1.35 ) * 1.6,
  240. worldPosition[1] + ( (mouseOffset[1] * 4) * (1 - cameraZoom) * 1.35 ) * 1.6,
  241. ]);
  242. //0.46699 1 2.14137
  243. //0.38238 1.15
  244. //
  245.  
  246. } else if (localStorage.multiboxEnabled === '1') {
  247. moveBot ();
  248. } else {
  249. gamepadConnected = false;
  250. }
  251. window.requestAnimationFrame (frame);
  252. }
  253.  
  254.  
  255.  
  256.  
  257. document.addEventListener ('keydown', e => {
  258. if (e.key === 'f') {
  259. localStorage.multiboxEnabled = Number (!Boolean (parseInt (localStorage.multiboxEnabled)))
  260. }
  261. if (e.key === 'g') {
  262. localStorage.copyMovement = Number (!Boolean (parseInt (localStorage.copyMovement)))
  263. }
  264. if (e.key === 'r') {
  265. localStorage.followCursor = Number (!Boolean (parseInt (localStorage.followCursor)))
  266. }
  267. if (e.key === 'q') {
  268. gui = !gui;
  269. overlay.style.display = gui ? 'block' : 'none'
  270. }
  271. if (e.key === ',') {
  272. localStorage.autoShoot = Number (!Boolean (parseInt (localStorage.autoShoot)))
  273. }
  274. if (e.key === 'z') {
  275. localStorage.autoRespawn = Number (!Boolean (parseInt (localStorage.autoRespawn)))
  276. }
  277. if (e.key === '[') {
  278. test += 0.25;
  279. }
  280. })
  281.  
  282. document.addEventListener ('mousemove', e => {
  283. const aimRatioX = 1 - (e.x / canvas.width);
  284. const aimRatioY = 1 - (e.y / canvas.height);
  285.  
  286. if (Boolean (document.hasFocus ())) {
  287. localStorage.aimRatioX = aimRatioX;
  288. localStorage.aimRatioY = aimRatioY;
  289. }
  290.  
  291. mouseOffset = [
  292. e.x - canvas.width / 2,
  293. e.y - canvas.height / 2,
  294. ]
  295. });
  296. function terminate () {
  297. if (!localStorage.multiboxEnabled) {
  298. localStorage.multiboxEnabled = 0;
  299. }
  300. if (!localStorage.copyMovement) {
  301. localStorage.copyMovement = 1;
  302. }
  303. if (!localStorage.followCursor) {
  304. localStorage.followCursor = 0;
  305. }
  306. if (!localStorage.autoRespawn) {
  307. localStorage.autoRespawn = 0;
  308. }
  309. if (!localStorage.autoShoot) {
  310. localStorage.autoShoot = 0;
  311. }
  312.  
  313. overlay = document.createElement('div');
  314. overlay.style.position = 'fixed';
  315. overlay.style.top = '1px';
  316. overlay.style.left = '1px';
  317. overlay.style.fontFamily = 'Lucida Console, Courier, monospace';
  318. overlay.style.fontSize = '12px';
  319. overlay.style.color = '#ffffff';
  320. overlay.style.pointerEvents = 'none';
  321. overlay.style.userSelect = 'none';
  322. overlay.style.fontSize = '14px';
  323. overlay.style.backgroundColor = 'gray';
  324. overlay.style.height = '450px';
  325. overlay.style.width = '250px';
  326. overlay.style.borderRadius = '1px'
  327. overlay.style.borderStyle = 'solid'
  328. overlay.style.borderColor = '#404040'
  329. overlay.style.borderWidth = '5px'
  330. overlay.style.textAlign = 'center';
  331. document.body.appendChild(overlay);
  332.  
  333. frame ();
  334. hookMinimapArrow ();
  335. hookMinimap ();
  336.  
  337.  
  338.  
  339. }
  340. terminate ();
  341.  
  342.  
  343.  
  344.  
  345. const toString = function() {
  346.  
  347. switch(this) {
  348. case fill: return _toString.call(_fill);
  349. case moveTo: return _toString.call(_moveTo);
  350. case beginPath: return _toString.call(_beginPath);
  351. case lineTo: return _toString.call(_lineTo);
  352. case getGamepads: return _toString.call(_getGamepads);
  353. case strokeRect: return _toString.call(_strokeRect);
  354. case toString: return _toString.call(_toString);
  355. }
  356.  
  357. return _toString.call(this);
  358.  
  359. };
  360. p.fill = fill;
  361. p.beginPath = beginPath;
  362. p.moveTo = moveTo;
  363. p.lineTo = lineTo;
  364. window.navigator.getGamepads = getGamepads;
  365. p.strokeRect = strokeRect;
  366. Function.prototype.toString = toString;
  367. },400);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址