Advertisement
Zainul-Aabidheen

Shell Shockers Aim bot and ESP

Oct 3rd, 2023
937
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.38 KB | Gaming | 0 0
  1. Copy and paste the text below the dotted line into google extension "Violent monkey"
  2. Link: https://chrome.google.com/webstore/detail/violentmonkey/jinjaccalgkegednnccohejagnlnfdag
  3.  
  4. -------------------------------------------------------
  5.  
  6. // ==UserScript==
  7. // @name Shellshock.IO Aimbot & ESP
  8. // @namespace http://tampermonkey.net/
  9. // @version 0.3.1
  10. // @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.
  11. // @author Zainul-Aabidheen (Zain)
  12. // @match *://shellshock.io/*
  13. // @grant none
  14. // @run-at document-start
  15. // ==/UserScript==
  16.  
  17. window.XMLHttpRequest = class extends window.XMLHttpRequest {
  18. open(method, url) {
  19. if (url.indexOf('shellshock.js') > -1) {
  20. this.isScript = true;
  21. }
  22. return super.open(...arguments);
  23. }
  24.  
  25. get response() {
  26. if (this.isScript) {
  27. const code = super.response;
  28. let babylonVarName,
  29. playersVarName,
  30. myPlayerVarName,
  31. sceneVarName,
  32. cullFuncName;
  33. try {
  34. babylonVarName = /this\.origin=new ([a-zA-Z]+)\.Vector3/.exec(code)[1];
  35. playersVarName = /([^,]+)=\[\],[^,]+=\[\],{}/.exec(code)[1];
  36. myPlayerVarName = /"fire":document.pointerLockElement&&([^&]+)&&/.exec(code)[1];
  37. sceneVarName = /createMapCells\(([^,]+),/.exec(code)[1];
  38. cullFuncName = /=([a-zA-Z_$]+)\(this\.mesh,\.[0-9]+\)/.exec(code)[1];
  39. } catch (error) {
  40. alert('Script failed to inject. Report the issue to the script developer.\n' + JSON.stringify(getVars(), undefined, 2));
  41. return code;
  42. }
  43.  
  44. function getVars() {
  45. return {
  46. babylonVarName,
  47. playersVarName,
  48. myPlayerVarName,
  49. playersVarName,
  50. sceneVarName,
  51. cullFuncName
  52. };
  53. }
  54.  
  55. console.log('%cInjecting code...', 'color: red; background: black; font-size: 2em;', getVars());
  56.  
  57. return code.replace(sceneVarName + '.render()', `
  58. window[ '${onUpdateFuncName}' ](
  59. ${babylonVarName},
  60. ${playersVarName},
  61. ${myPlayerVarName}
  62. );
  63. ${sceneVarName}.render()`)
  64. .replace(`function ${cullFuncName}`, `
  65. function ${cullFuncName}() {
  66. return true;
  67. }
  68. function someFunctionWhichWillNeverBeUsedNow`);
  69. }
  70. return super.response;
  71. }
  72. };
  73.  
  74. let espEnabled = true;
  75. let aimbotEnabled = true;
  76. let showLines = true;
  77. let aimbotOnRightMouse = false;
  78.  
  79. const temp = document.createElement('div');
  80.  
  81. temp.innerHTML = `<style>
  82. .info {
  83. position: absolute;
  84. left: 50%;
  85. top: 50%;
  86. padding: 20px;
  87. background: rgba(0, 0, 0, 0.8);
  88. border: 6px solid rgba(0, 0, 0, 0.2);
  89. color: #fff;
  90. transform: translate(-50%, -50%);
  91. text-align: center;
  92. z-index: 999999;
  93. font-weight: bolder;
  94. }
  95. .info * {
  96. color: #fff;
  97. }
  98. .close-icon {
  99. position: absolute;
  100. right: 5px;
  101. top: 5px;
  102. width: 20px;
  103. height: 20px;
  104. opacity: 0.5;
  105. cursor: pointer;
  106. }
  107. .close-icon:before, .close-icon:after {
  108. content: ' ';
  109. position: absolute;
  110. left: 50%;
  111. top: 50%;
  112. width: 100%;
  113. height: 20%;
  114. transform: translate(-50%, -50%) rotate(-45deg);
  115. background: #fff;
  116. }
  117. .close-icon:after {
  118. transform: translate(-50%, -50%) rotate(45deg);
  119. }
  120. .close-icon:hover {
  121. opacity: 1;
  122. }
  123. .btn {
  124. cursor: pointer;
  125. padding: 0.5em;
  126. background: red;
  127. border: 3px solid rgba(0, 0, 0, 0.2);
  128. }
  129. .btn:active {
  130. transform: scale(0.8);
  131. }
  132. .msg {
  133. position: absolute;
  134. left: 10px;
  135. bottom: 10px;
  136. color: #fff;
  137. background: rgba(0, 0, 0, 0.6);
  138. font-weight: bolder;
  139. padding: 15px;
  140. animation: msg 0.5s forwards, msg 0.5s reverse forwards 3s;
  141. z-index: 999999;
  142. pointer-events: none;
  143. }
  144. @keyframes msg {
  145. from {
  146. transform: translate(-120%, 0);
  147. }
  148. to {
  149. transform: none;
  150. }
  151. }
  152. </style>
  153. <div class="msg" style="display: none;"></div>
  154. <div class="info">
  155. <div class="close-icon" onclick="this.parentNode.style.display='none';"></div>
  156. <big>== Aimbot & ESP ==</big>
  157. <br>
  158. <br>
  159. [B] to toggle aimbot
  160. <br>
  161. [V] to toggle ESP
  162. <br>
  163. [N] to toggle ESP Lines
  164. <br>
  165. [L] to toggle aimbot on <br>right mouse hold
  166. <br>
  167. [H] to show/hide help
  168. <br>
  169. <br>
  170. By Zain
  171. <br>
  172. <br>
  173. </div>`;
  174.  
  175. const msgEl = temp.querySelector('.msg');
  176. const infoEl = temp.querySelector('.info');
  177.  
  178. window.addEventListener('DOMContentLoaded', async function () {
  179. while (temp.children.length > 0) {
  180. document.body.appendChild(temp.children[0]);
  181. }
  182. });
  183.  
  184. let rightMouseDown = false;
  185.  
  186. function handleMouse(event) {
  187. if (event.button === 2) {
  188. rightMouseDown = event.type === 'pointerdown' ? true : false;
  189. }
  190. }
  191.  
  192. window.addEventListener('pointerdown', handleMouse);
  193. window.addEventListener('pointerup', handleMouse);
  194.  
  195. window.addEventListener('keyup', function (event) {
  196. if (document.activeElement && document.activeElement.tagName === 'INPUT') {
  197. return;
  198. }
  199.  
  200. switch (event.code) {
  201. case 'KeyB':
  202. aimbotEnabled = !aimbotEnabled;
  203. showMsg('Aimbot', aimbotEnabled);
  204. break;
  205.  
  206. case 'KeyV':
  207. espEnabled = !espEnabled;
  208. showMsg('ESP', espEnabled);
  209. break;
  210.  
  211. case 'KeyN':
  212. showLines = !showLines;
  213. showMsg('ESP Lines', showLines);
  214. break;
  215.  
  216. case 'KeyH':
  217. infoEl.style.display = infoEl.style.display === '' ? 'none' : '';
  218. break;
  219.  
  220. case 'KeyL':
  221. aimbotOnRightMouse = !aimbotOnRightMouse;
  222. showMsg('Aimbot On Right Mouse Hold', aimbotOnRightMouse);
  223. break;
  224. }
  225. });
  226.  
  227. function showMsg(name, bool) {
  228. msgEl.innerText = name + ': ' + (bool ? 'ON' : 'OFF');
  229. msgEl.style.display = 'none';
  230. void msgEl.offsetWidth;
  231. msgEl.style.display = '';
  232. }
  233.  
  234. let lineOrigin, lines;
  235.  
  236. const onUpdateFuncName = btoa(Math.random().toString(32));
  237.  
  238. window[onUpdateFuncName] = function (BABYLON, players, myPlayer) {
  239. if (!myPlayer) {
  240. return;
  241. }
  242.  
  243. if (!lineOrigin) {
  244. lineOrigin = new BABYLON.Vector3();
  245. linesArray = [];
  246. }
  247.  
  248. lineOrigin.copyFrom(myPlayer.actor.mesh.position);
  249.  
  250. const yaw = myPlayer.actor.mesh.rotation.y;
  251.  
  252. lineOrigin.x += Math.sin(yaw);
  253. lineOrigin.z += Math.cos(yaw);
  254. lineOrigin.y += Math.sin(-myPlayer.pitch);
  255.  
  256. for (let i = 0; i < linesArray.length; i++) {
  257. linesArray[i].playerExists = false;
  258. }
  259.  
  260. for (let i = 0; i < players.length; i++) {
  261. const player = players[i];
  262.  
  263. if (!player || player === myPlayer) {
  264. continue;
  265. }
  266.  
  267. if (player.sphere === undefined) {
  268. console.log('Adding sphere...');
  269. const material = new BABYLON.StandardMaterial('myMaterial', player.actor.scene);
  270. material.emissiveColor = material.diffuseColor = new BABYLON.Color3(1, 0, 0);
  271. material.wireframe = true;
  272.  
  273. const sphere = BABYLON.MeshBuilder.CreateBox('mySphere', { width: 0.5, height: 0.75, depth: 0.5 }, player.actor.scene);
  274. sphere.material = material;
  275. sphere.position.y = 0.3;
  276.  
  277. sphere.parent = player.actor.mesh;
  278.  
  279. player.sphere = sphere;
  280. }
  281.  
  282. if (player.lines === undefined) {
  283. const options = {
  284. points: [lineOrigin, player.actor.mesh.position],
  285. updatable: true
  286. };
  287.  
  288. const lines = options.instance = BABYLON.MeshBuilder.CreateLines('lines', options, player.actor.scene);
  289. lines.color = new BABYLON.Color3(1, 0, 0);
  290. lines.alwaysSelectAsActiveMesh = true;
  291. lines.renderingGroupId = 1;
  292.  
  293. player.lines = lines;
  294. player.lineOptions = options;
  295.  
  296. linesArray.push(lines);
  297.  
  298. console.log('%cAdding line...', 'color: green; background: black; font-size: 2em;');
  299. }
  300.  
  301. player.lines.playerExists = true;
  302. player.lines = BABYLON.MeshBuilder.CreateLines('lines', player.lineOptions);
  303.  
  304. player.sphere.renderingGroupId = espEnabled ? 1 : 0;
  305. player.sphere.visibility = (aimbotEnabled || espEnabled) && myPlayer !== player && (myPlayer.team === 0 || myPlayer.team !== player.team);
  306.  
  307. player.lines.visibility = player.playing && player.sphere.visibility && showLines;
  308. }
  309.  
  310. for (let i = 0; i < linesArray.length; i++) {
  311. if (!linesArray[i].playerExists) {
  312. console.log('%cRemoving line...', 'color: red; background: black; font-size: 2em;');
  313. linesArray[i].dispose();
  314. linesArray.splice(i, 1);
  315. }
  316. }
  317.  
  318. if (aimbotEnabled && (aimbotOnRightMouse ? rightMouseDown : true) && myPlayer.playing) {
  319. let minDistance = Infinity;
  320. let targetPlayer;
  321.  
  322. for (let i = 0; i < players.length; i++) {
  323. const player = players[i];
  324.  
  325. if (player && player !== myPlayer && player.playing && (myPlayer.team === 0 || player.team !== myPlayer.team)) {
  326. const distance = Math.hypot(player.x - myPlayer.x, player.y - myPlayer.y, player.z - myPlayer.z);
  327.  
  328. if (distance < minDistance) {
  329. minDistance = distance;
  330. targetPlayer = player;
  331. }
  332. }
  333. }
  334.  
  335. if (targetPlayer) {
  336. const x = targetPlayer.actor.mesh.position.x - myPlayer.actor.mesh.position.x;
  337. const y = targetPlayer.actor.mesh.position.y - myPlayer.actor.mesh.position.y;
  338. const z = targetPlayer.actor.mesh.position.z - myPlayer.actor.mesh.position.z;
  339.  
  340. myPlayer.yaw = Math.radAdd(Math.atan2(x, z), 0);
  341. myPlayer.pitch = -Math.atan2(y, Math.hypot(x, z)) % 1.5;
  342. }
  343. }
  344. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement