1v1.LOL Aimbot, ESP & Wireframe View

Lets you see players behind walls. Comes with a wireframe view mode and an aimbot too. Press M, N, and T to toggle them.

  1. // ==UserScript==
  2. // @name 1v1.LOL Aimbot, ESP & Wireframe View
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2
  5. // @description Lets you see players behind walls. Comes with a wireframe view mode and an aimbot too. Press M, N, and T to toggle them.
  6. // @author maxence (Zert)
  7. // @match *://1v1.lol/*
  8. // @match *://1v1.school/*
  9. // @icon https://www.google.com/s2/favicons?domain=1v1.lol
  10. // @grant none
  11. // @run-at document-start
  12. // @require https://cdn.jsdelivr.net/npm/lil-gui@0.19
  13. // ==/UserScript==
  14.  
  15. const isSchoolLink = window.location.hostname.indexOf('1v1.school') > -1;
  16.  
  17. const searchSize = 300;
  18. const threshold = 4.5;
  19.  
  20. const settings = {
  21. aimbot: false,
  22. aimbotSpeed: 0.15,
  23. esp: true,
  24. wireframe: true,
  25. createdBy: 'Zertalious',
  26. showHelp() {
  27. dialogEl.style.display = dialogEl.style.display === '' ? 'none' : '';
  28. }
  29. };
  30.  
  31. let gui;
  32.  
  33. function initGui() {
  34. gui = new lil.GUI();
  35. const controllers = {};
  36. for (const key in settings) {
  37. controllers[key] = gui.add(settings, key).name(fromCamel(key)).listen();
  38. }
  39. controllers.aimbotSpeed.min(0.05).max(0.5).step(0.01);
  40. controllers.createdBy.disable();
  41. }
  42.  
  43. function fromCamel(text) {
  44. const result = text.replace(/([A-Z])/g, ' $1');
  45. return result.charAt(0).toUpperCase() + result.slice(1);
  46. }
  47.  
  48. const WebGL = WebGL2RenderingContext.prototype;
  49.  
  50. HTMLCanvasElement.prototype.getContext = new Proxy(HTMLCanvasElement.prototype.getContext, {
  51. apply(target, thisArgs, args) {
  52. if (args[1]) {
  53. args[1].preserveDrawingBuffer = true;
  54. }
  55. return Reflect.apply(...arguments);
  56. }
  57. });
  58.  
  59. WebGL.shaderSource = new Proxy(WebGL.shaderSource, {
  60. apply(target, thisArgs, args) {
  61. let [shader, src] = args;
  62. if (src.indexOf('gl_Position') > -1) {
  63. if (src.indexOf('OutlineEnabled') > -1) {
  64. shader.isPlayerShader = true;
  65. }
  66. src = src.replace('void main', `
  67. out float vDepth;
  68. uniform bool enabled;
  69. uniform float threshold;
  70. void main
  71. `).replace(/return;/, `
  72. vDepth = gl_Position.z;
  73. if (enabled && vDepth > threshold) {
  74. gl_Position.z = 1.0;
  75. }
  76. `);
  77. } else if (src.indexOf('SV_Target0') > -1) {
  78. src = src.replace('void main', `
  79. in float vDepth;
  80. uniform bool enabled;
  81. uniform float threshold;
  82. void main
  83. `).replace(/return;/, `
  84. if (enabled && vDepth > threshold) {
  85. SV_Target0 = vec4(1.0, 0.0, 0.0, 1.0);
  86. }
  87. `);
  88. }
  89. args[1] = src;
  90. return Reflect.apply(...arguments);
  91. }
  92. });
  93.  
  94. WebGL.attachShader = new Proxy(WebGL.attachShader, {
  95. apply(target, thisArgs, [program, shader]) {
  96. if (shader.isPlayerShader) program.isPlayerProgram = true;
  97. return Reflect.apply(...arguments);
  98. }
  99. });
  100.  
  101. WebGL.getUniformLocation = new Proxy(WebGL.getUniformLocation, {
  102. apply(target, thisArgs, [program, name]) {
  103. const result = Reflect.apply(...arguments);
  104. if (result) {
  105. result.name = name;
  106. result.program = program;
  107. }
  108. return result;
  109. }
  110. });
  111.  
  112. WebGL.uniform4fv = new Proxy(WebGL.uniform4fv, {
  113. apply(target, thisArgs, [uniform]) {
  114. const name = uniform && uniform.name;
  115. if (name === 'hlslcc_mtx4x4unity_ObjectToWorld' ||
  116. name === 'hlslcc_mtx4x4unity_ObjectToWorld[0]') {
  117. uniform.program.isUIProgram = true;
  118. }
  119. return Reflect.apply(...arguments);
  120. }
  121. });
  122.  
  123. let movementX = 0, movementY = 0;
  124. let count = 0;
  125.  
  126. let gl;
  127.  
  128. const handler = {
  129. apply(target, thisArgs, args) {
  130. const program = thisArgs.getParameter(thisArgs.CURRENT_PROGRAM);
  131. if (!program.uniforms) {
  132. program.uniforms = {
  133. enabled: thisArgs.getUniformLocation(program, 'enabled'),
  134. threshold: thisArgs.getUniformLocation(program, 'threshold')
  135. };
  136. }
  137. const couldBePlayer = (isSchoolLink || program.isPlayerProgram) && args[1] > 3000;
  138. program.uniforms.enabled && thisArgs.uniform1i(program.uniforms.enabled, (settings.esp || settings.aimbot) && couldBePlayer);
  139. program.uniforms.threshold && thisArgs.uniform1f(program.uniforms.threshold, threshold);
  140. args[0] = settings.wireframe && !program.isUIProgram && args[1] > 6 ? thisArgs.LINES : args[0];
  141. if (couldBePlayer) {
  142. gl = thisArgs;
  143. }
  144. Reflect.apply(...arguments);
  145. }
  146. };
  147.  
  148. WebGL.drawElements = new Proxy(WebGL.drawElements, handler);
  149. WebGL.drawElementsInstanced = new Proxy(WebGL.drawElementsInstanced, handler);
  150.  
  151. window.requestAnimationFrame = new Proxy(window.requestAnimationFrame, {
  152. apply(target, thisArgs, args) {
  153. args[0] = new Proxy(args[0], {
  154. apply() {
  155. update();
  156. return Reflect.apply(...arguments);
  157. }
  158. });
  159. return Reflect.apply(...arguments);
  160. }
  161. });
  162.  
  163. function update() {
  164. const isPlaying = document.querySelector('canvas').style.cursor === 'none';
  165. rangeEl.style.display = isPlaying && settings.aimbot ? '' : 'none';
  166. if (settings.aimbot && gl) {
  167. const width = Math.min(searchSize, gl.canvas.width);
  168. const height = Math.min(searchSize, gl.canvas.height);
  169. const pixels = new Uint8Array(width * height * 4);
  170. const centerX = gl.canvas.width / 2;
  171. const centerY = gl.canvas.height / 2;
  172. const x = Math.floor(centerX - width / 2);
  173. const y = Math.floor(centerY - height / 2);
  174. gl.readPixels(x, y, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  175. for (let i = 0; i < pixels.length; i += 4) {
  176. if (pixels[i] === 255 && pixels[i + 1] === 0 && pixels[i + 2] === 0 && pixels[i + 3] === 255) {
  177. const idx = i / 4;
  178. const dx = idx % width;
  179. const dy = (idx - dx) / width;
  180. movementX += (x + dx - centerX);
  181. movementY += - (y + dy - centerY);
  182. count++;
  183. }
  184. }
  185. }
  186. if (count > 0 && isPlaying) {
  187. const f = settings.aimbotSpeed / count;
  188. movementX *= f;
  189. movementY *= f;
  190. window.dispatchEvent(new MouseEvent('mousemove', { movementX, movementY }));
  191. rangeEl.classList.add('range-active');
  192. } else {
  193. rangeEl.classList.remove('range-active');
  194. }
  195. movementX = 0;
  196. movementY = 0;
  197. count = 0;
  198. gl = null;
  199. }
  200.  
  201. const el = document.createElement('div');
  202.  
  203. el.innerHTML = `<style>
  204. .dialog {
  205. position: absolute;
  206. left: 50%;
  207. top: 50%;
  208. padding: 20px;
  209. background: #1e294a;
  210. color: #fff;
  211. transform: translate(-50%, -50%);
  212. text-align: center;
  213. z-index: 999999;
  214. font-family: cursive;
  215. }
  216. .dialog * {
  217. color: #fff;
  218. }
  219. .close {
  220. position: absolute;
  221. right: 5px;
  222. top: 5px;
  223. width: 20px;
  224. height: 20px;
  225. opacity: 0.5;
  226. cursor: pointer;
  227. }
  228. .close:before, .close:after {
  229. content: ' ';
  230. position: absolute;
  231. left: 50%;
  232. top: 50%;
  233. width: 100%;
  234. height: 20%;
  235. transform: translate(-50%, -50%) rotate(-45deg);
  236. background: #fff;
  237. }
  238. .close:after {
  239. transform: translate(-50%, -50%) rotate(45deg);
  240. }
  241. .close:hover {
  242. opacity: 1;
  243. }
  244. .btn {
  245. cursor: pointer;
  246. padding: 0.5em;
  247. background: red;
  248. border: 3px solid rgba(0, 0, 0, 0.2);
  249. }
  250. .btn:active {
  251. transform: scale(0.8);
  252. }
  253. .msg {
  254. position: absolute;
  255. left: 10px;
  256. top: 10px;
  257. background: #1e294a;
  258. color: #fff;
  259. font-family: cursive;
  260. font-weight: bolder;
  261. padding: 15px;
  262. animation: msg 0.5s forwards, msg 0.5s reverse forwards 3s;
  263. z-index: 999999;
  264. pointer-events: none;
  265. }
  266. @keyframes msg {
  267. from {
  268. transform: translate(-120%, 0);
  269. }
  270. to {
  271. transform: none;
  272. }
  273. }
  274. .range {
  275. position: absolute;
  276. left: 50%;
  277. top: 50%;
  278. width: ${searchSize}px;
  279. height: ${searchSize}px;
  280. max-width: 100%;
  281. max-height: 100%;
  282. border: 1px solid white;
  283. transform: translate(-50%, -50%);
  284. }
  285. .range-active {
  286. border: 2px solid red;
  287. }
  288. </style>
  289. <div class="dialog">
  290. <big>1v1.LOL Aimbot, ESP & Wireframe</big>
  291. <br><br>
  292. [T] to toggle aimbot<br>
  293. [M] to toggle ESP<br>
  294. [N] to toggle wireframe<br>
  295. [H] to show/hide help<br>
  296. [/ ] to show/hide control panel<br>
  297. <br>By Zertalious
  298. <br><br>
  299. <div style="display: grid; grid-template-columns: 1fr 1fr; grid-gap: 5px;">
  300. <div class="btn" onclick="window.open('https://discord.gg/K24Zxy88VM', '_blank')">Discord</div>
  301. <div class="btn" onclick="window.open('https://www.instagram.com/zertalious/', '_blank')">Instagram</div>
  302. <div class="btn" onclick="window.open('https://twitter.com/Zertalious', '_blank')">Twitter</div>
  303. <div class="btn" onclick="window.open('https://greasyfork.org/en/users/662330-zertalious', '_blank')">More scripts</div>
  304. </div>
  305. </div>
  306. <div class="msg" style="display: none;"></div>
  307. <div class="range" style="display: none;"></div>`;
  308.  
  309. const msgEl = el.querySelector('.msg');
  310. const dialogEl = el.querySelector('.dialog');
  311. const rangeEl = el.querySelector('.range');
  312.  
  313. window.addEventListener('DOMContentLoaded', function () {
  314. while (el.children.length > 0) {
  315. document.body.appendChild(el.children[0]);
  316. }
  317. initGui();
  318. });
  319.  
  320. function toggleSetting(key) {
  321. settings[key] = !settings[key];
  322. showMsg(fromCamel(key), settings[key]);
  323. }
  324.  
  325. const keyToSetting = {
  326. 'KeyM': 'esp',
  327. 'KeyN': 'wireframe',
  328. 'KeyT': 'aimbot'
  329. };
  330.  
  331. window.addEventListener('keyup', function (event) {
  332. if (document.activeElement && document.activeElement.value !== undefined) return;
  333. if (keyToSetting[event.code]) {
  334. toggleSetting(keyToSetting[event.code]);
  335. }
  336. switch (event.code) {
  337. case 'KeyH':
  338. settings.showHelp();
  339. break;
  340. case 'Slash':
  341. gui._hidden ? gui.show() : gui.hide();
  342. break;
  343. }
  344. });
  345.  
  346. function showMsg(name, bool) {
  347. msgEl.innerText = name + ': ' + (bool ? 'ON' : 'OFF');
  348. msgEl.style.display = 'none';
  349. void msgEl.offsetWidth;
  350. msgEl.style.display = '';
  351. }