Advertisement
Guest User

Untitled

a guest
Mar 4th, 2023
1,819
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.20 KB | None | 0 0
  1. // ==UserScript==
  2. // @name 1v1.LOL ESP & aimbot 0.8
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.8
  5. // @description ESP & Aimbot
  6. // @author RPN Panda#0001
  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 = 250;
  15. const threshold = 4.7;
  16. const aimbotSpeed = 0.2;
  17.  
  18. let aimbotEnabled = false;
  19. let espEnabled = true;
  20. let wireframeEnabled = false;
  21. let guiEnabled = true;
  22.  
  23. const WebGL = WebGL2RenderingContext.prototype;
  24.  
  25. HTMLCanvasElement.prototype.getContext = new Proxy( HTMLCanvasElement.prototype.getContext, {
  26. apply( target, thisArgs, args ) {
  27.  
  28. if ( args[ 1 ] ) {
  29.  
  30. args[ 1 ].preserveDrawingBuffer = true;
  31.  
  32. }
  33.  
  34. return Reflect.apply( ...arguments );
  35.  
  36. }
  37. } );
  38.  
  39. WebGL.shaderSource = new Proxy( WebGL.shaderSource, {
  40. apply( target, thisArgs, args ) {
  41.  
  42. if ( args[ 1 ].indexOf( 'gl_Position' ) > - 1 ) {
  43.  
  44. args[ 1 ] = args[ 1 ].replace( 'void main', `
  45.  
  46. out float vDepth;
  47. uniform bool enabled;
  48. uniform float threshold;
  49.  
  50. void main
  51.  
  52. ` ).replace( /return;/, `
  53.  
  54. vDepth = gl_Position.z;
  55.  
  56. if ( enabled && vDepth > threshold ) {
  57.  
  58. gl_Position.z = 1.0;
  59.  
  60. }
  61.  
  62. ` );
  63.  
  64. } else if ( args[ 1 ].indexOf( 'SV_Target0' ) > - 1 ) {
  65.  
  66. args[ 1 ] = args[ 1 ].replace( 'void main', `
  67.  
  68. in float vDepth;
  69. uniform bool enabled;
  70. uniform float threshold;
  71.  
  72. void main
  73.  
  74. ` ).replace( /return;/, `
  75.  
  76. if ( enabled && vDepth > threshold ) {
  77.  
  78. SV_Target0 = vec4( 1.0, 0.0, 0.0, 1.0 );
  79.  
  80. }
  81.  
  82. ` );
  83.  
  84. }
  85.  
  86. return Reflect.apply( ...arguments );
  87.  
  88. }
  89. } );
  90.  
  91. WebGL.getUniformLocation = new Proxy( WebGL.getUniformLocation, {
  92. apply( target, thisArgs, [ program, name ] ) {
  93.  
  94. const result = Reflect.apply( ...arguments );
  95.  
  96. if ( result ) {
  97.  
  98. result.name = name;
  99. result.program = program;
  100.  
  101. }
  102.  
  103. return result;
  104.  
  105. }
  106. } );
  107.  
  108. WebGL.uniform4fv = new Proxy( WebGL.uniform4fv, {
  109. apply( target, thisArgs, args ) {
  110.  
  111. if ( args[ 0 ].name === 'hlslcc_mtx4x4unity_ObjectToWorld' ) {
  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 ] > 5000;
  140.  
  141. thisArgs.uniform1i( program.uniforms.enabled, espEnabled && 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. const v = isPlaying && aimbotEnabled ? '' : 'none';
  195.  
  196. if ( v !== rangeEl.style.display ) {
  197.  
  198. rangeEl.style.display = v;
  199.  
  200. }
  201.  
  202. if ( count > 0 && isPlaying ) {
  203.  
  204. const f = aimbotSpeed / count;
  205.  
  206. movementX *= f;
  207. movementY *= f;
  208.  
  209. window.dispatchEvent( new MouseEvent( 'mousemove', { movementX, movementY } ) );
  210.  
  211. ! rangeEl.classList.contains( 'range-active' ) && rangeEl.classList.add( 'range-active' );
  212.  
  213. } else {
  214.  
  215. rangeEl.classList.contains( 'range-active' ) && rangeEl.classList.remove( 'range-active' );
  216.  
  217. }
  218.  
  219. movementX = 0;
  220. movementY = 0;
  221. count = 0;
  222.  
  223. return Reflect.apply( ...arguments );
  224.  
  225. }
  226. } );
  227.  
  228. return Reflect.apply( ...arguments );
  229.  
  230. }
  231. } )
  232.  
  233. const value = parseInt( new URLSearchParams( window.location.search ).get( 'showAd' ), 16 );
  234.  
  235. const shouldShowAd = isNaN( value ) || Date.now() - value < 0 || Date.now() - value > 10 * 60 * 1000;
  236.  
  237. const el = document.createElement( 'div' );
  238.  
  239. el.innerHTML = `<style>
  240.  
  241. .dialog {
  242. position: absolute;
  243. left: 50%;
  244. top: 50%;
  245. padding: 20px;
  246. background: #080707;
  247. color: #f5ff69;
  248. transform: translate(-50%, -50%);
  249. text-align: center;
  250. z-index: 999999;
  251. font-family: cursive;
  252. }
  253.  
  254. .dialog * {
  255. color: #f5ff69;
  256. }
  257.  
  258. .close {
  259. position: absolute;
  260. right: 5px;
  261. top: 5px;
  262. width: 20px;
  263. height: 20px;
  264. opacity: 0.5;
  265. cursor: pointer;
  266.  
  267. }
  268.  
  269. .close:before, .close:after {
  270. content: ' ';
  271. position: absolute;
  272. left: 50%;
  273. top: 50%;
  274. width: 100%;
  275. height: 20%;
  276. transform: translate(-50%, -50%) rotate(-45deg);
  277. background: #0593ff;
  278. }
  279.  
  280. .close:after {
  281. transform: translate(-50%, -50%) rotate(45deg);
  282. }
  283.  
  284. .close:hover {
  285. opacity: 1;
  286. }
  287.  
  288. .btn {
  289. cursor: pointer;
  290. padding: 0.5em;
  291. background: #262424;
  292. border: 3px solid rgba(0, 0, 0, 0.3);
  293. }
  294.  
  295. .btn:active {
  296. transform: scale(0.8);
  297. }
  298.  
  299. .msg {
  300. position: absolute;
  301. left: 10px;
  302. bottom: 650px;
  303. background: #080707;
  304. color: #f5ff69;
  305. font-family: cursor;
  306. font-weight: bolder;
  307. padding: 15px;
  308. animation: msg 0.2s forwards, msg 0.2s reverse forwards 2s;
  309. z-index: 999999;
  310. pointer-events: none;
  311. }
  312.  
  313. @keyframes msg {
  314. from {
  315. transform: translate(-120%, 0);
  316. }
  317.  
  318. to {
  319. transform: none;
  320. }
  321. }
  322.  
  323. .range {
  324. position: absolute;
  325. left: 50%;
  326. top: 50%;
  327. width: ${searchSize}px;
  328. height: ${searchSize}px;
  329. max-width: 100%;
  330. max-height: 100%;
  331. border: 1px solid white;
  332. transform: translate(-50%, -50%);
  333. }
  334.  
  335. .range-active {
  336. border: 2px solid red;
  337. }
  338.  
  339. </style>
  340. <div class="dialog">${shouldShowAd ? `<big><big> <img src="https://cdn.discordapp.com/attachments/1002382084859506740/1064143315731230800/01157-unscreen.gif"
  341. </body>
  342. <br>
  343. 𝙀𝙎𝙋 & 𝙎𝙤𝙛𝙩𝘼𝙞𝙢
  344. </big>
  345. <br>
  346. <br>
  347. [𝚃] 𝙏𝙤 𝙩𝙤𝙜𝙜𝙡𝙚 𝙎𝙤𝙛𝙩𝘼𝙞𝙢 marroqui
  348. <br>
  349. [𝙼] 𝙏𝙤 𝙩𝙤𝙜𝙜𝙡𝙚 𝙀𝙎𝙋 morroco
  350. <br>
  351. [𝙽] 𝙏𝙤 𝙩𝙤𝙜𝙜𝙡𝙚 𝙒𝙞𝙧𝙚𝙛𝙧𝙖𝙢𝙚 venezolanos 2.0
  352. <br>
  353. [𝙷] 𝙏𝙤 𝙨𝙝𝙤𝙬/𝙝𝙞𝙙𝙚 para las ratillas
  354. <br>
  355. <br>-------------------------------
  356. <div style="display: grid; grid-template-columns: 1fr 1fr; grid-gap: 7px;">
  357. <div class="btn" onclick="window.open('https://discord.gg/hsxjcru76q', '_blank')">𝘿𝙞𝙨𝙘𝙤𝙧𝙙</div>
  358. <div class="btn" onclick="window.open('https://www.youtube.com/c/RPNPanda', '_blank')">𝐘𝐨𝐮𝐓𝐮𝐛𝐞</div>
  359. </div>
  360. </big>` : `<div class="close" onclick="this.parentNode.style.display='none';"></div>
  361. </div>
  362. ` }
  363. </div>
  364. <div class="msg" style="display: none;"></div>
  365. <div class="range" style="display: none;"></div>`;
  366.  
  367. const msgEl = el.querySelector( '.msg' );
  368. const dialogEl = el.querySelector( '.dialog' );
  369.  
  370. const rangeEl = el.querySelector( '.range' );
  371.  
  372. window.addEventListener( 'DOMContentLoaded', function () {
  373.  
  374. while ( el.children.length > 0 ) {
  375.  
  376. document.body.appendChild( el.children[ 0 ] );
  377.  
  378. }
  379.  
  380. if ( shouldShowAd ) {
  381.  
  382. const url = new URL( window.location.href );
  383.  
  384. url.searchParams.set( 'RPN', Date.now().toString( 16 ) );
  385. url.searchParams.set( 'scriptVersion', GM.info.script.version );
  386.  
  387. }
  388.  
  389. } );
  390.  
  391. window.addEventListener( 'keyup', function ( event ) {
  392.  
  393. switch ( String.fromCharCode( event.keyCode ) ) {
  394.  
  395. case 'M' :
  396.  
  397. espEnabled = ! espEnabled;
  398.  
  399. showMsg( 'ESP morroco', espEnabled );
  400.  
  401. break;
  402.  
  403. case 'N' :
  404.  
  405. wireframeEnabled = ! wireframeEnabled;
  406.  
  407. showMsg( 'Wireframe peruano', wireframeEnabled );
  408.  
  409. break;
  410.  
  411. case 'T' :
  412.  
  413. aimbotEnabled = ! aimbotEnabled;
  414.  
  415. showMsg( 'Aimbot putomalo', aimbotEnabled );
  416.  
  417. break;
  418.  
  419. case 'H' :
  420.  
  421. guiEnabled = ! guiEnabled;
  422.  
  423. showMsg( 'GUI Menu', guiEnabled );
  424.  
  425.  
  426. dialogEl.style.display = dialogEl.style.display === '' ? 'none' : '';
  427.  
  428. break;
  429.  
  430. }
  431.  
  432. } );
  433.  
  434. function showMsg( name, bool ) {
  435.  
  436. msgEl.innerText = name + ': ' + ( bool ? 'ON 🟩 ' : 'OFF 🟥' );
  437.  
  438. msgEl.style.display = 'none';
  439.  
  440. void msgEl.offsetWidth;
  441.  
  442. msgEl.style.display = '';
  443.  
  444. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement