Advertisement
WeExploitersBoys

1v1.lol Hack (OP AF)

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