1v1.LOL Aimbot, ESP & Wireframe View

Let's you see players behind walls. Comes with a wireframe view mode too. Press V and N to toggle them.

目前为 2023-12-25 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name 1v1.LOL Aimbot, ESP & Wireframe View
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.7
  5. // @description Let's you see players behind walls. Comes with a wireframe view mode too. Press V and N to toggle them.
  6. // @author Zertalious (Zert)
  7. // @match *://1v1.lol/*
  8. // @icon https://www.google.com/s2/favicons?domain=1v1.lol
  9. // @grant none
  10. // @run-at document-start
  11. // @antifeature ads
  12. // ==/UserScript==
  13.  
  14. const searchSize = 300;
  15. const threshold = 4.5;
  16. const aimbotSpeed = 0.15;
  17.  
  18. let aimbotEnabled = false;
  19. let espEnabled = false;
  20. let wireframeEnabled = true;
  21.  
  22. const WebGL = WebGL2RenderingContext.prototype;
  23.  
  24. HTMLCanvasElement.prototype.getContext = new Proxy( HTMLCanvasElement.prototype.getContext, {
  25. apply( target, thisArgs, args ) {
  26.  
  27. if ( args[ 1 ] ) {
  28.  
  29. args[ 1 ].preserveDrawingBuffer = true;
  30.  
  31. }
  32.  
  33. return Reflect.apply( ...arguments );
  34.  
  35. }
  36. } );
  37.  
  38. WebGL.shaderSource = new Proxy( WebGL.shaderSource, {
  39. apply( target, thisArgs, args ) {
  40.  
  41. if ( args[ 1 ].indexOf( 'gl_Position' ) > - 1 ) {
  42.  
  43. args[ 1 ] = args[ 1 ].replace( 'void main', `
  44.  
  45. out float vDepth;
  46. uniform bool enabled;
  47. uniform float threshold;
  48.  
  49. void main
  50.  
  51. ` ).replace( /return;/, `
  52.  
  53. vDepth = gl_Position.z;
  54.  
  55. if ( enabled && vDepth > threshold ) {
  56.  
  57. gl_Position.z = 1.0;
  58.  
  59. }
  60.  
  61. ` );
  62.  
  63. } else if ( args[ 1 ].indexOf( 'SV_Target0' ) > - 1 ) {
  64.  
  65. args[ 1 ] = args[ 1 ].replace( 'void main', `
  66.  
  67. in float vDepth;
  68. uniform bool enabled;
  69. uniform float threshold;
  70.  
  71. void main
  72.  
  73. ` ).replace( /return;/, `
  74.  
  75. if ( enabled && vDepth > threshold ) {
  76.  
  77. SV_Target0 = vec4( 1.0, 0.0, 0.0, 1.0 );
  78.  
  79. }
  80.  
  81. ` );
  82.  
  83. }
  84.  
  85. return Reflect.apply( ...arguments );
  86.  
  87. }
  88. } );
  89.  
  90. WebGL.getUniformLocation = new Proxy( WebGL.getUniformLocation, {
  91. apply( target, thisArgs, [ program, name ] ) {
  92.  
  93. const result = Reflect.apply( ...arguments );
  94.  
  95. if ( result ) {
  96.  
  97. result.name = name;
  98. result.program = program;
  99.  
  100. }
  101.  
  102. return result;
  103.  
  104. }
  105. } );
  106.  
  107. WebGL.uniform4fv = new Proxy( WebGL.uniform4fv, {
  108. apply( target, thisArgs, args ) {
  109.  
  110. if ( args[ 0 ].name === 'hlslcc_mtx4x4unity_ObjectToWorld' ||
  111. args[ 0 ].name === 'hlslcc_mtx4x4unity_ObjectToWorld[0]' ) {
  112.  
  113. args[ 0 ].program.isUIProgram = true;
  114.  
  115. }
  116.  
  117. return Reflect.apply( ...arguments );
  118.  
  119. }
  120. } );
  121.  
  122. let movementX = 0, movementY = 0;
  123. let count = 0;
  124.  
  125. WebGL.drawElements = new Proxy( WebGL.drawElements, {
  126. apply( target, thisArgs, args ) {
  127.  
  128. const program = thisArgs.getParameter( thisArgs.CURRENT_PROGRAM );
  129.  
  130. if ( ! program.uniforms ) {
  131.  
  132. program.uniforms = {
  133. enabled: thisArgs.getUniformLocation( program, 'enabled' ),
  134. threshold: thisArgs.getUniformLocation( program, 'threshold' )
  135. };
  136.  
  137. }
  138.  
  139. const couldBePlayer = args[ 1 ] > 4000;
  140.  
  141. thisArgs.uniform1i( program.uniforms.enabled, ( espEnabled || aimbotEnabled ) && couldBePlayer );
  142. thisArgs.uniform1f( program.uniforms.threshold, threshold );
  143.  
  144. args[ 0 ] = wireframeEnabled && ! program.isUIProgram && args[ 1 ] > 6 ? thisArgs.LINES : args[ 0 ];
  145.  
  146. Reflect.apply( ...arguments );
  147.  
  148. if ( aimbotEnabled && couldBePlayer ) {
  149.  
  150. const width = Math.min( searchSize, thisArgs.canvas.width );
  151. const height = Math.min( searchSize, thisArgs.canvas.height );
  152.  
  153. const pixels = new Uint8Array( width * height * 4 );
  154.  
  155. const centerX = thisArgs.canvas.width / 2;
  156. const centerY = thisArgs.canvas.height / 2;
  157.  
  158. const x = Math.floor( centerX - width / 2 );
  159. const y = Math.floor( centerY - height / 2 );
  160.  
  161. thisArgs.readPixels( x, y, width, height, thisArgs.RGBA, thisArgs.UNSIGNED_BYTE, pixels );
  162.  
  163. for ( let i = 0; i < pixels.length; i += 4 ) {
  164.  
  165. if ( pixels[ i ] === 255 && pixels[ i + 1 ] === 0 && pixels[ i + 2 ] === 0 && pixels[ i + 3 ] === 255 ) {
  166.  
  167. const idx = i / 4;
  168.  
  169. const dx = idx % width;
  170. const dy = ( idx - dx ) / width;
  171.  
  172. movementX += ( x + dx - centerX );
  173. movementY += - ( y + dy - centerY );
  174.  
  175. count ++;
  176.  
  177. }
  178.  
  179. }
  180.  
  181. }
  182.  
  183. }
  184. } );
  185.  
  186. window.requestAnimationFrame = new Proxy( window.requestAnimationFrame, {
  187. apply( target, thisArgs, args ) {
  188.  
  189. args[ 0 ] = new Proxy( args[ 0 ], {
  190. apply() {
  191.  
  192. const isPlaying = document.querySelector( 'canvas' ).style.cursor === 'none';
  193.  
  194. rangeEl.style.display = isPlaying && aimbotEnabled ? '' : 'none';
  195.  
  196. if ( count > 0 && isPlaying ) {
  197.  
  198. const f = aimbotSpeed / count;
  199.  
  200. movementX *= f;
  201. movementY *= f;
  202.  
  203. window.dispatchEvent( new MouseEvent( 'mousemove', { movementX, movementY } ) );
  204.  
  205. rangeEl.classList.add( 'range-active' );
  206.  
  207. } else {
  208.  
  209. rangeEl.classList.remove( 'range-active' );
  210.  
  211. }
  212.  
  213. movementX = 0;
  214. movementY = 0;
  215. count = 0;
  216.  
  217. return Reflect.apply( ...arguments );
  218.  
  219. }
  220. } );
  221.  
  222. return Reflect.apply( ...arguments );
  223. }
  224. } )
  225.  
  226. const value = parseInt( new URLSearchParams( window.location.search ).get( 'showAd' ), 16 );
  227.  
  228. const shouldShowAd = isNaN( value ) || Date.now() - value < 0 || Date.now() - value > 10 * 60 * 1000;
  229.  
  230. const el = document.createElement( 'div' );
  231.  
  232. el.innerHTML = `<style>
  233.  
  234. .dialog {
  235. position: absolute;
  236. left: 50%;
  237. top: 50%;
  238. padding: 20px;
  239. background: #1e294a;
  240. color: #fff;
  241. transform: translate(-50%, -50%);
  242. text-align: center;
  243. z-index: 999999;
  244. font-family: cursive;
  245. }
  246.  
  247. .dialog * {
  248. color: #fff;
  249. }
  250.  
  251. .close {
  252. position: absolute;
  253. right: 5px;
  254. top: 5px;
  255. width: 20px;
  256. height: 20px;
  257. opacity: 0.5;
  258. cursor: pointer;
  259. }
  260.  
  261. .close:before, .close:after {
  262. content: ' ';
  263. position: absolute;
  264. left: 50%;
  265. top: 50%;
  266. width: 100%;
  267. height: 20%;
  268. transform: translate(-50%, -50%) rotate(-45deg);
  269. background: #fff;
  270. }
  271.  
  272. .close:after {
  273. transform: translate(-50%, -50%) rotate(45deg);
  274. }
  275.  
  276. .close:hover {
  277. opacity: 1;
  278. }
  279.  
  280. .btn {
  281. cursor: pointer;
  282. padding: 0.5em;
  283. background: red;
  284. border: 3px solid rgba(0, 0, 0, 0.2);
  285. }
  286.  
  287. .btn:active {
  288. transform: scale(0.8);
  289. }
  290.  
  291. .msg {
  292. position: absolute;
  293. left: 10px;
  294. bottom: 10px;
  295. background: #1e294a;
  296. color: #fff;
  297. font-family: cursive;
  298. font-weight: bolder;
  299. padding: 15px;
  300. animation: msg 0.5s forwards, msg 0.5s reverse forwards 3s;
  301. z-index: 999999;
  302. pointer-events: none;
  303. }
  304. @keyframes msg {
  305. from {
  306. transform: translate(-120%, 0);
  307. }
  308. to {
  309. transform: none;
  310. }
  311. }
  312.  
  313. .range {
  314. position: absolute;
  315. left: 50%;
  316. top: 50%;
  317. width: ${searchSize}px;
  318. height: ${searchSize}px;
  319. max-width: 100%;
  320. max-height: 100%;
  321. border: 1px solid white;
  322. transform: translate(-50%, -50%);
  323. }
  324.  
  325. .range-active {
  326. border: 2px solid red;
  327. }
  328.  
  329. </style>
  330. <div class="dialog">${shouldShowAd ? `<big>Loading ad...</big>` : `<div class="close" onclick="this.parentNode.style.display='none';"></div>
  331. <big>ESP & Wireframe</big>
  332. <br>
  333. <br>
  334. [T] to toggle aimbot
  335. <br>
  336. [M] to toggle ESP
  337. <br>
  338. [N] to toggle wireframe
  339. <br>
  340. [H] to show/hide help
  341. <br>
  342. <br>
  343. By Zertalious
  344. <br>
  345. <br>
  346. <div style="display: grid; grid-template-columns: 1fr 1fr; grid-gap: 5px;">
  347. <div class="btn" onclick="window.open('https://discord.gg/K24Zxy88VM', '_blank')">Discord</div>
  348. <div class="btn" onclick="window.open('https://www.instagram.com/zertalious/', '_blank')">Instagram</div>
  349. <div class="btn" onclick="window.open('https://twitter.com/Zertalious', '_blank')">Twitter</div>
  350. <div class="btn" onclick="window.open('https://greasyfork.org/en/users/662330-zertalious', '_blank')">More scripts</div>
  351. </div>
  352. ` }
  353. </div>
  354. <div class="msg" style="display: none;"></div>
  355. <div class="range" style="display: none;"></div>`;
  356.  
  357. const msgEl = el.querySelector( '.msg' );
  358. const dialogEl = el.querySelector( '.dialog' );
  359.  
  360. const rangeEl = el.querySelector( '.range' );
  361.  
  362. window.addEventListener( 'DOMContentLoaded', function () {
  363. while ( el.children.length > 0 ) {
  364. document.body.appendChild( el.children[ 0 ] );
  365. }
  366. if ( shouldShowAd ) {
  367.  
  368. const url = new URL( window.location.href );
  369. url.searchParams.set( 'showAd', Date.now().toString( 16 ) );
  370. url.searchParams.set( 'scriptVersion', GM.info.script.version );
  371. window.location.href = 'https://zertalious.xyz?ref=' + new TextEncoder().encode( url.href ).toString();
  372. }
  373.  
  374. } );
  375.  
  376. window.addEventListener( 'keyup', function ( event ) {
  377.  
  378. switch ( String.fromCharCode( event.keyCode ) ) {
  379.  
  380. case 'M' :
  381. espEnabled = ! espEnabled;
  382. showMsg( 'ESP', espEnabled );
  383. break;
  384. case 'N' :
  385. wireframeEnabled = ! wireframeEnabled;
  386. showMsg( 'Wireframe', wireframeEnabled );
  387.  
  388. break;
  389.  
  390. case 'T' :
  391.  
  392. aimbotEnabled = ! aimbotEnabled;
  393.  
  394. showMsg( 'Aimbot', aimbotEnabled );
  395.  
  396. break;
  397.  
  398. case 'H' :
  399.  
  400. dialogEl.style.display = dialogEl.style.display === '' ? 'none' : '';
  401. break;
  402.  
  403. }
  404.  
  405. } );
  406.  
  407. function showMsg( name, bool ) {
  408.  
  409. msgEl.innerText = name + ': ' + ( bool ? 'ON' : 'OFF' );
  410.  
  411. msgEl.style.display = 'none';
  412.  
  413. void msgEl.offsetWidth;
  414.  
  415. msgEl.style.display = '';
  416.  
  417. }