iiBuggzZz

Shell Shockers Aimbot & ESP Script

Apr 5th, 2022 (edited)
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 7.49 KB | None | 0 0
  1. // ==UserScript==
  2. // @name         Shellshock.IO Aimbot & ESP
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1.1
  5. // @description  Locks aim to the nearest player in shellshock.io. Comes with an ESP too. Press B, V, N to toggle aimbot, esp, esp lines.
  6. // @author       iiBuggzZz (Aiden)
  7. // @match        *://shellshock.io/*
  8. // @icon         https://www.google.com/s2/favicons?domain=shellshock.io
  9. // @grant        none
  10. // @run-at       document-start
  11. // @antifeature  ads
  12. // ==/UserScript==
  13.  
  14. XMLHttpRequest = class extends XMLHttpRequest {
  15.  
  16.     open( method, url ) {
  17.  
  18.         if ( url.indexOf( 'shellshock.js' ) > - 1 ) {
  19.  
  20.             this.isScript = true;
  21.  
  22.         }
  23.  
  24.         return super.open( ...arguments );
  25.  
  26.     }
  27.  
  28.     get response() {
  29.  
  30.         if ( this.isScript ) {
  31.  
  32.             const code = super.response;
  33.  
  34.             const babylonVarName = /new ([a-zA-Z]+)\.Vector3/.exec( code )[ 1 ];
  35.             const playersVarName = /([^,]+)=\[\],{}/.exec( code )[ 1 ];
  36.             const myPlayerVarName = /"fire":document.pointerLockElement&&([^&]+)&&/.exec( code )[ 1 ];
  37.             const sceneVarName = /createMapCells\(([^,]+),/.exec( code )[ 1 ];
  38.             const cullFuncName = /=([a-zA-Z]+)\(this\.mesh,\.[0-9]+\)/.exec( code )[ 1 ];
  39.  
  40.             console.log( '%cInjecting code...', 'color: red; background: black; font-size: 2em;', {
  41.                 babylonVarName,
  42.                 playersVarName,
  43.                 myPlayerVarName,
  44.                 playersVarName,
  45.                 sceneVarName,
  46.                 cullFuncName
  47.             } );
  48.  
  49.             return code.replace( sceneVarName + '.render()', `( function () {
  50.  
  51.                 const players = ${playersVarName};
  52.                 const myPlayer = ${myPlayerVarName};
  53.                 const BABYLON = ${babylonVarName};
  54.  
  55.                 if ( ! myPlayer ) {
  56.  
  57.                     return;
  58.  
  59.                 }
  60.  
  61.                 if ( ! window.lineOrigin ) {
  62.  
  63.                     window.lineOrigin = new BABYLON.Vector3();
  64.                     window.lines = [];
  65.  
  66.                 }
  67.  
  68.                 window.lineOrigin.copyFrom( myPlayer.actor.mesh.position );
  69.  
  70.                 const yaw = myPlayer.actor.mesh.rotation.y;
  71.  
  72.                 window.lineOrigin.x += Math.sin( yaw );
  73.                 window.lineOrigin.z += Math.cos( yaw );
  74.                 window.lineOrigin.y += Math.sin( - myPlayer.pitch );
  75.  
  76.                 for ( let i = 0; i < window.lines.length; i ++ ) {
  77.  
  78.                     window.lines[ i ].playerExists = false;
  79.  
  80.                 }
  81.  
  82.                 for ( let i = 0; i < players.length; i ++ ) {
  83.  
  84.                     const player = players[ i ];
  85.  
  86.                     if ( ! player || player === myPlayer ) {
  87.  
  88.                         continue;
  89.  
  90.                     }
  91.  
  92.                     if ( player.sphere === undefined ) {
  93.  
  94.                         console.log( 'Adding sphere...' );
  95.  
  96.                         const material = new BABYLON.StandardMaterial( 'myMaterial', player.actor.scene );
  97.                         material.emissiveColor = material.diffuseColor = new BABYLON.Color3( 1, 0, 0 );
  98.                         material.wireframe = true;
  99.  
  100.                         const sphere = BABYLON.MeshBuilder.CreateBox( 'mySphere', { width: 0.5, height: 0.75, depth: 0.5 }, player.actor.scene );
  101.                         sphere.material = material;
  102.                         sphere.position.y = 0.3;
  103.  
  104.                         sphere.parent = player.actor.mesh;
  105.  
  106.                         player.sphere = sphere;
  107.  
  108.                     }
  109.  
  110.                     if ( player.lines === undefined ) {
  111.  
  112.                         const options = {
  113.                             points: [ window.lineOrigin, player.actor.mesh.position ],
  114.                             updatable: true
  115.                         };
  116.  
  117.                         const lines = options.instance = BABYLON.MeshBuilder.CreateLines( 'lines', options, player.actor.scene );
  118.                         lines.color = new BABYLON.Color3( 1, 0, 0 );
  119.                         lines.alwaysSelectAsActiveMesh = true;
  120.                         lines.renderingGroupId = 1;
  121.  
  122.                         player.lines = lines;
  123.                         player.lineOptions = options;
  124.  
  125.                         window.lines.push( lines );
  126.  
  127.                         console.log( '%cAdding line...', 'color: green; background: black; font-size: 2em;' );
  128.  
  129.                     }
  130.  
  131.                     player.lines.playerExists = true;
  132.                     player.lines = BABYLON.MeshBuilder.CreateLines( 'lines', player.lineOptions );
  133.  
  134.                     player.sphere.renderingGroupId = window.espEnabled ? 1 : 0;
  135.                     player.sphere.visibility = ( window.aimbotEnabled || window.espEnabled ) && myPlayer !== player && ( myPlayer.team === 0 || myPlayer.team !== player.team );
  136.  
  137.                     player.lines.visibility = player.playing && player.sphere.visibility && window.showLines;
  138.  
  139.                 }
  140.  
  141.                 for ( let i = 0; i < window.lines.length; i ++ ) {
  142.  
  143.                     if ( ! window.lines[ i ].playerExists ) {
  144.  
  145.                         console.log( '%cRemoving line...', 'color: red; background: black; font-size: 2em;' );
  146.  
  147.                         window.lines[ i ].dispose();
  148.                         window.lines.splice( i, 1 );
  149.  
  150.                     }
  151.  
  152.                 }
  153.  
  154.                 if ( window.aimbotEnabled && myPlayer.playing ) {
  155.  
  156.                     let minDistance = Infinity;
  157.                     let targetPlayer;
  158.  
  159.                     for ( let i = 0; i < players.length; i ++ ) {
  160.  
  161.                         const player = players[ i ];
  162.  
  163.                         if ( player && player !== myPlayer && player.playing && ( myPlayer.team === 0 || player.team !== myPlayer.team ) ) {
  164.  
  165.                             const distance = Math.hypot( player.x - myPlayer.x, player.y - myPlayer.y, player.z - myPlayer.z );
  166.  
  167.                             if ( distance < minDistance ) {
  168.  
  169.                                 minDistance = distance;
  170.  
  171.                                 targetPlayer = player;
  172.  
  173.                             }
  174.  
  175.                         }
  176.  
  177.                     }
  178.  
  179.                     if ( targetPlayer ) {
  180.  
  181.                         const x = targetPlayer.actor.mesh.position.x - myPlayer.actor.mesh.position.x;
  182.                         const y = targetPlayer.actor.mesh.position.y - myPlayer.actor.mesh.position.y;
  183.                         const z = targetPlayer.actor.mesh.position.z - myPlayer.actor.mesh.position.z;
  184.  
  185.                         myPlayer.yaw = Math.radAdd( Math.atan2( x, z ), 0 );
  186.                         myPlayer.pitch = - Math.atan2( y, Math.hypot( x, z ) ) % 1.5;
  187.  
  188.                     }
  189.  
  190.                 }
  191.  
  192.             } )(); ${sceneVarName}.render()` )
  193.                 .replace( `function ${cullFuncName}`, `
  194.  
  195.                     function ${cullFuncName}() {
  196.  
  197.                         return true;
  198.  
  199.                     }
  200.  
  201.                 function someFunctionWhichWillNeverBeUsedNow` );
  202.  
  203.         }
  204.  
  205.         return super.response;
  206.  
  207.     }
  208.  
  209. };
  210.  
  211. window.espEnabled = true;
  212. window.aimbotEnabled = true;
  213. window.showLines = true;
  214.  
  215. window.addEventListener( 'keyup', function ( event ) {
  216.  
  217.     if ( document.activeElement && document.activeElement.tagName === 'INPUT' ) {
  218.  
  219.         return;
  220.  
  221.     }
  222.  
  223.     switch ( String.fromCharCode( event.keyCode ) ) {
  224.  
  225.         case 'B':
  226.  
  227.             window.aimbotEnabled = ! window.aimbotEnabled;
  228.  
  229.             break;
  230.  
  231.         case 'V':
  232.  
  233.             window.espEnabled = ! window.espEnabled;
  234.  
  235.             break;
  236.  
  237.         case 'N':
  238.  
  239.             window.showLines = ! window.showLines;
  240.  
  241.             break;
  242.  
  243.     }
  244.  
  245. } );
  246.  
  247. window.addEventListener( 'DOMContentLoaded', async function () {
  248.  
  249.     const value = parseInt( new URLSearchParams( window.location.search ).get( 'showAd' ), 16 );
  250.  
  251.     const shouldShowAd = isNaN( value ) || Date.now() - value < 0 || Date.now() - value > 10 * 60 * 1000;
  252.  
  253.     const temp = document.createElement( 'div' );
  254.  
  255.     temp.innerHTML = '<div class="popup_window popup_lg centered roundme_lg">' +
  256.         ( shouldShowAd ? `<h1 class="roundme_sm">Loading ad...</h1>` : `<button class="popup_close clickme roundme_sm" onclick="this.parentNode.style.display='none';"></button>
  257.         <h1 class="roundme_sm">Aimbot & ESP!</h1>
  258.         <h4 style="text-align:center;">
  259.             [B] to toggle aimbot
  260.             <br>
  261.             [V] to toggle ESP
  262.             <br>
  263.             [N] to toggle ESP lines
  264.             <br>
  265.             <br>
  266.             By Zertalious
  267.         </h4>
  268.         <div id="btn-horizontal" class="f-center">
  269.             <button class="ss_button btn_red bevel_red btn_sm" onclick="window.open('https://discord.gg/K24Zxy88VM', '_blank')">Discord</button>
  270.             <button class="ss_button btn_yolk bevel_yolk btn_sm" onclick="window.open('https://greasyfork.org/en/users/662330-zertalious', '_blank')">More scripts</button>
  271.         </div>
  272.         <div id="btn-horizontal" class="f-center">
  273.             <button class="ss_button btn_green bevel_green btn_sm" onclick="window.open('https://www.instagram.com/zertalious/', '_blank')">Instagram</button>
  274.             <button class="ss_button btn_blue bevel_blue btn_sm" onclick="window.open('https://twitter.com/Zertalious', '_blank')">Twitter</button>
  275.         </div>` ) +
  276.     '</div>';
  277.  
  278.     }
  279.  
  280. );
Add Comment
Please, Sign In to add comment