Shell Shockers | Sound Hacks

9/30/2024, 9:45:17 PM

  1. // ==UserScript==
  2. // @name Shell Shockers | Sound Hacks
  3. // @grant GM_setValue
  4. // @grant GM_getValue
  5. // @grant GM_deleteValue
  6. // @grant GM_listValues
  7. // @grant GM_info
  8. // @grant GM_setClipboard
  9. // @grant GM_openInTab
  10. //
  11. // @grant GM.setValue
  12. // @grant GM.getValue
  13. // @grant GM.deleteValue
  14. // @grant GM.listValues
  15. // @grant GM.info
  16. // @grant GM.setClipboard
  17. // @grant GM.openInTab
  18.  
  19. // @version 2.5
  20. // @author wish?
  21. // @description 9/30/2024, 9:45:17 PM
  22.  
  23. // @match *://*.shellshock.io/*
  24. // @match *://*.shell.onlypuppy7.online/*
  25. // @match *://*.algebra.best/*
  26. // @match *://*.algebra.vip/*
  27. // @match *://*.biologyclass.club/*
  28. // @match *://*.deadlyegg.com/*
  29. // @match *://*.deathegg.world/*
  30. // @match *://*.eggboy.club/*
  31. // @match *://*.eggboy.xyz/*
  32. // @match *://*.eggcombat.com/*
  33. // @match *://*.egg.dance/*
  34. // @match *://*.eggfacts.fun/*
  35. // @match *://*.egghead.institute/*
  36. // @match *://*.eggisthenewblack.com/*
  37. // @match *://*.eggsarecool.com/*
  38. // @match *://*.geometry.best/*
  39. // @match *://*.geometry.monster/*
  40. // @match *://*.geometry.pw/*
  41. // @match *://*.geometry.report/*
  42. // @match *://*.hardboiled.life/*
  43. // @match *://*.hardshell.life/*
  44. // @match *://*.humanorganising.org/*
  45. // @match *://*.mathactivity.xyz/*
  46. // @match *://*.mathactivity.club/*
  47. // @match *://*.mathdrills.info/*
  48. // @match *://*.mathdrills.life/*
  49. // @match *://*.mathfun.rocks/*
  50. // @match *://*.mathgames.world/*
  51. // @match *://*.math.international/*
  52. // @match *://*.mathlete.fun/*
  53. // @match *://*.mathlete.pro/*
  54. // @match *://*.overeasy.club/*
  55. // @match *://*.risenegg.com/*
  56. // @match *://*.scrambled.tech/*
  57. // @match *://*.scrambled.today/*
  58. // @match *://*.scrambled.us/*
  59. // @match *://*.scrambled.world/*
  60. // @match *://*.shellshockers.club/*
  61. // @match *://*.shellshockers.life/*
  62. // @match *://*.shellshockers.site/*
  63. // @match *://*.shellshockers.us/*
  64. // @match *://*.shellshockers.world/*
  65. // @match *://*.shellshockers.xyz/*
  66. // @match *://*.shellsocks.com/*
  67. // @match *://*.softboiled.club/*
  68. // @match *://*.urbanegger.com/*
  69. // @match *://*.violentegg.club/*
  70. // @match *://*.violentegg.fun/*
  71. // @match *://*.yolk.best/*
  72. // @match *://*.yolk.life/*
  73. // @match *://*.yolk.rocks/*
  74. // @match *://*.yolk.tech/*
  75. // @match *://*.yolk.quest/*
  76. // @match *://*.yolk.today/*
  77. // @match *://*.zygote.cafe/*
  78. // @match *://*.shellshockers.best/*
  79. // @match *://*.eggboy.me/*
  80. // @grant none
  81. // @run-at document-start
  82. // @require https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js
  83. // @require https://cdn.jsdelivr.net/npm/tweakpane@3.1.10/dist/tweakpane.min.js
  84. // @require https://cdn.jsdelivr.net/npm/@tweakpane/plugin-essentials@0.1.8/dist/tweakpane-plugin-essentials.min.js
  85. // @require https://cdnjs.cloudflare.com/ajax/libs/jszip/3.7.1/jszip.min.js
  86. //
  87. // @license MIT
  88. // @namespace https://greasyfork.org/users/1361048
  89. // ==/UserScript==
  90. // (function () {
  91. // const consoleMethods = ["log", "warn", "info", "error", "exception", "table", "trace"];
  92. // const _innerConsole = console;
  93.  
  94. // consoleMethods.forEach((method) => {
  95. // if (unsafeWindow.console[method]) {
  96. // Object.defineProperty(unsafeWindow.console, method, {
  97. // configurable: false,
  98. // get: (...args) => {
  99. // return _innerConsole[method].bind(_innerConsole);
  100. // },
  101. // set: () => {},
  102. // });
  103. // }
  104. // });
  105. // })();
  106. (function () {
  107. let noPointerPause;
  108. const clientKeysURL = `https://js.getstate.farm/vardata/`;
  109. let ss;
  110. let F = [];
  111. let H = {};
  112. let functionNames = [];
  113. let keyRetrieved = false;
  114.  
  115. const tp = {
  116. soundsFolder: {
  117. crackshot: "default",
  118. "egg-k": "default",
  119. scrambler: "default",
  120. "free-ranger": "default",
  121. rpegg: "default",
  122. whipper: "default",
  123. "tri-hard": "default",
  124. pistol: "default",
  125. },
  126. meleeSounds: {
  127. melee: "default",
  128. },
  129. bindsFolder: {
  130. hidePanel: localStorage.getItem("tp-hidePanel") || "h",
  131. refreshSounds: localStorage.getItem("tp-refreshSounds") || "g",
  132. },
  133. };
  134.  
  135. function refreshSounds() {
  136. updatedNeeded = true; // this updates the weapons
  137.  
  138. keyRetrieved = false; // this will grab the key necessary
  139. }
  140.  
  141. let updatedNeeded = false;
  142.  
  143. const patterns = {
  144. sound: /"sound\/sounds\.json\?"\+(..)/,
  145. scope: /,this\.(..)\.position\.z=2/,
  146. teamColors: /([A-Za-z]+)=\{text:\["#fff100","#00ffff","#f53e40"\]/g,
  147. killsText: /(.)\=\'\<span style.*?;/,
  148. lastDmg: /\([A-Za-z$_]\.lastDmgType\=([A-Za-z$_]).*?{/,
  149. weapon: /this\.([a-zA-Z0-9_$]+)\=\"gun\_/,
  150. };
  151.  
  152. const startUp = function () {
  153. console.log("startup");
  154. injectScript();
  155. console.log("after startup");
  156. };
  157.  
  158. let originalReplace = String.prototype.replace;
  159. let originalReplaceAll = String.prototype.replaceAll;
  160.  
  161. String.prototype.originalReplace = function () {
  162. return originalReplace.apply(this, arguments);
  163. };
  164. String.prototype.originalReplaceAll = function () {
  165. return originalReplaceAll.apply(this, arguments);
  166. };
  167.  
  168. const log = function (...args) {
  169. let condition;
  170. try {
  171. condition = false;
  172. } catch (error) {
  173. condition = GM_getValue(storageKey + "DisableLogs");
  174. }
  175. if (!condition) {
  176. console.log(...args);
  177. }
  178. };
  179.  
  180. const fetchTextContent = function (url) {
  181. try {
  182. var xhr = new XMLHttpRequest();
  183. xhr.open("GET", url, false);
  184. xhr.send();
  185. if (xhr.status === 200) {
  186. return xhr.responseText;
  187. } else {
  188. console.error("Error fetching " + url);
  189. return null;
  190. }
  191. } catch (err) {
  192. return null;
  193. }
  194. };
  195. const findKeyWithProperty = function (obj, propertyToFind) {
  196. for (const key in obj) {
  197. if (obj[key] === null || obj[key] === undefined) {
  198. continue;
  199. }
  200. if (!!obj[key] && (typeof obj[key] == "object" || typeof obj[key] == "function") && obj[key].hasOwnProperty(propertyToFind)) {
  201. return key;
  202. }
  203. }
  204. // Property not found
  205. return null;
  206. };
  207. const getScrambled = () => Array.from({ length: 10 }, () => String.fromCharCode(97 + Math.floor(Math.random() * 26))).join("");
  208. const createAnonFunction = function (name, func) {
  209. const funcName = getScrambled();
  210. unsafeWindow[funcName] = func;
  211. unsafeWindow[funcName] = function () {
  212. try {
  213. return func.apply(this, arguments);
  214. } catch (error) {
  215. log("Error in anonymous function:", error);
  216. }
  217. };
  218.  
  219. F[name] = unsafeWindow[funcName];
  220. functionNames[name] = funcName;
  221. };
  222.  
  223. const injectScript = function () {
  224. createAnonFunction("retrieveFunctions", function (vars) {
  225. // console.log(vars)
  226. ss = vars;
  227. unsafeWindow.globalSS = vars;
  228. // console.log("lmao");
  229.  
  230. F.customSounds();
  231. });
  232.  
  233. createAnonFunction("customSounds", function () {
  234. unsafeWindow.globalSS.PLAYERS.forEach((PLAYER) => {
  235. let H = unsafeWindow.H;
  236. if (PLAYER.hasOwnProperty("ws")) {
  237. unsafeWindow.globalSS.MYPLAYER = PLAYER;
  238. }
  239. if (unsafeWindow.globalSS.MYPLAYER) {
  240. let myWeapon = unsafeWindow.globalSS.MYPLAYER.weapons[0][H.actor][H.extra.weapon];
  241. let changeSound = unsafeWindow.globalSS.MYPLAYER.weapons[0][H.actor];
  242.  
  243. if (updatedNeeded) {
  244. if (myWeapon === "gun_m24") {
  245. changeSound.fireSound = `gun_m24_${tp.soundsFolder["crackshot"]}`;
  246. // console.log("inside the if block", changeSound);
  247. }
  248. if (myWeapon === "gun_eggk47") {
  249. changeSound.fireSound = `gun_eggk47_${tp.soundsFolder["egg-k"]}`;
  250. }
  251. if (myWeapon === "gun_dozenGauge") {
  252. changeSound.fireSound = `gun_dozenGauge_${tp.soundsFolder["scrambler"]}`;
  253. }
  254. if (myWeapon === "gun_csg1") {
  255. changeSound.fireSound = `gun_csg1_${tp.soundsFolder["free-ranger"]}`;
  256. }
  257. if (myWeapon === "gun_rpegg") {
  258. changeSound.fireSound = `gun_rpegg_${tp.soundsFolder["rpegg"]}`;
  259. }
  260. if (myWeapon === "gun_smg") {
  261. changeSound.fireSound = `gun_smg_${tp.soundsFolder["whipper"]}`;
  262. }
  263. if (myWeapon === "gun_aug") {
  264. changeSound.fireSound = `gun_aug_${tp.soundsFolder["tri-hard"]}`;
  265. }
  266. // console.log(changeSound)
  267.  
  268. // MELEE
  269. unsafeWindow.globalSS.MYPLAYER.meleeWeapon[H.actor].swingSounds = tp.meleeSounds["melee"];
  270.  
  271. // PISTOL
  272. unsafeWindow.globalSS.MYPLAYER.weapons[1][H.actor].fireSound = `gun_cluck9mm_${tp.soundsFolder["pistol"]}`;
  273. updatedNeeded = false;
  274. }
  275. }
  276. });
  277.  
  278. H.actor = findKeyWithProperty(unsafeWindow.globalSS.MYPLAYER, H.mesh);
  279. });
  280.  
  281. let _apc = HTMLElement.prototype.appendChild;
  282.  
  283. HTMLElement.prototype.appendChild = function(node) {
  284. if (node.tagName === 'SCRIPT' && node.innerHTML && node.innerHTML.startsWith('(()=>{')) {
  285. node.innerHTML = applyScript(node.innerHTML);
  286. }
  287. return _apc.call(this, node);
  288. }
  289.  
  290. function sha256(str) {
  291. const utf8 = new TextEncoder().encode(str);
  292. const k = Uint32Array.of(
  293. 0x428a2f98,
  294. 0x71374491,
  295. 0xb5c0fbcf,
  296. 0xe9b5dba5,
  297. 0x3956c25b,
  298. 0x59f111f1,
  299. 0x923f82a4,
  300. 0xab1c5ed5,
  301. 0xd807aa98,
  302. 0x12835b01,
  303. 0x243185be,
  304. 0x550c7dc3,
  305. 0x72be5d74,
  306. 0x80deb1fe,
  307. 0x9bdc06a7,
  308. 0xc19bf174,
  309. 0xe49b69c1,
  310. 0xefbe4786,
  311. 0x0fc19dc6,
  312. 0x240ca1cc,
  313. 0x2de92c6f,
  314. 0x4a7484aa,
  315. 0x5cb0a9dc,
  316. 0x76f988da,
  317. 0x983e5152,
  318. 0xa831c66d,
  319. 0xb00327c8,
  320. 0xbf597fc7,
  321. 0xc6e00bf3,
  322. 0xd5a79147,
  323. 0x06ca6351,
  324. 0x14292967,
  325. 0x27b70a85,
  326. 0x2e1b2138,
  327. 0x4d2c6dfc,
  328. 0x53380d13,
  329. 0x650a7354,
  330. 0x766a0abb,
  331. 0x81c2c92e,
  332. 0x92722c85,
  333. 0xa2bfe8a1,
  334. 0xa81a664b,
  335. 0xc24b8b70,
  336. 0xc76c51a3,
  337. 0xd192e819,
  338. 0xd6990624,
  339. 0xf40e3585,
  340. 0x106aa070,
  341. 0x19a4c116,
  342. 0x1e376c08,
  343. 0x2748774c,
  344. 0x34b0bcb5,
  345. 0x391c0cb3,
  346. 0x4ed8aa4a,
  347. 0x5b9cca4f,
  348. 0x682e6ff3,
  349. 0x748f82ee,
  350. 0x78a5636f,
  351. 0x84c87814,
  352. 0x8cc70208,
  353. 0x90befffa,
  354. 0xa4506ceb,
  355. 0xbef9a3f7,
  356. 0xc67178f2
  357. );
  358. let h = Uint32Array.of(0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19);
  359.  
  360. const pad = new Uint8Array(((utf8.length + 9) & ~63) + 64);
  361. pad.set(utf8), (pad[utf8.length] = 0x80);
  362. new DataView(pad.buffer).setUint32(pad.length - 4, utf8.length << 3, false);
  363.  
  364. let w = new Uint32Array(64),
  365. v,
  366. i,
  367. j,
  368. a,
  369. b,
  370. c,
  371. d,
  372. e,
  373. f,
  374. g,
  375. h0,
  376. S0,
  377. S1,
  378. ch,
  379. maj,
  380. temp1,
  381. temp2;
  382. for (i = 0; i < pad.length; i += 64) {
  383. v = new DataView(pad.buffer, i, 64);
  384. for (j = 0; j < 16; j++) w[j] = v.getUint32(j << 2, false);
  385. for (; j < 64; j++)
  386. w[j] =
  387. (w[j - 16] +
  388. ((w[j - 15] >>> 7) ^ (w[j - 15] << 25) ^ (w[j - 15] >>> 18) ^ (w[j - 15] << 14) ^ (w[j - 15] >>> 3)) +
  389. w[j - 7] +
  390. ((w[j - 2] >>> 17) ^ (w[j - 2] << 15) ^ (w[j - 2] >>> 19) ^ (w[j - 2] << 13) ^ (w[j - 2] >>> 10))) >>>
  391. 0;
  392.  
  393. [a, b, c, d, e, f, g, h0] = h;
  394. for (j = 0; j < 64; j++) {
  395. S1 = ((e >>> 6) | (e << 26)) ^ ((e >>> 11) | (e << 21)) ^ ((e >>> 25) | (e << 7));
  396. ch = (e & f) ^ (~e & g);
  397. temp1 = (h0 + S1 + ch + k[j] + w[j]) >>> 0;
  398. S0 = ((a >>> 2) | (a << 30)) ^ ((a >>> 13) | (a << 19)) ^ ((a >>> 22) | (a << 10));
  399. maj = (a & b) ^ (a & c) ^ (b & c);
  400. temp2 = (S0 + maj) >>> 0;
  401. (h0 = g), (g = f), (f = e), (e = (d + temp1) >>> 0), (d = c), (c = b), (b = a), (a = (temp1 + temp2) >>> 0);
  402. }
  403. (h[0] += a), (h[1] += b), (h[2] += c), (h[3] += d), (h[4] += e), (h[5] += f), (h[6] += g), (h[7] += h0);
  404. }
  405. // console.log(str);
  406.  
  407. return h.reduce((s, x) => s + x.toString(16).padStart(8, "0"), "");
  408. }
  409.  
  410. const applyScript = function (js) {
  411. let match;
  412. let clientKeys;
  413.  
  414. let originalJS = fetchTextContent("/js/shellshock.js");
  415.  
  416. const getVardata = function (hash) {
  417. return fetchTextContent(clientKeysURL + "latest.json?v=" + Date.now());
  418. };
  419.  
  420. let hash = sha256(originalJS);
  421. // console.log(hash);
  422. let onlineClientKeys = getVardata(hash);
  423.  
  424. try {
  425. clientKeys = JSON.parse(onlineClientKeys);
  426. } catch (e) {
  427. console.error(e);
  428. }
  429.  
  430. let H = clientKeys.vars;
  431. let C = clientKeys.commCodes?.codes;
  432.  
  433. const soundVar = patterns.sound.exec(js)[1];
  434. const scopeVar = patterns.scope.exec(js)[1];
  435. H.extra = {
  436. sound: soundVar,
  437. scope: scopeVar,
  438. teamColors: patterns.teamColors.exec(js)[1],
  439. killsText: patterns.killsText.exec(js),
  440. lastDmg: patterns.lastDmg.exec(js),
  441. weapon: patterns.weapon.exec(js)[1],
  442. };
  443. unsafeWindow.H = H;
  444.  
  445. let injectionString = "";
  446.  
  447. try {
  448. //SERVERSYNC
  449. match = new RegExp(`function serverSync\\(\\)\\{(.*?)\\)\\}`).exec(js);
  450. log("SERVERSYNC:", match);
  451. H.SERVERSYNC = match ? match[1].replace(/[a-zA-Z$_\.\[\]]+shots/, 0) + ")" : "function(){log('no serversync womp womp')}";
  452. //PAUSE
  453. match = new RegExp(`,setTimeout\\(\\(\\(\\)=>\\{([=A-z0-9\\(\\),\\{ \\.;!\\|\\?:\\}]+send\\([a-zA-Z$_]+\\))`).exec(js);
  454. log("PAUSE:", match);
  455. H.PAUSE = match ? `function(){${match[1]}}` : "function(){log('no pause womp womp')}";
  456.  
  457. const variableNameRegex = /^[a-zA-Z0-9_$\[\]"\\\.,]*$/;
  458. console.log(H);
  459. for (let name in H) {
  460. let deobf = H[name];
  461. if (name == "SERVERSYNC" || name == "PAUSE" || variableNameRegex.test(deobf)) {
  462. //serversync should only be defined just before...
  463. injectionString = `${injectionString}${name}: (() => { let variable = "value_undefined"; try { eval("variable = ${deobf};"); } catch (error) { return "value_undefined"; }; return variable; })(),`;
  464. } else {
  465. }
  466. }
  467. console.log(injectionString);
  468.  
  469. log("%cSTATEFARM INJECTION STAGE 1: GATHER VARS", "color: yellow; font-weight: bold; font-size: 1.2em; text-decoration: underline;");
  470.  
  471. const modifyJS = function (find, replace) {
  472. let oldJS = js;
  473. try {
  474. js = js.originalReplaceAll(find, replace);
  475. } catch (err) {
  476. console.log(
  477. "%cReplacement failed! Likely a required var was not found. Attempted to replace " + find + " with: " + replace,
  478. "color: red; font-weight: bold; font-size: 0.6em; text-decoration: italic;"
  479. );
  480. }
  481. if (oldJS !== js) {
  482. console.log(
  483. "%cReplacement successful! Injected code: replaced: " + find + " with: " + replace,
  484. "color: green; font-weight: bold; font-size: 0.6em; text-decoration: italic;"
  485. );
  486. } else {
  487. console.log(
  488. "%cReplacement failed! Attempted to replace " + find + " with: " + replace,
  489. "color: red; font-weight: bold; font-size: 0.6em; text-decoration: italic;"
  490. );
  491. }
  492. };
  493.  
  494. const f = function (varName) {
  495. return varName.replace("$", "\\$");
  496. };
  497. const FUNCTIONPARAM = new RegExp("function " + f(H._connectFail) + "\\(([a-zA-Z$_]+)\\)").exec(js)[1];
  498. modifyJS(
  499. f(H.SCENE) + "." + f(H.render),
  500. `window["${functionNames.retrieveFunctions}"]({${injectionString}},true)||${f(H.SCENE)}.render`
  501. );
  502.  
  503. log(H, "last");
  504. return js;
  505. } catch (e) {
  506. console.log(e);
  507. }
  508. };
  509. };
  510. // injectScript();
  511. startUp();
  512.  
  513. function waitForElement(selector) {
  514. return new Promise((resolve) => {
  515. const intervalId = setInterval(() => {
  516. const element = document.querySelector(selector);
  517. if (element) {
  518. clearInterval(intervalId);
  519. resolve(element);
  520. }
  521. }, 100);
  522. });
  523. }
  524.  
  525.  
  526. function createFolders(NFolder) {
  527. let test = pane.addFolder({
  528. title: NFolder,
  529. expanded: false,
  530. });
  531. return test;
  532. }
  533.  
  534. function addInputWithValidation(folder, obj, property, label) {
  535. folder.addInput(obj, property, { label: label }).on("change", (value) => {
  536. if (value.value.length > 1) {
  537. value.value = "Enter toggle";
  538. value.target.controller_.binding.value.rawValue_ = "Enter toggle";
  539. unsafeWindow.alert("Please enter a single key");
  540. } else {
  541. const store = value.value.replace(/"/g, "");
  542. localStorage.setItem(`tp-${property}`, store);
  543. }
  544. });
  545. }
  546.  
  547. const makeDraggable = function (element, notMenu) {
  548. if (element) {
  549. let offsetX, offsetY;
  550. element.addEventListener("mousedown", function (e) {
  551. const dragElement = function (e) {
  552. const x = ((e.clientX - offsetX) / unsafeWindow.innerWidth) * 100;
  553. const y = ((e.clientY - offsetY) / unsafeWindow.innerHeight) * 100;
  554. const maxX = 100 - (element.offsetWidth / unsafeWindow.innerWidth) * 100;
  555. const maxY = 100 - (element.offsetHeight / unsafeWindow.innerHeight) * 100;
  556. element.style.left = `${Math.max(0, Math.min(x, maxX))}%`;
  557. element.style.top = `${Math.max(0, Math.min(y, maxY))}%`;
  558. };
  559. if (notMenu || e.target.classList.contains("tp-rotv_t")) {
  560. offsetX = e.clientX - element.getBoundingClientRect().left;
  561. offsetY = e.clientY - element.getBoundingClientRect().top;
  562. document.addEventListener("mousemove", dragElement);
  563. document.addEventListener("mouseup", function () {
  564. document.removeEventListener("mousemove", dragElement);
  565. });
  566. e.preventDefault(); // Prevent text selection during drag
  567. }
  568. });
  569. }
  570. };
  571.  
  572.  
  573. //TWEAKPANE CODE
  574. const Tweakpane = window.Tweakpane;
  575. const pane = new Tweakpane.Pane({
  576. title: "WISH",
  577. expanded: true,
  578. });
  579. const paneEl = document.querySelector("div.tp-dfwv");
  580. paneEl.style.zIndex = 100000;
  581. paneEl.style.width = "300px";
  582. makeDraggable(document.querySelector(".tp-dfwv"));
  583.  
  584. //FUNCTION TO CREATE FOLDERS
  585. function createFolders(NFolder) {
  586. let test = pane.addFolder({
  587. title: NFolder,
  588. expanded: false,
  589. });
  590. return test;
  591. }
  592.  
  593. // CREATE FOLDERS
  594. const soundsFolder = createFolders("Sounds");
  595. const addSettings = createFolders("Additional Settings");
  596. const bindsFolder = createFolders("Binds");
  597.  
  598. // ADD BLADES
  599. soundsFolder.addInput(tp.soundsFolder, "crackshot", {
  600. label: "Crackshot",
  601. options: {
  602. Default: "fire",
  603. Valkyrie: "Valkyrie_fire",
  604. Chess: "Chess_fire",
  605. Retro: "Retro_fire",
  606. BadEgg: "Badegg_fire",
  607. Cyborg: "Cyborg_fire",
  608. Fusion: "Fusion_fire",
  609. Techno: "Techno_fire",
  610. Infernal: "Infernal_fire",
  611. Quack: "Quackshot_fire",
  612. Scavenger: "Scavenger_fire",
  613. "8bit": "fire_m24_8bit",
  614. "Silenced (Fake)": "",
  615. },
  616. });
  617.  
  618. soundsFolder.addInput(tp.soundsFolder, "egg-k", {
  619. label: "Egg-k",
  620. options: {
  621. Default: "fire",
  622. Alien: "Alien_fire",
  623. Retro: "Retro_fire",
  624. Fusion: "Fusion_fire",
  625. Techno: "Techno_fire",
  626. Infernal: "Infernal_fire",
  627. Steambot: "Steambot_fire",
  628. Valkyrie: "Valkyrie_fire",
  629. Chocolate: "Chocolate_fire",
  630. "Infernal-2": "Infernal2_fire",
  631. },
  632. });
  633.  
  634. soundsFolder.addInput(tp.soundsFolder, "scrambler", {
  635. label: "Scrambler",
  636. options: {
  637. Default: "fire",
  638. Irish: "Irish_fire",
  639. Retro: "Retro_fire",
  640. Clouds: "Clouds_fire",
  641. Fusion: "Fusion_fire",
  642. Techno: "Techno_fire",
  643. Fantasy: "Fantasy_fire",
  644. Octopus: "Octopus_fire",
  645. Infernal: "Infernal_fire",
  646. Steambot: "Steambot_fire",
  647. Valkyrie: "Valkyrie_fire",
  648. Basketball: "Basketball_fire",
  649. },
  650. });
  651.  
  652. soundsFolder.addInput(tp.soundsFolder, "free-ranger", {
  653. label: "Free-Ranger",
  654. options: {
  655. Default: "fire",
  656. Retro: "Retro_fire",
  657. Fusion: "Fusion_fire",
  658. Techno: "Techno_fire",
  659. Infernal: "Infernal_fire",
  660. "Space-Egg": "spaceEgg_fire",
  661. Steambot: "Steambot_fire",
  662. Valkyrie: "Valkyrie_fire",
  663. Shellpreme: "Shellpreme_fire",
  664. RubberChicken: "RubberChicken_fire",
  665. },
  666. });
  667.  
  668. soundsFolder.addInput(tp.soundsFolder, "rpegg", {
  669. label: "Rpegg",
  670. options: {
  671. Default: "fire",
  672. Retro: "Retro_fire",
  673. Fusion: "Fusion_fire",
  674. Techno: "Techno_fire",
  675. Infernal: "Infernal_fire",
  676. Skeleton: "Skeleton_fire",
  677. Valkyrie: "Valkyrie_fire",
  678. Christmas: "Christmas_fire",
  679. },
  680. });
  681.  
  682. soundsFolder.addInput(tp.soundsFolder, "whipper", {
  683. label: "Whipper",
  684. options: {
  685. Default: "fire",
  686. Retro: "Retro_fire",
  687. Fusion: "Fusion_fire",
  688. Techno: "Techno_fire",
  689. Pumpkin: "Pumpkin_fire",
  690. Infernal: "Infernal_fire",
  691. Valkyrie: "Valkyrie_fire",
  692. "Special-Turkey": "SpecialTurkey_fire",
  693. },
  694. });
  695.  
  696. soundsFolder.addInput(tp.soundsFolder, "tri-hard", {
  697. label: "Tri-Hard",
  698. options: {
  699. Default: "fire",
  700. Cupid: "Cupid_fire",
  701. Fusion: "Fusion_fire",
  702. Retro: "Retro_fire",
  703. Infernal: "Infernal_fire",
  704. Techno: "Techno_fire_a",
  705. "Techno-B": "Techno_fire_b",
  706. Valkyrie: "Valkyrie_fire",
  707. Pumpkinpie: "Pumpkinpie_fire",
  708. },
  709. });
  710.  
  711. soundsFolder.addInput(tp.meleeSounds, "melee", {
  712. label: "Melee",
  713. options: {
  714. Default: ["melee_whisk_a"],
  715. Carver: ["melee_carver"],
  716. Cup: ["melee_cup_a", "melee_cup_b"],
  717. Eggpan: ["melee_eggpan"],
  718. Elf: ["melee_elf_a", "melee_elf_b"],
  719. Fish: ["melee_gfish_a", "melee_gfish_b"],
  720. Harrison: ["melee_harrison"],
  721. Infernal: ["melee_infernal"],
  722. Keytar: ["melee_keytar"],
  723. Mayan: ["melee_mayan"],
  724. Nutcracker: ["melee_nutcracker"],
  725. Pickleball: ["melee_pickleball"],
  726. Plunger: ["melee_plunger"],
  727. "Proper-Fish (idk)": ["melee_properfish_a", "melee_properfish_b"],
  728. Retro: ["melee_retro"],
  729. Rock: ["melee_rock"],
  730. Steambot: ["melee_steambot"],
  731. Techno: ["melee_techno"],
  732. Valkyrie: ["melee_valkyrie"],
  733. Zombie: ["melee_zombie"],
  734. },
  735. });
  736.  
  737. soundsFolder.addInput(tp.soundsFolder, "pistol", {
  738. label: "Pistol",
  739. options: {
  740. Default: "fire",
  741. Retro: "Retro_fire",
  742. Camera: "Camera_fire",
  743. Clouds: "Clouds_fire",
  744. Fusion: "Fusion_fire",
  745. Techno: "Techno_fire",
  746. Infernal: "Infernal_fire",
  747. "Space-Egg": "spaceEgg_fire",
  748. Steambot: "Steambot_fire",
  749. Valkyrie: "Valkyrie_fire",
  750. Megaphone: "Megaphone_fire",
  751. "Cubic-Castle": "CubicCastles_fire",
  752. },
  753. });
  754.  
  755. function refreshSounds() {
  756. updatedNeeded = true; // this updates the weapons
  757.  
  758. keyRetrieved = false; // this will grab the key necessary
  759. }
  760.  
  761. soundsFolder.on("change", (value) => {
  762. // console.log('Selected sound:', value);
  763. // console.log(tp.soundsFolder);
  764. refreshSounds();
  765. // Handle the sound change logic here
  766. localStorage.setItem("customSounds", JSON.stringify(tp.soundsFolder));
  767. });
  768.  
  769. addSettings
  770. .addButton({
  771. title: `Click if sounds didn\'t update`,
  772. })
  773. .on("click", () => {
  774. updatedNeeded = true;
  775. keyRetrieved = false;
  776. });
  777.  
  778. // BINDS FOLDER
  779. function addInputWithValidation(folder, obj, property, label) {
  780. folder.addInput(obj, property, { label: label }).on("change", (value) => {
  781. if (value.value.length > 1) {
  782. value.value = "Enter toggle";
  783. value.target.controller_.binding.value.rawValue_ = "Enter toggle";
  784. window.alert("Please enter a single key");
  785. } else {
  786. const store = value.value.replace(/"/g, "");
  787. localStorage.setItem(`tp-${property}`, store);
  788. }
  789. });
  790. }
  791. addInputWithValidation(bindsFolder, tp.bindsFolder, "hidePanel", "Hide Panel");
  792. addInputWithValidation(bindsFolder, tp.bindsFolder, "refreshSounds", "Refresh Sounds");
  793.  
  794. document.addEventListener("keydown", (e) => {
  795. if (e.key === tp.bindsFolder.hidePanel) {
  796. paneEl.style.display = paneEl.style.display === "block" ? "none" : "block";
  797. }
  798. if (e.key === tp.bindsFolder.refreshSounds) {
  799. refreshSounds();
  800. }
  801. });
  802. })();