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