Flipfire script 2023

Press F to sync bullets DO NOT use autofire or shoot, then just click right mouse button and it stacks

  1. // ==UserScript==
  2. // @name Flipfire script 2023
  3. // @namespace http://tampermonkey.net/
  4. // @version 2
  5. // @description Press F to sync bullets DO NOT use autofire or shoot, then just click right mouse button and it stacks
  6. // @author Mi300
  7. // @match https://diep.io/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @license MIT
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. let bruh = setInterval (function() {
  14. if (!document.querySelector('d-base').shadowRoot.children[0].shadowRoot.getElementById('username-input')) {
  15. return;
  16. }
  17. clearInterval (bruh)
  18. const toRadians = (degrees) => degrees * Math.PI / 180
  19.  
  20. let angle = 180;
  21. let scriptActive = false;
  22. let mouseX = 0;
  23. let mouseY = 0;
  24. let artificialX = 0;
  25. let artificialY = 0;
  26. let stacking = false;
  27. let position = 0;
  28.  
  29. const Wu = window.devicePixelRatio || 1;
  30. let canvas = window.document.getElementById("canvas");
  31.  
  32. const scriptInfo = [
  33. {name: 'Triangle-Rear', angles: [0, 210], timings: [100, 200, 300, 330]},
  34. {name: 'Fighter-Side', angles: [0, 90], timings: [100, 200, 300, 330]},
  35. {name: 'Gunner-Trapper', angles: [180, 0], timings: [150, 250, 1000, 1100]},
  36. //{name: 'Booster', angles: [0, 210], timings: [100, 150, 350, 370]},
  37. {name: 'Octo', angles: [0, 45], timings: [100, 200, 300, 330]},
  38. ]
  39.  
  40. let currentMode = scriptInfo[0];
  41.  
  42. document.addEventListener('mousemove', e => {
  43. e.stopPropagation();
  44. mouseX = e.x;
  45. mouseY = e.y;
  46.  
  47. if (scriptActive && stacking) {
  48. input.mouse (artificialX * Wu, artificialY * Wu)
  49. }
  50. });
  51.  
  52. document.addEventListener('keydown', e => {
  53. if (e.key === 'f') {
  54. scriptActive = !scriptActive;
  55. }
  56. if (e.key === 'r') {
  57. position++;
  58. currentMode = scriptInfo[Math.abs(position) % scriptInfo.length];
  59.  
  60. clearInterval(interval)
  61. interval = setInterval (flip, currentMode.timings[3])
  62. }
  63.  
  64. if (e.key === 'l') {
  65. scriptInfo[4].angles[1] = scriptInfo[4].angles[1] + 10;
  66. }
  67. });
  68.  
  69. document.addEventListener('mousedown', e => {
  70. if (e.button === 2) {
  71. stacking = true;
  72. }
  73. });
  74.  
  75. document.addEventListener('mouseup', e => {
  76. if (e.button === 2) {
  77. stacking = false;
  78. }
  79. });
  80.  
  81. function frame() {
  82. overlay.innerHTML = `
  83. [F] Bullets Synced: ${scriptActive}
  84. <br><br>
  85. [Right Click] Stack: ${stacking}
  86. <br><br>
  87. [R] Tank: ${currentMode.name}
  88. `
  89.  
  90. let radians = toRadians(angle)
  91. let tankX = window.innerWidth / 2;
  92. let tankY = window.innerHeight / 2;
  93. let angleSin = Math.sin(radians);
  94. let angleCos = Math.cos(radians);
  95.  
  96. let x = mouseX - tankX;
  97. let y = mouseY - tankY;
  98. let _x = angleCos * x - angleSin * y;
  99. let _y = angleSin * x + angleCos * y;
  100. artificialX = _x + tankX;
  101. artificialY = _y + tankY;
  102.  
  103. if (scriptActive && stacking) {
  104. input.mouse (artificialX * Wu, artificialY * Wu)
  105. }
  106.  
  107. window.requestAnimationFrame(frame)
  108. }
  109.  
  110. function flip() {
  111. if (!scriptActive) {
  112. return;
  113. }
  114. angle = currentMode.angles[0];
  115.  
  116. setTimeout (function() {
  117. input.key_down(32);
  118. },currentMode.timings[0]);
  119.  
  120. setTimeout (function() {
  121. angle = currentMode.angles[1];
  122. },currentMode.timings[1]);
  123.  
  124. setTimeout (function () {
  125. input.key_up(32);
  126. },currentMode.timings[2]);
  127. }
  128.  
  129. let interval = setInterval(flip, currentMode.timings[3])
  130.  
  131. var overlay = document.createElement('div');
  132. overlay.style.position = 'fixed';
  133. overlay.style.top = '20px';
  134. overlay.style.left = '15%';
  135. overlay.style.fontFamily = 'Lucida Console, Courier, monospace';
  136. overlay.style.fontSize = '12px';
  137. overlay.style.color = '#ffffff';
  138. overlay.style.pointerEvents = 'none';
  139. overlay.style.userSelect = 'none';
  140. overlay.style.fontSize = '20px';
  141. document.body.appendChild(overlay);
  142.  
  143. frame()
  144. }, 400);