diep.io key functions

Bounds keys do stuff

  1. // ==UserScript==
  2. // @name diep.io key functions
  3. // @version 47.2.1
  4. // @description Bounds keys do stuff
  5. // @author delta-1
  6. // @match *://*.diep.io/*
  7. // @grant none
  8. // @license MIT
  9. // @namespace http://tampermonkey.net/
  10. // ==/UserScript==
  11.  
  12.  
  13.  
  14.  
  15. (function() {
  16. document.body.onkeyup=function(e){
  17.  
  18. //Build keys
  19. //Go to http://keycode.info/ if you want to reassign keys and then change the number after "e.keyCode==="
  20.  
  21. //01277727 = "z key"
  22. if(e.keyCode===90){
  23. input.execute("game_stats_build 565656565656564848484848484877332");
  24. }
  25.  
  26. //57700077 = "x key"
  27. if(e.keyCode===88){
  28. input.execute("game_stats_build 232323888238238238238117777777111");
  29. }
  30.  
  31. //07776600 =
  32. if(e.keyCode===70){
  33. input.execute("game_stats_build 565656565656444444432323232323232");
  34. }
  35. //reset build = "0 key"
  36. if(e.keyCode===48){
  37. input.execute("game_stats_build 0");
  38. }
  39.  
  40. //00077676 = "G key"
  41. if(e.keyCode===71){
  42. input.execute("game_stats_build 565656565656547474747474774888888");
  43. }
  44. //Themes bellow.
  45.  
  46. //La Faucheuse theme = "v key"
  47. if(e.keyCode===86){
  48. input.set_convar("ren_minimap_viewport", true);
  49. input.set_convar("ren_background_color", 0xC8C661);
  50. input.set_convar("ren_pattern_grid", false);
  51. input.set_convar("ren_grid_base_alpha", 0.3);
  52. input.set_convar("ren_stroke_soft_color_intensity", 1);
  53. input.execute("net_replace_color 1 0xBCDED2");
  54. input.execute("net_replace_color 2 0x0E99EE");
  55. input.execute("net_replace_color 10 0x0BC9E1");
  56. input.execute("net_replace_color 9 0xF6181B");
  57. input.execute("net_replace_color 8 0xE3C816");
  58. input.execute("net_replace_color 11 0xA881C2");
  59. input.execute("net_replace_color 15 0xF71022");
  60. input.execute("net_replace_color 16 0xEBE776");
  61. input.execute("net_replace_color 14 0xBCB28F");
  62. input.execute("net_replace_color 3 0x0E99EE");
  63. input.execute("net_replace_color 4 0xF71022");
  64. input.execute("net_replace_color 5 0xC03998");
  65. input.execute("net_replace_color 6 0x9FFA03");
  66. input.execute("net_replace_color 101 0x999999");
  67. input.set_convar(`ren_raw_health_values`, true);
  68. input.execute("ren_fps true");
  69. setInterval(function(){input.keyDown(76);},150);
  70. }
  71. //b key
  72. if(e.keyCode===66){
  73. input.execute("net_replace_color 0 0x777777");
  74. input.execute("net_replace_color 1 0x898989");
  75. input.execute("net_replace_color 2 0x008db1");
  76. input.execute("net_replace_color 3 0x008db1");
  77. input.execute("net_replace_color 4 0xc23f43");
  78. input.execute("net_replace_color 5 0x9865c4");
  79. input.execute("net_replace_color 6 0x00aa4b");
  80. input.execute("net_replace_color 8 0xB8860B");
  81. input.execute("net_replace_color 9 0xa53c2c");
  82. input.execute("net_replace_color 10 0x105773");
  83. input.execute("net_replace_color 11 0xcc5fb0");
  84. input.execute("net_replace_color 12 0xccb954");
  85. input.execute("net_replace_color 13 0x2fb270");
  86. input.execute("net_replace_color 14 0x212121");
  87. input.execute("net_replace_color 15 0xc23f43");
  88. input.execute("net_replace_color 16 0xb48c56");
  89. input.set_convar("ren_background_color", 0x999999);
  90. input.execute("ren_solid_background true");
  91. input.execute("ren_minimap_viewport true");
  92. input.execute("ren_border_color_alpha 1");
  93. input.execute("ren_health_fill_color 0x20FFEF");
  94. input.execute("ren_health_background_color 0x000000");
  95. input.set_convar(`ren_raw_health_values`, true);
  96. input.execute("ren_fps true");
  97. }
  98. };
  99. })();
  100.  
  101.  
  102.  
  103. //predator stack
  104.  
  105.  
  106. document.addEventListener("keydown", function(zEvent) {
  107. if ( zEvent.code === "KeyN") {
  108. function fire(t, w) {
  109. setTimeout(function() {
  110. input.keyDown(32);
  111. }, t * 1000);
  112. setTimeout(function() {
  113. input.keyUp(32);
  114. }, t * 1000 + w);
  115. }
  116. fire(0, 100);
  117. fire(0.75, 200);
  118. fire(1.5, 750);
  119. setTimeout(function() {
  120. input.keyDown(69);
  121. }, 2000);
  122. }
  123. });
  124.  
  125. //stuff stack
  126. document.addEventListener("keydown", function(zEvent) {
  127. if ( zEvent.code === "KeyP") {
  128. function fire(t, w) {
  129. setTimeout(function() {
  130. input.keyDown(32);
  131. }, t * 1000);
  132. setTimeout(function() {
  133. input.keyUp(32);
  134. }, t * 1000 + w);
  135. }
  136. fire(0, 100);
  137. setTimeout(function() {
  138. input.keyDown(69);
  139. }, 200);
  140. }
  141. });
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148. 'use strict';
  149. const HTML = `
  150. <table style="width:100%">
  151. <tr>
  152. <td><b>So uh.......</b></td>
  153. <td><b>If you frogot the commands here they are: <br>
  154. click z for overlord build <br>
  155. x for ram build <br>
  156. f anti ram build <br>
  157. 0 to reset your build <br>
  158. g for glass build <br>
  159. v for cool theme <br>
  160. b for other cool theme <br>
  161. n predator stack (7 reload) <br>
  162. p stack for (twin,booster,gunner,octo,and more!) 7 reload! <br>
  163. and... esc for menu <br>
  164. <tr>
  165. <td>Ssp build for booster/fighter</td>
  166. <td><button onclick='input.execute("game_stats_build 565656565656567878787878787833322")'>Apply</button></td>
  167. </tr>
  168. <tr>
  169. <td>anti ram for hybrid/anni 1/7/7/4/7/7/0</td>
  170. <td><button onclick='input.execute("game_stats_build 565656565656564444232323232323231")'>Apply</button></td>
  171. </tr>
  172.  
  173. <tr>
  174. <td>Reset build button(again more convenient)</td>
  175. <td><button onclick='input.execute("game_stats_build 0")'>Apply</button></td>
  176. </tr>
  177. <tr>
  178. <img src="https://share.sketchpad.app/21/45b-afe5-45d32e.png" alt="diep cool pic". style="width:200px;height:100px;"> <br>
  179. if you understand you do if you dont... <a href="https://www.reddit.com/r/Diepio/comments/ot9rl3/fighter_plush/" target="_blank">Click here</a>
  180. </tr>
  181. </table>
  182. `
  183. const styles = `
  184. div#dt-menu > table, th, td {
  185. border: 1px solid green;
  186. padding-left:10px;
  187. padding-right:10px;
  188. border-collapse: collapse;
  189. overflow-y:auto;
  190. word-wrap:break-all;
  191. }
  192. div#dt-menu > button {
  193. font-family: inherit;
  194. font-size: 1em;
  195. }
  196.  
  197. `
  198. const menuStyles = {
  199. position: "absolute",
  200. top: "25%",
  201. width:"50vw",
  202. height:"60vh",
  203. left: "25%",
  204. display: "none",
  205. "background-color": "rgba(0, 80, 89, 1)",
  206. "font-family":'"Montserrat","Verdana"'
  207. }
  208. // <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat">
  209. const menu = document.createElement("div")
  210. for (var prop in menuStyles) {
  211. menu.style[prop] = menuStyles[prop]
  212. }
  213. menu.innerHTML = HTML
  214. menu.id = "dt-menu"
  215. const styleElement = document.createElement("style")
  216. const font = document.createElement("link")
  217. font.rel = "stylesheet"
  218. font.href = "https://fonts.googleapis.com/css?family=Montserrat"
  219. styleElement.innerHTML = styles
  220. document.head.appendChild(styleElement)
  221. document.head.appendChild(font)
  222. document.body.appendChild(menu)
  223. const myEvent = function(event) {
  224. switch (event.key) {
  225. case "Escape":
  226. if (menu.style.display == "none") {
  227. menu.style.display = "block"
  228. console.log("Menu Enabled!")
  229. }
  230. else {
  231. menu.style.display = "none"
  232. console.log("Menu Disabled!")
  233. }
  234. break
  235.  
  236. }
  237. }
  238. window.addEventListener("keydown",myEvent)
  239. console.log("Key functions loaded!")
  240.  
  241.  
  242. //diff colored names
  243. CanvasRenderingContext2D.prototype.fillText = new Proxy(CanvasRenderingContext2D.prototype.fillText, {
  244. apply(reference, _this, args) {
  245. if (_this.fillStyle == "#ffff90") {
  246. _this.fillStyle = "#03fcfc";
  247. }
  248. return reference.apply(_this, args);
  249. }
  250. });
  251. //afk
  252. //not by me
  253. //not finished
  254. ////<tr>
  255. //<td>Afk</td>
  256. //<td><button onclick="afk()">Apply</button></td>
  257. // </tr>
  258. function Afk() {
  259. }
  260.  
  261.  
  262.  
  263. //shows latency
  264. (function() {
  265. var isActive = true;
  266. function f(e){
  267. if (!isActive) return;
  268. var a = new KeyboardEvent("keydown", {
  269. bubbles: true,
  270. cancelable: true,
  271. shiftKey: false
  272. });
  273. delete a.keyCode;
  274. Object.defineProperty(a, "keyCode", {
  275. "value": 76
  276. });
  277. dispatchEvent(a);
  278. }
  279. function a(e) {
  280. addEventListener(e, f);
  281. }
  282. for (var i of ["focus", "blur", "keyup"]) {
  283. a(i);
  284. }
  285. addEventListener("keydown", function(e) {
  286. if (e.keyCode == 76 && e.isTrusted) {
  287. isActive ^= true;
  288. }
  289. });
  290. }());
  291. console.log("%c Keycode", "color: #B9E87E; font-size: 1.4em;");
  292. console.log("%c Developed By Delta-1", "color: #8ABC3F; font-size: 1.1em;");