Shellshock.IO Aimbot & ESP

Locks aim to the nearest player in shellshock.io. Comes with an ESP too. Press B, V, N, L to toggle aimbot, esp, esp lines, aimbot on right mouse hold.

< Feedback on Shellshock.IO Aimbot & ESP

Review: Bad - script does not work

§
Posted: 2024-11-08

// ==UserScript==
// @name Shellshock.IO Aimbot & ESP
// @namespace http://tampermonkey.net/
// @version 0.3.9
// @description Locks aim to the nearest player in shellshock.io. Comes with an ESP too. Press B, V, N, L to toggle aimbot, esp, esp lines, aimbot on right mouse hold.
// @author Zertalious (Zert)
// @match *://shellshock.io/*
// @grant none
// @run-at document-start
// @require https://cdn.jsdelivr.net/npm/lil-gui@0.19
// @require https://cdn.jsdelivr.net/npm/babylonjs@7.15.0/babylon.min.js
// ==/UserScript==

const keys = {};

const StringReplace = String.prototype.replace;

function log( msg, ...args ) {
console.log( '%c' + msg, 'color: red; background: black; font-size: 2em;', ...args );
}

window.XMLHttpRequest = class extends window.XMLHttpRequest {
open( method, url ) {
if ( url.indexOf( 'shellshock.js' ) > -1 ) {
this.isScript = true;
}
return super.open( ...arguments );
}

get response() {
if ( this.isScript ) {
let code = super.response;

let babylonVarName, playersVarName, myPlayerVarName, sceneVarName, cullFuncName;

const extractors = {
BracketSingleQuote() {
const matches = /([a-zA-Z_$0-9]+)\['([^']+)'\]\['([^']+)'\]\("[^"]+",{si/.exec( code );

babylonVarName = matches[ 1 ];
playersVarName = /[a-zA-Z_$0-9]+\['[^']+'\]\),!([a-zA-Z_$0-9]+)\[/.exec( code )[ 1 ];
myPlayerVarName = /document\.pointerLockElement&&([^&]+)&&/.exec( code )[ 1 ];
sceneVarName = /if\([a-zA-Z_$0-9]+\['[^']+'\]\(([a-zA-Z_$0-9]+),[a-zA-Z_$0-9]+,[a-zA-Z_$0-9]+,null/.exec( code )[ 1 ];
cullFuncName = /=([a-zA-Z_$0-9]+)\(this\['([^']+)'\],\.[0-9]+\)/.exec( code )[ 1 ];

keys.MeshBuilder = matches[ 2 ];
keys.CreateBox = matches[ 3 ];
keys.CreateLines = /\['([^']+)'\]\("",{po/.exec( code )[ 1 ];
keys.Vector3 = /new [a-zA-Z_$0-9]+\['([^']+)'\]\(\.5,\.5,\.5\),/.exec( code )[ 1 ];
keys.actor = /this\['([^']+)'\]\['([^']+)'\]\.position,!/.exec( code )[ 1 ];
keys.playing = /OPEN&&[a-zA-Z_$0-9]+\['([^']+)'\]/.exec( code )[ 1 ];

keys.yaw = /\*=[a-zA-Z_$0-9]+,[a-zA-Z_$0-9]+\['([^']+)'\]=Math\.r/.exec( code )[ 1 ];
keys.pitch = /\),[a-zA-Z_$0-9]+\['([^']+)'\]=Math\.max\(Math\.min/.exec( code )[ 1 ];
keys.mesh = /,\.[0-9]+\);this\['([^']+)'\]\['([^']+)'\]\(/.exec( code )[ 1 ];
},
BracketDoubleQuote() {
const matches = /([a-zA-Z_$0-9]+)\["([^"]+)"\]\["([^"]+)"\]\("[^"]+",{si/.exec( code );

babylonVarName = matches[ 1 ];
playersVarName = /[a-zA-Z_$0-9]+\["[^"]+"\]\),!([a-zA-Z_$0-9]+)\[/.exec( code )[ 1 ];
myPlayerVarName = /document\.pointerLockElement&&([^&]+)&&/.exec( code )[ 1 ];
sceneVarName = /if\([a-zA-Z_$0-9]+\["[^"]+"\]\(([a-zA-Z_$0-9]+),[a-zA-Z_$0-9]+,[a-zA-Z_$0-9]+,null/.exec( code )[ 1 ];
cullFuncName = /=([a-zA-Z_$0-9]+)\(this\["([^"]+)"\],\.[0-9]+\)/.exec( code )[ 1 ];

keys.MeshBuilder = matches[ 2 ];
keys.CreateBox = matches[ 3 ];
keys.CreateLines = /\["([^"]+)"\]\("",{po/.exec( code )[ 1 ];
keys.Vector3 = /new [a-zA-Z_$0-9]+\["([^"]+)"\]\(\.5,\.5,\.5\),/.exec( code )[ 1 ];
keys.actor = /this\["([^"]+)"\]\["([^"]+)"\]\.position,!/.exec( code )[ 1 ];
keys.playing = /OPEN&&[a-zA-Z_$0-9]+\["([^"]+)"\]/.exec( code )[ 1 ];

keys.yaw = /\*=[a-zA-Z_$0-9]+,[a-zA-Z_$0-9]+\["([^"]+)"\]=Math\.r/.exec( code )[ 1 ];
keys.pitch = /\),[a-zA-Z_$0-9]+\["([^"]+)"\]=Math\.max\(Math\.min/.exec( code )[ 1 ];
keys.mesh = /,\.[0-9]+\);this\["([^"]+)"\]\["([^"]+)"\]\(/.exec( code )[ 1 ];
},
Dot() {
playersVarName = /[a-zA-Z_$0-9]+\.[a-zA-Z_$0-9]+\),!([a-zA-Z_$0-9]+)\[/.exec( code )[ 1 ];
myPlayerVarName = /document\.pointerLockElement&&([^&]+)&&/.exec( code )[ 1 ];
sceneVarName = /if\([a-zA-Z_$0-9]+\.[a-zA-Z_$0-9]+\(([a-zA-Z_$0-9]+),[a-zA-Z_$0-9]+,[a-zA-Z_$0-9]+,null/.exec( code )[ 1 ];
cullFuncName = /=([a-zA-Z_$0-9]+)\(this\.([a-zA-Z_$0-9]+),\.[0-9]+\)/.exec( code )[ 1 ];

keys.actor = /this\.([a-zA-Z_$0-9]+)\.[a-zA-Z_$0-9]+\.position,!/.exec( code )[ 1 ];
keys.playing = /OPEN&&[a-zA-Z_$0-9]+\.([a-zA-Z_$0-9]+)/.exec( code )[ 1 ];

keys.yaw = /\*=[a-zA-Z_$0-9]+,[a-zA-Z_$0-9]+\.([a-zA-Z_$0-9]+)=Math\.r/.exec( code )[ 1 ];
keys.pitch = /\),[a-zA-Z_$0-9]+\.([a-zA-Z_$0-9]+)=Math\.max\(Math\.min/.exec( code )[ 1 ];
keys.mesh = /,\.[0-9]+\);this\.([a-zA-Z_$0-9]+)\.[a-zA-Z_$0-9]+\(/.exec( code )[ 1 ];
}
};

const numExtractors = Object.keys( extractors ).length;
let failures = 0;

for ( const name in extractors ) {
try {
extractors[ name ]();
log( `SUCCESS: ${name} passed!` );
break;
} catch ( error ) {
log( `WARNING: ${name} extractor failed!` );
failures ++;
if ( failures >= numExtractors ) {
log( `FATAL: Script failed to inject.`, getVars() );
alert( 'Script failed to inject. Report the issue to the script developer.\n' + JSON.stringify( getVars(), undefined, 2 ) );
return code;
}
}
}

function getVars() {
return {
babylonVarName,
playersVarName,
myPlayerVarName,
playersVarName,
sceneVarName,
cullFuncName,
keys
};
}

log( 'Injecting code', getVars() );

code = StringReplace.call( code, sceneVarName + '.render()', `
window[ '${onUpdateFuncName}' ](
${playersVarName},
${myPlayerVarName}
);

${sceneVarName}.render()` );
code = StringReplace.call( code, `function ${cullFuncName}`, `
function ${cullFuncName}() {
return true;
}
function someFunctionWhichWillNeverBeUsedNow` );

return code;
}

return super.response;
}
};

const settings = {
aimbotEnabled: true,
aimbotOnRightMouse: false,
espEnabled: true,
showLines: true,
showTeam: false,
createdBy: 'Zertalious',
showHelp() {
dialogEl.style.display = dialogEl.style.display === '' ? 'none' : '';
}
};

const keyToSetting = {
'KeyB': 'aimbotEnabled',
'KeyV': 'espEnabled',
'KeyN': 'showLines',
'KeyL': 'aimbotOnRightMouse',
'KeyK': 'showTeam'
};

let gui, controllers;

function initGui() {
const settingToKey = {};
for ( const key in keyToSetting ) {
settingToKey[ keyToSetting[ key ] ] = key;
}

gui = new lil.GUI();
controllers = {};
for ( const key in settings ) {
let name = fromCamel( key );
let shortKey = settingToKey[ key ];

if ( shortKey ) {
if ( shortKey.startsWith( 'Key' ) ) shortKey = shortKey.slice( 3 );
name = `[${shortKey}] ${name}`;
}

controllers[ key ] = gui.add( settings, key ).name( name ).listen();
}

const titleEl = gui.domElement.querySelector( '.title' );
titleEl.innerText = `[/] Controls`;
gui.domElement.style.zIndex = '99999';
controllers.createdBy.disable();
}

function fromCamel( text ) {
const result = text.replace( /([A-Z])/g, ' $1' );
return result.charAt( 0 ).toUpperCase() + result.slice( 1 );
}

const temp = document.createElement( 'div' );

temp.innerHTML = `


== Shellshock.IO Aimbot & ESP ==



[B] to toggle aimbot


[V] to toggle ESP


[N] to toggle ESP Lines


[K] to toggle team ESP


[L] to toggle aimbot on
right mouse hold


[H] to show/hide help


[/]: to show/hide control panel



By Zertalious

`;

const msgEl = temp.querySelector( '.msg' );
const dialogEl = temp.querySelector( '.info' );

window.addEventListener( 'DOMContentLoaded', async function () {
initGui();
while ( temp.children.length > 0 ) {
document.body.appendChild( temp.children[ 0 ] );
}
} );

let rightMouseDown = false;

function handleMouse( event ) {
if ( event.button === 2 ) {
rightMouseDown = event.type === 'pointerdown' ? true : false;
}
}

window.addEventListener( 'pointerdown', handleMouse );
window.addEventListener( 'pointerup', handleMouse );

function toggleSetting( key ) {
settings[ key ] = ! settings[ key ];
showMsg( fromCamel( key ), settings[ key ] );
}

window.addEventListener( 'keyup', function ( event ) {
if ( document.activeElement && document.activeElement.tagName === 'INPUT' ) return;
if ( keyToSetting[ event.code ] ) {
toggleSetting( keyToSetting[ event.code ] );
}

switch ( event.code ) {
case 'KeyH':
settings.showHelp();
break;

case 'Slash':
gui._hidden ? gui.show() : gui.hide();
break;
}
} );

function showMsg( name, bool ) {
msgEl.innerText = name + ': ' + ( bool ? 'ON' : 'OFF' );
msgEl.style.display = 'none';
void msgEl.offsetWidth;
msgEl.style.display = '';
}

let initialized = false;
let lineOrigin, linesArray;
let colors;

const onUpdateFuncName = btoa( Math.random().toString( 32 ) );

window[ onUpdateFuncName ] = function ( players, myPlayer ) {
if ( ! myPlayer ) return;

if ( ! initialized ) {
initialized = true;
lineOrigin = new BABYLON.Vector3();
linesArray = [];

colors = {
enemy: new BABYLON.Color3( 1, 0, 0 ),
team: new BABYLON.Color3( 0, 0, 1 ),
};
}

lineOrigin.copyFrom( myPlayer[ keys.actor ][ keys.mesh ].position );

for ( let i = 0; i < linesArray.length; i ++ ) {
linesArray[ i ].playerExists = false;
}

for ( let i = 0; i < players.length; i ++ ) {
const player = players[ i ];
if ( ! player || player === myPlayer ) continue;

if ( player.sphere === undefined ) {
log( 'Adding sphere...' );
const material = new BABYLON.StandardMaterial( 'myMaterial', player[ keys.actor ].scene );
material.wireframe = true;
const sphere = BABYLON.MeshBuilder.CreateBox( 'mySphere', { width: 0.5, height: 0.75, depth: 0.5 }, player[ keys.actor ].scene );
sphere.material = material;
sphere.position.y = 0.3;
sphere.parent = player[ keys.actor ][ keys.mesh ];
sphere.renderingGroupId = 1;
player.sphere = sphere;
}

if ( player.lines === undefined ) {
const options = {
points: [ lineOrigin, player[ keys.actor ][ keys.mesh ].position ],
updatable: true
};
const lines = options.instance = BABYLON.MeshBuilder.CreateLines( 'lines', options, player[ keys.actor ].scene );
lines.alwaysSelectAsActiveMesh = true;
lines.renderingGroupId = 1;
player.lines = lines;
player.lineOptions = options;
linesArray.push( lines );
log( 'Adding line...' );
}

player.lines.playerExists = true;
player.lines = BABYLON.MeshBuilder.CreateLines( 'lines', player.lineOptions );

const isEnemy = myPlayer.team === 0 || myPlayer.team !== player.team;
player.sphere.visibility = settings.espEnabled && ( isEnemy || settings.showTeam );
player.lines.visibility = settings.showLines && player[ keys.playing ] && ( isEnemy || settings.showTeam );

player.sphere.material.emissiveColor =
player.sphere.material.diffuseColor =
player.lines.color = isEnemy ? colors.enemy : colors.team;
}

for ( let i = 0; i < linesArray.length; i ++ ) {
if ( ! linesArray[ i ].playerExists ) {
log( 'Removing line...' );
linesArray[ i ].dispose();
linesArray.splice( i, 1 );
}
}

if ( settings.aimbotEnabled && ( settings.aimbotOnRightMouse ? rightMouseDown : true ) && myPlayer[ keys.playing ] ) {
let minDistance = Infinity;
let targetPlayer;

for ( let i = 0; i < players.length; i ++ ) {
const player = players[ i ];
if ( player && player !== myPlayer && player[ keys.playing ] && ( myPlayer.team === 0 || player.team !== myPlayer.team ) ) {
const distance = Math.hypot(
getPos( player, 'x' ) - getPos( myPlayer, 'x' ),
getPos( player, 'y' ) - getPos( myPlayer, 'y' ),
getPos( player, 'z' ) - getPos( myPlayer, 'z' )
);

if ( distance < minDistance ) {
minDistance = distance;
targetPlayer = player;
}
}
}

if ( targetPlayer ) {
const x = getPos( targetPlayer, 'x' ) - getPos( myPlayer, 'x' );
const y = getPos( targetPlayer, 'y' ) - getPos( myPlayer, 'y' );
const z = getPos( targetPlayer, 'z' ) - getPos( myPlayer, 'z' );

myPlayer[ keys.yaw ] = Math.radAdd( Math.atan2( x, z ), 0 );
myPlayer[ keys.pitch ] = - Math.atan2( y, Math.hypot( x, z ) ) % 1.5;
}
}
}

function getPos( player, component ) {
return player[ keys.actor ][ keys.mesh ].position[ component ];
}
here is and updated version that the real owner can use

Post reply

Sign in to post a reply.