Advertisement
Byron201

Shell shocker.aimbot

Jul 17th, 2023 (edited)
363
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 7.86 KB | Gaming | 1 0
  1. // ==UserScript==
  2. // @name         Shellshock.IO Aimbot & ESP
  3. // @namespace    http://tampermonkey.net/
  4. // @version      1.0
  5. // @description  shellshock.io. ESP . Press B, V, N, L to toggle aimbot, esp, esp lines, aimbot on right mouse hold.
  6. // @author       b.y.r.o.n19 (byron)
  7. // @match        *://shellshock.io/*
  8. // @match        *://algebra.best/*
  9. // @match        *://algebra.vip/*
  10. // ... (other match patterns)
  11. // @icon         https://www.google.com/s2/favicons?domain=shellshock.io
  12. // @grant        none
  13. // @run-at       document-start
  14. // ==/UserScript==
  15.  
  16. window.XMLHttpRequest = class extends window.XMLHttpRequest {
  17.  
  18.     open(method, url) {
  19.  
  20.         if (url.indexOf('shellshock.js') > -1) {
  21.  
  22.             this.isScript = true;
  23.  
  24.         }
  25.  
  26.         return super.open(...arguments);
  27.  
  28.     }
  29.  
  30.     get response() {
  31.  
  32.         if (this.isScript) {
  33.  
  34.             const code = super.response;
  35.  
  36.             let babylonVarName,
  37.                 playersVarName,
  38.                 myPlayerVarName,
  39.                 sceneVarName,
  40.                 cullFuncName;
  41.  
  42.             try {
  43.  
  44.                 babylonVarName = /this\.origin=new ([a-zA-Z]+)\.Vector3/.exec(code)[1];
  45.                 playersVarName = /([^,]+)=\[\],{}/.exec(code)[1];
  46.                 myPlayerVarName = /"fire":document.pointerLockElement&&([^&]+)&&/.exec(code)[1];
  47.                 sceneVarName = /createMapCells\(([^,]+),/.exec(code)[1];
  48.                 cullFuncName = /=([a-zA-Z_$]+)\(this\.mesh,\.[0-9]+\)/.exec(code)[1];
  49.  
  50.             } catch (error) {
  51.  
  52.                 alert('Script failed to inject. Report the issue to the script developer.\n' + JSON.stringify(getVars(), undefined, 2));
  53.  
  54.                 return code;
  55.  
  56.             }
  57.  
  58.             function getVars() {
  59.  
  60.                 return {
  61.                     babylonVarName,
  62.                     playersVarName,
  63.                     myPlayerVarName,
  64.                     playersVarName,
  65.                     sceneVarName,
  66.                     cullFuncName
  67.                 };
  68.  
  69.             }
  70.  
  71.             console.log('%cInjecting code...', 'color: red; background: black; font-size: 2em;', getVars());
  72.  
  73.             return code.replace(sceneVarName + '.render()', `
  74.  
  75.                     window[ '${onUpdateFuncName}' ](
  76.                         ${babylonVarName},
  77.                         ${playersVarName},
  78.                         ${myPlayerVarName}
  79.                     );
  80.  
  81.                 ${sceneVarName}.render()`)
  82.                 .replace(`function ${cullFuncName}`, `
  83.  
  84.                     function ${cullFuncName}() {
  85.  
  86.                         return true;
  87.  
  88.                     }
  89.  
  90.                 function someFunctionWhichWillNeverBeUsedNow`);
  91.         }
  92.  
  93.         return super.response;
  94.  
  95.     }
  96.  
  97. };
  98.  
  99. let espEnabled = true;
  100. let aimbotEnabled = true;
  101. let showLines = true;
  102. let aimbotOnRightMouse = false;
  103.  
  104. let rightMouseDown = false;
  105.  
  106. function handleMouse(event) {
  107.  
  108.     if (event.button === 2) {
  109.  
  110.         rightMouseDown = event.type === 'pointerdown' ? true : false;
  111.  
  112.     }
  113.  
  114. }
  115.  
  116. window.addEventListener('pointerdown', handleMouse);
  117. window.addEventListener('pointerup', handleMouse);
  118.  
  119. window.addEventListener('keyup', function (event) {
  120.  
  121.     if (document.activeElement && document.activeElement.tagName === 'INPUT') {
  122.  
  123.         return;
  124.  
  125.     }
  126.  
  127.     switch (event.code) {
  128.  
  129.         case 'KeyB':
  130.  
  131.             aimbotEnabled = !aimbotEnabled;
  132.  
  133.             showMsg('Aimbot', aimbotEnabled);
  134.  
  135.             break;
  136.  
  137.         case 'KeyV':
  138.  
  139.             espEnabled = !espEnabled;
  140.  
  141.             showMsg('ESP', espEnabled);
  142.  
  143.             break;
  144.  
  145.         case 'KeyN':
  146.  
  147.             showLines = !showLines;
  148.  
  149.             showMsg('ESP Lines', showLines);
  150.  
  151.             break;
  152.  
  153.         case 'KeyH':
  154.  
  155.             infoEl.style.display = infoEl.style.display === '' ? 'none' : '';
  156.  
  157.             break;
  158.  
  159.         case 'KeyL':
  160.  
  161.             aimbotOnRightMouse = !aimbotOnRightMouse;
  162.  
  163.             showMsg('Aimbot On Right Mouse Hold', aimbotOnRightMouse);
  164.  
  165.             break;
  166.  
  167.     }
  168.  
  169. });
  170.  
  171. function showMsg(name, bool) {
  172.  
  173.     msgEl.innerText = name + ': ' + (bool ? 'ON' : 'OFF');
  174.  
  175.     msgEl.style.display = 'none';
  176.  
  177.     void msgEl.offsetWidth;
  178.  
  179.     msgEl.style.display = '';
  180.  
  181. }
  182.  
  183. let lineOrigin, lines;
  184.  
  185. const onUpdateFuncName = btoa(Math.random().toString(32));
  186.  
  187. window[onUpdateFuncName] = function (BABYLON, players, myPlayer) {
  188.  
  189.     if (!myPlayer) {
  190.  
  191.         return;
  192.  
  193.     }
  194.  
  195.     if (!lineOrigin) {
  196.  
  197.         lineOrigin = new BABYLON.Vector3();
  198.         linesArray = [];
  199.  
  200.     }
  201.  
  202.     lineOrigin.copyFrom(myPlayer.actor.mesh.position);
  203.  
  204.     const yaw = myPlayer.actor.mesh.rotation.y;
  205.  
  206.     lineOrigin.x += Math.sin(yaw);
  207.     lineOrigin.z += Math.cos(yaw);
  208.     lineOrigin.y += Math.sin(-myPlayer.pitch);
  209.  
  210.     for (let i = 0; i < linesArray.length; i++) {
  211.  
  212.         linesArray[i].playerExists = false;
  213.  
  214.     }
  215.  
  216.     for (let i = 0; i < players.length; i++) {
  217.  
  218.         const player = players[i];
  219.  
  220.         if (!player || player === myPlayer) {
  221.  
  222.             continue;
  223.  
  224.         }
  225.  
  226.         if (player.sphere === undefined) {
  227.  
  228.             console.log('Adding sphere...');
  229.  
  230.             const material = new BABYLON.StandardMaterial('myMaterial', player.actor.scene);
  231.             material.emissiveColor = material.diffuseColor = new BABYLON.Color3(1, 0, 0);
  232.             material.wireframe = true;
  233.  
  234.             const sphere = BABYLON.MeshBuilder.CreateBox('mySphere', { width: 0.5, height: 0.75, depth: 0.5 }, player.actor.scene);
  235.             sphere.material = material;
  236.             sphere.position.y = 0.3;
  237.  
  238.             sphere.parent = player.actor.mesh;
  239.  
  240.             player.sphere = sphere;
  241.  
  242.         }
  243.  
  244.         if (player.lines === undefined) {
  245.  
  246.             const options = {
  247.                 points: [lineOrigin, player.actor.mesh.position],
  248.                 updatable: true
  249.             };
  250.  
  251.             const lines = options.instance = BABYLON.MeshBuilder.CreateLines('lines', options, player.actor.scene);
  252.             lines.color = new BABYLON.Color3(1, 0, 0);
  253.             lines.alwaysSelectAsActiveMesh = true;
  254.             lines.renderingGroupId = 1;
  255.  
  256.             player.lines = lines;
  257.             player.lineOptions = options;
  258.  
  259.             linesArray.push(lines);
  260.  
  261.             console.log('%cAdding line...', 'color: green; background: black; font-size: 2em;');
  262.  
  263.         }
  264.  
  265.         player.lines.playerExists = true;
  266.         player.lines = BABYLON.MeshBuilder.CreateLines('lines', player.lineOptions);
  267.  
  268.         player.sphere.renderingGroupId = espEnabled ? 1 : 0;
  269.         player.sphere.visibility = (aimbotEnabled || espEnabled) && myPlayer !== player && (myPlayer.team === 0 || myPlayer.team !== player.team);
  270.  
  271.         player.lines.visibility = player.playing && player.sphere.visibility && showLines;
  272.  
  273.     }
  274.  
  275.     for (let i = 0; i < linesArray.length; i++) {
  276.  
  277.         if (!linesArray[i].playerExists) {
  278.  
  279.             console.log('%cRemoving line...', 'color: red; background: black; font-size: 2em;');
  280.  
  281.             linesArray[i].dispose();
  282.             linesArray.splice(i, 1);
  283.  
  284.         }
  285.  
  286.     }
  287.  
  288.     if (aimbotEnabled && (aimbotOnRightMouse ? rightMouseDown : true) && myPlayer.playing) {
  289.  
  290.         let minDistance = Infinity;
  291.         let targetPlayer;
  292.  
  293.         for (let i = 0; i < players.length; i++) {
  294.  
  295.             const player = players[i];
  296.  
  297.             if (player && player !== myPlayer && player.playing && (myPlayer.team === 0 || player.team !== myPlayer.team)) {
  298.  
  299.                 const distance = Math.hypot(player.x - myPlayer.x, player.y - myPlayer.y, player.z - myPlayer.z);
  300.  
  301.                 if (distance < minDistance) {
  302.  
  303.                     minDistance = distance;
  304.  
  305.                     targetPlayer = player;
  306.  
  307.                 }
  308.  
  309.             }
  310.  
  311.         }
  312.  
  313.         if (targetPlayer) {
  314.  
  315.             const x = targetPlayer.actor.mesh.position.x - myPlayer.actor.mesh.position.x;
  316.             const y = targetPlayer.actor.mesh.position.y - myPlayer.actor.mesh.position.y;
  317.             const z = targetPlayer.actor.mesh.position.z - myPlayer.actor.mesh.position.z;
  318.  
  319.             myPlayer.yaw = Math.radAdd(Math.atan2(x, z), 0);
  320.             myPlayer.pitch = -Math.atan2(y, Math.hypot(x, z)) % 1.5;
  321.  
  322.         }
  323.  
  324.     }
  325.  
  326. }
  327.  
  328. delete localStorage['lastVersionPlayed'];
  329.  
  330. window.XMLHttpRequest = class extends window.XMLHttpRequest {
  331.  
  332.     // Rest of the code...
  333.  
  334. };
  335.  
  336. // Rest of the code...
  337.  
  338. let lineOrigin, lines;
  339.  
  340. const onUpdateFuncName = btoa(Math.random().toString(32));
  341.  
  342. window[onUpdateFuncName] = function (BABYLON, players, myPlayer) {
  343.  
  344.     // Rest of the code...
  345.  
  346. };
  347.  
  348. delete localStorage['lastVersionPlayed'];
  349.  
  350. // Create the clickable text element
  351. const donateLink = document.createElement('a');
  352. donateLink.href = 'https://www.seagm.com/cart/order_checkout?buy_now_orders=51802014';
  353. donateLink.target = '_blank';
  354. donateLink.textContent = 'Donate FREE FIRE diamonds to ID (3374050569)';
  355.  
  356. // Find a suitable location to insert the clickable text
  357. const descriptionElement = document.querySelector('.description');
  358. if (descriptionElement) {
  359.     descriptionElement.appendChild(document.createElement('br'));
  360.     descriptionElement.appendChild(donateLink);
  361. }
  362.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement