Skip to content

Commit 8ef1cae

Browse files
authored
remove more code from a certain baby
1 parent 03a21a0 commit 8ef1cae

1 file changed

Lines changed: 50 additions & 53 deletions

File tree

StateFarmClient.js

Lines changed: 50 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// ==UserScript==
22
// @name StateFarm Client V3
33
// @namespace http://github.com/
4-
// @version 3.0.1
5-
// @description Best hack client for shellshockers
4+
// @version 3.1.1
5+
// @description Best cheats menu for Shell Shockers in 2024. Many modules such as Aimbot, PlayerESP, AmmoESP, Chams, Nametags, Join/Leave messages, Chat Filter Disabling, AntiAFK, FOV Slider, Zooming, Co-ords, Player Stats, Auto Refill and many more whilst having unsurpassed customisation options such as binding to any key and easily editable colour scheme - all on the fly!
66
// @author Hydroflame521 and onlypuppy7
77
// @match *://shellshock.io/*
88
// @match *://algebra.best/*
@@ -66,7 +66,7 @@
6666
(function () {
6767
//script info
6868
const name="StateFarmClient";
69-
const version="3.0.1";
69+
const version="3.1.1";
7070
//startup sequence
7171
const startUp=function() {
7272
mainLoop()
@@ -1230,7 +1230,6 @@
12301230
transform: translate(-120%, 0);
12311231
opacity: 0;
12321232
}
1233-
12341233
to {
12351234
transform: none;
12361235
opacity: 1;
@@ -1247,7 +1246,7 @@
12471246
position: absolute;
12481247
left: 10px;
12491248
color: #fff;
1250-
background: rgba(0, 0, 0, 0.6);
1249+
background: rgba(0, 0, 0, 0.7);
12511250
font-weight: normal;
12521251
padding: 10px;
12531252
border-radius: 5px;
@@ -1325,8 +1324,8 @@
13251324
];
13261325
return resultRgb;
13271326
};
1328-
const distancePlayers = function(myPlayer,player) {
1329-
return Math.hypot( player.x - myPlayer.x, player.y - myPlayer.y, player.z - myPlayer.z );
1327+
const distancePlayers = function(yourPlayer,player) {
1328+
return Math.hypot(player.x-yourPlayer.x,player.y-yourPlayer.y,player.z-yourPlayer.z ); //pythagoras' theorem in 3 dimensions. no one owns maths, zert.
13301329
};
13311330
const isPartialMatch = function(array, searchString) {
13321331
return array.some(item => searchString.toLowerCase().includes(item.toLowerCase()));
@@ -1479,9 +1478,9 @@
14791478
console.log(3, injectionString);
14801479
};
14811480
try {
1482-
getVarName("BABYLON", 'this\\.origin=new ([a-zA-Z]+)\\.Vector3'); //todo
1481+
getVarName("BABYLON", ';([a-zA-Z]+)\\.TransformNode\\.prototype\\.setVisible'); //done
14831482
getVarName("players", '=([a-zA-Z]+)\\[this\\.controlledBy\\]'); //done
1484-
getVarName("myPlayer", '"fire":document.pointerLockElement&&([^&]+)&&'); //todo
1483+
getVarName("yourPlayer", '&&([a-zA-Z]+)\\.grenadeCountdown<=0\\)this\\.cancelGrenade'); //done
14851484
getVarName("weapons", ';([a-zA-Z]+)\\.classes=\\[\\{name:"Soldier"');
14861485
// getVarName("game", 'packInt8\\(([a-zA-Z]+)\\.explode\\),');
14871486
getVarName("renderList", '&&([a-zA-Z]+\\.getShadowMap\\(\\)\\.renderList)');
@@ -1552,7 +1551,7 @@
15521551
const mainLoop = function() {
15531552
const oneTime = function (ss) {
15541553
crosshairsPosition=new ss.BABYLON.Vector3();
1555-
Object.defineProperty(ss.myPlayer.scene, 'forceWireframe', {
1554+
Object.defineProperty(ss.yourPlayer.scene, 'forceWireframe', {
15561555
get: () => {
15571556
return extract("wireframe");
15581557
}
@@ -1565,14 +1564,14 @@
15651564
window.newGame=false;
15661565
};
15671566

1568-
crosshairsPosition.copyFrom(ss.myPlayer.actor.mesh.position);
1569-
const horizontalOffset = Math.sin(ss.myPlayer.actor.mesh.rotation.y);
1570-
const verticalOffset = Math.sin(-ss.myPlayer.pitch);
1567+
crosshairsPosition.copyFrom(ss.yourPlayer.actor.mesh.position);
1568+
const horizontalOffset = Math.sin(ss.yourPlayer.actor.mesh.rotation.y);
1569+
const verticalOffset = Math.sin(-ss.yourPlayer.pitch);
15711570
crosshairsPosition.x += horizontalOffset;
1572-
crosshairsPosition.z += Math.cos(ss.myPlayer.actor.mesh.rotation.y);
1571+
crosshairsPosition.z += Math.cos(ss.yourPlayer.actor.mesh.rotation.y);
15731572
crosshairsPosition.y += verticalOffset + 0.4;
15741573

1575-
ammo=ss.myPlayer.weapon.ammo;
1574+
ammo=ss.yourPlayer.weapon.ammo;
15761575

15771576
whitelistPlayers=extract("whitelist").split(',');
15781577
blacklistPlayers=extract("blacklist").split(',');
@@ -1603,7 +1602,7 @@
16031602
if (extract("playerESP")||extract("tracers")||extract("chams")||extract("nametags")||extract("joinMessages")||extract("leaveMessages")) {
16041603
for (let i=0; i<ss.players.length; i++) {
16051604
const player=ss.players[i];
1606-
if ( player && player !== ss.myPlayer && ( ss.myPlayer.team === 0 || player.team !== ss.myPlayer.team ) ) {
1605+
if ( player && player !== ss.yourPlayer && ( ss.yourPlayer.team === 0 || player.team !== ss.yourPlayer.team ) ) {
16071606
const whitelisted=(extract("whitelistESPType")=="highlight"||!extract("enableWhitelistTracers")||isPartialMatch(whitelistPlayers,player.name));
16081607
const blacklisted=(extract("blacklistESPType")=="justexclude"&&extract("enableBlacklistTracers")&&isPartialMatch(blacklistPlayers,player.name));
16091608
const passedLists=whitelisted&&(!blacklisted);
@@ -1615,7 +1614,7 @@
16151614
} else if (extract("enableBlacklistTracers") && extract("blacklistESPType")=="highlight" && isPartialMatch(blacklistPlayers,player.name) ) {
16161615
color=hexToRgb(extract("blacklistColor"));
16171616
} else if ( tracersType=="proximity" ) {
1618-
const distance = distancePlayers(ss.myPlayer,player);
1617+
const distance = distancePlayers(ss.yourPlayer,player);
16191618
if (distance < extract("tracersColor1to2")) { //fade between first set
16201619
progress=(distance/extract("tracersColor1to2"));
16211620
color=fadeBetweenColors(extract("tracersColor1"),extract("tracersColor2"),progress);
@@ -1647,10 +1646,10 @@
16471646
if (extract("nametags") && player.actor && player.actor.nameSprite) { //taken from shellshock.js, so var names are weird
16481647
player.actor.nameSprite._manager.renderingGroupId = 1;
16491648
player.actor.nameSprite.renderingGroupId = 1;
1650-
var h = Math.length3(player.x - ss.myPlayer.x, player.y - ss.myPlayer.y, player.z - ss.myPlayer.z),
1649+
var h = Math.length3(player.x - ss.yourPlayer.x, player.y - ss.yourPlayer.y, player.z - ss.yourPlayer.z),
16511650
d = Math.pow(h, 1.25)*2;
16521651
player.actor.nameSprite.width = d / 10 + .6, player.actor.nameSprite.height = d / 20 + .3;
1653-
ss.myPlayer.actor.scene.activeCamera.fov=0.75
1652+
ss.yourPlayer.actor.scene.activeCamera.fov=0.75
16541653
};
16551654
if (!player.logged) {
16561655
player.logged=true;
@@ -1707,11 +1706,11 @@
17071706
};
17081707
} else { //grenades
17091708
const regime=extract("grenadeESPRegime");
1710-
if (regime=="whendepleted" && ss.myPlayer.grenadeCount==0) {
1709+
if (regime=="whendepleted" && ss.yourPlayer.grenadeCount==0) {
17111710
willBeVisible=true;
1712-
} else if (regime=="whenlow" && ss.myPlayer.grenadeCount<=1) {
1711+
} else if (regime=="whenlow" && ss.yourPlayer.grenadeCount<=1) {
17131712
willBeVisible=true;
1714-
} else if (regime=="belowmax" && ss.myPlayer.grenadeCount<ss.myPlayer.grenadeCapacity) {
1713+
} else if (regime=="belowmax" && ss.yourPlayer.grenadeCount<ss.yourPlayer.grenadeCapacity) {
17151714
willBeVisible=true;
17161715
} else if (regime=="alwayson") {
17171716
willBeVisible=true;
@@ -1742,7 +1741,7 @@
17421741
};
17431742
};
17441743
window[mainLoopFunction] = function ( ss ) {
1745-
if ( !ss.myPlayer ) { return }; //injection fail
1744+
if ( !ss.yourPlayer ) { return }; //injection fail
17461745
if ( !ranOneTime ) { oneTime(ss) };
17471746
initVars(ss);
17481747
framesPassed=framesPassed+1;
@@ -1752,7 +1751,7 @@
17521751
};
17531752

17541753
if ( extract("freecam") ) {
1755-
ss.myPlayer.actor.mesh.position.y = ss.myPlayer.actor.mesh.position.y + 1;
1754+
ss.yourPlayer.actor.mesh.position.y = ss.yourPlayer.actor.mesh.position.y + 1;
17561755
};
17571756

17581757
if ( extract("spamChat") ) {
@@ -1763,9 +1762,9 @@
17631762
};
17641763

17651764
if ( extract("showCoordinates") ) {
1766-
const fonx = Number((ss.myPlayer.actor.mesh.position.x).toFixed(3));
1767-
const fony = Number((ss.myPlayer.actor.mesh.position.y).toFixed(3));
1768-
const fonz = Number((ss.myPlayer.actor.mesh.position.z).toFixed(3));
1765+
const fonx = Number((ss.yourPlayer.actor.mesh.position.x).toFixed(3));
1766+
const fony = Number((ss.yourPlayer.actor.mesh.position.y).toFixed(3));
1767+
const fonz = Number((ss.yourPlayer.actor.mesh.position.z).toFixed(3));
17691768
const personalCoordinate = `XYZ: ${fonx}, ${fony}, ${fonz}`;
17701769
coordElement.innerText = personalCoordinate;
17711770
void coordElement.offsetWidth;
@@ -1777,7 +1776,7 @@
17771776
for ( let i = 0; i < ss.players.length; i ++ ) {
17781777
const player = ss.players[i];
17791778
globalPlayer=ss;
1780-
if ( player && player !== ss.myPlayer && player.playing && ( ss.myPlayer.team === 0 || player.team !== ss.myPlayer.team ) ) {
1779+
if ( player && player !== ss.yourPlayer && player.playing && ( ss.yourPlayer.team === 0 || player.team !== ss.yourPlayer.team ) ) {
17811780
playerStates=playerStates+player.name+": "+Math.round(player.hp)+" HP\n";
17821781
};
17831782
};
@@ -1792,47 +1791,45 @@
17921791
}
17931792
if ( extract("autoRefill") ) {
17941793
if (ammo.rounds==0) {
1795-
ss.myPlayer.reload();
1794+
ss.yourPlayer.reload();
17961795
};
17971796
// console.log("round",t.rounds);
17981797
// console.log("capacity",t.capacity);
17991798
}
18001799

1801-
if (extract("aimbot") && ( extract("aimbotRightClick") ? isRightButtonDown : true ) && ss.myPlayer.playing) {
1800+
if (extract("aimbot") && ( extract("aimbotRightClick") ? isRightButtonDown : true ) && ss.yourPlayer.playing) {
18021801
if (!extract("lockOn") || !currentlyTargeting) {
18031802
currentlyTargeting=false
18041803
const targetType=extract("aimbotTargeting");
18051804
let minimumValue = Infinity;
18061805
for ( let i = 0; i < ss.players.length; i ++ ) {
18071806
const player = ss.players[ i ];
1808-
if ( player && player !== ss.myPlayer && player.playing && ( ss.myPlayer.team === 0 || player.team !== ss.myPlayer.team ) ) {
1807+
if ( player && player !== ss.yourPlayer && player.playing && ( ss.yourPlayer.team === 0 || player.team !== ss.yourPlayer.team ) ) {
18091808
const whitelisted=(!extract("enableWhitelistAimbot")||extract("enableWhitelistAimbot")&&isPartialMatch(whitelistPlayers,player.name));
18101809
const blacklisted=(extract("enableBlacklistAimbot")&&isPartialMatch(blacklistPlayers,player.name));
18111810
const passedLists=whitelisted&&(!blacklisted);
18121811
if (passedLists) {
18131812
if (targetType=="nearest") {
1814-
const distance = distancePlayers(ss.myPlayer,player);
1813+
const distance = distancePlayers(ss.yourPlayer,player);
18151814
if ( distance < minimumValue ) {
18161815
minimumValue = distance;
18171816
currentlyTargeting = player;
18181817
};
18191818
} else if (targetType=="pointingat") {
18201819
// Calculate the direction vector pointing to the player
18211820
const directionToPlayer = new ss.BABYLON.Vector3(
1822-
player.actor.mesh.position.x - ss.myPlayer.actor.mesh.position.x,
1823-
player.actor.mesh.position.y - ss.myPlayer.actor.mesh.position.y,
1824-
player.actor.mesh.position.z - ss.myPlayer.actor.mesh.position.z
1821+
player.actor.mesh.position.x - ss.yourPlayer.actor.mesh.position.x,
1822+
player.actor.mesh.position.y - ss.yourPlayer.actor.mesh.position.y,
1823+
player.actor.mesh.position.z - ss.yourPlayer.actor.mesh.position.z
18251824
);
18261825
// Calculate the angles between the direction vector and the player vector
1827-
const angleYaw = Math.radAdd(
1828-
Math.atan2(directionToPlayer.x, directionToPlayer.z),0
1829-
);
1826+
const angleYaw = Math.radAdd(Math.atan2(directionToPlayer.x, directionToPlayer.z),0);
18301827
const anglePitch = -Math.atan2(
18311828
directionToPlayer.y,
18321829
Math.hypot(directionToPlayer.x, directionToPlayer.z)
18331830
);
18341831
// Calculate the absolute angular difference
1835-
const angleDifference = Math.abs(ss.myPlayer.yaw - angleYaw) + Math.abs(ss.myPlayer.pitch - anglePitch);
1832+
const angleDifference = Math.abs(ss.yourPlayer.yaw - angleYaw) + Math.abs(ss.yourPlayer.pitch - anglePitch);
18361833
if (angleDifference < minimumValue) {
18371834
minimumValue = angleDifference;
18381835
currentlyTargeting = player;
@@ -1847,8 +1844,8 @@
18471844
y=currentlyTargeting.actor.mesh.position.y
18481845
z=currentlyTargeting.actor.mesh.position.z;
18491846
if (extract("prediction")) {
1850-
const distanceBetweenPlayers=distancePlayers(ss.myPlayer,currentlyTargeting);
1851-
const bulletSpeed=ss.weapons.classes[ss.myPlayer.primaryWeaponItem.exclusive_for_class].weapon.velocity;
1847+
const distanceBetweenPlayers=distancePlayers(ss.yourPlayer,currentlyTargeting);
1848+
const bulletSpeed=ss.weapons.classes[ss.yourPlayer.primaryWeaponItem.exclusive_for_class].weapon.velocity;
18521849
const timeToReachTarget = distanceBetweenPlayers / bulletSpeed;
18531850
x = x + currentlyTargeting.dx * timeToReachTarget;
18541851
z = z + currentlyTargeting.dz * timeToReachTarget;
@@ -1858,12 +1855,12 @@
18581855
y = y + currentlyTargeting.dy * timeToReachTarget;
18591856
};
18601857
};
1861-
x = x - ss.myPlayer.actor.mesh.position.x;
1862-
y = y - ss.myPlayer.actor.mesh.position.y;
1863-
z = z - ss.myPlayer.actor.mesh.position.z;
1858+
x = x - ss.yourPlayer.actor.mesh.position.x;
1859+
y = y - ss.yourPlayer.actor.mesh.position.y;
1860+
z = z - ss.yourPlayer.actor.mesh.position.z;
18641861

1865-
const finalYaw = (Math.log(Math.abs(x) + Math.sqrt(z ** 2)) / Math.log(2)) + 0;
1866-
const finalPitch = -Math.acos(y / Math.sqrt(x ** 2 + z ** 2)) % 1.5;
1862+
const finalYaw = Math.radAdd(Math.atan2(x,z),0);
1863+
const finalPitch = -Math.atan2(y,Math.hypot(x,z))%1.5;
18671864

18681865
const antiSnap=1-(extract("aimbotAntiSnap")||0);
18691866
function lerp(start, end, alpha) {
@@ -1872,22 +1869,22 @@
18721869
value=end
18731870
};
18741871
return value
1875-
}
1872+
};
18761873
// Exponential lerp towards the target rotation
1877-
ss.myPlayer.yaw = lerp(ss.myPlayer.yaw, finalYaw, antiSnap);
1878-
ss.myPlayer.pitch = lerp(ss.myPlayer.pitch, finalPitch, antiSnap);
1874+
ss.yourPlayer.yaw = lerp(ss.yourPlayer.yaw, finalYaw, antiSnap);
1875+
ss.yourPlayer.pitch = lerp(ss.yourPlayer.pitch, finalPitch, antiSnap);
18791876
if (extract("tracers")) {
18801877
currentlyTargeting.tracerLines.color = new ss.BABYLON.Color3(...hexToRgb(extract("aimbotColor")));
1881-
}
1878+
};
18821879
if (extract("playerESP")) {
18831880
const boxMaterial = currentlyTargeting.box.material;
18841881
boxMaterial.emissiveColor = boxMaterial.diffuseColor = new ss.BABYLON.Color3(...hexToRgb(extract("aimbotColor")));
1885-
}
1882+
};
18861883
if (extract("autoFire")) {
18871884
if (ammo.capacity>0) {
1888-
ss.myPlayer.pullTrigger();
1885+
ss.yourPlayer.pullTrigger();
18891886
} else {
1890-
ss.myPlayer.melee();
1887+
ss.yourPlayer.melee();
18911888
};
18921889
};
18931890
} else {

0 commit comments

Comments
 (0)