1v1.LOL Aimbot, ESP & Wireframe View

Let's 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.4
  5. // @description Let's 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 Zertalious (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.  
  28. dialogEl.style.display = dialogEl.style.display === '' ? 'none' : '';
  29.  
  30. }
  31. };
  32.  
  33. let gui;
  34.  
  35. function initGui() {
  36.  
  37. gui = new lil.GUI();
  38. const controllers = {};
  39. for ( const key in settings ) {
  40.  
  41. controllers[ key ] = gui.add( settings, key ).name( fromCamel( key ) ).listen();
  42.  
  43. }
  44. controllers.aimbotSpeed.min( 0.05 ).max( 0.5 ).step( 0.01 );
  45. controllers.createdBy.disable();
  46.  
  47. }
  48.  
  49. function fromCamel( text ) {
  50.  
  51. const result = text.replace( /([A-Z])/g, ' $1' );
  52. return result.charAt( 0 ).toUpperCase() + result.slice( 1 );
  53.  
  54. }
  55.  
  56. const WebGL = WebGL2RenderingContext.prototype;
  57.  
  58. HTMLCanvasElement.prototype.getContext = new Proxy( HTMLCanvasElement.prototype.getContext, {
  59. apply( target, thisArgs, args ) {
  60.  
  61. if ( args[ 1 ] ) {
  62.  
  63. args[ 1 ].preserveDrawingBuffer = true;
  64.  
  65. }
  66.  
  67. return Reflect.apply( ...arguments );
  68.  
  69. }
  70. } );
  71.  
  72. WebGL.shaderSource = new Proxy( WebGL.shaderSource, {
  73. apply( target, thisArgs, args ) {
  74.  
  75. let [ shader, src ] = args;
  76.  
  77. if ( src.indexOf( 'gl_Position' ) > - 1 ) {
  78.  
  79. if ( src.indexOf( 'OutlineEnabled' ) > - 1 ) {
  80.  
  81. shader.isPlayerShader = true;
  82.  
  83. }
  84.  
  85. src = src.replace( 'void main', `
  86.  
  87. out float vDepth;
  88. uniform bool enabled;
  89. uniform float threshold;
  90.  
  91. void main
  92.  
  93. ` ).replace( /return;/, `
  94.  
  95. vDepth = gl_Position.z;
  96.  
  97. if ( enabled && vDepth > threshold ) {
  98.  
  99. gl_Position.z = 1.0;
  100.  
  101. }
  102.  
  103. ` );
  104.  
  105. } else if ( src.indexOf( 'SV_Target0' ) > - 1 ) {
  106.  
  107. src = src.replace( 'void main', `
  108.  
  109. in float vDepth;
  110. uniform bool enabled;
  111. uniform float threshold;
  112.  
  113. void main
  114.  
  115. ` ).replace( /return;/, `
  116.  
  117. if ( enabled && vDepth > threshold ) {
  118.  
  119. SV_Target0 = vec4( 1.0, 0.0, 0.0, 1.0 );
  120.  
  121. }
  122.  
  123. ` );
  124.  
  125. }
  126.  
  127. args[ 1 ] = src;
  128.  
  129. return Reflect.apply( ...arguments );
  130.  
  131. }
  132. } );
  133.  
  134. WebGL.attachShader = new Proxy( WebGL.attachShader, {
  135. apply( target, thisArgs, [ program, shader ] ) {
  136.  
  137. if ( shader.isPlayerShader ) program.isPlayerProgram = true;
  138.  
  139. return Reflect.apply( ...arguments );
  140.  
  141. }
  142. } );
  143.  
  144. WebGL.getUniformLocation = new Proxy( WebGL.getUniformLocation, {
  145. apply( target, thisArgs, [ program, name ] ) {
  146.  
  147. const result = Reflect.apply( ...arguments );
  148.  
  149. if ( result ) {
  150.  
  151. result.name = name;
  152. result.program = program;
  153.  
  154. }
  155.  
  156. return result;
  157.  
  158. }
  159. } );
  160.  
  161. WebGL.uniform4fv = new Proxy( WebGL.uniform4fv, {
  162. apply( target, thisArgs, [ uniform ] ) {
  163.  
  164. const name = uniform && uniform.name;
  165.  
  166. if ( name === 'hlslcc_mtx4x4unity_ObjectToWorld' ||
  167. name === 'hlslcc_mtx4x4unity_ObjectToWorld[0]' ) {
  168.  
  169. uniform.program.isUIProgram = true;
  170.  
  171. }
  172.  
  173. return Reflect.apply( ...arguments );
  174.  
  175. }
  176. } );
  177.  
  178. let movementX = 0, movementY = 0;
  179. let count = 0;
  180.  
  181. let gl;
  182.  
  183. const handler = {
  184. apply( target, thisArgs, args ) {
  185.  
  186. const program = thisArgs.getParameter( thisArgs.CURRENT_PROGRAM );
  187.  
  188. if ( ! program.uniforms ) {
  189.  
  190. program.uniforms = {
  191. enabled: thisArgs.getUniformLocation( program, 'enabled' ),
  192. threshold: thisArgs.getUniformLocation( program, 'threshold' )
  193. };
  194.  
  195. }
  196.  
  197. const couldBePlayer = ( isSchoolLink || program.isPlayerProgram ) && args[ 1 ] > 3000;
  198.  
  199. program.uniforms.enabled && thisArgs.uniform1i( program.uniforms.enabled, ( settings.esp || settings.aimbot ) && couldBePlayer );
  200. program.uniforms.threshold && thisArgs.uniform1f( program.uniforms.threshold, threshold );
  201.  
  202. args[ 0 ] = settings.wireframe && ! program.isUIProgram && args[ 1 ] > 6 ? thisArgs.LINES : args[ 0 ];
  203.  
  204. if ( couldBePlayer ) {
  205.  
  206. gl = thisArgs;
  207.  
  208. }
  209.  
  210. Reflect.apply( ...arguments );
  211.  
  212. }
  213. };
  214.  
  215. WebGL.drawElements = new Proxy( WebGL.drawElements, handler );
  216. WebGL.drawElementsInstanced = new Proxy( WebGL.drawElementsInstanced, handler );
  217.  
  218. window.requestAnimationFrame = new Proxy( window.requestAnimationFrame, {
  219. apply( target, thisArgs, args ) {
  220.  
  221. args[ 0 ] = new Proxy( args[ 0 ], {
  222. apply() {
  223.  
  224. update();
  225.  
  226. return Reflect.apply( ...arguments );
  227.  
  228. }
  229. } );
  230.  
  231. return Reflect.apply( ...arguments );
  232.  
  233. }
  234. } );
  235.  
  236. function update() {
  237.  
  238. const isPlaying = document.querySelector( 'canvas' ).style.cursor === 'none';
  239. rangeEl.style.display = isPlaying && settings.aimbot ? '' : 'none';
  240.  
  241. if ( settings.aimbot && gl ) {
  242.  
  243. const width = Math.min( searchSize, gl.canvas.width );
  244. const height = Math.min( searchSize, gl.canvas.height );
  245.  
  246. const pixels = new Uint8Array( width * height * 4 );
  247.  
  248. const centerX = gl.canvas.width / 2;
  249. const centerY = gl.canvas.height / 2;
  250.  
  251. const x = Math.floor( centerX - width / 2 );
  252. const y = Math.floor( centerY - height / 2 );
  253.  
  254. gl.readPixels( x, y, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels );
  255.  
  256. for ( let i = 0; i < pixels.length; i += 4 ) {
  257.  
  258. if ( pixels[ i ] === 255 && pixels[ i + 1 ] === 0 && pixels[ i + 2 ] === 0 && pixels[ i + 3 ] === 255 ) {
  259.  
  260. const idx = i / 4;
  261.  
  262. const dx = idx % width;
  263. const dy = ( idx - dx ) / width;
  264.  
  265. movementX += ( x + dx - centerX );
  266. movementY += - ( y + dy - centerY );
  267.  
  268. count ++;
  269.  
  270. }
  271.  
  272. }
  273.  
  274. }
  275.  
  276. if ( count > 0 && isPlaying ) {
  277.  
  278. const f = settings.aimbotSpeed / count;
  279.  
  280. movementX *= f;
  281. movementY *= f;
  282.  
  283. window.dispatchEvent( new MouseEvent( 'mousemove', { movementX, movementY } ) );
  284.  
  285. rangeEl.classList.add( 'range-active' );
  286.  
  287. } else {
  288.  
  289. rangeEl.classList.remove( 'range-active' );
  290.  
  291. }
  292.  
  293. movementX = 0;
  294. movementY = 0;
  295. count = 0;
  296.  
  297. gl = null;
  298.  
  299. }
  300.  
  301. const el = document.createElement( 'div' );
  302.  
  303. el.innerHTML = `<style>
  304.  
  305. .dialog {
  306. position: absolute;
  307. left: 50%;
  308. top: 50%;
  309. padding: 20px;
  310. background: #1e294a;
  311. color: #fff;
  312. transform: translate(-50%, -50%);
  313. text-align: center;
  314. z-index: 999999;
  315. font-family: cursive;
  316. }
  317.  
  318. .dialog * {
  319. color: #fff;
  320. }
  321.  
  322. .close {
  323. position: absolute;
  324. right: 5px;
  325. top: 5px;
  326. width: 20px;
  327. height: 20px;
  328. opacity: 0.5;
  329. cursor: pointer;
  330. }
  331.  
  332. .close:before, .close:after {
  333. content: ' ';
  334. position: absolute;
  335. left: 50%;
  336. top: 50%;
  337. width: 100%;
  338. height: 20%;
  339. transform: translate(-50%, -50%) rotate(-45deg);
  340. background: #fff;
  341. }
  342.  
  343. .close:after {
  344. transform: translate(-50%, -50%) rotate(45deg);
  345. }
  346.  
  347. .close:hover {
  348. opacity: 1;
  349. }
  350.  
  351. .btn {
  352. cursor: pointer;
  353. padding: 0.5em;
  354. background: red;
  355. border: 3px solid rgba(0, 0, 0, 0.2);
  356. }
  357.  
  358. .btn:active {
  359. transform: scale(0.8);
  360. }
  361.  
  362. .msg {
  363. position: absolute;
  364. left: 10px;
  365. top: 10px;
  366. background: #1e294a;
  367. color: #fff;
  368. font-family: cursive;
  369. font-weight: bolder;
  370. padding: 15px;
  371. animation: msg 0.5s forwards, msg 0.5s reverse forwards 3s;
  372. z-index: 999999;
  373. pointer-events: none;
  374. }
  375.  
  376. @keyframes msg {
  377. from {
  378. transform: translate(-120%, 0);
  379. }
  380.  
  381. to {
  382. transform: none;
  383. }
  384. }
  385.  
  386. .range {
  387. position: absolute;
  388. left: 50%;
  389. top: 50%;
  390. width: ${searchSize}px;
  391. height: ${searchSize}px;
  392. max-width: 100%;
  393. max-height: 100%;
  394. border: 1px solid white;
  395. transform: translate(-50%, -50%);
  396. }
  397.  
  398. .range-active {
  399. border: 2px solid red;
  400. }
  401.  
  402. </style>
  403. <div class="dialog">${`<div class="close" onclick="this.parentNode.style.display='none';"></div>
  404. <big>1v1.LOL Aimbot, ESP & Wireframe</big>
  405. <br>
  406. <br>
  407. [T] to toggle aimbot<br>
  408. [M] to toggle ESP<br>
  409. [N] to toggle wireframe<br>
  410. [H] to show/hide help<br>
  411. [/] to show/hide control panel<br>
  412. <br>
  413. By Zertalious
  414. <br>
  415. <br>
  416. <div style="display: grid; grid-template-columns: 1fr 1fr; grid-gap: 5px;">
  417. <div class="btn" onclick="window.open('https://discord.gg/K24Zxy88VM', '_blank')">Discord</div>
  418. <div class="btn" onclick="window.open('https://www.instagram.com/zertalious/', '_blank')">Instagram</div>
  419. <div class="btn" onclick="window.open('https://twitter.com/Zertalious', '_blank')">Twitter</div>
  420. <div class="btn" onclick="window.open('https://greasyfork.org/en/users/662330-zertalious', '_blank')">More scripts</div>
  421. </div>
  422. ` }
  423. </div>
  424. <div class="msg" style="display: none;"></div>
  425. <div class="range" style="display: none;"></div>`;
  426.  
  427. const msgEl = el.querySelector( '.msg' );
  428. const dialogEl = el.querySelector( '.dialog' );
  429.  
  430. const rangeEl = el.querySelector( '.range' );
  431.  
  432. window.addEventListener( 'DOMContentLoaded', function () {
  433.  
  434. while ( el.children.length > 0 ) {
  435.  
  436. document.body.appendChild( el.children[ 0 ] );
  437.  
  438. }
  439.  
  440. initGui();
  441.  
  442. } );
  443.  
  444. function toggleSetting( key ) {
  445.  
  446. settings[ key ] = ! settings[ key ];
  447. showMsg( fromCamel( key ), settings[ key ] );
  448.  
  449. }
  450.  
  451. const keyToSetting = {
  452. 'KeyM': 'esp',
  453. 'KeyN': 'wireframe',
  454. 'KeyT': 'aimbot'
  455. };
  456.  
  457. window.addEventListener( 'keyup', function ( event ) {
  458.  
  459. if ( document.activeElement && document.activeElement.value !== undefined ) return;
  460.  
  461. if ( keyToSetting[ event.code ] ) {
  462.  
  463. toggleSetting( keyToSetting[ event.code ] );
  464.  
  465. }
  466.  
  467. switch ( event.code ) {
  468.  
  469. case 'KeyH':
  470. settings.showHelp();
  471. break;
  472.  
  473. case 'Slash' :
  474. gui._hidden ? gui.show() : gui.hide();
  475. break;
  476.  
  477. }
  478.  
  479. } );
  480.  
  481. function showMsg( name, bool ) {
  482.  
  483. msgEl.innerText = name + ': ' + ( bool ? 'ON' : 'OFF' );
  484.  
  485. msgEl.style.display = 'none';
  486. void msgEl.offsetWidth;
  487. msgEl.style.display = '';
  488.  
  489. }