One-Tap Script for Diep.io

One tap script for the game diep.io, shoots from your front barrel

  1. // ==UserScript==
  2. // @name One-Tap Script for Diep.io
  3. // @version 1
  4. // @description One tap script for the game diep.io, shoots from your front barrel
  5. // @author diep.io#7444 (496382143753093120)
  6. // @match https://diep.io/
  7. // @grant none
  8. // @namespace https://gf.qytechs.cn/users/467236
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. var realSend = window.WebSocket.prototype.send;
  15. const URLRegex = /^wss?:\/\/[a-z0-9]{4}\.s\.m28n\.net\/$/g; // wss://XXXX.s.m28n.net
  16. var gameWS;
  17. var doTap = false; // One-Tap enabled
  18. const delay = 2; // How many 01 packets to wait before tapping, increase if you have high ping
  19. var shouldTap = 0; // Keep track of when to click
  20.  
  21. window.WebSocket.prototype.send = function(data)
  22. {
  23. if (data instanceof Int8Array && this.url.match(URLRegex)) // The other websockets (for checking latency) uses ArrayBuffer, we want only the diep.io game's websocket
  24. {
  25. gameWS = this;
  26.  
  27. if (data[0] === 1 && doTap === true)
  28. {
  29. data[1] &= 0b11111110; // Incase the player is already clicking
  30. data[1] ^= (shouldTap === delay ? 1 : 0); // Toggle holding or releasing
  31.  
  32. shouldTap += 1;
  33. if (shouldTap > delay) shouldTap = 0;
  34. }
  35. }
  36.  
  37. return realSend.call(this, data);
  38. }
  39.  
  40. document.addEventListener('keydown', function(event)
  41. {
  42. if (!document.getElementById("textInput").disabled) return; // Disable keybinds while we are typing into the textbox where you enter the name to spawn in with
  43. if (event.repeat) return event.cancelBubble = true; // Holding down the key does not spam the toggle and notification
  44. var keyCode = event.keyCode || event.which;
  45. switch (keyCode)
  46. {
  47. case 84: // T
  48. {
  49. doTap = !doTap;
  50. if (!doTap) shouldTap = 0;
  51.  
  52. var timer = new DataView(new ArrayBuffer(4));
  53. timer.setFloat32(0, 5000);
  54. var notification = [3].concat(Array.from((new TextEncoder()).encode("One-Tap: " + (doTap ? "ON" : "OFF")))).concat([0, 255, 0, 0, 0]).concat(Array.from(new Uint8Array(timer.buffer)).reverse()).concat(Array.from((new TextEncoder()).encode("onetap_toggle"))).concat(0);
  55. gameWS.onmessage.call(gameWS, {data: notification});
  56.  
  57. break;
  58. }
  59. }
  60. });
  61. })();

QingJ © 2025

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