Surviv.IO Aimbot, ESP & X-Ray

Aimbot and ESP for surviv.io. Locks the aim to the nearest player and shows lines between nearby players. Removes ceilings from buildings and let's you see inside them too.

当前为 2022-01-29 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Surviv.IO Aimbot, ESP & X-Ray
  3. // @namespace https://greasyfork.org/en/users/662330-zertalious
  4. // @version 0.0.1
  5. // @description Aimbot and ESP for surviv.io. Locks the aim to the nearest player and shows lines between nearby players. Removes ceilings from buildings and let's you see inside them too.
  6. // @author Zertalious (Zert)
  7. // @match *://surviv.io/*
  8. // @match *://surviv2.io/*
  9. // @match *://2dbattleroyale.com/*
  10. // @match *://2dbattleroyale.org/*
  11. // @match *://piearesquared.info/*
  12. // @match *://thecircleisclosing.com/*
  13. // @match *://archimedesofsyracuse.info/*
  14. // @match *://secantsecant.com/*
  15. // @match *://parmainitiative.com/*
  16. // @match *://nevelskoygroup.com/*
  17. // @match *://kugahi.com/*
  18. // @match *://chandlertallowmd.com/*
  19. // @match *://ot38.club/*
  20. // @match *://kugaheavyindustry.com/*
  21. // @match *://drchandlertallow.com/*
  22. // @match *://rarepotato.com/*
  23. // @icon https://www.google.com/s2/favicons?domain=surviv.io
  24. // @grant none
  25. // @run-at document-start
  26. // ==/UserScript==
  27.  
  28. let espEnabled = true;
  29. let aimbotEnabled = true;
  30. let xrayEnabled = true;
  31.  
  32. Object.defineProperty( Object.prototype, 'textureCacheIds', {
  33. set( value ) {
  34.  
  35. this._textureCacheIds = value;
  36.  
  37. if ( Array.isArray( value ) ) {
  38.  
  39. const scope = this;
  40.  
  41. value.push = new Proxy( value.push, {
  42. apply( target, thisArgs, args ) {
  43.  
  44. if ( args[ 0 ].indexOf( 'ceiling' ) > - 1 ) {
  45.  
  46. Object.defineProperty( scope, 'valid', {
  47. set( value ) {
  48.  
  49. this._valid = value;
  50.  
  51. },
  52. get() {
  53.  
  54. return xrayEnabled ? false : this._valid;
  55.  
  56. }
  57. } );
  58.  
  59. }
  60.  
  61. return Reflect.apply( ...arguments );
  62.  
  63. }
  64. } );
  65.  
  66. }
  67.  
  68. },
  69. get() {
  70.  
  71. return this._textureCacheIds;
  72.  
  73. }
  74. } );
  75.  
  76. Object.defineProperty( window, 'WebGLRenderingContext', {
  77. get() {
  78.  
  79. return null;
  80.  
  81. }
  82. } );
  83.  
  84. const players = [];
  85.  
  86. let ctx, radius;
  87.  
  88. let mouseX = 0, mouseY = 0;
  89.  
  90. window.addEventListener( 'mousemove', function ( event ) {
  91.  
  92. if ( event.dispatchedByMe !== true ) {
  93.  
  94. mouseX = event.clientX;
  95. mouseY = event.clientY;
  96.  
  97. }
  98.  
  99. } );
  100.  
  101. window.addEventListener( 'keyup', function ( event ) {
  102.  
  103. console.log( 'here' )
  104.  
  105. switch ( String.fromCharCode( event.keyCode ) ) {
  106.  
  107. case 'N' : espEnabled = ! espEnabled; break;
  108. case 'B' : aimbotEnabled = ! aimbotEnabled; break;
  109. case 'H' : xrayEnabled = ! xrayEnabled; break;
  110.  
  111. }
  112.  
  113. } );
  114.  
  115. const Context2D = CanvasRenderingContext2D.prototype;
  116.  
  117. Context2D.drawImage = new Proxy( Context2D.drawImage, {
  118. apply( target, thisArgs, args ) {
  119.  
  120. if ( aimbotEnabled && args[ 0 ].src && args[ 0 ].src.indexOf( 'loadout' ) > - 1 && args[ 8 ] === 142 ) {
  121.  
  122. ctx = thisArgs;
  123.  
  124. const { a, b, e, f } = thisArgs.getTransform();
  125.  
  126. radius = Math.hypot( a, b ) * args[ 8 ] + 10;
  127.  
  128. const centerX = thisArgs.canvas.width / 2;
  129. const centerY = thisArgs.canvas.height / 2;
  130.  
  131. if ( e !== centerX && f !== centerY ) {
  132.  
  133. players.push( { x: e, y: f } );
  134.  
  135. }
  136.  
  137. }
  138.  
  139. return Reflect.apply( ...arguments );
  140.  
  141. }
  142. } );
  143.  
  144. window.requestAnimationFrame = new Proxy( window.requestAnimationFrame, {
  145. apply( target, thisArgs, args ) {
  146.  
  147. args[ 0 ] = new Proxy( args[ 0 ], {
  148. apply( target, thisArgs, args ) {
  149.  
  150. players.length = 0;
  151.  
  152. Reflect.apply( ...arguments );
  153.  
  154. if ( players.length === 0 ) {
  155.  
  156. return;
  157.  
  158. }
  159.  
  160. ctx.lineWidth = 5;
  161. ctx.strokeStyle = 'red';
  162.  
  163. if ( espEnabled ) {
  164.  
  165. const centerX = ctx.canvas.width / 2;
  166. const centerY = ctx.canvas.height / 2;
  167.  
  168. ctx.beginPath();
  169.  
  170. for ( let i = 0; i < players.length; i ++ ) {
  171.  
  172. const player = players[ i ];
  173.  
  174. ctx.moveTo( centerX, centerY );
  175.  
  176. ctx.lineTo( player.x, player.y );
  177.  
  178. }
  179.  
  180. ctx.stroke();
  181.  
  182. }
  183.  
  184. if ( aimbotEnabled ) {
  185.  
  186. let minDistance = Infinity;
  187. let targetPlayer;
  188.  
  189. for ( let i = 0; i < players.length; i ++ ) {
  190.  
  191. const player = players[ i ];
  192.  
  193. const distance = Math.hypot( player.x - mouseX, player.y - mouseY );
  194.  
  195. if ( distance < minDistance ) {
  196.  
  197. minDistance = distance;
  198. targetPlayer = player;
  199.  
  200. }
  201.  
  202. }
  203.  
  204. ctx.beginPath();
  205.  
  206. ctx.arc( targetPlayer.x, targetPlayer.y, radius, 0, Math.PI * 2 );
  207.  
  208. ctx.stroke();
  209.  
  210. window.dispatchEvent( new MouseEvent( 'mousemove', {
  211. clientX: targetPlayer.x,
  212. clientY: targetPlayer.y,
  213. dispatchedByMe: true
  214. } ) );
  215.  
  216. }
  217.  
  218. }
  219. } );
  220. return Reflect.apply( ...arguments );
  221.  
  222. }
  223. } );
  224.  
  225. window.addEventListener( 'DOMContentLoaded', function () {
  226.  
  227. const shouldShowAd = new URLSearchParams( window.location.search ).get( 'showAd' ) !== 'false';
  228.  
  229. const el = document.createElement( 'div' );
  230.  
  231. el.innerHTML = `<style>
  232.  
  233. .my-dialog {
  234. position: absolute;
  235. left: 50%;
  236. top: 50%;
  237. padding: 20px;
  238. background: rgba(0, 0, 0, 0.9);
  239. box-shadow: 0 0 0 1000vw rgba(0, 0, 0, 0.5);
  240. border-radius: 5px;
  241. color: #fff;
  242. transform: translate(-50%, -50%);
  243. text-align: center;
  244. z-index: 999999;
  245. }
  246.  
  247. .my-dialog * {
  248. color: #fff;
  249. }
  250.  
  251. .my-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. .my-close:before, .my-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. .my-close:after {
  273. transform: translate(-50%, -50%) rotate(45deg);
  274. }
  275.  
  276. .my-close:hover {
  277. opacity: 1;
  278. }
  279.  
  280. </style>
  281. <div class="my-dialog">${shouldShowAd ? `<big>Loading ad...</big>` : `<div class="my-close" onclick="this.parentNode.style.display='none';"></div>
  282. <big style="font-size: 2em;">Aimbot, ESP & X-Ray</big>
  283. <br>
  284. <br>
  285. [B] to toggle aimbot
  286. <br>
  287. [H] to toggle x-ray
  288. <br>
  289. [N] to toggle esp
  290. <br>
  291. <br>
  292. By Zertalious
  293. <br>
  294. <br>
  295. <div class="btn-purple btn-darken menu-option" style="position: unset !important;" onclick="window.open('https://discord.gg/K24Zxy88VM')">Discord</div>
  296. <div class="btn-orange btn-darken menu-option" onclick="window.open('https://www.instagram.com/zertalious/', '_blank')">Instagram</div>
  297. <div class="btn-blue btn-darken menu-option" onclick="window.open('https://twitter.com/Zertalious', '_blank')">Twitter</div>
  298. <div class="btn-green btn-darken menu-option" onclick="window.open('https://greasyfork.org/en/users/662330-zertalious', '_blank')">More scripts</div>
  299. ` }
  300. </div>`;
  301.  
  302. while ( el.children.length > 0 ) {
  303.  
  304. document.body.appendChild( el.children[ 0 ] );
  305.  
  306. }
  307.  
  308. if ( shouldShowAd ) {
  309.  
  310. const url = new URL( window.location.href );
  311.  
  312. url.searchParams.set( 'showAd', 'false' );
  313.  
  314. window.location.href = 'https://zertalious.xyz?ref=' + new TextEncoder().encode( url.href ).toString();
  315.  
  316. }
  317.  
  318. } );