Shell Shockers Aimbot & ESP: StateFarm Client V3 - Bloom, Chat, Botting, Unban & More, shellshock.io

Fixed for 0.48.3! Advanced, Open Source, No Ads. Best cheats menu for shellshock.io 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, easily editable color scheme and themes - all on the fly!

Per 25-10-2024. Zie de nieuwste versie.

  1. // ==UserScript==
  2. // @name Shell Shockers Aimbot & ESP: StateFarm Client V3 - Bloom, Chat, Botting, Unban & More, shellshock.io
  3. // @description Fixed for 0.48.3! Advanced, Open Source, No Ads. Best cheats menu for shellshock.io 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, easily editable color scheme and themes - all on the fly!
  4. // @author Hydroflame521, onlypuppy7, enbyte, notfood, 1ust, OakSwingZZZ, Seq and de_Neuublue
  5. // @namespace http://github.com/Hydroflame522/StateFarmClient/
  6. // @supportURL http://github.com/Hydroflame522/StateFarmClient/issues/
  7. // @license GPL-3.0
  8. // @run-at document-start
  9.  
  10. // @grant GM_setValue
  11. // @grant GM_getValue
  12. // @grant GM_deleteValue
  13. // @grant GM_listValues
  14. // @grant GM_info
  15. // @grant GM_setClipboard
  16. // @grant GM_openInTab
  17.  
  18. // @grant GM.setValue
  19. // @grant GM.getValue
  20. // @grant GM.deleteValue
  21. // @grant GM.listValues
  22. // @grant GM.info
  23. // @grant GM.setClipboard
  24. // @grant GM.openInTab
  25.  
  26. // @icon https://raw.githubusercontent.com/Hydroflame522/StateFarmClient/main/icons/StateFarmClientLogo384px.png
  27.  
  28. // @require https://cdn.jsdelivr.net/npm/tweakpane@3.1.10/dist/tweakpane.min.js
  29. // @require https://cdn.jsdelivr.net/npm/@tweakpane/plugin-essentials@0.1.8/dist/tweakpane-plugin-essentials.min.js
  30. // @require https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.1.1/crypto-js.min.js
  31. // @require https://cdnjs.cloudflare.com/ajax/libs/jszip/3.7.1/jszip.min.js
  32.  
  33. // version naming:
  34. //3.#.#-pre[number] for development versions, increment for every commit (not full release) note: please increment it
  35. //3.#.#-release for release (in the unlikely event that happens)
  36. // this ensures that each version of the script is counted as different
  37.  
  38. // @version 3.4.1-pre129
  39.  
  40. // @match *://*.shellshock.io/*
  41. // @match *://*.shell.onlypuppy7.online/*
  42. // @match *://*.algebra.best/*
  43. // @match *://*.algebra.vip/*
  44. // @match *://*.biologyclass.club/*
  45. // @match *://*.combateggs.com/*
  46. // @match *://*.deadlyegg.com/*
  47. // @match *://*.deathegg.life/*
  48. // @match *://*.deathegg.world/*
  49. // @match *://*.eggbattle.com/*
  50. // @match *://*.eggboy.club/*
  51. // @match *://*.eggboy.me/*
  52. // @match *://*.eggboy.xyz/*
  53. // @match *://*.eggcombat.com/*
  54. // @match *://*.egg.dance/*
  55. // @match *://*.eggfacts.fun/*
  56. // @match *://*.egghead.institute/*
  57. // @match *://*.eggisthenewblack.com/*
  58. // @match *://*.eggsarecool.com/*
  59. // @match *://*.eggshock.com/*
  60. // @match *://*.eggshooter.best/*
  61. // @match *://*.eggshooter.com/*
  62. // @match *://*.eggwarfare.com/*
  63. // @match *://*.geometry.best/*
  64. // @match *://*.geometry.monster/*
  65. // @match *://*.geometry.pw/*
  66. // @match *://*.geometry.report/*
  67. // @match *://*.hardboiled.life/*
  68. // @match *://*.hardshell.life/*
  69. // @match *://*.humanorganising.org/*
  70. // @match *://*.mathactivity.club/*
  71. // @match *://*.mathactivity.xyz/*
  72. // @match *://*.mathdrills.info/*
  73. // @match *://*.mathdrills.life/*
  74. // @match *://*.mathfun.rocks/*
  75. // @match *://*.mathgames.world/*
  76. // @match *://*.math.international/*
  77. // @match *://*.mathlete.fun/*
  78. // @match *://*.mathlete.pro/*
  79. // @match *://*.overeasy.club/*
  80. // @match *://*.risenegg.com/*
  81. // @match *://*.scrambled.tech/*
  82. // @match *://*.scrambled.today/*
  83. // @match *://*.scrambled.us/*
  84. // @match *://*.scrambled.world/*
  85. // @match *://*.shellshockers.best/*
  86. // @match *://*.shellshockers.club/*
  87. // @match *://*.shellshockers.life/*
  88. // @match *://*.shellshockers.site/*
  89. // @match *://*.shellshockers.today/*
  90. // @match *://*.shellshockers.us/*
  91. // @match *://*.shellshockers.wiki/*
  92. // @match *://*.shellshockers.world/*
  93. // @match *://*.shellshockers.xyz/*
  94. // @match *://*.shellsocks.com/*
  95. // @match *://*.softboiled.club/*
  96. // @match *://*.urbanegger.com/*
  97. // @match *://*.violentegg.club/*
  98. // @match *://*.violentegg.fun/*
  99. // @match *://*.yolk.best/*
  100. // @match *://*.yolk.life/*
  101. // @match *://*.yolk.rocks/*
  102. // @match *://*.yolk.tech/*
  103. // @match *://*.yolk.quest/*
  104. // @match *://*.yolk.today/*
  105. // @match *://*.zygote.cafe/*
  106. // ==/UserScript==
  107.  
  108. let attemptedInjection = false;
  109. // log("StateFarm: running (before function)");
  110.  
  111. (function () {
  112. if (typeof isCrackedShell !== 'undefined') alert('CrackedShell v1 is no longer supported. Upgrade to v2.');
  113.  
  114. let crackedShell = typeof $WEBSOCKET !== 'undefined';
  115.  
  116. if (crackedShell) {
  117. GM_getValue = (name) => {
  118. try {
  119. return JSON.parse(localStorage.getItem(name));
  120. } catch {
  121. return localStorage.getItem(name);
  122. };
  123. };
  124. GM_setValue = (name, value) => {
  125. if (typeof value === 'object') localStorage.setItem(name, JSON.stringify(value));
  126. else localStorage.setItem(name, value);
  127. };
  128. GM_listValues = () => localStorage;
  129. GM_deleteValue = (...a) => localStorage.removeItem(...a);
  130. GM_openInTab = (link) => window.open(link, '_blank');
  131. GM_setClipboard = (text, _, callback) => navigator.clipboard.writeText(text).then(() => callback());
  132. unsafeWindow = window;
  133. };
  134.  
  135. const storageKey = "StateFarm_" + (unsafeWindow.document.location.host.replaceAll(".", "")) + "_";
  136. const log = function(...args) {
  137. let condition;
  138. try {
  139. condition = extract("consoleLogs");
  140. } catch (error) {
  141. condition = GM_getValue(storageKey + "DisableLogs");
  142. };
  143. if (!condition) {
  144. console.log(...args);
  145. };
  146. };
  147.  
  148. let originalReplace = String.prototype.replace;
  149. let originalReplaceAll = String.prototype.replaceAll;
  150.  
  151. String.prototype.originalReplace = function () {
  152. return originalReplace.apply(this, arguments);
  153. };
  154. String.prototype.originalReplaceAll = function () {
  155. return originalReplaceAll.apply(this, arguments);
  156. };
  157.  
  158. log("StateFarm: running (after function)");
  159. //script info
  160. const name = "ЅtateFarm Client";
  161. const version = typeof (GM_info) !== 'undefined' ? GM_info.script.version : "3";
  162. const menuTitle = name + " v" + version;
  163. //INIT WEBSITE LINKS: store them here so they are easy to maintain and update!
  164. const discordURL = "https://dsc.gg/sfnetwork";
  165. const githubURL = "https://github.com/Hydroflame522/StateFarmClient";
  166. const downloadURL = "https://update.greasyfork.org/scripts/482982/Shell%20Shockers%20Aimbot%20%20ESP%3A%20StateFarm%20Client%20V3%20-%20Cheats%20For%20Bloom%2C%20Chat%2C%20Botting%2C%20Unbanning%20%20More.user.js";
  167. const updateURL = "https://update.greasyfork.org/scripts/482982/Shell%20Shockers%20Aimbot%20%20ESP%3A%20StateFarm%20Client%20V3%20-%20Cheats%20For%20Bloom%2C%20Chat%2C%20Botting%2C%20Unbanning%20%20More.meta.js";
  168. const scriptInfoURL = "https://greasyfork.org/scripts/482982.json";
  169. const featuresGuideURL = "https://github.com/Hydroflame522/StateFarmClient/tree/main?tab=readme-ov-file#-features";
  170. const bottingGuideURL = "https://github.com/Hydroflame522/StateFarmClient/tree/main?tab=readme-ov-file#-botting";
  171. const violentmonkeyURL = "https://violentmonkey.github.io/get-it/";
  172.  
  173. const babylonURL = "https://cdn.jsdelivr.net/npm/babylonjs@7.15.0/babylon.min.js";
  174.  
  175. const replacementLogoURL = "https://github.com/Hydroflame522/StateFarmClient/blob/main/icons/shell-logo-replacement.png?raw=true";
  176. const replacementLogoHalloweenURL = "https://github.com/Hydroflame522/StateFarmClient/blob/main/icons/shell-logo-replacement-halloween.png?raw=true";
  177.  
  178. const replacementFeedURL = "https://raw.githubusercontent.com/Hydroflame522/StateFarmClient/main/ingamefeeds/";
  179. const commitFeedURL = "https://api.github.com/repos/Hydroflame522/StateFarmClient/commits?path=StateFarmClient.js";
  180. const badgeListURL = "https://raw.githubusercontent.com/Hydroflame522/StateFarmClient/main/ingamebadges/";
  181. const iconURL = "https://raw.githubusercontent.com/Hydroflame522/StateFarmClient/main/icons/StateFarmClientLogo384px.png";
  182. const itsOverURL = "https://github.com/Hydroflame522/StateFarmClient/blob/main/assets/its over/ItsOver4Smaller.png?raw=true";
  183. const sfxURL = "https://api.github.com/repos/Hydroflame522/StateFarmClient/contents/soundpacks/sfx";
  184. const skyboxListURL = "https://api.github.com/repos/Hydroflame522/StateFarmClient/contents/skyboxes/";
  185.  
  186. const shellPrintURL = 'https://shellprint.villainsrule.xyz/v3/account?key=';
  187. const jsArchiveURL = 'https://raw.githubusercontent.com/onlypuppy7/ShellShockJSArchives/main/js_archive/';
  188. const clientKeysURL = "https://raw.githubusercontent.com/StateFarmNetwork/client-keys/main/statefarm_";
  189. const sfChatURL = "https://raw.githack.com/OakSwingZZZ/StateFarmChatFiles/main/index.html";
  190.  
  191. //startup sequence
  192. const startUp = function () {
  193. log("StateFarm: detectURLParams()");
  194. detectURLParams();
  195. log("StateFarm: mainLoop()");
  196. mainLoop();
  197. log("StateFarm: injectScript()");
  198. injectScript();
  199. document.addEventListener("DOMContentLoaded", function () {
  200. onContentLoaded();
  201. log("StateFarm: DOMContentLoaded, ran onContentLoaded, fetching sfx");
  202. try {
  203. log("fetching badge list...", badgeListURL + "badges.json");
  204. badgeList = fetchTextContent(badgeListURL + "badges.json");
  205. badgeList = JSON.parse(badgeList);
  206. log(badgeList);
  207. } catch (error) {
  208. log("couldnt fetch badge list :(");
  209. };
  210. try {
  211. log("fetching greasyfork info...", scriptInfoURL);
  212. scriptInfo = fetchTextContent(scriptInfoURL);
  213. scriptInfo = JSON.parse(scriptInfo);
  214. log(scriptInfo);
  215. } catch (error) {
  216. log("couldnt fetch greasyfork info :(");
  217. };
  218. let oldVersion = load("version");
  219. save("version", version);
  220.  
  221. if (extract("statefarmUpdates")) {
  222. const maxAttempts = 30;
  223. const interval = 500;
  224. let attempts = 0;
  225. const checkForElement = function() {
  226. const existingContainer = document.querySelector('.secondary-aside-wrap');
  227. if (existingContainer) {
  228. log('Element found:', existingContainer);
  229. createAndAppendCommitHistoryBox(existingContainer);
  230. } else if (attempts < maxAttempts) {
  231. attempts++;
  232. // log(`Attempt ${attempts}/${maxAttempts} failed. Retrying...`);
  233. setTimeout(checkForElement, interval); // Retry after interval
  234. } else {
  235. log('Element not found after maximum attempts');
  236. }
  237. };
  238. const createAndAppendCommitHistoryBox = function(existingContainer) {
  239. let commitHistoryBox = document.createElement('div');
  240. commitHistoryBox.className = 'media-tabs-wrapper box_relative border-blue5 roundme_sm bg_blue6 common-box-shadow ss_margintop_sm';
  241. let commitHistoryContent = `
  242. <div class="media-tab-container display-grid align-items-center gap-sm bg_blue3">
  243. <h4 class="common-box-shadow text-shadow-black-40 text_white dynamic-text" style="display: flex; align-items: center;">
  244. <div class="dynamic-text" style="width: 10em; font-size: 1em;">
  245. <div class="dynamic-text" style="font-size: 1em;">StateFarm Updates</div>
  246. </div>
  247. <a href="${discordURL}" target="_blank" style="text-decoration: none; margin-left: auto;">
  248. <button class="ss_button btn_blue bevel_blue box_relative pause-screen-ui btn-account-w-icon text-shadow-none text_blue1" style="font-size: 0.75em; display: flex; align-items: center; padding: 0.5em 1em; width: 12em; margin-left: -3em;">
  249. <i class="fab fa-discord" style="font-size: 1.2em; margin-right: 0.5em;"></i>
  250. <span>Join Discord</span>
  251. </button>
  252. </a>
  253. </h4>
  254. </div>
  255. <div class="media-tabs-content f_col">
  256. <div class="tab-content ss_paddingright ss_paddingleft">
  257. <div class="news-container f_col v_scroll" style="height: 20em; overflow-y: auto;">
  258. `;
  259. fetch(commitFeedURL).then(response => {
  260. if (response.ok) return response.json();
  261. else throw new Error('Failed to fetch commit history contents');
  262. }).then(commitHistory => {
  263. log("retrieved: commit history", commitHistory);
  264. if (oldVersion !== version) {
  265. commitHistoryContent += `
  266. <a href="${githubURL}" target="_blank" style="text-decoration: none;">
  267. <div class="updated-notice" style="background-color: #28a745; color: #fff; padding: 0.75em; text-align: center; font-weight: bold; margin-bottom: 0.15em; margin-top: 0.25em; border-radius: 10px; border: 2px solid #155724;">
  268. <p style="margin: 0; font-size: 0.95em;">🎉 StateFarm has been updated (v${version})! Check out the latest updates below.</p>
  269. </div>
  270. </a>
  271. `;
  272. }
  273. if (scriptInfo && scriptInfo.version && scriptInfo.version !== version) {
  274. commitHistoryContent += `
  275. <a href="${downloadURL}" target="_blank" style="text-decoration: none;">
  276. <div class="attention-notice" style="background-color: #ffcc00; color: #000; padding: 0.75em; text-align: center; font-weight: bold; margin-bottom: 0.15em; margin-top: 0.25em; border-radius: 5px; border: 2px solid #ffff00;">
  277. <p style="margin: 0; font-size: 0.95em;">🚨 A new update for StateFarm is available (v${scriptInfo.version})! Click to install it.</p>
  278. </div>
  279. </a>
  280. `;
  281. }
  282. commitHistory.forEach(commit => {
  283. const commitDate = new Date(commit.commit.author.date).toLocaleString();
  284. const authorProfileURL = `https://github.com/${commit.author.login}`; // Replace with actual URL if available
  285. const messageParts = commit.commit.message.split('\n\n', 2); // Split by the first occurrence of '\n\n'
  286. const title = messageParts[0]; // Title part of the message
  287. const description = messageParts[1] || ''; // Description part of the message, defaults to empty string if not present
  288. commitHistoryContent += `
  289. <div class="commit-item" style="padding: 0.2em 0.3em; background-color: #95e2fe; border-bottom: 2px solid #0B93BD;">
  290. <div style="display: flex; align-items: flex-start;">
  291. <a href="${authorProfileURL}" target="_blank" style="margin-right: 0.3em; display: flex; align-items: flex-start;">
  292. <img src="${commit.author.avatar_url}" alt="${commit.author.login}" style="width: 24px; height: 24px; border-radius: 50%;">
  293. </a>
  294. <div style="display: flex; flex-direction: column; justify-content: flex-start;">
  295. <a href="${commit.html_url}" target="_blank" style="color: #0E7697; text-decoration: none; font-size: 0.75em; font-weight: bold; line-height: 1.2;">
  296. ${title}
  297. </a>
  298. ${description ? `<p style="color: #0B93BD; font-size: 0.65em; margin: 0; line-height: 1.2;">${description}</p>` : ''}
  299. <span style="color: white; font-size: 0.75em; font-weight: bold;">
  300. by <a href="${authorProfileURL}" target="_blank" style="color: #0E7697; text-decoration: none; font-size: 0.75em;">${commit.author.login}</a> on ${commitDate}
  301. </span>
  302. </div>
  303. </div>
  304. </div>
  305. `;
  306. });
  307. commitHistoryContent += `
  308. </div>
  309. </div>
  310. </div>
  311. `;
  312. commitHistoryBox.innerHTML = commitHistoryContent;
  313. existingContainer.appendChild(commitHistoryBox);
  314. }).catch(error => {
  315. log('Error:', error);
  316. });
  317. };
  318. checkForElement();
  319. };
  320. (async () => {
  321. try {
  322. var response = await fetch(sfxURL);
  323. if (!response.ok) throw new Error('Failed to fetch folder contents (custom sfx)');
  324. var data = await response.json();
  325. data.forEach((file) => {
  326. retrievedSFX.push({ text: file.name.replace(".zip", ""), value: btoa(file.download_url) });
  327. });
  328. //1ust i hated your implementation and this is me showing that i reached my breaking point.
  329. var response = await fetch(skyboxListURL); //when the nice guy loses his temper
  330. if (!response.ok) throw new Error('Failed to fetch folder contents (custom skyboxes)');
  331. var data = await response.json();
  332. data.forEach((folder) => {
  333. if (folder.type === "dir") {
  334. let url = folder.url;
  335. //make it into a download url
  336. url = url.replace("//api.github.com/repos/", "//raw.githubusercontent.com/");
  337. url = url.replace("/contents/", "/master/");
  338. url = `${url.split("?")[0]}/`;
  339. log(folder.name, url, folder);
  340. loadedSkyboxes.push({
  341. text: folder.name,
  342. value: btoa(url)
  343. });
  344. };
  345. });
  346. initMenu(false);
  347. tp.mainPanel.hidden = extract("hideAtStartup");
  348. } catch (error) {
  349. console.error('Error:', error);
  350. initMenu(false);
  351. tp.mainPanel.hidden = extract("hideAtStartup");
  352. };
  353. })();
  354. });
  355.  
  356. };
  357. //INIT VARS
  358. const inbuiltPresets = { //Don't delete onlypuppy7's Config
  359. "onlypuppy7's Config": `sfChatNotifications>true<sfChatNotificationSound>true<sfChatAutoStart>true<aimbot>true<aimbotTargetMode>0<aimbotVisibilityMode>1<aimbotRightClick>true<silentAimbot>false<aimbSemiSilent>false<noWallTrack>false<prediction>true<antiBloom>true<antiSwitch>true<oneKill>true<aimbotMinAngle>174<aimbotAntiSnap>0.75<antiSneak>1.8<aimbotColor>"#0000ff"<autoRefill>true<smartRefill>true<enableAutoFire>true<autoFireType>3<grenadeMax>true<playerESP>true<tracers>true<chams>false<nametags>true<targets>false<predictionESP>false<tracersType>0<tracersColor1>"#ff0000"<tracersColor2>"#00ff00"<tracersColor3>"#ffffff"<tracersColor1to2>5<tracersColor2to3>15<predictionESPColor>"#ff0000"<ammoESP>true<ammoTracers>false<ammoESPRegime>1<ammoESPColor>"#ffff00"<grenadeESP>true<grenadeTracers>false<grenadeESPRegime>2<grenadeESPColor>"#00ffff"<lookTracers>false<lookTracersRGI1>false<lookTracersColor>"#00ffff"<fov>120<zoom>15<perspective>0<perspectiveAlpha>false<perspectiveY>0.5<perspectiveZ>2<freecam>false<wireframe>false<particleSpeedMultiplier>0.35<eggSize>1<setDetail>0<enableTextures>true<renderDelay>0<revealBloom>true<showLOS>true<showMinAngle>false<highlightLeaderboard>true<showCoordinates>true<radar>false<playerStats>true<playerInfo>true<gameInfo>true<showStreams>true<chatExtend>true<chatHighlight>false<maxChat>10<disableChatFilter>true<unfilterNames>true<chatFilterBypass>false<tallChat>false<antiAFK>false<spamChat>false<fakeMessageID>12<fakeMessageText>"dsc.gg/s𝖿network: ЅtateFarm Client v3.4.1-pre94 On Top! "<fakeMessageBold>false<spamChatDelay>500<spamChatText>"dsc.gg/s𝖿network: ЅtateFarm Client v3.4.1-pre71 On Top! "<mockMode>false<announcer>false<autoEZ>false<cheatAccuse>false<joinMessages>true<leaveMessages>true<publicBroadcast>false<joinLeaveBranding>false<whitelist>"User-1, User-2"<enableWhitelistAimbot>false<enableWhenNoneVisible>false<enableWhitelistTracers>false<whitelistESPType>0<whitelistColor>"#e80aac"<blacklist>"User-1, User-2"<enableBlacklistAimbot>false<enableBlacklistTracers>false<blacklistESPType>0<blacklistColor>"#00ff00"<bunnyhop>true<autoWalk>false<autoStrafe>false<autoJump>false<autoJumpDelay>1<autoWeapon>0<autoGrenade>false<autoJoin>false<joinCode>"CODE"<useCustomName>false<usernameAutoJoin>"ЅtateFarmer"<autoRespawn>false<autoTeam>0<gameBlacklist>false<gameBlacklistCodes>""<leaveEmpty>false<autoLeave>false<autoLeaveDelay>300<autoGamemode>0<autoRegion>0<eggColor>0<autoStamp>0<autoHat>0<skybox>9<legacyModels>true<filter>2<gunPosition>0<muteGame>false<distanceMult>1.5<customSFX1>3<customSFX2>4<customSFX3>1<replaceLogo>true<titleAnimation>true<themeType>5<loginEmailPass>"ssss"<loginDatabaseSelection>1<autoLogin>0<accountGmail>"example (NO @gmail.com)"<accountPass>"password69"<accountRecordsLogging>false<shellPrintKey>""<adBlock>true<spoofVIP>false<noAnnoyances>true<noTrack>true<quickRespawn>true<statefarmUpdates>true<replaceFeeds>true<customBadges>true<unlockSkins>false<adminSpoof>false<autoUnban>true<autoChickenWinner>true<customMacro>"log('cool');"<autoMacro>false<silentRoll>false<enableSeizureX>false<amountSeizureX>2<enableSeizureY>false<amountSeizureY>2<hideAtStartup>false<consoleLogs>false<popups>true<enablePanic>false<panicURL>"https://classroom.google.com/"<selectedPreset>0<debug>false`,
  360. "OP7 + Server Hopper": `sfChatNotifications>true<sfChatNotificationSound>true<sfChatAutoStart>true<aimbot>true<aimbotTargetMode>0<aimbotVisibilityMode>1<aimbotRightClick>true<silentAimbot>false<aimbSemiSilent>false<noWallTrack>false<prediction>true<antiBloom>true<antiSwitch>true<oneKill>true<aimbotMinAngle>174<aimbotAntiSnap>0.75<antiSneak>1.8<aimbotColor>"#0000ff"<autoRefill>true<smartRefill>true<enableAutoFire>true<autoFireType>3<grenadeMax>true<playerESP>true<tracers>true<chams>false<nametags>true<targets>false<predictionESP>false<tracersType>0<tracersColor1>"#ff0000"<tracersColor2>"#00ff00"<tracersColor3>"#ffffff"<tracersColor1to2>5<tracersColor2to3>15<predictionESPColor>"#ff0000"<ammoESP>true<ammoTracers>false<ammoESPRegime>1<ammoESPColor>"#ffff00"<grenadeESP>true<grenadeTracers>false<grenadeESPRegime>2<grenadeESPColor>"#00ffff"<lookTracers>false<lookTracersRGI1>false<lookTracersColor>"#00ffff"<fov>120<zoom>15<perspective>0<perspectiveAlpha>false<perspectiveY>0.5<perspectiveZ>2<freecam>false<wireframe>false<particleSpeedMultiplier>0.35<eggSize>1<setDetail>0<enableTextures>true<renderDelay>0<revealBloom>true<showLOS>true<showMinAngle>false<highlightLeaderboard>true<showCoordinates>true<radar>false<playerStats>true<playerInfo>true<gameInfo>true<showStreams>true<chatExtend>true<chatHighlight>false<maxChat>10<disableChatFilter>true<unfilterNames>true<chatFilterBypass>false<tallChat>false<antiAFK>false<spamChat>false<fakeMessageID>12<fakeMessageText>"dsc.gg/s𝖿network: ЅtateFarm Client v3.4.1-pre94 On Top! "<fakeMessageBold>false<spamChatDelay>500<spamChatText>"dsc.gg/s𝖿network: ЅtateFarm Client v3.4.1-pre71 On Top! "<mockMode>false<announcer>false<autoEZ>false<cheatAccuse>false<joinMessages>true<leaveMessages>true<publicBroadcast>false<joinLeaveBranding>false<whitelist>"User-1, User-2"<enableWhitelistAimbot>false<enableWhenNoneVisible>false<enableWhitelistTracers>false<whitelistESPType>0<whitelistColor>"#e80aac"<blacklist>"User-1, User-2"<enableBlacklistAimbot>false<enableBlacklistTracers>false<blacklistESPType>0<blacklistColor>"#00ff00"<bunnyhop>true<autoWalk>false<autoStrafe>false<autoJump>false<autoJumpDelay>1<autoWeapon>0<autoGrenade>false<autoJoin>false<joinCode>"CODE"<useCustomName>false<usernameAutoJoin>"ЅtateFarmer"<autoRespawn>false<autoTeam>0<gameBlacklist>false<gameBlacklistCodes>""<leaveEmpty>true<autoLeave>true<autoLeaveDelay>150<autoGamemode>5<autoRegion>8<eggColor>0<autoStamp>0<autoHat>0<skybox>9<legacyModels>true<filter>2<gunPosition>0<muteGame>false<distanceMult>1.5<customSFX1>3<customSFX2>4<customSFX3>1<replaceLogo>true<titleAnimation>true<themeType>5<loginEmailPass>"ssss"<loginDatabaseSelection>1<autoLogin>0<accountGmail>"example (NO @gmail.com)"<accountPass>"password69"<accountRecordsLogging>false<shellPrintKey>""<adBlock>true<spoofVIP>false<noAnnoyances>true<noTrack>true<quickRespawn>true<statefarmUpdates>true<replaceFeeds>true<customBadges>true<unlockSkins>false<adminSpoof>false<autoUnban>true<autoChickenWinner>true<customMacro>"log('cool');"<autoMacro>false<silentRoll>false<enableSeizureX>false<amountSeizureX>2<enableSeizureY>false<amountSeizureY>2<hideAtStartup>false<consoleLogs>false<popups>true<enablePanic>false<panicURL>"https://classroom.google.com/"<selectedPreset>0<debug>false`,
  361. "OP7 + Server Hopper + Stream Stealth": `sfChatNotifications>true<sfChatNotificationSound>true<sfChatAutoStart>true<aimbot>true<aimbotTargetMode>0<aimbotVisibilityMode>1<aimbotRightClick>true<silentAimbot>true<aimbSemiSilent>false<noWallTrack>false<prediction>true<antiBloom>true<antiSwitch>false<oneKill>false<aimbotMinAngle>174<aimbotAntiSnap>0.75<antiSneak>1.8<aimbotColor>"#0000ff"<autoRefill>true<smartRefill>true<enableAutoFire>true<autoFireType>3<grenadeMax>true<playerESP>false<tracers>false<chams>false<nametags>true<targets>false<predictionESP>false<tracersType>0<tracersColor1>"#ff0000"<tracersColor2>"#00ff00"<tracersColor3>"#ffffff"<tracersColor1to2>5<tracersColor2to3>15<predictionESPColor>"#ff0000"<ammoESP>false<ammoTracers>false<ammoESPRegime>1<ammoESPColor>"#ffff00"<grenadeESP>false<grenadeTracers>false<grenadeESPRegime>2<grenadeESPColor>"#00ffff"<lookTracers>false<lookTracersRGI1>false<lookTracersColor>"#00ffff"<fov>120<zoom>15<perspective>0<perspectiveAlpha>false<perspectiveY>0.5<perspectiveZ>2<freecam>false<wireframe>false<particleSpeedMultiplier>0.35<eggSize>1<setDetail>0<enableTextures>true<renderDelay>0<revealBloom>false<showLOS>false<showMinAngle>false<highlightLeaderboard>true<showCoordinates>false<radar>false<playerStats>false<playerInfo>false<gameInfo>true<showStreams>false<chatExtend>true<chatHighlight>false<maxChat>10<disableChatFilter>true<unfilterNames>true<chatFilterBypass>false<tallChat>false<antiAFK>false<spamChat>false<fakeMessageID>1<fakeMessageText>"dsc.gg/s𝖿network: ЅtateFarm Client v3.4.1-pre95 On Top! "<fakeMessageBold>false<spamChatDelay>500<spamChatText>"dsc.gg/s𝖿network: ЅtateFarm Client v3.4.1-pre95 On Top! "<mockMode>false<announcer>false<autoEZ>false<cheatAccuse>false<joinMessages>true<leaveMessages>true<publicBroadcast>false<joinLeaveBranding>false<whitelist>"User-1, User-2"<enableWhitelistAimbot>false<enableWhenNoneVisible>false<enableWhitelistTracers>false<whitelistESPType>0<whitelistColor>"#e80aac"<blacklist>"User-1, User-2"<enableBlacklistAimbot>false<enableBlacklistTracers>false<blacklistESPType>0<blacklistColor>"#00ff00"<bunnyhop>true<autoWalk>false<autoStrafe>false<autoJump>false<autoJumpDelay>1<autoWeapon>0<autoGrenade>false<autoJoin>false<joinCode>"CODE"<useCustomName>true<usernameAutoJoin>"[sfc] onlypuppy7"<autoRespawn>false<autoTeam>0<gameBlacklist>false<gameBlacklistCodes>""<leaveEmpty>true<autoLeave>true<autoLeaveDelay>150<autoGamemode>5<autoRegion>8<eggColor>0<autoStamp>0<autoHat>0<skybox>9<legacyModels>true<filter>true<gunPosition>true<muteGame>false<distanceMult>1.5<customSFX1>3<customSFX2>4<customSFX3>1<replaceLogo>true<titleAnimation>false<themeType>5<loginEmailPass>"ssss"<loginDatabaseSelection>1<autoLogin>0<accountGmail>"example (NO @gmail.com)"<accountPass>"password69"<accountRecordsLogging>false<shellPrintKey>""<adBlock>true<spoofVIP>false<noAnnoyances>true<noTrack>true<quickRespawn>true<statefarmUpdates>true<replaceFeeds>true<customBadges>true<unlockSkins>false<adminSpoof>false<autoUnban>true<autoChickenWinner>true<customMacro>"log('cool');"<autoMacro>false<silentRoll>false<enableSeizureX>false<amountSeizureX>2<enableSeizureY>false<amountSeizureY>2<hideAtStartup>false<consoleLogs>false<popups>false<enablePanic>false<panicURL>"https://classroom.google.com/"<selectedPreset>1<debug>false`,
  362. // "onlypuppy7's Silent Config": `aimbot>true<aimbotTargetMode>1<aimbotVisibilityMode>1<aimbotRightClick>true<silentAimbot>true<noWallTrack>false<prediction>true<antiBloom>true<antiSwitch>false<oneKill>false<aimbotMinAngle>360<aimbotAntiSnap>0.77<antiSneak>1.8<aimbotColor>"#0000ff"<autoRefill>true<smartRefill>true<enableAutoFire>true<autoFireType>3<grenadeMax>true<playerESP>true<tracers>true<chams>false<nametags>true<targets>true<tracersType>0<tracersColor1>"#ff0000"<tracersColor2>"#00ff00"<tracersColor3>"#ffffff"<tracersColor1to2>5<tracersColor2to3>15<ammoESP>true<ammoTracers>false<ammoESPRegime>1<ammoESPColor>"#ffff00"<grenadeESP>true<grenadeTracers>false<grenadeESPRegime>0<grenadeESPColor>"#00ffff"<fov>120<zoom>15<freecam>false<wireframe>false<eggSize>1<setDetail>0<enableTextures>true<renderDelay>0<revealBloom>true<showLOS>true<showMinAngle>false<highlightLeaderboard>false<showCoordinates>true<radar>false<playerStats>true<playerInfo>true<gameInfo>true<showStreams>true<chatExtend>true<chatHighlight>false<maxChat>10<disableChatFilter>true<chatFilterBypass>false<tallChat>false<antiAFK>true<spamChat>false<spamChatDelay>500<spamChatText>"dsc.gg/s𝖿network: ЅtateFarm Client v3.4.0-pre19 On Top! "<mockMode>false<announcer>false<autoEZ>false<cheatAccuse>false<joinMessages>true<leaveMessages>true<publicBroadcast>false<joinLeaveBranding>false<whitelist>"User-1, User-2"<enableWhitelistAimbot>false<enableWhitelistTracers>false<whitelistESPType>0<whitelistColor>"#e80aac"<blacklist>"User-1, User-2"<enableBlacklistAimbot>false<enableBlacklistTracers>false<blacklistESPType>0<blacklistColor>"#00ff00"<bunnyhop>true<autoWalk>false<autoStrafe>false<autoJump>false<autoJumpDelay>1<autoWeapon>0<autoGrenade>false<autoJoin>false<joinCode>"CODE"<useCustomName>false<usernameAutoJoin>"ЅtateFarmer"<autoRespawn>false<autoTeam>0<gameBlacklist>false<gameBlacklistCodes>""<leaveEmpty>false<autoLeave>false<autoLeaveDelay>300<autoGamemode>0<autoRegion>0<eggColor>0<autoStamp>0<autoHat>0<muteGame>false<distanceMult>1<customSFX>0<adBlock>true<spoofVIP>false<unlockSkins>false<adminSpoof>false<autoUnban>true<silentRoll>false<enableSeizureX>false<amountSeizureX>2<enableSeizureY>false<amountSeizureY>2<popups>true<replaceLogo>true<titleAnimation>true<themeType>5<enablePanic>false<panicURL>"https://classroom.google.com/"<selectedPreset>0<debug>false`,
  363. "Hydroflame521's Config": `aimbot>true<aimbotTargetMode>0<aimbotVisibilityMode>0<aimbotRightClick>true<silentAimbot>false<noWallTrack>true<prediction>true<antiBloom>true<antiSwitch>true<oneKill>true<aimbotMinAngle>30<aimbotAntiSnap>0.77<antiSneak>1.8<aimbotColor>"#0000ff"<autoRefill>true<smartRefill>true<enableAutoFire>true<autoFireType>3<grenadeMax>true<playerESP>true<tracers>true<chams>false<nametags>true<targets>true<tracersType>1<tracersColor1>"#b200ff"<tracersColor2>"#ff0000"<tracersColor3>"#00ff4b"<tracersColor1to2>3<tracersColor2to3>20<ammoESP>true<ammoTracers>false<ammoESPRegime>1<ammoESPColor>"#ffff00"<grenadeESP>true<grenadeTracers>false<grenadeESPRegime>0<grenadeESPColor>"#00ffff"<fov>120<zoom>15<freecam>false<wireframe>false<eggSize>1<setDetail>0<enableTextures>true<renderDelay>0<revealBloom>true<showLOS>true<showMinAngle>false<highlightLeaderboard>false<showCoordinates>true<radar>false<playerStats>true<playerInfo>true<gameInfo>true<showStreams>true<chatExtend>true<chatHighlight>false<maxChat>10<disableChatFilter>true<chatFilterBypass>false<tallChat>false<antiAFK>false<spamChat>false<spamChatDelay>1440<spamChatText>"Live now at twitch.tv/ЅtateFarmNetwork! "<mockMode>false<announcer>false<autoEZ>false<cheatAccuse>false<joinMessages>true<leaveMessages>true<publicBroadcast>false<joinLeaveBranding>false<whitelist>"User-1, User-2"<enableWhitelistAimbot>false<enableWhitelistTracers>false<whitelistESPType>0<whitelistColor>"#e80aac"<blacklist>"User-1, User-2"<enableBlacklistAimbot>false<enableBlacklistTracers>false<blacklistESPType>0<blacklistColor>"#00ff00"<bunnyhop>false<autoWalk>false<autoStrafe>false<autoJump>false<autoJumpDelay>1<autoWeapon>0<autoGrenade>false<autoJoin>false<joinCode>"CODE"<useCustomName>false<usernameAutoJoin>"CaptainShell74"<autoRespawn>false<autoTeam>0<gameBlacklist>false<gameBlacklistCodes>""<leaveEmpty>false<autoLeave>false<autoLeaveDelay>240<autoGamemode>0<autoRegion>0<eggColor>0<autoStamp>0<autoHat>0<muteGame>false<distanceMult>0.59<customSFX>true<adBlock>true<spoofVIP>false<unlockSkins>false<adminSpoof>false<autoUnban>true<silentRoll>false<enableSeizureX>false<amountSeizureX>2<enableSeizureY>false<amountSeizureY>0.04772456526919999<popups>true<replaceLogo>false<titleAnimation>false<themeType>7<enablePanic>false<panicURL>"https://classroom.google.com/"<selectedPreset>0<debug>false`,
  364. // "Server Hopper + Non-Silent": `aimbot>true<aimbotTargetMode>0<aimbotVisibilityMode>0<aimbotRightClick>true<silentAimbot>false<noWallTrack>true<prediction>true<antiBloom>true<antiSwitch>true<oneKill>true<aimbotMinAngle>30<aimbotAntiSnap>0.77<antiSneak>1.8<aimbotColor>"#0000ff"<autoRefill>true<smartRefill>true<enableAutoFire>true<autoFireType>0<grenadeMax>true<playerESP>true<tracers>true<chams>false<nametags>true<targets>true<tracersType>0<tracersColor1>"#ff0000"<tracersColor2>"#00ff00"<tracersColor3>"#ffffff"<tracersColor1to2>5<tracersColor2to3>15<ammoESP>true<ammoTracers>false<ammoESPRegime>1<ammoESPColor>"#ffff00"<grenadeESP>true<grenadeTracers>false<grenadeESPRegime>0<grenadeESPColor>"#00ffff"<fov>120<zoom>15<freecam>false<wireframe>false<eggSize>1<setDetail>0<enableTextures>true<renderDelay>0<revealBloom>true<showLOS>true<showMinAngle>false<highlightLeaderboard>false<showCoordinates>true<radar>false<playerStats>true<playerInfo>true<gameInfo>true<showStreams>true<chatExtend>true<chatHighlight>false<maxChat>10<disableChatFilter>true<chatFilterBypass>false<tallChat>false<antiAFK>true<spamChat>false<spamChatDelay>1440<spamChatText>"Live now at twitch.tv/ЅtateFarmNetwork! "<mockMode>false<announcer>false<autoEZ>false<cheatAccuse>false<joinMessages>true<leaveMessages>true<publicBroadcast>false<joinLeaveBranding>false<whitelist>"User-1, User-2"<enableWhitelistAimbot>false<enableWhitelistTracers>false<whitelistESPType>0<whitelistColor>"#e80aac"<blacklist>"User-1, User-2"<enableBlacklistAimbot>false<enableBlacklistTracers>false<blacklistESPType>0<blacklistColor>"#00ff00"<bunnyhop>true<autoWalk>false<autoStrafe>false<autoJump>false<autoJumpDelay>1<autoWeapon>0<autoGrenade>false<autoJoin>false<joinCode>"CODE"<useCustomName>false<usernameAutoJoin>"CaptainShell74"<autoRespawn>false<autoTeam>0<gameBlacklist>false<gameBlacklistCodes>""<leaveEmpty>false<autoLeave>true<autoLeaveDelay>240<autoGamemode>0<autoRegion>0<eggColor>0<autoStamp>0<autoHat>0<muteGame>false<distanceMult>0.59<customSFX>0<adBlock>true<spoofVIP>false<unlockSkins>false<adminSpoof>false<autoUnban>true<silentRoll>false<enableSeizureX>false<amountSeizureX>2<enableSeizureY>false<amountSeizureY>0.04772456526919999<popups>true<replaceLogo>true<titleAnimation>true<themeType>2<enablePanic>false<panicURL>"https://classroom.google.com/"<selectedPreset>0<debug>false`,
  365. // "Server Hopper + Silent": `aimbot>true<aimbotTargetMode>1<aimbotVisibilityMode>1<aimbotRightClick>true<silentAimbot>true<noWallTrack>false<prediction>true<antiBloom>true<antiSwitch>false<oneKill>false<aimbotMinAngle>360<aimbotAntiSnap>0.77<antiSneak>1.8<aimbotColor>"#0000ff"<autoRefill>true<smartRefill>true<enableAutoFire>true<autoFireType>3<grenadeMax>true<playerESP>true<tracers>true<chams>false<nametags>true<targets>true<tracersType>0<tracersColor1>"#ff0000"<tracersColor2>"#00ff00"<tracersColor3>"#ffffff"<tracersColor1to2>5<tracersColor2to3>15<ammoESP>true<ammoTracers>false<ammoESPRegime>1<ammoESPColor>"#ffff00"<grenadeESP>true<grenadeTracers>false<grenadeESPRegime>0<grenadeESPColor>"#00ffff"<fov>120<zoom>15<freecam>false<wireframe>false<eggSize>1<setDetail>0<enableTextures>true<renderDelay>0<revealBloom>true<showLOS>true<showMinAngle>false<highlightLeaderboard>false<showCoordinates>true<radar>false<playerStats>true<playerInfo>true<gameInfo>true<showStreams>true<chatExtend>true<chatHighlight>false<maxChat>10<disableChatFilter>true<chatFilterBypass>false<tallChat>false<antiAFK>true<spamChat>false<spamChatDelay>1440<spamChatText>"Live now at twitch.tv/ЅtateFarmNetwork! "<mockMode>false<announcer>false<autoEZ>false<cheatAccuse>false<joinMessages>true<leaveMessages>true<publicBroadcast>false<joinLeaveBranding>false<whitelist>"User-1, User-2"<enableWhitelistAimbot>false<enableWhitelistTracers>false<whitelistESPType>0<whitelistColor>"#e80aac"<blacklist>"User-1, User-2"<enableBlacklistAimbot>false<enableBlacklistTracers>false<blacklistESPType>0<blacklistColor>"#00ff00"<bunnyhop>true<autoWalk>false<autoStrafe>false<autoJump>false<autoJumpDelay>1<autoWeapon>0<autoGrenade>false<autoJoin>false<joinCode>"CODE"<useCustomName>false<usernameAutoJoin>"CaptainShell74"<autoRespawn>false<autoTeam>0<gameBlacklist>false<gameBlacklistCodes>""<leaveEmpty>false<autoLeave>true<autoLeaveDelay>240<autoGamemode>0<autoRegion>0<eggColor>0<autoStamp>0<autoHat>0<muteGame>false<distanceMult>0.59<customSFX>true<adBlock>true<spoofVIP>false<unlockSkins>false<adminSpoof>false<autoUnban>true<silentRoll>false<enableSeizureX>false<amountSeizureX>2<enableSeizureY>false<amountSeizureY>0.04772456526919999<popups>true<replaceLogo>true<titleAnimation>true<themeType>2<enablePanic>false<panicURL>"https://classroom.google.com/"<selectedPreset>0<debug>false`,
  366. };
  367. const presetStorageLocation = "StateFarmUserPresets";
  368. let hudElementPositions = {};
  369. let cachedRealData = {};
  370. let blacklistedGameCodes = [];
  371. let sfChatIframe;
  372. let sfChatContainer;
  373. let sfChatUsername;
  374. let presetIgnore = ['sfChatUsername', 'otherSettingYouMightWantNotToBeExported'];
  375. log("Save key:", storageKey);
  376. let binding = false;
  377. let previousFrame = 0;
  378. let previousLogin = 0;
  379. let lastSpamMessage = [0, ""];
  380. let startTime = Date.now();
  381. let lastAutoJump = 0;
  382. let lastAntiAFKMessage = 0;
  383. let spamMessageCount = 0;
  384. let currentFrameIndex = 0;
  385. let deciSecondsPassed = 0;
  386. let timeJoinedGame = 0;
  387. let lastSentMessage = "";
  388. let spamDelay = 0;
  389. let URLParams = "";
  390. let retrievedSFX = [{ text: "Default", value: "default" }];
  391. let soundsSFC = {};
  392. let targetingComplete = false;
  393. let firstExecution = false;
  394. let username = "";
  395. let autoStrafeValue = [0, 0, "left"];
  396. let TEAMCOLORS = ["#fed838", "#40e0ff", "#ffc0a0"];
  397. let autoLeaveReminder = 9999;
  398. let lastRandomSkyBoxChangeTime = Date.now(); //in milliseconds
  399. const allModules = [];
  400. const allFolders = [];
  401. const F = [];
  402. const createAudioContext = function () { return new (window.AudioContext || window.webkitAudioContext)() };
  403. const audioContexts = {
  404. "BGM": createAudioContext(),
  405. "KOTC": createAudioContext(),
  406. "OTHER1": createAudioContext(),
  407. "OTHER2": createAudioContext(),
  408. "OTHER3": createAudioContext(),
  409. "OTHER4": createAudioContext(),
  410. "OTHER5": createAudioContext(),
  411. "OTHER6": createAudioContext(),
  412. "OTHER7": createAudioContext(),
  413. "OTHER8": createAudioContext(),
  414. "OTHER9": createAudioContext(),
  415. "SOUNDS": createAudioContext(),
  416. };
  417. const loadedSkyboxes = [
  418. { text: 'Default', value: 'default' }
  419. ];
  420. const divertContexts = {
  421. "KOTC": ["kotc_capture", "kotc_capturing_opponents", "kotc_capturing_player", "kotc_contested", "kotc_pointscore", "kotc_roundend", "kotc_zonespawn"],
  422. };
  423. const L = {};
  424. L.CryptoJS = CryptoJS;
  425. delete CryptoJS;
  426. const functionNames = [];
  427. const isKeyToggled = {};
  428. let ESPArray = [];
  429. let onlinePlayersArray = [];
  430. let bindsArray = {};
  431. let H = {}; // obfuscated shit lol
  432. const tp = {}; // <-- tp = tweakpane
  433. // blank variables
  434. let ss = {};
  435. let msgElement, tooltipElement, vardataOverlay, vardataPopup, closeVardataPopup, botBlacklist, botWhitelist, hash, onlineClientKeys, initialisedCustomSFX, accuracyPercentage, automatedBorder, clientID, partyLight, didStateFarm, menuInitiated, GAMECODE, noPointerPause, sneakyDespawning, resetModules, amountOnline, errorString, playersInGame, loggedGameMap, startUpComplete, isBanned, attemptedAutoUnban, coordElement, gameInfoElement, playerinfoElement, playerstatsElement, firstUseElement, minangleCircle, redCircle, crosshairsPosition, currentlyTargeting, ammo, ranOneTime, lastWeaponBox, lastChatItemLength, configMain, configBots, playerLogger;
  436. let whitelistPlayers, scrambledMsgEl, accountStatus, updateMenu, badgeList, scriptInfo, annoyancesRemoved, oldGa, newGame, previousDetail, previousLegacyModels, previousTitleAnimation, blacklistPlayers, playerLookingAt, forceControlKeys, forceControlKeysCache, playerNearest, enemyLookingAt, enemyNearest, AUTOMATED, ranEverySecond
  437. let cachedCommand = "", cachedCommandTime = Date.now();
  438. let activePath, findNewPath, activeNodeTarget;
  439. let pathfindingTargetOverride = undefined;
  440. let isFirstFrameAttemptingToPathfind = true;
  441. let despawnIfNoPath = false;
  442. let isLeftButtonDown = false;
  443. let isRightButtonDown = false;
  444. let configNotSet = true;
  445. let nameTextures = {};
  446. let tooltips = {};
  447. let amountVisible = 0;
  448. const weaponArray = { //this could be done differently but i cba
  449. eggk47: 0,
  450. scrambler: 1,
  451. freeranger: 2,
  452. rpegg: 3,
  453. whipper: 4,
  454. crackshot: 5,
  455. trihard: 6,
  456. random: 3, // :trol_fancy:
  457. };
  458. // const antiAFKString = "AntiAFK Message. This message is not visible to others. || ";
  459. const filteredList = [ //a selection of filtered words for antiafk. brimslate reports afk messages, so have fun reporting this and trying to explain this to the "eggforcers"
  460. 'date', 'dick', 'fuck', 'fuk', 'suck', 'piss', 'hate', 'nude', 'fux', 'hate', 'pussy',
  461. ]; //filteredList[randomInt(0,filteredList.length-1)]
  462. let proxyList = [
  463. 'shellshock.io', 'algebra.best', 'algebra.vip', 'biologyclass.club', 'combateggs.com', 'deadlyegg.com', 'deathegg.life', 'deathegg.world', 'eggbattle.com', 'eggboy.club', 'eggboy.me', 'eggboy.xyz', 'eggcombat.com', 'egg.dance',
  464. 'eggfacts.fun', 'egghead.institute', 'eggisthenewblack.com', 'eggsarecool.com', 'eggshock.com', 'eggshooter.best', 'eggshooter.com', 'eggwarfare.com', 'geometry.best', 'geometry.monster', 'geometry.pw', 'geometry.report', 'hardboiled.life',
  465. 'hardshell.life', 'humanorganising.org', 'mathactivity.club', 'mathactivity.xyz', 'mathdrills.info', 'mathdrills.life', 'mathfun.rocks', 'mathgames.world', 'math.international',
  466. 'mathlete.fun', 'mathlete.pro', 'overeasy.club', 'risenegg.com', 'scrambled.tech', 'scrambled.today', 'scrambled.us', 'scrambled.world', 'shellshockers.best', 'shellshockers.club', 'shellshockers.life', 'shellshockers.site',
  467. 'shellshockers.today', 'shellshockers.us', 'shellshockers.wiki', 'shellshockers.world', 'shellshockers.xyz', 'shellsocks.com', 'softboiled.club', 'urbanegger.com', 'violentegg.club', 'violentegg.fun', 'yolk.best', 'yolk.life',
  468. 'yolk.rocks', 'yolk.tech', 'yolk.quest', 'yolk.today', 'zygote.cafe'
  469. ];
  470. proxyList = proxyList.filter(item => item !== unsafeWindow.location.hostname);
  471. proxyList = [...proxyList].sort(() => Math.random() - 0.5);
  472. let proxyListIndex = 0;
  473. const monitorObjects = {};
  474. //title animation
  475. const titleAnimationFrames = [
  476. '︻デ═一',
  477. '︻デ═一',
  478. 'デ═一 -',
  479. '═一   -',
  480. '一    -',
  481. '.     -',
  482. '.    -',
  483. '.   -',
  484. '.    -  0',
  485. '.     -0',
  486. '.    \\/',
  487. '.   _-_',
  488. '. ___',
  489. '__',
  490. '.',
  491. 'STATEFARMCLIEN',
  492. 'TATEFARMCLIENT',
  493. 'ATEFARMCLIENTV',
  494. 'TEFARMCLIENTV3',
  495. 'EFARMCLIENTV3 ',
  496. 'FARMCLIENTV3 S',
  497. 'ARMCLIENTV3 ST',
  498. 'RMCLIENTV3 STA',
  499. 'MCLIENTV3 STAT',
  500. 'CLIENTV3 STATE',
  501. 'LIENTV3 STATEF',
  502. 'IENTV3 STATEFA',
  503. 'ENTV3 STATEFAR',
  504. 'NTV3 STATEFARM',
  505. 'TV3 STATEFARMC',
  506. 'V3 STATEFARMCL',
  507. '3 STATEFARMCLI',
  508. 'STATEFARMCLIEN',
  509. 'TATEFARMCLIENT',
  510. 'STATEFARM',
  511. 'CLIENT V3',
  512. 'STATEFARM',
  513. 'CLIENT V3',
  514. 'STATEFARM',
  515. 'CLIENT V3',
  516. 'STATEFARM',
  517. 'CLIENT V3',
  518. ':)',
  519. ';)',
  520. ':)',
  521. '⠝⠓⠗⠅ ஃ ⠟⠑⠙⠟',
  522. '⠑⠑⠟⠟ ஃ ⠙⠛⠟⠕',
  523. '⠛⠟⠍⠑ ஃ ⠅⠑⠍⠃',
  524. '⠅⠟⠇⠝ ஃ ⠟⠕⠗⠕',
  525. '⠝⠓⠗⠅ ஃ ⠟⠑⠙⠟',
  526. '⠑⠑⠟⠟ ஃ ⠙⠛⠟⠕',
  527. '⠛⠟⠍⠑ ஃ ⠅⠑⠍⠃',
  528. '⠅⠟⠇⠝ ஃ ⠟⠕⠗⠕',
  529. '( ͡° ͜ʖ ͡°)',
  530. '( ͠° ͟ʖ ͡°)',
  531. '( ͡° ͟ʖ ͡°)',
  532. '( ͡° ͟ʖ ͠°)一',
  533. '( ͡° ͟ʖ ͠°)═一',
  534. '( ͡° ͟ʖ ͠°)デ═一',
  535. '( ͡° ͟ʖ ͠°)︻デ═一',
  536. ' ͡° ͟ʖ ͠°)︻デ═一',
  537. ' ͟ʖ ͠°)︻デ═一',
  538. ' ͠°)︻デ═一',
  539. ')︻デ═一',
  540. ];
  541.  
  542. const getScrambled = () => Array.from({ length: 10 }, () => String.fromCharCode(97 + Math.floor(Math.random() * 26))).join('');
  543. let skyboxName = getScrambled();
  544. let mapData = getScrambled();
  545.  
  546. //menu interaction functions
  547. //menu extraction
  548. const extract = function (variable, shouldUpdate) {
  549. if (shouldUpdate) { updateConfig() };
  550. return configMain[variable] || configBots[variable];
  551. };
  552. const extractDropdownList = function (variable) {
  553. return tp[variable + "Button"].controller_.binding.value.constraint_.constraints[0].options;
  554. };
  555. const extractAsDropdownInt = function (variable) {
  556. const options = extractDropdownList(variable);
  557. const state = extract(variable);
  558. for (let i = 0; i < options.length; i++) {
  559. if (options[i].value === state) {
  560. return i;
  561. };
  562. };
  563. };
  564.  
  565. const beginBinding = function (value) {
  566. if (binding == false) {
  567. binding = value;
  568. tp[binding + "BindButton"].title = "PRESS KEY";
  569. };
  570. };
  571. //one day i should make this unshit. dom is not the correct way to go about this.
  572. //unfortunately tweakpane is a pain in the ass and has barely anything for actually extracting/changing vars
  573. //a way it could be done is export preset => change value => import preset
  574. //but doesnt account for it being a button... and dropdowns wouldnt switch properly too. laziness. the problem is that this works fine.
  575. //suppose i could always just log the type of module and refer to it later. you can also get the parent object from the tp object, that would save iterating over everything.
  576. const change = function (module, newValue) { //its important to note that every module must have a unique name (the title of the module, NOT the storeAs)
  577. const labels = document.querySelectorAll('.tp-lblv_l');
  578. const moduleButton = module + "Button";
  579. const moduleLabel = tp[moduleButton].label;
  580. for (const label of labels) {
  581. if (label.textContent == moduleLabel) {
  582. const inputContainer = label.nextElementSibling;
  583. const currentValue = extract(module);
  584. // check for checkbox
  585. const checkbox = inputContainer.querySelector('.tp-ckbv_i');
  586. if (checkbox) {
  587. if (newValue == undefined) {
  588. newValue = (!currentValue);
  589. };
  590. if (newValue !== (!!currentValue)) {
  591. checkbox.click(); // Toggle checkbox
  592. };
  593. log(module, "checkbox", currentValue, newValue);
  594. return extract(module, true);
  595. };
  596. // check for button
  597. const button = inputContainer.querySelector('.tp-btnv_b');
  598. if (button) {
  599. button.click(); // Trigger button click
  600. log(module, "button", currentValue, newValue);
  601. return ("NOMSG"); //no change of state, dont show pop up message
  602. };
  603. // check for dropdown
  604. const dropdown = inputContainer.querySelector('.tp-lstv_s');
  605. if (dropdown) {
  606. if (newValue == undefined) { //if youre going to set a list to a certain value, use the int value of the list item
  607. newValue = (dropdown.selectedIndex + 1) % dropdown.options.length;
  608. };
  609. dropdown.selectedIndex = newValue;
  610. dropdown.dispatchEvent(new Event('change')); // trigger change event for dropdown
  611. log(module, "dropdown", currentValue, newValue);
  612. return extract(module, true);
  613. };
  614. // check for text input
  615. const textInput = inputContainer.querySelector('.tp-txtv_i');
  616. if (textInput) {
  617. textInput.value = newValue;
  618. textInput.dispatchEvent(new Event('change')); // trigger change event for dropdown
  619. return extract(module, true);
  620. };
  621. };
  622. };
  623. };
  624. document.addEventListener('mousedown', function (event) {
  625. if (event.button === 2) {
  626. isRightButtonDown = true;
  627. } else if (event.button === 0) {
  628. isLeftButtonDown = true;
  629. };
  630. });
  631. document.addEventListener('mouseup', function (event) {
  632. if (event.button === 2) {
  633. isRightButtonDown = false;
  634. } else if (event.button === 0) {
  635. isLeftButtonDown = false;
  636. };
  637. });
  638. //menu
  639. document.addEventListener("keydown", function (event) {
  640. event = (event.code.originalReplace("Key", ""));
  641. isKeyToggled[event] = true;
  642. if (event == "Escape") {
  643. noPointerPause = false; unsafeWindow.document.onpointerlockchange();
  644. };
  645. });
  646. document.addEventListener("keyup", function (event) {
  647. event = (event.code.originalReplace("Key", ""));
  648. isKeyToggled[event] = false;
  649. if (document.activeElement && document.activeElement.tagName === 'INPUT') {
  650. return;
  651. } else if (binding != false) {
  652. if (event == "Delete") { event = "Set Bind" };
  653. tp[binding + "BindButton"].title = event;
  654. bindsArray[binding] = event;
  655. save(binding + "Bind", event);
  656. createPopup("Bound " + tp[binding + "Button"].label + " to key: " + event);
  657. binding = false;
  658. } else {
  659. Object.keys(bindsArray).forEach(function (module) {
  660. if ((bindsArray[module] == event) && module != "zoom") {
  661. let state = change(module);
  662. let popupText = state;
  663. if (state != "NOMSG") {
  664. if (state === true || state === false || state === undefined) { state = (state ? "ON" : "OFF") };
  665. popupText = "Set " + module + " to: " + state;
  666. if (extract("announcer")) {
  667. sendChatMessage("I just set " + module + " to " + state + "!");
  668. };
  669. } else {
  670. switch (module) {
  671. case ("hide"):
  672. popupText = "Toggled StateFarm Panel"; break;
  673. case ("showBotPanel"):
  674. popupText = "Toggled Bot Panel"; break;
  675. case ("sfChatShowHide"):
  676. popupText = "Toggled SFC Chat"; break;
  677. case ("panic"):
  678. popupText = "Exiting to set URL..."; break;
  679. default:
  680. popupText = module; break;
  681. };
  682. };
  683. createPopup(popupText);
  684. };
  685. });
  686. };
  687. });
  688. const initTabs = function (tab, guideData) {
  689. tp[tab.storeAs] = tab.location.addTab({
  690. pages: [
  691. { title: 'Modules' },
  692. { title: 'Binds' },
  693. { title: 'Guide' },
  694. ],
  695. });
  696. if (guideData) {
  697. const thePages = [];
  698. guideData.forEach(aPage => {
  699. thePages.push({ title: aPage.title });
  700. });
  701. tp[tab.storeAs + "Guide"] = tp[tab.storeAs].pages[2].addTab({ pages: thePages }); //is there a one liner for this? uhhh probabyl
  702. //tp[tab.storeAs + "Guide"] = tab.location.addTab({ thePages: guideData.map(page => ({ title: page.title })) });
  703. for (let i = 0; i < guideData.length; i++) {
  704. const storeAs = tab.storeAs + "Guide" + i;
  705. const text = (guideData[i].content || "Not set up correctly lmao");
  706. initModule({ location: tp[tab.storeAs + "Guide"].pages[i], storeAs: storeAs, monitor: (text.split('\n').length + 0.25), });
  707. monitorObjects[storeAs] = text;
  708. const infoElement = tp[storeAs + "Button"].controller_.view.element.children[1].children[0];
  709. infoElement.style.width = "270px";
  710. infoElement.style.setProperty("margin-left", "-110px", "important");
  711. };
  712. };
  713. };
  714. const initFolder = function (folder) {
  715. tp[folder.storeAs] = folder.location.addFolder({
  716. title: folder.title,
  717. expanded: load(folder.storeAs) !== null ? load(folder.storeAs) : false
  718. });
  719. allFolders.push(folder.storeAs);
  720. };
  721. const initModule = function (module) {
  722. if (module.requirements) {
  723.  
  724. };
  725.  
  726. const value = {};
  727. value[module.storeAs] = (module.defaultValue !== undefined ? module.defaultValue : false);
  728.  
  729. if (module.tooltip) tooltips[module.title] = module.tooltip;
  730.  
  731. tp[module.storeAs + "TiedModules"] = {
  732. showConditions: (module.showConditions || false),
  733. hideConditions: (module.hideConditions || false),
  734. enableConditions: (module.enableConditions || false),
  735. disableConditions: (module.disableConditions || false), //why have disable when there is already enable? enable acts like an AND operator, whereas having conditions for the opposite allows for an OR operation. it is messy, but hey it works lmao?
  736. };
  737.  
  738. if (!(module.slider && module.slider.step)) { module.slider = {} };
  739. const config = {
  740. label: module.title,
  741. options: module.dropdown,
  742. min: module.slider.min,
  743. max: module.slider.max,
  744. step: module.slider.step,
  745. title: module.button,
  746. };
  747. if (module.button) {
  748. tp[(module.storeAs + "Button")] = module.location.addButton({
  749. label: module.title,
  750. title: module.button,
  751. }).on("click", (value) => {
  752. if (module.clickFunction !== undefined) { module.clickFunction(value) };
  753. if (module.botParam !== undefined) { updateBotParams(module.botParam) };
  754. });
  755. } else if (module.monitor) {
  756. monitorObjects[module.storeAs] = "Text Goes Here";
  757. tp[(module.storeAs + "Button")] = module.location.addMonitor(monitorObjects, module.storeAs, {
  758. label: '',
  759. expanded: true,
  760. multiline: true,
  761. lineCount: module.monitor,
  762. });
  763. setInterval(() => {
  764. tp[(module.storeAs + "Button")].refresh();
  765. }, 1000);
  766. } else {
  767. tp[module.storeAs + "Button"] = module.location.addInput(value, module.storeAs, config
  768. ).on("change", (value) => {
  769. if (module.changeFunction !== undefined) { module.changeFunction(value) };
  770. setTimeout(() => {
  771. if (startUpComplete) {
  772. if ((module.botParam !== undefined)) {
  773. updateBotParams(module.botParam);
  774. };
  775. };
  776. updateHiddenAndDisabled();
  777. saveConfig();
  778. }, 150);
  779. });
  780. };
  781. allModules.push(module.storeAs);
  782. if (module.bindLocation) { initBind(module) };
  783. };
  784. const initBind = function (module) {
  785. if (resetModules) { remove(module.storeAs + "Bind") };
  786. const theBind = (load(module.storeAs + "Bind") || module.defaultBind || "Set Bind");
  787. tp[(module.storeAs + "BindButton")] = module.bindLocation.addButton({
  788. label: module.title,
  789. title: theBind,
  790. }).on("click", (value) => {
  791. beginBinding(module.storeAs);
  792. });
  793. bindsArray[module.storeAs] = theBind;
  794. };
  795. const initMenu = function (reset) {
  796. //INIT MENU
  797. //init tp.mainPanel
  798.  
  799. resetModules = reset === true;
  800. menuInitiated = false;
  801.  
  802. if (tp.mainPanel) { tp.mainPanel.dispose() };
  803. if (tp.botPanel) { tp.botPanel.dispose() };
  804.  
  805. tp.mainPanel = new Tweakpane.Pane(); // eslint-disable-line
  806. tp.mainPanel.hidden = true;
  807. tp.mainPanel.title = menuTitle;
  808. //SFC CHAT
  809. initFolder({ location: tp.mainPanel, title: "StateFarm Chat", storeAs: "sfChatFolder", });
  810. initTabs({ location: tp.sfChatFolder, storeAs: "sfChatTab" }, [
  811. {
  812. title: "WIP", content:
  813. `Sorry! No guide yet!`},
  814. ]);
  815. initModule({ location: tp.sfChatTab.pages[0], title: "Username", storeAs: "sfChatUsername", tooltip: "Your username in the chatroom", defaultValue: ("Guest" + (Math.floor(Math.random() * 8999) + 1000)), });
  816. // initModule({ location: tp.sfChatTab.pages[0], title: "Join Chat", storeAs: "sfChatJoin", button: "Join", bindLocation: tp.sfChatTab.pages[1], clickFunction: function(){
  817. // if (sfChatIframe != undefined){
  818. // createPopup("Already Started. Try Showing it.");
  819. // } else {
  820. // startStateFarmChat();
  821. // };
  822. // },});
  823. tp.sfChatTab.pages[0].addSeparator();
  824. initModule({
  825. location: tp.sfChatTab.pages[0], title: "Show/Hide", storeAs: "sfChatShowHide", tooltip: "Toggle chat panel visibility", button: "Show/Hide", bindLocation: tp.sfChatTab.pages[1], defaultBind: "K", clickFunction: function () {
  826. if (sfChatContainer != undefined) {
  827. if (sfChatContainer.style.display == "none") {
  828. sfChatContainer.style.display = "block";
  829. } else {
  830. sfChatContainer.style.display = "none";
  831. };
  832. } else {
  833. startStateFarmChat(); //its just easier this way imo
  834. };
  835. },
  836. });
  837. tp.sfChatTab.pages[0].addSeparator();
  838. initModule({ location: tp.sfChatTab.pages[0], title: "Notifications", storeAs: "sfChatNotifications", tooltip: "Shows an in-game notification for every new chat message", bindLocation: tp.sfChatTab.pages[1], });
  839. initModule({ location: tp.sfChatTab.pages[0], title: "Notification Sound", storeAs: "sfChatNotificationSound", tooltip: "Play a sound for every new message", bindLocation: tp.sfChatTab.pages[1], });
  840. tp.sfChatTab.pages[0].addSeparator();
  841. initModule({ location: tp.sfChatTab.pages[0], title: "Auto Start Chat", storeAs: "sfChatAutoStart", tooltip: "Automatically connects to the chatroom on startup", bindLocation: tp.sfChatTab.pages[1], });
  842. tp.sfChatTab.pages[0].addSeparator();
  843. initModule({ location: tp.sfChatTab.pages[0], title: "Prompt Invitations", storeAs: "sfChatInvitations", tooltip: "Show invite prompts when someone sends a game code in the chatroom", bindLocation: tp.sfChatTab.pages[1], defaultValue: true, });
  844. //COMBAT MODULES
  845. initFolder({ location: tp.mainPanel, title: "Combat", storeAs: "combatFolder", });
  846. initTabs({ location: tp.combatFolder, storeAs: "combatTab" }, [
  847. {
  848. title: "Basics", content:
  849. `This is the combat tab. Here you will find
  850. options relating to aimbotting, and other
  851. useful macros. Aimbot is made active by
  852. turning it on. Using ToggleRM will give you
  853. more control by allowing you to switch by
  854. pressing the right mouse button.
  855. TargetMode also allows a more intuitive
  856. means of selecting who you will target.
  857. The most powerful features you can use
  858. are Predictions and Antibloom. These
  859. improve the accuracy of the tracking.
  860. AntiSwitch will make you lock on to a
  861. target until they die, and if you don't want
  862. to target anyone else after they die then
  863. choose 1Kill too. Auto Refill helps you
  864. stay topped up and choosing the Smart
  865. mode allows you to refill at the moment
  866. when you will not have a long
  867. reload time. GrenadeMAX makes all
  868. grenades get thrown at max strength.`},
  869. {
  870. title: "Visibility", content:
  871. `There are a couple of options related to
  872. visibility (Line-of-Sight). First is
  873. TargetVisible. This tunes the aimbot to
  874. be more strategic with where it aims.
  875. NoWallTrack makes it such that if a
  876. targeted player goes behind a wall, you
  877. stop aimlocking them. There is also an
  878. AutoFire mode with this sort of
  879. functionality.`},
  880. {
  881. title: "Advanced", content:
  882. `If you want to increase stealthiness,
  883. make use of MinAngle and AntiSnap. The
  884. first will make it so that you have to
  885. manually move your reticle within your
  886. specified radius to lock on. The latter
  887. smooths snapping, which evades
  888. detection on botter spotter scripts.
  889. If you want to be more powerful, opt for
  890. SilentAim. This modifies your direction
  891. packets instead of making you lock on.
  892. However, this can lead to slightly glitchy
  893. movement. When this is on, MinAngle
  894. changes to instead narrow down the
  895. selection of targets rather than acting
  896. as a guide.
  897. AntiSneak is a module which, while not
  898. always showing use, can help you in a
  899. difficult situation. It automatically
  900. switches targets to a player that enters
  901. your specified range, and begins
  902. shooting with your primary gun, and then
  903. the pistol. Ideal use case is when you are
  904. sniping and someone sneaks up on you
  905. (...hence it is called... AntiSneak).`},
  906. ]);
  907. initModule({ location: tp.combatTab.pages[0], title: "Aimbot", storeAs: "aimbot", tooltip: "Locks onto targeted player", bindLocation: tp.combatTab.pages[1], defaultBind: "V", });
  908. initFolder({ location: tp.combatTab.pages[0], title: "Aimbot Options", storeAs: "aimbotFolder", });
  909. initModule({ location: tp.aimbotFolder, title: "TargetMode", storeAs: "aimbotTargetMode", tooltip: "Decides the priority for which player aimbot should target", bindLocation: tp.combatTab.pages[1], defaultBind: "T", dropdown: [{ text: "Pointing At", value: "pointingat" }, { text: "Nearest", value: "nearest" }], defaultValue: "pointingat", enableConditions: [["aimbot", true]], });
  910. initModule({ location: tp.aimbotFolder, title: "TargetVisible", storeAs: "aimbotVisibilityMode", tooltip: "A filter, applied after TargetMode helping to pick the aimbot target", bindLocation: tp.combatTab.pages[1], dropdown: [{ text: "Disabled", value: "disabled" }, { text: "Prioritise Visible", value: "prioritise" }, { text: "Only Visible", value: "onlyvisible" }], defaultValue: "disabled", enableConditions: [["aimbot", true]] });
  911. tp.aimbotFolder.addSeparator();
  912. initModule({ location: tp.aimbotFolder, title: "ToggleRM", storeAs: "aimbotRightClick", tooltip: "Modifies aimbot to only lock when the right mouse is held", bindLocation: tp.combatTab.pages[1], enableConditions: [["aimbot", true]], });
  913. initModule({ location: tp.aimbotFolder, title: "SilentAim", storeAs: "silentAimbot", tooltip: "Shoots without moving the camera. ONLY visual, VERY blatant cheating. Refer to the GitHub README for more information", bindLocation: tp.combatTab.pages[1], enableConditions: [["aimbot", true]], });
  914. initModule({ location: tp.aimbotFolder, title: "SemiSilent", storeAs: "aimbSemiSilent", tooltip: "SilentAimbot behavior, but will move the camera after a shot has been fired", bindLocation: tp.combatTab.pages[1], enableConditions: [["aimbot", true], ["silentAimbot", true]], });
  915. initModule({ location: tp.aimbotFolder, title: "NoWallTrack", storeAs: "noWallTrack", tooltip: "Aimbot ignores the player if they're behind obstacles", bindLocation: tp.combatTab.pages[1], enableConditions: [["aimbot", true], ["silentAimbot", false]], });
  916. tp.aimbotFolder.addSeparator();
  917. initModule({ location: tp.aimbotFolder, title: "Prediction", storeAs: "prediction", tooltip: "Predicts where the player will be when the bullet hits them and ajusts aimbot accordingly", bindLocation: tp.combatTab.pages[1], enableConditions: [["aimbot", true]], defaultValue: true, });
  918. initModule({ location: tp.aimbotFolder, title: "AntiBloom", storeAs: "antiBloom", tooltip: "Locks onto the predicted bloom point. Good for shooting & moving", bindLocation: tp.combatTab.pages[1], enableConditions: [["aimbot", true]], defaultValue: true, });
  919. tp.aimbotFolder.addSeparator();
  920. initModule({ location: tp.aimbotFolder, title: "AntiSwitch", storeAs: "antiSwitch", tooltip: "Prevents the aimbot from changing the target until they die", bindLocation: tp.combatTab.pages[1], enableConditions: [["aimbot", true]], });
  921. initModule({ location: tp.aimbotFolder, title: "1 Kill", storeAs: "oneKill", tooltip: "Disables aimbot when the targeted player dies", bindLocation: tp.combatTab.pages[1], enableConditions: [["aimbot", true]], });
  922. tp.aimbotFolder.addSeparator();
  923. initModule({ location: tp.aimbotFolder, title: "MinAngle", storeAs: "aimbotMinAngle", tooltip: "Prevents you from snapping if the angle between you and the player is greater than this value (in degrees)", slider: { min: 0.05, max: 360, step: 1 }, defaultValue: 360, enableConditions: [["aimbot", true]], });
  924. initModule({ location: tp.aimbotFolder, title: "AntiSnap", storeAs: "aimbotAntiSnap", tooltip: "This makes snapping smooth at higher values. useful to avoid being spotted", slider: { min: 0, max: 0.99, step: 0.01 }, defaultValue: 0, enableConditions: [["aimbot", true], ["silentAimbot", false]], });
  925. initModule({ location: tp.aimbotFolder, title: "AntiSneak", storeAs: "antiSneak", tooltip: "Recommended distance under 2. This automatically kills players in the given range", slider: { min: 0, max: 5, step: 0.2 }, defaultValue: 0, enableConditions: [["aimbot", true]], });
  926. tp.aimbotFolder.addSeparator();
  927. initModule({ location: tp.aimbotFolder, title: "ESPColor", storeAs: "aimbotColor", tooltip: "The color used to highlight the ESP line of a targeted player. Useless if PlayerESP is disabled", defaultValue: "#0000ff", enableConditions: [["aimbot", true]] });
  928. tp.combatTab.pages[0].addSeparator();
  929. initModule({ location: tp.combatTab.pages[0], title: "Auto Refill", storeAs: "autoRefill", tooltip: "This automatically reloads your gun if there is no more ammo", bindLocation: tp.combatTab.pages[1], });
  930. initModule({ location: tp.combatTab.pages[0], title: "Smart Refill", storeAs: "smartRefill", tooltip: "This makes your weapon refill at the best moment, which reduces reload time", bindLocation: tp.combatTab.pages[1], showConditions: [["autoRefill", true]], });
  931. tp.combatTab.pages[0].addSeparator();
  932. initModule({ location: tp.combatTab.pages[0], title: "Auto Fire", storeAs: "enableAutoFire", tooltip: "Automatically shoot the gun", bindLocation: tp.combatTab.pages[1], });
  933. initModule({ location: tp.combatTab.pages[0], title: "AutoFireType", storeAs: "autoFireType", tooltip: "Picks how to shoot the gun", bindLocation: tp.combatTab.pages[1], dropdown: [{ text: "Force Automatic", value: "forceAutomatic" }, { text: "While Visible", value: "whileVisible" }, { text: "While Aimbotting", value: "whileAimbot" }, { text: "Visible and Aimbotting", value: "whileVisAimbot" }, { text: "Always", value: "always" }], defaultValue: "leftMouse", showConditions: [["enableAutoFire", true]] });
  934. initModule({ location: tp.combatTab.pages[0], title: "MinAccuracy%", storeAs: "autoFireAccuracy", tooltip: "Minimum spread/accuracy before shooting. Helpful for sniper guns, bad for automatics. Leave at 0 for default.", slider: { min: 0, max: 1, step: 0.05 }, defaultValue: 0, });
  935. tp.combatTab.pages[0].addSeparator();
  936. initModule({ location: tp.combatTab.pages[0], title: "GrenadeMAX", storeAs: "grenadeMax", tooltip: "Sets grenades to be thrown to max power immediately without the need of charging", bindLocation: tp.combatTab.pages[1], });
  937. initModule({ location: tp.combatTab.pages[0], title: "Nade Power", storeAs: "grenadePower", tooltip: "porcupane hijinks ensue — Today at 6:33 PM• goo/ber grenade power override for how long you hold ot", slider: { min: 0, max: 1, step: 0.05 }, defaultValue: 1, });
  938. //RENDER MODULES
  939. initFolder({ location: tp.mainPanel, title: "Render", storeAs: "renderFolder", });
  940. initTabs({ location: tp.renderFolder, storeAs: "renderTab" }, [
  941. {
  942. title: "WIP", content:
  943. `Sorry! No guide yet!`},
  944. ]);
  945. initModule({ location: tp.renderTab.pages[0], title: "PlayerESP", storeAs: "playerESP", tooltip: "Creates boxes around enemy players", bindLocation: tp.renderTab.pages[1], });
  946. initModule({ location: tp.renderTab.pages[0], title: "Tracers", storeAs: "tracers", tooltip: "Creates lines pointing from the center of the screen to the location of enemy players", bindLocation: tp.renderTab.pages[1], });
  947. initModule({ location: tp.renderTab.pages[0], title: "Chams", storeAs: "chams", tooltip: "Renders players through walls", bindLocation: tp.renderTab.pages[1], });
  948. initModule({ location: tp.renderTab.pages[0], title: "Nametags", storeAs: "nametags", tooltip: "Enlarges nametags and makes them appear through walls", bindLocation: tp.renderTab.pages[1], });
  949. initModule({ location: tp.renderTab.pages[0], title: "Targets", storeAs: "targets", tooltip: "It's borked rn", bindLocation: tp.renderTab.pages[1], });
  950. initModule({ location: tp.renderTab.pages[0], title: "PredictionESP", storeAs: "predictionESP", tooltip: "Creates an ESP box at the predicted position of the player", bindLocation: tp.renderTab.pages[1], });
  951. tp.renderTab.pages[0].addSeparator();
  952. initFolder({ location: tp.renderTab.pages[0], title: "Player ESP/Tracers Options", storeAs: "tracersFolder", });
  953. initModule({ location: tp.tracersFolder, title: "Type", storeAs: "tracersType", tooltip: "The mode for how ESP/Tracers are coloured. Different colour options present themselves based on option.\n\nStatic: Just stays as one colour.\nProximity: Fades between three colours based on how close someone is.\nVisibility: Switches between two colours if there is Line of Sight.", bindLocation: tp.renderTab.pages[1], dropdown: [{ text: "Static", value: "static" }, { text: "Proximity", value: "proximity" }, { text: "Visibility", value: "visibility" }], defaultValue: "static", disableConditions: [["tracers", false], ["playerESP", false]], });
  954. initModule({ location: tp.tracersFolder, title: "Color 1", storeAs: "tracersColor1", tooltip: "Static: Just stays this colour.\nProximity: Very close colour\nVisibility: Not visible.", defaultValue: "#ff0000", disableConditions: [["tracers", false], ["playerESP", false]], });
  955. initModule({ location: tp.tracersFolder, title: "Color 2", storeAs: "tracersColor2", tooltip: "Static: (Unused)\nProximity: Moderately close colour\nVisibility: Visible.", defaultValue: "#00ff00", disableConditions: [["tracers", false], ["playerESP", false]], hideConditions: [["tracersType", "static"]], });
  956. initModule({ location: tp.tracersFolder, title: "Color 3", storeAs: "tracersColor3", tooltip: "Static: (Unused)\nProximity: Furthest colour\nVisibility: (Unused)", defaultValue: "#ffffff", disableConditions: [["tracers", false], ["playerESP", false]], showConditions: [["tracersType", "proximity"]], });
  957. initModule({ location: tp.tracersFolder, title: "Dist 1->2", storeAs: "tracersColor1to2", tooltip: "Proximity: Distance from which it fades from 1 to 2. Should be the smaller range.", slider: { min: 0, max: 30, step: 0.25 }, defaultValue: 5, showConditions: [["tracersType", "proximity"]], disableConditions: [["tracers", false], ["playerESP", false]], });
  958. initModule({ location: tp.tracersFolder, title: "Dist 2->3", storeAs: "tracersColor2to3", tooltip: "Proximity: Distance from which it fades from 2 to 3. Should be the larger range.", slider: { min: 0, max: 30, step: 0.25 }, defaultValue: 15, showConditions: [["tracersType", "proximity"]], disableConditions: [["tracers", false], ["playerESP", false]], });
  959. tp.tracersFolder.addSeparator();
  960. initModule({ location: tp.tracersFolder, title: "PredictionESPColor", storeAs: "predictionESPColor", tooltip: "Colour to use for the PredictionESP box", defaultValue: "#ff0000", disableConditions: [ ["predictionESP", false]], });
  961. tp.renderTab.pages[0].addSeparator();
  962. initFolder({ location: tp.renderTab.pages[0], title: "Ammo ESP/Tracers Options", storeAs: "tracersAmmoFolder", });
  963. initFolder({ location: tp.tracersAmmoFolder, title: "Ammo", storeAs: "ammoFolder", });
  964. initModule({ location: tp.ammoFolder, title: "AESP", storeAs: "ammoESP", tooltip: "Displays where ammo is on the map", bindLocation: tp.renderTab.pages[1], });
  965. initModule({ location: tp.ammoFolder, title: "ATracers", storeAs: "ammoTracers", tooltip: "No tooltip available", bindLocation: tp.renderTab.pages[1], });
  966. tp.ammoFolder.addSeparator();
  967. initModule({ location: tp.ammoFolder, title: "ARegime", storeAs: "ammoESPRegime", tooltip: "No tooltip available", bindLocation: tp.renderTab.pages[1], dropdown: [{ text: "When Depleted", value: "whendepleted" }, { text: "When Low", value: "whenlow" }, { text: "Below Max", value: "belowmax" }, { text: "Always On", value: "alwayson" },], defaultValue: "whendepleted", disableConditions: [["ammoESP", false], ["ammoTracers", false]], });
  968. initModule({ location: tp.ammoFolder, title: "AColor", storeAs: "ammoESPColor", tooltip: "No tooltip available", defaultValue: "#ffff00", disableConditions: [["ammoESP", false], ["ammoTracers", false]], });
  969. initFolder({ location: tp.tracersAmmoFolder, title: "Grenades", storeAs: "grenadesFolder", });
  970. initModule({ location: tp.grenadesFolder, title: "GESP", storeAs: "grenadeESP", tooltip: "Displays where grenade pickupables is on the map", bindLocation: tp.renderTab.pages[1], });
  971. initModule({ location: tp.grenadesFolder, title: "GTracers", storeAs: "grenadeTracers", tooltip: "No tooltip available", bindLocation: tp.renderTab.pages[1], });
  972. tp.grenadesFolder.addSeparator();
  973. initModule({ location: tp.grenadesFolder, title: "GRegime", storeAs: "grenadeESPRegime", tooltip: "No tooltip available", bindLocation: tp.renderTab.pages[1], dropdown: [{ text: "When Depleted", value: "whendepleted" }, { text: "When Low", value: "whenlow" }, { text: "Below Max", value: "belowmax" }, { text: "Always On", value: "alwayson" },], defaultValue: "whendepleted", disableConditions: [["grenadeESP", false], ["grenadeTracers", false]], });
  974. initModule({ location: tp.grenadesFolder, title: "GColor", storeAs: "grenadeESPColor", tooltip: "No tooltip available", defaultValue: "#00ffff", disableConditions: [["grenadeESP", false], ["grenadeTracers", false]], });
  975. tp.renderTab.pages[0].addSeparator();
  976. initModule({ location: tp.renderTab.pages[0], title: "Show Look Dir", storeAs: "lookTracers", tooltip: "Renders the looking direction of each player as a line", bindLocation: tp.renderTab.pages[1], });
  977. initFolder({ location: tp.renderTab.pages[0], title: "Look Direction Options", storeAs: "lookTracersFolder", });
  978. initModule({ location: tp.lookTracersFolder, title: "Render Above", storeAs: "lookTracersRGI1", tooltip: "Renders LookTracers above obstacles", bindLocation: tp.renderTab.pages[1], });
  979. //initModule({ location: tp.lookTracersFolder, title: "length", storeAs: "lookTracersLength", slider: { min: 0, max: 100, step: 0.25 }, defaultValue: 75, });
  980. initModule({ location: tp.lookTracersFolder, title: "LookTracerColor", storeAs: "lookTracersColor", tooltip: "Color of the LookTracers", defaultValue: "#00ffff", });
  981. tp.renderTab.pages[0].addSeparator();
  982. initModule({ location: tp.renderTab.pages[0], title: "FOV", storeAs: "fov", tooltip: "Controls the FOV of the game", slider: { min: 0, max: 360, step: 3 }, defaultValue: 72, });
  983. initModule({ location: tp.renderTab.pages[0], title: "Zoom FOV", storeAs: "zoom", tooltip: "Controls how zoomed in/out you are. Default keybind is C to zoom", slider: { min: 0, max: 72, step: 1 }, defaultValue: 15, bindLocation: tp.renderTab.pages[1], defaultBind: "C", });
  984. tp.renderTab.pages[0].addSeparator();
  985. initModule({ location: tp.renderTab.pages[0], title: "Perspective", storeAs: "perspective", tooltip: "Allows you to switch between third and first person. Think Minecraft F5!", bindLocation: tp.renderTab.pages[1], dropdown: [{ text: "1st Person (Default)", value: "firstPerson" }, { text: "3rd Person", value: "thirdPerson" }, { text: "3rd Person (Alt)", value: "thirdPersonAlt" } ], defaultValue: "disabled", defaultBind: "Digit5", });
  986. initFolder({ location: tp.renderTab.pages[0], title: "Perspective Options", storeAs: "perspectiveFolder", });
  987. initModule({ location: tp.perspectiveFolder, title: "Alpha Effect", storeAs: "perspectiveAlpha", tooltip: "Makes players a bit transparent when in third person", bindLocation: tp.renderTab.pages[1], });
  988. tp.perspectiveFolder.addSeparator();
  989. initModule({ location: tp.perspectiveFolder, title: "Y Offset", storeAs: "perspectiveY", tooltip: "Offset of the camera in y-direction (how far behind should it be?)", slider: { min: 0, max: 30, step: 0.25 }, defaultValue: 0.5});
  990. initModule({ location: tp.perspectiveFolder, title: "Z Offset", storeAs: "perspectiveZ", tooltip: "Offset of the camera in z-direction (how far above should it be?)", slider: { min: 0, max: 30, step: 0.25 }, defaultValue: 2});
  991. initModule({ location: tp.renderTab.pages[0], title: "CamWIP", storeAs: "freecam", tooltip: "Still a WIP (lazy devs lmaooooooooooo)", bindLocation: tp.renderTab.pages[1], });
  992. initModule({ location: tp.renderTab.pages[0], title: "Wireframe", storeAs: "wireframe", tooltip: "Outlines map objects to allow you to see directly though walls. Will leave rendering artifacts on the skybox, making the game basically unplayable", bindLocation: tp.renderTab.pages[1], });
  993. initModule({ location: tp.renderTab.pages[0], title: "Particle Speed", storeAs: "particleSpeedMultiplier", tooltip: "Adjusts speed of particles :D", slider: { min: 0.05, max: 5, step: 0.05 }, defaultValue: 1, });
  994. initModule({ location: tp.renderTab.pages[0], title: "Egg Size", storeAs: "eggSize", tooltip: "Changes how big eggs are. This does not affect hitboxes and is client-side only", slider: { min: 0, max: 10, step: 0.25 }, defaultValue: 1, });
  995. tp.renderTab.pages[0].addSeparator();
  996. initModule({ location: tp.renderTab.pages[0], title: "Set Detail", storeAs: "setDetail", tooltip: "Changes quality of game graphics", bindLocation: tp.renderTab.pages[1], dropdown: [{ text: "Disabled", value: "disabled" }, { text: "Auto Detail", value: "autodetail" }, { text: "No Details", value: "nodetails" }, { text: "Shadows", value: "shadows" }, { text: "High Res", value: "highres" }, { text: "Shadows+High Res", value: "shadowshighres" }], defaultValue: "disabled" });
  997. initModule({ location: tp.renderTab.pages[0], title: "Textures", storeAs: "enableTextures", tooltip: "Disables some textures. primarily, the sky", bindLocation: tp.renderTab.pages[1], defaultValue: true, });
  998. initModule({ location: tp.renderTab.pages[0], title: "Render Delay", storeAs: "renderDelay", tooltip: "Basically, this adds extra FPS buffer", slider: { min: 0, max: 30000, step: 10 }, defaultValue: 0, });
  999. //HUD MODULES
  1000. initFolder({ location: tp.mainPanel, title: "HUD", storeAs: "hudFolder", });
  1001. initTabs({ location: tp.hudFolder, storeAs: "hudTab" }, [
  1002. {
  1003. title: "WIP", content:
  1004. `Sorry! No guide yet!`},
  1005. ]);
  1006. initModule({ location: tp.hudTab.pages[0], title: "Show Bloom", storeAs: "revealBloom", tooltip: "Displays the next shot's bloom as a red dot onscreen", bindLocation: tp.hudTab.pages[1], });
  1007. initModule({ location: tp.hudTab.pages[0], title: "Show LOS", storeAs: "showLOS", tooltip: "Changes the crosshair's color if the player is in an enemy's line of sight", bindLocation: tp.hudTab.pages[1], });
  1008. initModule({ location: tp.hudTab.pages[0], title: "Show MinAngle", storeAs: "showMinAngle", tooltip: "Draws a circle representing the aimbot's minAngle to the hud", bindLocation: tp.hudTab.pages[1], });
  1009. initModule({ showConditions: [["disabledlmao", true]], location: tp.hudTab.pages[0], title: "Leaderboard", storeAs: "highlightLeaderboard", tooltip: "Sie wurden enterbt", bindLocation: tp.hudTab.pages[1], enableConditions: [["aimbot", true]], });
  1010. tp.hudTab.pages[0].addSeparator();
  1011. initModule({ location: tp.hudTab.pages[0], title: "Co-ords", storeAs: "showCoordinates", tooltip: "Displays current position on the map", bindLocation: tp.hudTab.pages[1], });
  1012. initModule({ location: tp.hudTab.pages[0], title: "RadarWIP", storeAs: "radar", tooltip: "Work-in-progress module. You should leave this off if you are not a dev", bindLocation: tp.hudTab.pages[1], });
  1013. initModule({ location: tp.hudTab.pages[0], title: "HP Display", storeAs: "playerStats", tooltip: "Displays the health of your opponents", bindLocation: tp.hudTab.pages[1], });
  1014. initModule({ location: tp.hudTab.pages[0], title: "PlayerInfo", storeAs: "playerInfo", tooltip: "Displays added information about the player you're targeting", bindLocation: tp.hudTab.pages[1], });
  1015. initModule({ location: tp.hudTab.pages[0], title: "GameInfo", storeAs: "gameInfo", tooltip: "Displays extra game information", bindLocation: tp.hudTab.pages[1], });
  1016. initModule({ location: tp.hudTab.pages[0], title: "ShowStream", storeAs: "showStreams", tooltip: "Detects & displays ongoing twitch streamers", bindLocation: tp.hudTab.pages[1], });
  1017. //CHAT MODULES
  1018. initFolder({ location: tp.mainPanel, title: "Chat", storeAs: "chatFolder", });
  1019. initTabs({ location: tp.chatFolder, storeAs: "chatTab" }, [
  1020. {
  1021. title: "WIP", content:
  1022. `Sorry! No guide yet!`},
  1023. ]);
  1024. initModule({ location: tp.chatTab.pages[0], title: "InfiniHistory", storeAs: "chatExtend", tooltip: "Disables the default limiting of message history", bindLocation: tp.chatTab.pages[1], });
  1025. initModule({ location: tp.chatTab.pages[0], title: "HighlightTxt", storeAs: "chatHighlight", tooltip: "Allows you to highlight text from the chat to copy somewhere else", bindLocation: tp.chatTab.pages[1], });
  1026. // initModule({ location: tp.chatTab.pages[0], title: "RestoreScroll", storeAs: "restoreScroll", tooltip: "Dont fucking add tooltips to modules that HAVE BEEN COMMENTED OUT WTF PUPPY?", bindLocation: tp.chatTab.pages[1], });
  1027. initModule({ location: tp.chatTab.pages[0], title: "Max Ingame", storeAs: "maxChat", tooltip: "The number of messages to show ingame (if unset, infinite history will cause issues)", slider: { min: 0, max: 30, step: 1 }, defaultValue: 5, });
  1028. initModule({ location: tp.chatTab.pages[0], title: "ShowFiltered", storeAs: "disableChatFilter", tooltip: "View messages that are caught by the game filter in red", bindLocation: tp.chatTab.pages[1], });
  1029. initModule({ location: tp.chatTab.pages[0], title: "UnfilterNames", storeAs: "unfilterNames", tooltip: "See filtered people's real names, highlighed in the leaderboard", bindLocation: tp.chatTab.pages[1], });
  1030. tp.chatTab.pages[0].addSeparator();
  1031. initModule({ location: tp.chatTab.pages[0], title: "BypassFilter", storeAs: "chatFilterBypass", tooltip: "Bypass naughty word game message filter!!!!1111 :D", bindLocation: tp.chatTab.pages[1], });
  1032. initModule({ location: tp.chatTab.pages[0], title: "Tall Chat", storeAs: "tallChat", tooltip: "Makes the chat text taller, appends a character to all sent messages", bindLocation: tp.chatTab.pages[1], });
  1033. tp.chatTab.pages[0].addSeparator();
  1034. initFolder({ location: tp.chatTab.pages[0], title: "FakeMessage", storeAs: "fakeMessageFolder", });
  1035. let listOfIDs = [];
  1036. if (unsafeWindow.extern && unsafeWindow.extern.inGame && ss && ss.PLAYERS) {
  1037. ss.PLAYERS.forEach((player) => {
  1038. listOfIDs.push({ text: player.name, value: String(player.id) });
  1039. log({ text: player.name, value: player.id })
  1040. });
  1041. };
  1042. initModule({ location: tp.fakeMessageFolder, title: "Send As", storeAs: "fakeMessageID", tooltip: "Who to send fake message as", bindLocation: tp.chatTab.pages[1], dropdown: [ ...listOfIDs, { text: "MOD", value: "254" }, { text: "SERVER", value: "255" } ], defaultValue: "255" });
  1043. initModule({ location: tp.fakeMessageFolder, title: '(Refresh List)', storeAs: 'fakeMessageRefresh', button: 'REFRESH', tooltip: "Refreshes list", bindLocation: tp.chatTab.pages[1], clickFunction: function () {
  1044. updateMenu = true;
  1045. } });
  1046. initModule({ location: tp.fakeMessageFolder, title: "Content", storeAs: "fakeMessageText", tooltip: "The content of the fake message", defaultValue: "ЅtateFarm Client On Top! ", });
  1047. initModule({ location: tp.fakeMessageFolder, title: "Bold Text", storeAs: "fakeMessageBold", tooltip: "Bold text", bindLocation: tp.chatTab.pages[1], });
  1048. initModule({ location: tp.fakeMessageFolder, title: 'SEND', storeAs: 'fakeMessageSend', button: 'SEND MESSAGE', tooltip: "Allows sending messages as MOD or SERVER (client sided only)", bindLocation: tp.chatTab.pages[1], clickFunction: function () {
  1049. if (ss.addChat && unsafeWindow.extern.inGame) {
  1050. try {
  1051. if (ss.isBadWord(extract("fakeMessageText"))) createPopup("Message would be filtered.", "error");
  1052. ss.addChat(extract("fakeMessageText"), !!extract("fakeMessageBold"), Number(extract("fakeMessageID")));
  1053. } catch (error) {
  1054. log("shit, sending a fake message failed. damn lmao.", error)
  1055. };
  1056. }
  1057. } });
  1058. tp.chatTab.pages[0].addSeparator();
  1059. initModule({ location: tp.chatTab.pages[0], title: "Spammer", storeAs: "spamChat", tooltip: "Automatically send messages", bindLocation: tp.chatTab.pages[1], });
  1060. initFolder({ location: tp.chatTab.pages[0], title: "Spammer Options", storeAs: "spammerFolder", });
  1061. initModule({ location: tp.spammerFolder, title: "Delay (ms)", storeAs: "spamChatDelay", tooltip: "The interval to send messages", slider: { min: 250, max: 60000, step: 10 }, defaultValue: 500, enableConditions: [["spamChat", true]], });
  1062. initModule({ location: tp.spammerFolder, title: "Spam Text", storeAs: "spamChatText", tooltip: "The message to spam", defaultValue: "ЅtateFarm Client On Top! ", });
  1063. tp.chatTab.pages[0].addSeparator();
  1064. initFolder({ location: tp.chatTab.pages[0], title: "Trolling", storeAs: "trollingFolder", });
  1065. initModule({ location: tp.trollingFolder, title: "Mock", storeAs: "mockMode", tooltip: "Rudely mocks people talking in chat", bindLocation: tp.chatTab.pages[1], });
  1066. initModule({ location: tp.trollingFolder, title: "Announcer", storeAs: "announcer", tooltip: "Announces when you change GUI config", bindLocation: tp.chatTab.pages[1], });
  1067. tp.trollingFolder.addSeparator();
  1068. initModule({ location: tp.trollingFolder, title: "AutoEZ", storeAs: "autoEZ", tooltip: "Gloats on people when you kill them", bindLocation: tp.chatTab.pages[1], });
  1069. initModule({ location: tp.trollingFolder, title: "CheatAccuse", storeAs: "cheatAccuse", tooltip: "Accuses your killer of cheating", bindLocation: tp.chatTab.pages[1], });
  1070. tp.chatTab.pages[0].addSeparator();
  1071. initFolder({ location: tp.chatTab.pages[0], title: "Join/Leave Msgs Options", storeAs: "joinLeaveFolder", });
  1072. initModule({ location: tp.joinLeaveFolder, title: "Join Msgs", storeAs: "joinMessages", tooltip: " Notify you when players join", bindLocation: tp.chatTab.pages[1], });
  1073. initModule({ location: tp.joinLeaveFolder, title: "Leave Msgs", storeAs: "leaveMessages", tooltip: "Notify you when players leave", bindLocation: tp.chatTab.pages[1], });
  1074. tp.joinLeaveFolder.addSeparator();
  1075. initModule({ location: tp.joinLeaveFolder, title: "Send2Chat", storeAs: "publicBroadcast", tooltip: "Decides if these messages are shown to only you or everyone", bindLocation: tp.chatTab.pages[1], disableConditions: [["joinMessages", false], ["leaveMessages", false]], });
  1076. initModule({ location: tp.joinLeaveFolder, title: "[SFC]Added", storeAs: "joinLeaveBranding", tooltip: "If send2chat is enabled, this will add [SFC] to the beginning of the join/leave messages", bindLocation: tp.chatTab.pages[1], disableConditions: [["joinMessages", false], ["leaveMessages", false]], });
  1077. //LISTS MODULES
  1078. initFolder({ location: tp.mainPanel, title: "Lists", storeAs: "listsFolder", });
  1079. initTabs({ location: tp.listsFolder, storeAs: "listsTab" }, [
  1080. {
  1081. title: "WIP", content:
  1082. `Sorry! No guide yet!`},
  1083. ]);
  1084. initModule({ location: tp.listsTab.pages[0], title: "Whitelist", storeAs: "whitelist", tooltip: "A list of names to use the below configuration. Separate with commas", defaultValue: "User-1, User-2", });
  1085. initFolder({ location: tp.listsTab.pages[0], title: "Whitelist (Target Only) Options", storeAs: "whitelistFolder", });
  1086. initModule({ location: tp.whitelistFolder, title: "WAimbot", storeAs: "enableWhitelistAimbot", tooltip: "Only will aimbot on the specified whitelist player(s). if the player(s) are all dead, you will target nothing", bindLocation: tp.listsTab.pages[1], });
  1087. initModule({ location: tp.whitelistFolder, title: "When None Visible", storeAs: "enableWhenNoneVisible", tooltip: "Still targets non-whitelisted players if no whitelisted player is a valid target", bindLocation: tp.listsTab.pages[1], });
  1088. initModule({ location: tp.whitelistFolder, title: "WESP", storeAs: "enableWhitelistTracers", tooltip: "A special behavior will appear to whitelisted ESP people", bindLocation: tp.listsTab.pages[1], disableConditions: [["tracers", false], ["playerESP", false]], });
  1089. initModule({ location: tp.whitelistFolder, title: "WESPType", storeAs: "whitelistESPType", tooltip: "Make their ESP line a special color, or exclude", bindLocation: tp.listsTab.pages[1], dropdown: [{ text: "Only Include", value: "onlyinclude" }, { text: "Highlight", value: "highlight" },], defaultValue: "onlyinclude", disableConditions: [["tracers", false], ["playerESP", false]], showConditions: [["enableWhitelistTracers", true]], });
  1090. initModule({ location: tp.whitelistFolder, title: "WHighlight", storeAs: "whitelistColor", tooltip: "The color to highlight whitelisted players in", defaultValue: "#e80aac", disableConditions: [["tracers", false], ["playerESP", false]], showConditions: [["enableWhitelistTracers", true], ["whitelistESPType", "highlight"]], });
  1091. tp.listsTab.pages[0].addSeparator();
  1092. initModule({ location: tp.listsTab.pages[0], title: "Blacklist", storeAs: "blacklist", tooltip: "A list of names to use the below configuration. Separate with commas", defaultValue: "User-1, User-2", });
  1093. initFolder({ location: tp.listsTab.pages[0], title: "Blacklist (Exclude) Options", storeAs: "blacklistFolder", });
  1094. initModule({ location: tp.blacklistFolder, title: "BAimbot", storeAs: "enableBlacklistAimbot", tooltip: "Never will aimbot on the specified whitelist player(s)", bindLocation: tp.listsTab.pages[1], });
  1095. initModule({ location: tp.blacklistFolder, title: "BESP", storeAs: "enableBlacklistTracers", tooltip: "A special behavior will appear to blacklisted ESP people", bindLocation: tp.listsTab.pages[1], disableConditions: [["tracers", false], ["playerESP", false]], });
  1096. initModule({ location: tp.blacklistFolder, title: "BESPType", storeAs: "blacklistESPType", tooltip: "what", bindLocation: tp.listsTab.pages[1], dropdown: [{ text: "Just Exclude", value: "justexclude" }, { text: "Highlight", value: "highlight" },], defaultValue: "justexclude", disableConditions: [["tracers", false], ["playerESP", false]], showConditions: [["enableBlacklistTracers", true]], });
  1097. initModule({ location: tp.blacklistFolder, title: "BHighlight", storeAs: "blacklistColor", tooltip: "Color to use for blacklisted highlighting", defaultValue: "#00ff00", disableConditions: [["tracers", false], ["playerESP", false]], showConditions: [["enableBlacklistTracers", true], ["blacklistESPType", "highlight"]], });
  1098. //AUTOMATION MODULES
  1099. initFolder({ location: tp.mainPanel, title: "Automation", storeAs: "automationFolder", });
  1100. initTabs({ location: tp.automationFolder, storeAs: "automationTab" }, [
  1101. {
  1102. title: "WIP", content:
  1103. `Sorry! No guide yet!`},
  1104. ]);
  1105. initModule({
  1106. location: tp.automationTab.pages[0], title: "Flood Report", storeAs: "floodReport", tooltip: "Mass reports everyone. o7, comrade", bindLocation: tp.automationTab.pages[1], button: "Spam Now!", clickFunction: function () {
  1107. createPopup("Thank you for your efforts comrade! o7");
  1108. spamReport();
  1109. },
  1110. });
  1111. tp.automationTab.pages[0].addSeparator();
  1112. initModule({ location: tp.automationTab.pages[0], title: "Bunnyhop", storeAs: "bunnyhop", tooltip: "Makes you automatically bunnyhop when holding down the jump button", bindLocation: tp.automationTab.pages[1], });
  1113. initModule({ location: tp.automationTab.pages[0], title: "Auto Walk", storeAs: "autoWalk", tooltip: "Walks forward automatically", bindLocation: tp.automationTab.pages[1], });
  1114. initModule({ location: tp.automationTab.pages[0], title: "Auto Strafe", storeAs: "autoStrafe", tooltip: "Strafes automatically", bindLocation: tp.automationTab.pages[1], });
  1115. initModule({ location: tp.automationTab.pages[0], title: "Auto Jump", storeAs: "autoJump", tooltip: "Jumps on the specified interval", bindLocation: tp.automationTab.pages[1], });
  1116. initModule({ location: tp.automationTab.pages[0], title: "Jump Delay", storeAs: "autoJumpDelay", tooltip: "How often should AutoJump trigger", slider: { min: 1, max: 10000, step: 1 }, defaultValue: 1, showConditions: [["autoJump", true]], });
  1117. tp.automationTab.pages[0].addSeparator();
  1118. initModule({ location: tp.automationTab.pages[0], title: "AutoWeapon", storeAs: "autoWeapon", tooltip: "Automatically picks a weapon", bindLocation: tp.automationTab.pages[1], dropdown: [{ text: "Disabled", value: "disabled" }, { text: "EggK-47", value: "eggk47" }, { text: "Scrambler", value: "scrambler" }, { text: "Free Ranger", value: "freeranger" }, { text: "RPEGG", value: "rpegg" }, { text: "Whipper", value: "whipper" }, { text: "Crackshot", value: "crackshot" }, { text: "Tri-Hard", value: "trihard" }, { text: "Randomised", value: "random" }], defaultValue: "disabled" });
  1119. initModule({ location: tp.automationTab.pages[0], title: "AutoGrenade", storeAs: "autoGrenade", tooltip: "Automatically grenades w/ a delay", bindLocation: tp.automationTab.pages[1], });
  1120. tp.automationTab.pages[0].addSeparator();
  1121. initFolder({ location: tp.automationTab.pages[0], title: "Auto Join Options", storeAs: "autoJoinFolder", });
  1122. initModule({ location: tp.autoJoinFolder, title: "Auto Join", storeAs: "autoJoin", tooltip: "Automatically joins a game", bindLocation: tp.automationTab.pages[1], });
  1123. initModule({ location: tp.autoJoinFolder, title: "Join Code", storeAs: "joinCode", tooltip: "The gamecode used by AutoJoin", defaultValue: "CODE", enableConditions: [["autoJoin", true]], });
  1124. initModule({ location: tp.autoJoinFolder, title: "Get Code", storeAs: "getCode", tooltip: "Get the current gamecode for the autoJoin code field, uses last code you were in if in menu", button: "Retrieve", clickFunction: function () { change("joinCode", GAMECODE) }, enableConditions: [["autoJoin", true]], });
  1125. initFolder({ location: tp.automationTab.pages[0], title: "Auto Name Options", storeAs: "autoNamesFolder", });
  1126. initModule({ location: tp.autoNamesFolder, title: "Use Name", storeAs: "useCustomName", tooltip: "Automaticaly names yourself", bindLocation: tp.automationTab.pages[1], });
  1127. initModule({ location: tp.autoNamesFolder, title: "New Name", storeAs: "usernameAutoJoin", tooltip: "The name used by useCustomName", defaultValue: "ЅtateFarmer", enableConditions: [["useCustomName", true]], });
  1128. //the name usernameAutoJoin is only kept for compatability
  1129. initModule({ location: tp.autoNamesFolder, title: "Copy Name", storeAs: "copyName", button: "Steal Name", enableConditions: [["useCustomName", true]], tooltip: "Steals a random lobby player's name", bindLocation: tp.automationTab.pages[1], clickFunction: function(){
  1130. const copiedName = retrieveCopiedName();
  1131. log("Retrieved copied name:",copiedName);
  1132. change("usernameAutoJoin",(copiedName||"ЅtateFarmer"));
  1133. },});
  1134. initModule({ location: tp.autoNamesFolder, title: "Random Name", storeAs: "randomName", button: "Randomise Name", enableConditions: [["useCustomName", true]], tooltip: "Gets a random shell shockers default sounding name", bindLocation: tp.automationTab.pages[1], clickFunction: function(){
  1135. const randomisedName = unsafeWindow.extern.generateRandomName();
  1136. change("usernameAutoJoin",(randomisedName||"ЅtateFarmer"));
  1137. },});
  1138. tp.automationTab.pages[0].addSeparator();
  1139. initModule({ location: tp.automationTab.pages[0], title: "AutoRespawn", storeAs: "autoRespawn", tooltip: "Automatically respawn", bindLocation: tp.automationTab.pages[1], });
  1140. initModule({ location: tp.automationTab.pages[0], title: "Auto Team", storeAs: "autoTeam", tooltip: "Automatically picks a team", bindLocation: tp.automationTab.pages[1], dropdown: [{ text: "Disabled", value: "disabled" }, { text: "Red Team", value: "red" }, { text: "Blue Team", value: "blue" }, { text: "Random Team", value: "random" }], defaultValue: "disabled" });
  1141. tp.automationTab.pages[0].addSeparator();
  1142. initFolder({ location: tp.automationTab.pages[0], title: "Game Blacklist Settings", storeAs: "gameBlacklistFolder", });//Game Blacklist Folder
  1143. initModule({ location: tp.gameBlacklistFolder, title: "Blacklist On", storeAs: "gameBlacklist", tooltip: "Prevents you from joining specific games", bindLocation: tp.automationTab.pages[1], });
  1144. initModule({ location: tp.gameBlacklistFolder, title: "Codes:", storeAs: "gameBlacklistCodes", tooltip: "The game list used by GameBlacklist, seperated with commas", defaultValue: "", });
  1145. initModule({ location: tp.gameBlacklistFolder, title: "Get BL Code", storeAs: "getCodeBlacklist", button: "Retrieve", tooltip: "Get the current gamecode for the GameBlacklist code field, uses last code you were in if in menu", bindLocation: tp.automationTab.pages[1], clickFunction: function(){
  1146. if (GAMECODE != undefined && GAMECODE != null){
  1147. if (extract("gameBlacklistCodes") != "" && extract("gameBlacklistCodes") != undefined) { //does the list exist yet?
  1148. let cds = extract("gameBlacklistCodes").split(","); //get the codes as an array
  1149. if(cds.includes(GAMECODE)){ //the code is already in the list!
  1150. createPopup("Gamecode already in list!"); //notify user that we aren't adding the code'
  1151. return; //no need to add code to list, so gtfo
  1152. }
  1153. }
  1154. extract("gameBlacklistCodes") != undefined ? change("gameBlacklistCodes", extract("gameBlacklistCodes")+GAMECODE+",") : change("gameBlacklistCodes", GAMECODE+",");
  1155. } else {
  1156. createPopup("Join a game first");
  1157. };
  1158. },});
  1159. initModule({ location: tp.gameBlacklistFolder, title: "Clear BL Codes", storeAs: "clearCodeBlacklist", button: "Clear", tooltip: "Empties the GameBlacklist code list", bindLocation: tp.automationTab.pages[1], clickFunction: function(){ //capitalise PLS
  1160. //not a big fan of this "logic in init" thing, but it's basically the norm now + the funcs are really designed to be used this way so yh :( (Seq rant)
  1161. if(extract("gameBlacklistCodes") != undefined) //do we have codes yet? Otherwise the log is either gonna be pointless or error...
  1162. log("Clearing BL codes, cleared list: " +extract("gameBlacklistCodes")); //wouldn't be needed but allows for retrival of codes on accidental/partial deletion, and one more line of log can't hurt too much, can it?
  1163. change("gameBlacklistCodes", ""); //just set the blacklist to an empty String
  1164. },});
  1165. tp.automationTab.pages[0].addSeparator();
  1166. initModule({ location: tp.automationTab.pages[0], title: "LeaveGame", storeAs: "leaveGame", button: "Unjoin Game", tooltip: "Leave to the menu", bindLocation: tp.automationTab.pages[1], clickFunction: function () { unsafeWindow.vueApp.onLeaveGameConfirm() }, });
  1167. initModule({ location: tp.automationTab.pages[0], title: "LeaveEmpty", storeAs: "leaveEmpty", tooltip: "Leaves empty games", bindLocation: tp.automationTab.pages[1], });
  1168. initModule({ location: tp.automationTab.pages[0], title: "Auto Leave", storeAs: "autoLeave", tooltip: "Automatically leaves after a specified interval", bindLocation: tp.automationTab.pages[1], });
  1169. initModule({ location: tp.automationTab.pages[0], title: "Delay (s)", storeAs: "autoLeaveDelay", tooltip: "The interval after which autoLeave evacuates to the lobby", slider: { min: 0, max: 3600, step: 1 }, defaultValue: 300, enableConditions: [["autoLeave", true]] });
  1170. tp.automationTab.pages[0].addSeparator();
  1171. initModule({ location: tp.automationTab.pages[0], title: "Gamemode", storeAs: "autoGamemode", tooltip: "Picks a gamemode for autojoin", bindLocation: tp.automationTab.pages[1], dropdown: [{ text: "Disabled", value: "disabled" }, { text: "FFA", value: "ffa" }, { text: "Teams", value: "teams" }, { text: "Captula", value: "captula" }, { text: "KotC", value: "kotc" }, { text: "Randomised", value: "random" }], defaultValue: "disabled" });
  1172. initModule({ location: tp.automationTab.pages[0], title: "Auto Region", storeAs: "autoRegion", tooltip: "Automatically selects a region to play in", bindLocation: tp.automationTab.pages[1], dropdown: [{ text: "Disabled", value: "disabled" }, { text: "Chile", value: "santiago" }, { text: "Germany", value: "germany" }, { text: "Singapore", value: "singapore" }, { text: "Sydney", value: "sydney" }, { text: "US Central", value: "uscentral" }, { text: "US East", value: "useast" }, { text: "US West", value: "uswest" }, { text: "Randomised", value: "random" }], defaultValue: "disabled" });
  1173. tp.automationTab.pages[0].addSeparator();
  1174. initModule({ location: tp.automationTab.pages[0], title: "Egg Color", storeAs: "eggColor", tooltip: "Picks the egg color automatically", bindLocation: tp.automationTab.pages[1], dropdown: [{ text: "Disabled", value: "disabled" }, { text: "White", value: "white" }, { text: "Light Blue", value: "lightblue" }, { text: "Light Eggshell", value: "lighteggshell" }, { text: "Eggshell", value: "eggshell" }, { text: "Dark Eggshell", value: "darkeggshell" }, { text: "Darker Eggshell", value: "darkereggshell" }, { text: "Darkest Eggshell", value: "darkesteggshell" }, { text: "Red (VIP)", value: "red" }, { text: "Purple (VIP)", value: "purple" }, { text: "Pink (VIP)", value: "pink" }, { text: "Yellow (VIP)", value: "yellow" }, { text: "Blue (VIP)", value: "blue" }, { text: "Green (VIP)", value: "green" }, { text: "Lime (VIP)", value: "lime" }, /*{text: "Randomised", value: "random"}*/], defaultValue: "disabled" });
  1175. initModule({ location: tp.automationTab.pages[0], title: "Auto Stamp", storeAs: "autoStamp", tooltip: "Picks the egg stamp automatically", bindLocation: tp.automationTab.pages[1], dropdown: [{ text: "Disabled", value: "disabled" }, { text: "Target Stamp", value: "target" }, { text: "No Sign Stamp", value: "nosign" }, { text: "Question Mark Stamp?", value: "question" }, { text: "Peace Stamp", value: "peace" }, { text: "Thumbs Up Stamp", value: "thumbsup" }, { text: "Pablo Smile Stamp", value: "pablosmile" }], defaultValue: "disabled" });
  1176. initModule({ location: tp.automationTab.pages[0], title: "Auto Hat", storeAs: "autoHat", tooltip: "Picks the egg hat automatically", bindLocation: tp.automationTab.pages[1], dropdown: [{ text: "Disabled", value: "disabled" }, { text: "Ball Cap", value: "ballcap" }, { text: "Boat Fedora", value: "boatfedora" }, { text: "Top Hat", value: "tophat" }, { text: "Derby Hat", value: "derbyhat" }, { text: "Mountie Hat", value: "mountiehat" }, { text: "Pablo Hat", value: "pablohat" }], defaultValue: "disabled" });
  1177. //BOTTING MODULES
  1178. initFolder({ location: tp.mainPanel, title: "Botting", storeAs: "bottingFolder", });
  1179. initTabs({ location: tp.bottingFolder, storeAs: "bottingTab" }, [
  1180. {
  1181. title: "WIP", content:
  1182. `Sorry! No guide yet!
  1183. But check out the GitHub guide.`},
  1184. ]);
  1185. initModule({ location: tp.bottingTab.pages[0], title: "Show Panel", storeAs: "showBotPanel", tooltip: "Show the bot panel", bindLocation: tp.bottingTab.pages[1], button: "Show Panel", defaultBind: "J", clickFunction: () => {
  1186. tp.botPanel.hidden = !tp.botPanel.hidden;
  1187. }});
  1188. tp.bottingTab.pages[0].addSeparator();
  1189. initModule({ location: tp.bottingTab.pages[0], title: "How To?", storeAs: "bottingGuide", tooltip: "Click for infos on how to get started and free candy", button: "Link", clickFunction: function () { GM_openInTab(bottingGuideURL, { active: true }) }, });
  1190. //THEMING MODULES
  1191. initFolder({ location: tp.mainPanel, title: "Theming", storeAs: "themingFolder", });
  1192. initTabs({ location: tp.themingFolder, storeAs: "themingTab" }, [
  1193. {
  1194. title: "WIP", content:
  1195. `Sorry! No guide yet!`},
  1196. ]);
  1197. initModule({ location: tp.themingTab.pages[0], title: "Skybox", storeAs: "skybox", tooltip: "Allows you to switch out Shell's default skybox", bindLocation: tp.themingTab.pages[1], dropdown: loadedSkyboxes, changeFunction: (newSkybox) => {
  1198. if (!unsafeWindow[skyboxName]) return;
  1199. unsafeWindow[skyboxName].material.reflectionTexture.coordinatesMode = L.BABYLON.Texture.SKYBOX_MODE;
  1200. }});
  1201. initModule({ location: tp.themingTab.pages[0], title: "Randomize Skybox", storeAs: "randomSkyBox", tooltip: "Switches the skybox to a random one", bindLocation: tp.themingTab.pages[1], });
  1202. initModule({ location: tp.themingTab.pages[0], title: "Switch Interval", storeAs: "randomSkyBoxInterval", tooltip: "The interval after which the skybox is switched, given that randomSkyBox is enabled. In minutes", slider: { min: 1, max: 10, step: 0.1 }, defaultValue: 3, });
  1203. tp.themingTab.pages[0].addSeparator();
  1204. initModule({ location: tp.themingTab.pages[0], title: "Legacy Models", storeAs: "legacyModels", tooltip: "Switches to the old models", bindLocation: tp.themingTab.pages[1], });
  1205. initModule({ location: tp.themingTab.pages[0], title: "Game Filter", storeAs: "filter", tooltip: "Adds a color tint to the game", bindLocation: tp.themingTab.pages[1], dropdown: [
  1206. {text: "Default", value: 2},
  1207. {text: "Blue", value: 3},
  1208. {text: "Mexico", value: 4},
  1209. ],});
  1210. initModule({ location: tp.themingTab.pages[0], title: "Gun Position", storeAs: "gunPosition", tooltip: "Changes the position of your player's gun", bindLocation: tp.themingTab.pages[1], dropdown: [
  1211. {text: "Right", value: "right"},
  1212. {text: "Left", value: "left"},
  1213. {text: "Hidden", value: "hidden"},
  1214. ],});
  1215. tp.themingTab.pages[0].addSeparator();
  1216. initFolder({ location: tp.themingTab.pages[0], title: "Audio Settings", storeAs: "audioFolder", });
  1217. initModule({ location: tp.audioFolder, title: "Mute Game", storeAs: "muteGame", tooltip: "Mute the game?", bindLocation: tp.themingTab.pages[1], });
  1218. initModule({ location: tp.audioFolder, title: "DistanMult", storeAs: "distanceMult", tooltip: "Makes the distance when playing sfx change", slider: { min: 0.01, max: 2, step: 0.01 }, defaultValue: 1, });
  1219. tp.audioFolder.addSeparator();
  1220. initModule({ location: tp.audioFolder, title: "CustomSFX (1st)", storeAs: "customSFX1", tooltip: "Select a custom sound pack. Changes in-game sounds. Three pack slots available at once", bindLocation: tp.themingTab.pages[1], enableConditions: [["muteGame", false]], dropdown: JSON.parse(JSON.stringify(retrievedSFX)), });
  1221. initModule({ location: tp.audioFolder, title: "CustomSFX (2nd)", storeAs: "customSFX2", tooltip: "Select a custom sound pack. Changes in-game sounds. Three pack slots available at once", bindLocation: tp.themingTab.pages[1], enableConditions: [["muteGame", false]], dropdown: JSON.parse(JSON.stringify(retrievedSFX)), });
  1222. initModule({ location: tp.audioFolder, title: "CustomSFX (3rd)", storeAs: "customSFX3", tooltip: "Select a custom sound pack. Changes in-game sounds. Three pack slots available at once", bindLocation: tp.themingTab.pages[1], enableConditions: [["muteGame", false]], dropdown: JSON.parse(JSON.stringify(retrievedSFX)), });
  1223. tp.themingTab.pages[0].addSeparator();
  1224. initModule({ location: tp.themingTab.pages[0], title: "Replace Logo", storeAs: "replaceLogo", tooltip: "Replaces shell shockers' BORING logo with the BEAUTIFUL StateFarm logo", bindLocation: tp.themingTab.pages[1], });
  1225. initModule({ location: tp.themingTab.pages[0], title: "Animate Title", storeAs: "titleAnimation", tooltip: "Makes the page title look cool", bindLocation: tp.themingTab.pages[1], });
  1226. initModule({ location: tp.themingTab.pages[0], title: "Client Theme", storeAs: "themeType", tooltip: "Controls the client's UI theme", bindLocation: tp.themingTab.pages[1], dropdown: [
  1227. {text: "Default", value: "defaultTheme"},
  1228. {text: "Iceberg", value: "icebergTheme"},
  1229. {text: "Jet Black", value: "jetblackTheme"},
  1230. {text: "Light", value: "lightTheme"},
  1231. {text: "Retro", value: "retroTheme"},
  1232. {text: "Translucent", value: "translucentTheme"},
  1233. {text: "StateFarmer", value: "statefarmerTheme"},
  1234. {text: "Blurple", value: "blurpleTheme"},
  1235. {text: "ShellFarm", value: "shellFarmTheme"},
  1236. ], defaultValue: "defaultTheme", changeFunction: function(value) {
  1237. applyTheme(value.value);
  1238. }});
  1239. tp.themingTab.pages[0].addSeparator();
  1240. initModule({ location: tp.themingTab.pages[0], title: "Enable Party Lights", storeAs: "partyLightsEnabled", tooltip: "🥳🥳 Let the party begin 🎉🎉", bindLocation: tp.themingTab.pages[1], });
  1241. initModule({ location: tp.themingTab.pages[0], title: "Party Lights Intensity", storeAs: "partyLightsIntensity", tooltip: "Intensity of the party 🥳", slider: { min: 0.01, max: 20, step: 0.01 }, defaultValue: 0.5, });
  1242. //ACCOUNT MODULES
  1243. initFolder({ location: tp.mainPanel, title: "Accounts", storeAs: "accountsFolder", });
  1244. initTabs({ location: tp.accountsFolder, storeAs: "accountsTab" }, [
  1245. {
  1246. title: "Basics", content:
  1247. `This is the accounts tab. Here you will find
  1248. options relating to managing your thousands of
  1249. shell accounts and options that will enable you
  1250. to alt like a pro.
  1251.  
  1252. NOTE: ShellPrint is currently unsupported on
  1253. this version of StateFarm Client.`},
  1254. {
  1255. title: "Login DB", content:
  1256. `The Login DB allows you to alt with ease. Put
  1257. simply, it is just a list of EmailPass combos.
  1258. It is simpler than AccountRecords, but one does
  1259. not replace the other. Login DB is stored
  1260. universally across all Shell proxies, and
  1261. has a queue system. Each time an account
  1262. from this list is logged into, it moves it
  1263. to the back of the list, allowing you to
  1264. have a steady stream of fresh accounts.
  1265.  
  1266. PRIVACY NOTE: This database will contain some
  1267. important information. All data is stored locally
  1268. and will never be requested by the StateFarm
  1269. development team, but can theoretically be stolen
  1270. via the use of other userscripts not authorised
  1271. by the StateFarm developers. This DB is not
  1272. exposed to the Shell Shockers game (unless you
  1273. have enabled debug mode).`},
  1274. {
  1275. title: "AccRecord", content:
  1276. `The AccountRecords database is similar, but
  1277. different to the Login DB. Whilst the Login DB
  1278. serves to allow you to quickly switch to a new
  1279. account, AccountRecords saves information
  1280. related to accounts you've logged into. It saves
  1281. info such as your egg count, items in your
  1282. inventory and the value of your inventory.
  1283. This feature is even more advanced than the
  1284. Login DB, and is only recommended for use by
  1285. people who really know what they're doing. If
  1286. you just like aimbotting, you really don't need
  1287. to worry about this.
  1288.  
  1289. FYI: This will attempt to save info about any
  1290. account, but will only perform best when you
  1291. are using an account that you logged into using
  1292. StateFarm's login or account creation modules.
  1293. Other accounts will have limited info, such as
  1294. masked emails and no EmailPass combos.
  1295.  
  1296. PRIVACY NOTE: This database will contain some
  1297. important information. You can disable the
  1298. logging of this info in the settings. All data
  1299. is stored locally and will never be requested
  1300. by the StateFarm development team, but can
  1301. theoretically be stolen via the use of other
  1302. userscripts not authorised by the StateFarm
  1303. developers. This DB is not exposed to the
  1304. Shell Shockers game (unless you have enabled
  1305. debug mode).`},
  1306. ]);
  1307. initFolder({ location: tp.accountsTab.pages[0], title: "Account Login (Basic)", storeAs: "loginFolder", });
  1308. initModule({ location: tp.loginFolder, title: 'Email:Pass', storeAs: 'loginEmailPass', tooltip: "Field for loginLogin", defaultValue: "ex@gmail.com:passwd" });
  1309. initModule({ location: tp.loginFolder, title: 'Login Account', storeAs: 'loginLogin', tooltip: "Log into an account using email:pass without using shell's UI", button: 'LOGIN', bindLocation: tp.accountsTab.pages[1], clickFunction: function () {
  1310. let emailPass = extract("loginEmailPass");
  1311. if (emailPass.includes(":")) {
  1312. loginOrCreateWithEmailPass(emailPass);
  1313. } else {
  1314. emailPass = prompt('Your email:pass isn\'t valid. Enter your combo below or input the correct one in the box.', '');
  1315. if (emailPass.includes(":")) {
  1316. loginOrCreateWithEmailPass(emailPass);
  1317. }; //else fuck you. im not doing anything with that.
  1318. };
  1319. } });
  1320. tp.accountsTab.pages[0].addSeparator();
  1321. initFolder({ location: tp.accountsTab.pages[0], title: "Account Login (Login Database)", storeAs: "loginDatabaseFolder", });
  1322. initModule({ location: tp.loginDatabaseFolder, title: 'Login Next Account', storeAs: 'loginDatabaseLogin', button: 'LOGIN', tooltip: "Tools for managing accounts in a Database", bindLocation: tp.accountsTab.pages[1], clickFunction: function () {
  1323. let loginDB = GM_getValue("StateFarm_LoginDB") || []; //why declare this so many times? the DBs need to be constantly rechecked, as other clients may have modified. we wouldnt want to be overwriting each other. (yes this needed to be said again)
  1324. let loginDBlength = loginDB.length;
  1325. if (loginDBlength > 0) {
  1326. let index = extract("loginDatabaseSelection") == "inorder" ? 0 : Math.ceil((Math.random()*0.75)*(loginDBlength-1));
  1327. log(`selecting index ${index}, this is out of ${loginDBlength} entries.`);
  1328. let [emailPass] = loginDB.splice(index, 1); //delete and retrieve
  1329. loginDB.push(emailPass);
  1330. log(`deleted and reinserted ${emailPass} at the end.`);
  1331. loginOrCreateWithEmailPass(emailPass);
  1332. GM_setValue("StateFarm_LoginDB", loginDB);
  1333. createPopup(`Logging in from index ${index}...`);
  1334. } else {
  1335. createPopup("LoginDB is empty!", "error");
  1336. };
  1337. } });
  1338. initModule({ location: tp.loginDatabaseFolder, title: "Selection Type", storeAs: "loginDatabaseSelection", tooltip: "Tools for managing accounts in a Database", bindLocation: tp.accountsTab.pages[1], dropdown: [{ text: "In Order", value: "inorder" }, { text: "Random", value: "random" }], defaultValue: "inorder" });
  1339. initModule({ location: tp.loginDatabaseFolder, title: "Auto Login", storeAs: "autoLogin", tooltip: "Tools for managing accounts in a Database", bindLocation: tp.accountsTab.pages[1], dropdown: [{ text: "Disabled", value: "disabled" }, { text: "When No Account", value: "noaccount" }, { text: "Always", value: "always" }], defaultValue: "disabled" });
  1340. tp.loginDatabaseFolder.addSeparator();
  1341. initModule({ location: tp.loginDatabaseFolder, title: 'Export DB(JSON)', storeAs: 'loginDatabaseExport', tooltip: "Tools for managing accounts in a Database", button: 'EXPORT (COPY)', bindLocation: tp.accountsTab.pages[1], clickFunction: function () {
  1342. GM_setClipboard(JSON.stringify(GM_getValue("StateFarm_LoginDB") || []), "text", () => log("Clipboard set!"));
  1343. createPopup("Login DB copied to clipboard...");
  1344. } });
  1345. initModule({ location: tp.loginDatabaseFolder, title: 'Import Into LoginDB', storeAs: 'loginDatabaseExport', tooltip: "Tools for managing accounts in a Database", button: 'APPEND (PASTE)', bindLocation: tp.accountsTab.pages[1], clickFunction: function () {
  1346. let userInput = prompt(`Input data you would like to add to your LoginDB. This will NOT replace your current data. All data added here will be put at the end of the queue. Also make sure that this data goes here and not into the AccountRecords DB.`, 'Reminder: JSON format!');
  1347. try {
  1348. let loginDB = GM_getValue("StateFarm_LoginDB") || []; //why declare this so many times? the DBs need to be constantly rechecked, as other clients may have modified. we wouldnt want to be overwriting each other. (yes this needed to be said again)
  1349. let appendedData = JSON.parse(userInput);
  1350. appendedData.forEach(data => {
  1351. if (data && !loginDB.includes(data)) loginDB.push(data);
  1352. });
  1353. GM_setValue("StateFarm_LoginDB", loginDB);
  1354. createPopup("Success! Data appended to LoginDB.", "success");
  1355. } catch {
  1356. createPopup("Failed! Check the formatting.", "error");
  1357. };
  1358. } });
  1359. initModule({ location: tp.loginDatabaseFolder, title: 'ImportFromRecords', storeAs: 'loginDatabaseImportRecords', tooltip: "Tools for managing accounts in a Database", button: 'APPEND', bindLocation: tp.accountsTab.pages[1], clickFunction: function () {
  1360. if (prompt("This action will import any Email:Pass combos you have in AccountRecords. Make sure you want to do this, as this will potentially add a lot of new records. Type 'ok' to proceed. This cannot be reversed, export first to be safe. Note: all the new records are added to the end of the queue.") === 'ok') {
  1361. let accountRecords = GM_getValue("StateFarm_AccountRecords") || {}; //why declare this so many times? the DBs need to be constantly rechecked, as other clients may have modified. we wouldnt want to be overwriting each other.
  1362. let loginDB = GM_getValue("StateFarm_LoginDB") || []; //why declare this so many times? the DBs need to be constantly rechecked, as other clients may have modified. we wouldnt want to be overwriting each other. (yes this needed to be said again)
  1363. Object.entries(accountRecords).forEach(([key, account]) => {
  1364. let emailPass = account.emailPass;
  1365. if (emailPass && !loginDB.includes(emailPass)) {
  1366. loginDB.push(emailPass);
  1367. };
  1368. });
  1369. GM_setValue("StateFarm_LoginDB", loginDB);
  1370. createPopup("Appended from AccountDetails!", "success");
  1371. };
  1372. } });
  1373. initModule({ location: tp.loginDatabaseFolder, title: 'Delete LoginDB', storeAs: 'loginDatabaseDelete', tooltip: "Tools for managing accounts in a Database", button: 'DELETE!', bindLocation: tp.accountsTab.pages[1], clickFunction: function () {
  1374. if (prompt("WARNING! This is a destructive action! Type 'ok' if you are really sure you want to delete your LoginDB! This cannot be reversed, export first to be safe.") === 'ok') {
  1375. GM_setValue("StateFarm_LoginDB", []); //o7 data
  1376. };
  1377. } });
  1378. initModule({ location: tp.loginDatabaseFolder, title: 'LoginDB Info', storeAs: 'loginDatabaseInfo', tooltip: "Tools for managing accounts in a Database", button: 'INFO', bindLocation: tp.accountsTab.pages[1], clickFunction: function () {
  1379. let loginDB = GM_getValue("StateFarm_LoginDB") || []; //why declare this so many times? the DBs need to be constantly rechecked, as other clients may have modified. we wouldnt want to be overwriting each other. (yes this needed to be said again)
  1380. alert(`You currently have ${loginDB.length} accounts in LoginDB. For info on what this is, check the guide tab.`);
  1381. } });
  1382. tp.accountsTab.pages[0].addSeparator();
  1383. initFolder({ location: tp.accountsTab.pages[0], title: "Account Generator (Basic)", storeAs: "generatorFolder", });
  1384. initModule({ location: tp.generatorFolder, title: 'Gmail (before @)', storeAs: 'accountGmail', tooltip: "The gmail prefix", defaultValue: "example (NO @gmail.com)" });
  1385. initModule({ location: tp.generatorFolder, title: 'Password to use', storeAs: 'accountPass', tooltip: "The account's password", defaultValue: "password69" });
  1386. initModule({ location: tp.generatorFolder, title: 'Create (Basic)', storeAs: 'accountCreate', tooltip: "Basic Gmail account creation", button: 'CREATE', bindLocation: tp.accountsTab.pages[1], clickFunction: function () {
  1387. loginOrCreateWithEmailPass(extract("accountGmail")+"+"+getScrambled()+"@gmail.com:"+extract("accountPass"));
  1388. } });
  1389. tp.accountsTab.pages[0].addSeparator();
  1390. initFolder({ location: tp.accountsTab.pages[0], title: "Account Records Database", storeAs: "accountRecordsFolder", });
  1391. initModule({ location: tp.accountRecordsFolder, title: "Disable Logging", storeAs: "accountRecordsLogging", tooltip: "Account Records Database options. Only needed when dealing with a lot of accounts", bindLocation: tp.accountsTab.pages[1], });
  1392. initModule({ location: tp.accountRecordsFolder, title: 'Export DB (JSON)', storeAs: 'accountRecordsExport', tooltip: "Account Records Database options. Only needed when dealing with a lot of accounts", button: 'EXPORT (COPY)', bindLocation: tp.accountsTab.pages[1], clickFunction: function () {
  1393. GM_setClipboard(JSON.stringify(GM_getValue("StateFarm_AccountRecords") || {}), "text", () => log("Clipboard set!"));
  1394. createPopup("AccountRecords DB copied to clipboard...");
  1395. } });
  1396. initModule({ location: tp.accountRecordsFolder, title: 'Import Into DB', storeAs: 'accountRecordsImport', tooltip: "Account Records Database options. Only needed when dealing with a lot of accounts", button: 'APPEND (PASTE)', bindLocation: tp.accountsTab.pages[1], clickFunction: function () {
  1397. let userInput = prompt(`Input data you would like to add to your AccountRecords DB. This will NOT replace your current data. All data added here either be added or replace existing records. Also make sure that this data goes here and not into the LoginDB.`, 'Reminder: JSON format!');
  1398. try {
  1399. let accountRecords = GM_getValue("StateFarm_AccountRecords") || {}; //why declare this so many times? the DBs need to be constantly rechecked, as other clients may have modified. we wouldnt want to be overwriting each other.
  1400. let appendedData = JSON.parse(userInput);
  1401. Object.entries(appendedData).forEach(([key, account]) => {
  1402. if (account) accountRecords[key] = account;
  1403. });
  1404. GM_setValue("StateFarm_AccountRecords", accountRecords);
  1405. createPopup("Success! Data appended to AccountRecords.", "success");
  1406. } catch {
  1407. createPopup("Failed! Check the formatting.", "error");
  1408. };
  1409. } });
  1410. initModule({ location: tp.accountRecordsFolder, title: 'Delete DB', storeAs: 'accountRecordsDelete', tooltip: "Account Records Database options. Only needed when dealing with a lot of accounts", button: 'DELETE!', bindLocation: tp.accountsTab.pages[1], clickFunction: function () {
  1411. if (prompt("WARNING! This is a destructive action! Type 'ok' if you are really sure you want to delete your AccountRecords DB! This cannot be reversed, export first to be safe.") === 'ok') {
  1412. GM_setValue("StateFarm_AccountRecords", {}); //o7 data
  1413. };
  1414. } });
  1415. initModule({ location: tp.accountRecordsFolder, title: 'View Info', storeAs: 'accountRecordsInfo', tooltip: "Account Records Database options. Only needed when dealing with a lot of accounts", button: 'INFO', bindLocation: tp.accountsTab.pages[1], clickFunction: function () {
  1416. let userInput = prompt(`This will output some information relating to what information you have in your AccountRecords DB.\nParameters: Enter 1 to only print Email:Pass list of those with items, enter 2 for those with no items.`, '');
  1417. let accountRecords = GM_getValue("StateFarm_AccountRecords") || {}; //why declare this so many times? the DBs need to be constantly rechecked, as other clients may have modified. we wouldnt want to be overwriting each other.
  1418. let tierCache = GM_getValue("StateFarm_TierCache") || {};
  1419. const itemCounts = {};
  1420. const tierCounts = {};
  1421. let emailPassList = [];
  1422. let accountCount = 0;
  1423. let accountWithItemsCount = 0;
  1424. let itemCountTotal = 0;
  1425. Object.entries(accountRecords).forEach(([key, account]) => {
  1426. if (account) {
  1427. let countedAccount = false; accountCount++;
  1428. let inventoryList=[];
  1429. account.inventory.forEach(item=>{inventoryList.push(item.name)});
  1430. if (inventoryList) {
  1431. for (let item of inventoryList) {
  1432. if (!countedAccount) {countedAccount = true; accountWithItemsCount++};
  1433. if (tierCache[item]) {
  1434. item = `${item} [T${tierCache[item]}]`;
  1435. };
  1436. let tier = item.match(/\[T([0-9])\]/);
  1437. if (tier && tier[1]) {
  1438. if (tierCounts.hasOwnProperty(tier[1])) {
  1439. tierCounts[tier[1]]++;
  1440. } else {
  1441. tierCounts[tier[1]] = 1;
  1442. };
  1443. };
  1444. itemCountTotal++;
  1445. if (itemCounts.hasOwnProperty(item)) {
  1446. itemCounts[item]++;
  1447. } else {
  1448. itemCounts[item] = 1;
  1449. };
  1450. };
  1451. if (account.emailPass && !emailPassList.includes(account.emailPass)) {
  1452. if ((userInput == "1" && inventoryList.length > 0) || // with items
  1453. (userInput == "2" && inventoryList.length < 1) || // no items
  1454. (userInput !== "1" && userInput !== "2")) { // do them all
  1455. emailPassList.push(account.emailPass);
  1456. };
  1457. };
  1458. };
  1459. };
  1460. });
  1461. log('%c' + ' '.repeat(500), 'background: white; color: white; font-size: 50px;');
  1462. log('%cAccountRecords Info', 'color: red; font-size: 30px;');
  1463. log("Full AccountRecords:");
  1464. log(accountRecords);
  1465. log(`itemCounts (Total items: ${itemCountTotal}):`);
  1466. log(itemCounts);
  1467. log(`tierCounts:`);
  1468. log(tierCounts);
  1469. log(`tierCache:`);
  1470. log(tierCache);
  1471. log(`emailPassList (Count: ${emailPassList.length}):`);
  1472. log(JSON.stringify(emailPassList));
  1473. log('%c' + ' '.repeat(500), 'background: white; color: white; font-size: 50px;');
  1474. alert(`Results:\nAccounts Total: ${accountCount}; With Items: ${accountWithItemsCount}\nItem Count: ${itemCountTotal}\nOther info has been pasted into console.`);
  1475. } });
  1476. tp.accountsTab.pages[0].addSeparator();
  1477. initFolder({ location: tp.accountsTab.pages[0], title: "Account Generator (ShellPrint)", storeAs: "shellPrintFolder", });
  1478. initModule({ location: tp.shellPrintFolder, title: 'ShellPrint Key', storeAs: 'shellPrintKey', tooltip: "ShellPrint token. NOTE: ShellPrint is currently unsupported on this version of StateFarm Client", defaultValue: "" });
  1479. initModule({ location: tp.shellPrintFolder, title: ' ', storeAs: 'getSPKey', tooltip: "ShellPrint help. NOTE: ShellPrint is currently unsupported on this version of StateFarm Client", button: 'Get a Key', clickFunction: () => GM_openInTab(discordURL, { active: true }) });
  1480. initModule({ location: tp.shellPrintFolder, title: 'Create (ShellPrint)', storeAs: 'shellprintGen', tooltip: "Account creation using ShellPrint™ technology. NOTE: ShellPrint is currently unsupported on this version of StateFarm Client", button: 'Generate!', clickFunction: () => F.register(), bindLocation: tp.accountsTab.pages[1] });
  1481. tp.accountsTab.pages[0].addSeparator();
  1482. //MISC MODULES
  1483. initFolder({ location: tp.mainPanel, title: "Misc", storeAs: "miscFolder", });
  1484. initTabs({ location: tp.miscFolder, storeAs: "miscTab" }, [
  1485. {
  1486. title: "WIP", content:
  1487. `Sorry! No guide yet!`},
  1488. ]);
  1489. initModule({ location: tp.miscTab.pages[0], title: "Ad Block", storeAs: "adBlock", tooltip: "Prevents the anti-adblocker code. NOTE: this will always display the VIP badge as a side effect", bindLocation: tp.miscTab.pages[1], });
  1490. initModule({ location: tp.miscTab.pages[0], title: "VIP Spoof", storeAs: "spoofVIP", tooltip: "Makes the VIP badge visible locally (other players won't see)", bindLocation: tp.miscTab.pages[1], });
  1491. initModule({ location: tp.miscTab.pages[0], title: "NoAnnoyances", storeAs: "noAnnoyances", tooltip: "Removes ads", bindLocation: tp.miscTab.pages[1], });
  1492. initModule({ location: tp.miscTab.pages[0], title: "NoTrack", storeAs: "noTrack", tooltip: "Removes some user data tracking code", bindLocation: tp.miscTab.pages[1], });
  1493. tp.miscTab.pages[0].addSeparator();
  1494. initModule({ location: tp.chatTab.pages[0], title: "AntiAFK", storeAs: "antiAFK", tooltip: "Bypasses AFK kicks", bindLocation: tp.chatTab.pages[1], });
  1495. initModule({ location: tp.miscTab.pages[0], title: "Quick Respawn", storeAs: "quickRespawn", tooltip: "Respawns quicker than usual", bindLocation: tp.miscTab.pages[1], });
  1496. initModule({ location: tp.miscTab.pages[0], title: "Sneaky Despawn", storeAs: "sneakyDespawn", tooltip: "Despawns, similar to the Esc key, but you can move while despawning, not that you cannot deal damage while sneaky despawning", bindLocation: tp.miscTab.pages[1], button: "Despawn... soon!", defaultBind: "Backquote", clickFunction: function(){
  1497. if (!(unsafeWindow.extern.gamePaused || sneakyDespawning)) {
  1498. sneakyDespawning = true;
  1499. ss.PAUSE(); createPopup("SneakyDespawn: 3 seconds.");
  1500. setTimeout(() => { createPopup("SneakyDespawn: 2 seconds.");
  1501. }, 1e3);
  1502. setTimeout(() => { createPopup("SneakyDespawn: 1 second.");
  1503. }, 2e3);
  1504. setTimeout(() => { createPopup("SneakyDespawn: Now despawning!");
  1505. document.exitPointerLock(); document.onpointerlockchange();
  1506. setTimeout(() => {
  1507. sneakyDespawning = false;
  1508. }, 200);
  1509. }, 3e3);
  1510. };
  1511. },});
  1512. tp.miscTab.pages[0].addSeparator();
  1513. initModule({ location: tp.miscTab.pages[0], title: "StateFarm Updates", storeAs: "statefarmUpdates", tooltip: "Shows a element at the home screen about statefarm's update history, notifies you when update is available", bindLocation: tp.miscTab.pages[1], defaultValue: true, });
  1514. initModule({ location: tp.miscTab.pages[0], title: "Replace Feeds", storeAs: "replaceFeeds", tooltip: "Replaces the game menu's news and videos feed with content by the StateFarm dev team", bindLocation: tp.miscTab.pages[1], defaultValue: true, });
  1515. initModule({ location: tp.miscTab.pages[0], title: "Custom Badges", storeAs: "customBadges", tooltip: "Enables custom StateFarm badges", bindLocation: tp.miscTab.pages[1], defaultValue: true, });
  1516. tp.miscTab.pages[0].addSeparator();
  1517. initModule({ location: tp.miscTab.pages[0], title: "Unlock Skins", storeAs: "unlockSkins", tooltip: "Unlocks all skins in locally (other players will not see these)", bindLocation: tp.miscTab.pages[1], });
  1518. initModule({ location: tp.miscTab.pages[0], title: "Unlock Bros Grenade", storeAs: "brosGrenade", tooltip: "Unlocks the real bros grenade skin to your account", bindLocation: tp.miscTab.pages[1], button: "Unlock, real.", clickFunction: function(){
  1519. extern.giveBasketBrosReward();
  1520. },});
  1521. initModule({ location: tp.miscTab.pages[0], title: "Admin Spoof", storeAs: "adminSpoof", tooltip: "Shows admin options such as BOOT and BAN in games. no ACTUAL functionality", bindLocation: tp.miscTab.pages[1], });
  1522. tp.miscTab.pages[0].addSeparator();
  1523. initModule({ location: tp.miscTab.pages[0], title: "Unban", storeAs: "unban", tooltip: "Unbans you by signing out. you will lose skins if you're not signed in", bindLocation: tp.miscTab.pages[1], button: "UNBAN NOW", clickFunction: function(){
  1524. if (GM_getValue('StateFarm_Unbanned')) unban();
  1525. else if (prompt("By proceeding, you will be signed out. If you don't have an account, your stats will be lost.\nEnter 'ok' to confirm this.\nThis popup will not be shown again for future unbans.") === 'ok') {
  1526. GM_setValue('StateFarm_Unbanned', 'true');
  1527. unban();
  1528. } else {
  1529. alert('You did not entire "ok", so the unban was cancelled.');
  1530. };
  1531. },});
  1532. initModule({ location: tp.miscTab.pages[0], title: "Auto Unban", storeAs: "autoUnban", tooltip: "Automatically detects bans & unbans in above fashion", bindLocation: tp.miscTab.pages[1],});
  1533. initModule({ location: tp.miscTab.pages[0], title: "New Proxy", storeAs: "newProxy", tooltip: "Switches to a new shell shockers link. SF config won't be transferred", bindLocation: tp.miscTab.pages[1], button: "NEW PROXY", clickFunction: function(){
  1534. const userConfirmed=confirm("Switching to a proxy URL. By proceeding, you will enter another URL for Shell Shockers but your data doesn't get transferred.");
  1535. if (userConfirmed) {
  1536. newProxy();
  1537. };
  1538. },});
  1539. initModule({ location: tp.miscTab.pages[0], title: "Reload Page", storeAs: "reload", tooltip: "Reloads the page", bindLocation: tp.miscTab.pages[1], button: "RELOAD NOW", clickFunction: function(){
  1540. reloadPage();
  1541. },});
  1542. tp.miscTab.pages[0].addSeparator();
  1543. initModule({ location: tp.miscTab.pages[0], title: "Switch Focus", storeAs: "unfocus", tooltip: "Controls the focus of the game. Allows for tabbing out without despawning", bindLocation: tp.miscTab.pages[1], button: "FOCUS/UNFOCUS", defaultBind: "P", clickFunction: function(){
  1544. if (document.pointerLockElement !== null) { //currently locked
  1545. noPointerPause=true; unsafeWindow.document.exitPointerLock();
  1546. } else if (noPointerPause) { //already unlocked?
  1547. noPointerPause=false;
  1548. unsafeWindow.canvas.requestPointerLock();
  1549. };
  1550. },});
  1551. tp.miscTab.pages[0].addSeparator();
  1552. initModule({ location: tp.miscTab.pages[0], title: "FastChickenWinner", storeAs: "chickenWinner", tooltip: "Instantly plays the chick'n winner minigame", bindLocation: tp.miscTab.pages[1], button: "Force Play", clickFunction: function(){
  1553. unsafeWindow.extern.chwTryPlay();
  1554. const eggElement = document.getElementById("eggOne");
  1555. eggElement.click();eggElement.click();eggElement.click();eggElement.click();eggElement.click();eggElement.click();eggElement.click();eggElement.click();eggElement.click();
  1556. let chicknWinnerElementLoaded = false;
  1557. const checkInterval = setInterval(() => {
  1558. const chicknWinnerElement = document.getElementById('chicknWinner');
  1559. chicknWinnerElementLoaded = (chicknWinnerElement?.style?.display == ''); //idk, this is kind of shit? but who actually cares that much...
  1560. if (chicknWinnerElementLoaded) {
  1561. const gotWinnerOkElement = document.getElementById('gotWinnerOk');
  1562. if (gotWinnerOkElement) {
  1563. gotWinnerOkElement.click();
  1564. };
  1565. if (chicknWinnerElement.style.display == 'none') {
  1566. log("ermm, found");
  1567. clearInterval(checkInterval);
  1568. updateAccountRecords();
  1569. accountStatus = "chwDone";
  1570. };
  1571. };
  1572. }, 100);
  1573. },});
  1574. initModule({ location: tp.miscTab.pages[0], title: "AutoChickenWinner", storeAs: "autoChickenWinner", tooltip: "Automatically plays the chick'n winner minigame when cooldowns are over", bindLocation: tp.miscTab.pages[1],});
  1575. tp.miscTab.pages[0].addSeparator();
  1576. initModule({ location: tp.miscTab.pages[0], title: "Custom Macro", storeAs: "customMacro", tooltip: "The JavaScript macro executed via executeMacro", defaultValue: "log('cool');" });
  1577. initModule({ location: tp.miscTab.pages[0], title: "Execute Macro", storeAs: "executeMacro", tooltip: "Allows for JS code to be executed from the client itself. Runs in userscript environment, so use unsafeWindow etc.", bindLocation: tp.miscTab.pages[1], button: "EXECUTE", clickFunction: function(){
  1578. //use at your own risk, i guess. but is this really any more dangerous than pasting something into console? not really.
  1579. (async () => {
  1580. try {
  1581. log(extract("customMacro"));
  1582. // stay safe out there. this runs in the **userscript** environment. make sure to use unsafeWindow for whatever reason you may need the window object.
  1583. await eval(extract("customMacro")); // eslint-disable-line
  1584. } catch (error) {
  1585. console.error("Error executing code:", error);
  1586. }
  1587. })();
  1588. },}); //but yes, as you can see "macros" are just scripts you can execute for whatever purposes you need. reminds me of userscripts...
  1589. initModule({ location: tp.miscTab.pages[0], title: "Do At Startup", storeAs: "autoMacro", tooltip: "Executes the entered macro at client startup", bindLocation: tp.miscTab.pages[1],});
  1590. tp.miscTab.pages[0].addSeparator();
  1591. initModule({ location: tp.miscTab.pages[0], title: "[WIP]RandomPath", storeAs: "randomPath", tooltip: "Forces a new random path (pathfinding currently disabled)", bindLocation: tp.miscTab.pages[1], button: "Random Path", clickFunction: function(){
  1592. findNewPath = true;
  1593. },});
  1594. findNewPath = false;
  1595. tp.miscTab.pages[0].addSeparator();
  1596. initModule({ location: tp.miscTab.pages[0], title: "SilentRoll", storeAs: "silentRoll", tooltip: "Rolls around without showing it client sided", bindLocation: tp.miscTab.pages[1], });
  1597. initFolder({ location: tp.miscTab.pages[0], title: "Seizure Options", storeAs: "seizureFolder", });
  1598. initModule({ location: tp.seizureFolder, title: "SeizureX", storeAs: "enableSeizureX", tooltip: "Rotates the player by the specified amount around the y-axis (yaw)", bindLocation: tp.miscTab.pages[1], });
  1599. initModule({ location: tp.seizureFolder, title: "X Amount", storeAs: "amountSeizureX", tooltip: "Amount to roll", slider: { min: -6.283185307179586, max: 6.283185307179586, step: Math.PI / 280 }, defaultValue: 2, });
  1600. initModule({ location: tp.seizureFolder, title: "SeizureY", storeAs: "enableSeizureY", tooltip: "Rotates the player by the specified amount around the x-axis (pitch)", bindLocation: tp.miscTab.pages[1], });
  1601. initModule({ location: tp.seizureFolder, title: "Y Amount", storeAs: "amountSeizureY", tooltip: "Amount to roll", slider: { min: -6.283185307179586, max: 6.283185307179586, step: Math.PI / 280 }, defaultValue: 2, });
  1602. //CLIENT MODULES
  1603. initFolder({ location: tp.mainPanel, title: "Client & About", storeAs: "clientFolder", });
  1604. initTabs({ location: tp.clientFolder, storeAs: "clientTab" }, [
  1605. {
  1606. title: "WIP", content:
  1607. `Sorry! No guide yet!`},
  1608. ]);
  1609. initModule({ location: tp.clientTab.pages[0], title: "VarData Fallback", storeAs: "vardataFallback", tooltip: "What to try if varData loading fails", bindLocation: tp.clientTab.pages[1], dropdown: [{ text: "None", value: "none" }, { text: "Load Latest (online)", value: "loadLatest" }, { text: "Load Cached (current hash)", value: "loadCached" }, { text: "Load Cached (latest cache)", value: "loadRecent" }, { text: "Custom String", value: "loadCustom" }], defaultValue: "none", });
  1610. initModule({ location: tp.clientTab.pages[0], title: "Fallback Behavior", storeAs: "vardataType", tooltip: "When to use fallback", bindLocation: tp.clientTab.pages[1], dropdown: [{ text: "Never", value: "never" }, { text: "Just This Once", value: "justOnce" }, { text: "Until Next Hash", value: "nextHash" }, { text: "Always", value: "always" }], defaultValue: "never", });
  1611. initModule({ location: tp.clientTab.pages[0], title: "Custom VarData", storeAs: "vardataCustom", tooltip: "Uses the entered varData", defaultValue: "{}", enableConditions: [["vardataFallback", "loadCustom"]] });
  1612. tp.clientTab.pages[0].addSeparator();
  1613. initModule({ location: tp.clientTab.pages[0], title: "Hide GUI", storeAs: "hide", tooltip: "Hides the big StateFarm menu. default key to do this is H", bindLocation: tp.clientTab.pages[1], button: "Hide!", clickFunction: function () { tp.mainPanel.hidden = !tp.mainPanel.hidden }, defaultBind: "H", });
  1614. initModule({ location: tp.clientTab.pages[0], title: "Hide at Startup", storeAs: "hideAtStartup", tooltip: "Hides the StateFarm menu by default", bindLocation: tp.clientTab.pages[1], defaultValue: false,});
  1615. initModule({ location: tp.clientTab.pages[0], title: "No Console Logs", storeAs: "consoleLogs", tooltip: "Blocks the client frome sending messages to the browser console", bindLocation: tp.clientTab.pages[1], defaultValue: false,});
  1616. initModule({ location: tp.clientTab.pages[0], title: "Pop-ups", storeAs: "popups", tooltip: "Disables/enables bottom-left corner popups of configs changed & notifications", bindLocation: tp.clientTab.pages[1], defaultValue: true, });
  1617. initModule({ location: tp.clientTab.pages[0], title: "Tooltips", storeAs: "tooltips", tooltip: "Controls whether you want to see tooltips (the box displaying this very message!) (I'm just an innocent tooltip! I did nothing! Let me live! Don't disable me :( )", bindLocation: tp.clientTab.pages[1], defaultValue: true, });
  1618. tp.clientTab.pages[0].addSeparator();
  1619. initModule({ location: tp.clientTab.pages[0], title: "Panic", storeAs: "panic", tooltip: "Allows you to quickly exit to a set URL. great for hacking in class", bindLocation: tp.clientTab.pages[1], button: "EXIT!", clickFunction: function () { if (extract("enablePanic")) { unsafeWindow.location.replace(extract("panicURL")) } }, defaultBind: "X", enableConditions: [["enablePanic", true]], });
  1620. initFolder({ location: tp.clientTab.pages[0], title: "Panic Options", storeAs: "panicFolder", });
  1621. initModule({ location: tp.panicFolder, title: "Enable", storeAs: "enablePanic", tooltip: "Enable evacuation", bindLocation: tp.clientTab.pages[1], defaultValue: false, });
  1622. initModule({ location: tp.panicFolder, title: "Set URL", storeAs: "panicURL", tooltip: "What url to evacuate to", defaultValue: "https://classroom.google.com/", enableConditions: [["enablePanic", true]], });
  1623. tp.clientTab.pages[0].addSeparator();
  1624. let presetList = [];
  1625. Object.entries(inbuiltPresets).forEach(([key, value]) => {//Get all presets from inbuilt presets var
  1626. let options = {};
  1627. options.text = key;//not the best way to add things to a dictionary, but the only way i could get to work
  1628. options.value = key; // idiot could've not violated eslint smfh
  1629. presetList.push(options);
  1630. });
  1631. //PRESETS: OakSwingZZZ 😎
  1632. initFolder({ location: tp.clientTab.pages[0], title: "Presets", storeAs: "presetFolder",});
  1633. initModule({ location: tp.presetFolder, title: "Preset List", storeAs: "selectedPreset", tooltip: "A set of predefined configs made by the StateFarm developers", defaultValue: "onlypuppy7's Config", bindLocation: tp.clientTab.pages[1], dropdown: presetList, });
  1634. initModule({ location: tp.presetFolder, title: "Apply", storeAs: "applyPreset", tooltip: "Apply the preset selected in the comboBox above", button: "Apply Preset", clickFunction: function () {
  1635. const userConfirmed = confirm( "Are you sure you want to continue? This will replace most of your current config." );
  1636. if (userConfirmed) { applySettings(inbuiltPresets[extract("selectedPreset")], true); };
  1637. },
  1638. });
  1639. tp.presetFolder.addSeparator();
  1640. initModule({ location: tp.presetFolder, title: "Save", storeAs: "savePreset", tooltip: "Saves your current settings as a preset", button: "Save As Preset", clickFunction: function () {
  1641. // log("Config Main: ", configMain);
  1642. let saveString = '';
  1643. const addParam = function(module,setTo) {saveString=saveString+module+">"+JSON.stringify(setTo)+"<"};
  1644. Object.entries(configMain).forEach(([key, value]) => {
  1645. log(key, value);
  1646. if (typeof(value) == 'string') {
  1647. try {
  1648. let dropdown = extractAsDropdownInt(key)
  1649. value = dropdown;
  1650. } catch (error) {
  1651. //dont care lmaoooo
  1652. };
  1653. };
  1654. if (!presetIgnore.includes(key)){
  1655. addParam(key, value);
  1656. }
  1657. });
  1658. saveString = saveString.substring(0, saveString.length - 1);
  1659. let presetName = prompt("Name of preset:"); // asks user for name of preset
  1660. if (presetName == "" || presetName == null) {
  1661. log("User cancelled save");
  1662. } else {
  1663. let result = saveUserPreset(presetName, saveString);//saves user preset
  1664. addUserPresets(loadUserPresets()); //updates inbuiltPresets to include
  1665. log("Saved Preset: ", saveString);
  1666. log("User Preset Result: ", result);
  1667. };
  1668. log("InbuiltPrests:");
  1669. log(inbuiltPresets);
  1670. initMenu(false); //Reloads menu to add to dropdown list
  1671. },});
  1672. initModule({ location: tp.presetFolder, title: "Delete", storeAs: "deletePreset", tooltip: "Deletes a preset", button: "Remove Preset", clickFunction: function () { // Function won't do anything if they select a preset that was loaded in the gamecode
  1673. let currUserPresets = loadUserPresets(); //gets current presets from storage
  1674. delete currUserPresets[extract("selectedPreset")];//deletes
  1675. delete inbuiltPresets[extract("selectedPreset")];//deletes
  1676. save(presetStorageLocation, currUserPresets); // saves cnages to file.
  1677. log("Current User Presets: ",currUserPresets);
  1678. initMenu(false); //reloads menu
  1679. },});
  1680. tp.presetFolder.addSeparator();
  1681. initModule({ location: tp.presetFolder, title: "Import", storeAs: "importPreset", tooltip: "Imports a custom preset", button: "Import Preset", clickFunction: function () {
  1682. let preset = prompt("Paste preset here:"); // asks user to paste preset
  1683. if (preset == "" || preset == null) {
  1684. log("User cancelled save");
  1685. } else {
  1686. const pattern = /([a-zA-Z]*>[^<]*<)+[a-zA-Z]*>[^<]*/;
  1687. if (pattern.test(preset)){
  1688. let presetName = prompt("Name of preset:"); // asks user for name of preset
  1689. if (presetName == "" || presetName == null) {
  1690. log("User cancelled save");
  1691. } else {
  1692. let result = saveUserPreset(presetName, preset);//saves user preset
  1693. addUserPresets(loadUserPresets()); //updates inbuiltPresets to include
  1694. log("Saved Preset: ", preset);
  1695. log("User Preset Result: ", result);
  1696. }
  1697. } else {
  1698. alert("Not A Valid Preset!");
  1699. log("Preset Not Valid");
  1700. };
  1701. initMenu(false);
  1702. };
  1703. },});
  1704. initModule({ location: tp.presetFolder, title: "Export", storeAs: "exportPreset", tooltip: "Copies your current preset to the clipboard", button: "Copy To Clipboard", clickFunction: function () {
  1705. let saveString = '';
  1706. const addParam = function(module,setTo) {saveString=saveString+module+">"+JSON.stringify(setTo)+"<"};
  1707. Object.entries(configMain).forEach(([key, value]) => {
  1708. log(key, value);
  1709. if (typeof(value) == 'string') {
  1710. try {
  1711. let dropdown = extractAsDropdownInt(key)
  1712. value = dropdown;
  1713. } catch (error) {
  1714. //dont care lmaoooo
  1715. };
  1716. };
  1717. if (!presetIgnore.includes(key)){
  1718. addParam(key, value);
  1719. }
  1720. });
  1721. saveString = saveString.substring(0, saveString.length - 1);
  1722. GM_setClipboard(saveString, "text", () => log("Clipboard set!"));
  1723. createPopup("Preset copied to clipboard...");
  1724. },});
  1725. tp.clientTab.pages[0].addSeparator();
  1726. initFolder({ location: tp.clientTab.pages[0], title: "Creator's Links", storeAs: "linksFolder",});
  1727. initModule({ location: tp.linksFolder, title: "Discord", storeAs: "discord", tooltip: "The official StateFarm Client Discord server", button: "Link", clickFunction: () => GM_openInTab(discordURL, { active: true }) });
  1728. initModule({ location: tp.linksFolder, title: "GitHub", storeAs: "github", tooltip: "The official StateFarm Client GitHub Repository! Check out the devs suffering here", button: "Link", clickFunction: () => GM_openInTab(githubURL, { active: true }) });
  1729. tp.clientTab.pages[0].addSeparator();
  1730. initModule({ location: tp.clientTab.pages[0], title: "Reset", storeAs: "clear", tooltip: "Powerwashes StateFarm completely", button: "DELETE", clickFunction: function(){
  1731. const userConfirmed=confirm("Are you sure you want to continue? This will clear all stored module states and keybinds.");
  1732. if (userConfirmed) {
  1733. initMenu(true);
  1734. alert("Reset to defaults.");
  1735. };
  1736. },});
  1737. initModule({ location: tp.clientTab.pages[0], title: "Debug", storeAs: "debug", tooltip: "Converts SFC into a development tool.\nExposes globalSS to the window (allowing you to manipulate many game variables directly) and also enables some extra logs.", bindLocation: tp.clientTab.pages[1], });
  1738. tp.mainPanel.addSeparator();
  1739. initModule({ location: tp.mainPanel, title: "Update", storeAs: "update", tooltip: "Go to the client's update page", button: "Link", clickFunction: () => GM_openInTab(downloadURL, { active: true }) });
  1740. initModule({ location: tp.mainPanel, title: "Guide", storeAs: "documentation", tooltip: "A guide with more in-depth information on modules", button: "Link", clickFunction: () => GM_openInTab(featuresGuideURL, { active: true }) });
  1741.  
  1742.  
  1743. tp.botPanel = new Tweakpane.Pane(); // eslint-disable-line
  1744. tp.botPanel.title = "StateFarm Bot Control Panel";
  1745. tp.botPanel.containerElem_.style.left = "15%";
  1746. tp.botPanel.containerElem_.style.top = "25%";
  1747. tp.botPanel.hidden = true;
  1748.  
  1749. tp.botTabs = tp.botPanel.addTab({
  1750. pages: [
  1751. { title: 'Deploy' },
  1752. { title: 'Manage' },
  1753. { title: 'Params' },
  1754. { title: 'Info' },
  1755. ],
  1756. });
  1757.  
  1758. //DEPLOY STUFF
  1759. initModule({ location: tp.botTabs.pages[0], title: "Bots Amount", storeAs: "numberBots", tooltip: "The number of bots/windows opened", slider: { min: 1, max: 18, step: 1 }, defaultValue: 1, });
  1760. initModule({ location: tp.botTabs.pages[0], title: "Deploy", storeAs: "deployBots", tooltip: "Open the bot's windows. If only one opens, make sure you have popups allowed", button: "START BOTS!", bindLocation: tp.bottingTab.pages[1], clickFunction: function () { deployBots() }, });
  1761. initModule({ location: tp.botTabs.pages[0], title: "Restart Bots", storeAs: "restartBots", tooltip: "Completely closes and restarts all bot instances", button: "RESTART BOTS", bindLocation: tp.bottingTab.pages[1], clickFunction: function () { broadcastToBots("kill"); setTimeout(function(){deployBots()}, 1000) }, });
  1762. tp.botTabs.pages[0].addSeparator();
  1763. initModule({ location: tp.botTabs.pages[0], title: "Window Width", storeAs: "botWindowWidth", tooltip: "Horizontal size of the bot's windows", slider: { min: 0, max: 10000, step: 1 }, defaultValue: 450, botParam: true, });
  1764. initModule({ location: tp.botTabs.pages[0], title: "Window Height", storeAs: "botWindowHeight", tooltip: "Vertical size of the bot's windows", slider: { min: 0, max: 10000, step: 1 }, defaultValue: 300, botParam: true, });
  1765. tp.botTabs.pages[0].addSeparator();
  1766. initModule({ location: tp.botTabs.pages[0], title: "Use Names", storeAs: "useCustomNameBots", tooltip: "Use special customized names", defaultValue: true, botParam: true, });
  1767. initModule({ location: tp.botTabs.pages[0], title: "Bot Name", storeAs: "botUsername", tooltip: "The names used by the bots", defaultValue: "ЅtateFarmer", enableConditions: [["useCustomNameBots", true]], });
  1768. initModule({ location: tp.botTabs.pages[0], title: "AntiDupe", storeAs: "botAntiDupe", tooltip: "Prevents duplication of names with a random letter at the end", enableConditions: [["useCustomNameBots", true]], });
  1769. initModule({ location: tp.botTabs.pages[0], title: "CopyNames", storeAs: "botCopyName", tooltip: "Copies names from other players in the lobby", enableConditions: [["useCustomNameBots", true]], });
  1770. tp.botTabs.pages[0].addSeparator();
  1771. initModule({ location: tp.botTabs.pages[0], title: "Use Macro", storeAs: "useBotMacro", tooltip: "Execute a macro at bot startup", defaultValue: true, botParam: true, });
  1772. initModule({ location: tp.botTabs.pages[0], title: "Bot Macro", storeAs: "botMacro", tooltip: "The macro to be executed by the module above", defaultValue: "createPopup('success?');", botParam: true, });
  1773. tp.botTabs.pages[0].addSeparator();
  1774. initModule({ location: tp.botTabs.pages[0], title: "Proxy URL", storeAs: "proxyBots", tooltip: "Use random proxy urls for each bot instance", dropdown: [{ text: "Randomised", value: "randomised" }, { text: "Static", value: "static" },], defaultValue: "darkesteggshell", });
  1775. tp.botTabs.pages[0].addSeparator();
  1776. initModule({ location: tp.botTabs.pages[0], title: "Bot Color", storeAs: "eggColorBots", tooltip: "Sets the egg skin color of your bots", dropdown: [{ text: "Disabled", value: "disabled" }, { text: "White", value: "white" }, { text: "Light Blue", value: "lightblue" }, { text: "Light Eggshell", value: "lighteggshell" }, { text: "Eggshell", value: "eggshell" }, { text: "Dark Eggshell", value: "darkeggshell" }, { text: "Darker Eggshell", value: "darkereggshell" }, { text: "Darkest Eggshell", value: "darkesteggshell" }, { text: "Red (VIP)", value: "red" }, { text: "Purple (VIP)", value: "purple" }, { text: "Pink (VIP)", value: "pink" }, { text: "Yellow (VIP)", value: "yellow" }, { text: "Blue (VIP)", value: "blue" }, { text: "Green (VIP)", value: "green" }, { text: "Lime (VIP)", value: "lime" }, { text: "Randomised", value: "random" }], defaultValue: "darkesteggshell", });
  1777. initModule({ location: tp.botTabs.pages[0], title: "Bot Stamp", storeAs: "autoStampBots", tooltip: "Sets the stamp of your bots", dropdown: [{ text: "Disabled", value: "disabled" }, { text: "Target Stamp", value: "target" }, { text: "No Sign Stamp", value: "nosign" }, { text: "Question Mark Stamp?", value: "question" }, { text: "Peace Stamp", value: "peace" }, { text: "Thumbs Up Stamp", value: "thumbsup" }, { text: "Pablo Smile Stamp", value: "pablosmile" }, { text: "Randomised", value: "random" }], defaultValue: "pablosmile", });
  1778. initModule({ location: tp.botTabs.pages[0], title: "Bot Hat", storeAs: "autoHatBots", tooltip: "Sets the hat of your bots", dropdown: [{ text: "Disabled", value: "disabled" }, { text: "Ball Cap", value: "ballcap" }, { text: "Boat Fedora", value: "boatfedora" }, { text: "Top Hat", value: "tophat" }, { text: "Derby Hat", value: "derbyhat" }, { text: "Mountie Hat", value: "mountiehat" }, { text: "Pablo Hat", value: "pablohat" }, { text: "Randomised", value: "random" }], defaultValue: "pablohat", });
  1779. //MANAGE STUFF
  1780. initModule({ location: tp.botTabs.pages[1], title: "Close Bots", storeAs: "killBots", tooltip: "Closes all bot tabs & kills all bots", button: "CLOSE TABS", clickFunction: function () { broadcastToBots("kill") }, });
  1781. initModule({ location: tp.botTabs.pages[1], title: "Refresh Pages", storeAs: "refreshBots", tooltip: "Reloads all bot tabs", button: "REFRESH", clickFunction: function () { broadcastToBots("refresh") }, });
  1782. tp.botTabs.pages[1].addSeparator();
  1783. initModule({ location: tp.botTabs.pages[1], title: "New Proxies", storeAs: "newProxyBots", tooltip: "Moves bots to new proxies", button: "NEW PROXIES", clickFunction: function () { broadcastToBots("newproxy") }, });
  1784. initModule({ location: tp.botTabs.pages[1], title: "Unban All", storeAs: "unbanBots", tooltip: "Unbans all bots", button: "UNBAN BOTS", clickFunction: function () { broadcastToBots("unban") }, });
  1785. initModule({ location: tp.botTabs.pages[1], title: "AutoUnbanBot", storeAs: "botAutoUnban", tooltip: "Automatically unbans all bots when they're banned", botParam: true, });
  1786. initModule({ location: tp.botTabs.pages[1], title: "AutoLoginBot", storeAs: "botAutoLogin", tooltip: "Automatically logs bots into accounts", dropdown: [{ text: "Disabled", value: "disabled" }, { text: "When No Account", value: "noaccount" }, { text: "Always", value: "always" }], defaultValue: "disabled", botParam: true, });
  1787. tp.botTabs.pages[1].addSeparator();
  1788. initModule({ location: tp.botTabs.pages[1], title: "Don'tKillMe", storeAs: "botNoKillMe", tooltip: "Forces bots to ignore you", botParam: true, });
  1789. initModule({ location: tp.botTabs.pages[1], title: "Don'tKillBot", storeAs: "botNoKillBots", tooltip: "Forces bots to ignore other bots", botParam: true, });
  1790. initModule({ location: tp.botTabs.pages[1], title: "FollowMe", storeAs: "botFollowMe", tooltip: "semibroken", botParam: true, });
  1791. initModule({ location: tp.botTabs.pages[1], title: "FollowBots", storeAs: "botFollowBots", tooltip: "semibroken", botParam: true, });
  1792. tp.botTabs.pages[1].addSeparator();
  1793. initModule({ location: tp.botTabs.pages[1], title: "Leave Games", storeAs: "leaveBots", tooltip: "Makes all bots leave their games", button: "LEAVE", clickFunction: function () { broadcastToBots("leave") }, });
  1794. initModule({ location: tp.botTabs.pages[1], title: "Leave Empty", storeAs: "leaveEmptyBots", tooltip: "Makes bots leave empty games", botParam: true, });
  1795. initModule({ location: tp.botTabs.pages[1], title: "AutoLeave", storeAs: "autoLeaveBots", tooltip: "Makes bots leave after the specified interval", botParam: true, });
  1796. initModule({ location: tp.botTabs.pages[1], title: "Delay (s)", storeAs: "autoLeaveDelayBots", tooltip: "Interval to leave after", slider: { min: 0, max: 3600, step: 1 }, defaultValue: 300, enableConditions: [["autoLeaveBots", true]], botParam: true, });
  1797. tp.botTabs.pages[1].addSeparator();
  1798. initModule({ location: tp.botTabs.pages[1], title: "Spam Report", storeAs: "reportBots", tooltip: "Makes the bots report everyone in the lobby", button: "SPAM REPORT!", clickFunction: function () { broadcastToBots("report") }, });
  1799. tp.botTabs.pages[1].addSeparator();
  1800. initModule({ location: tp.botTabs.pages[1], title: "Join Game", storeAs: "botAutoJoin", tooltip: "Forces bots to join a game", botParam: true, });
  1801. initModule({ location: tp.botTabs.pages[1], title: "Game Code", storeAs: "botJoinCode", tooltip: "The code of the game the bots will join. If not specified, they'll find a random game", defaultValue: "CODE", botParam: true, });
  1802. initModule({ location: tp.botTabs.pages[1], title: "Get Code", storeAs: "getCodeBots", tooltip: "Get your current gameÄs ID", button: "Retrieve", clickFunction: function () { change("botJoinCode", GAMECODE) }, botParam: true, });
  1803. tp.botTabs.pages[1].addSeparator();
  1804. initModule({ location: tp.botTabs.pages[1], title: "GameType", storeAs: "autoGamemodeBots", tooltip: "The game type the bots join - ffa, kotc, etc. can be random or disabled", dropdown: [{ text: "Disabled", value: "disabled" }, { text: "FFA", value: "ffa" }, { text: "Teams", value: "teams" }, { text: "Captula", value: "captula" }, { text: "KotC", value: "kotc" }, { text: "Randomised", value: "random" }], defaultValue: "disabled", botParam: true, });
  1805. initModule({ location: tp.botTabs.pages[1], title: "AutoRegion", storeAs: "autoRegionBots", tooltip: "The region the bots join - use, usc, etc. can be random or disabled", dropdown: [{ text: "Disabled", value: "disabled" }, { text: "Chile", value: "santiago" }, { text: "Germany", value: "germany" }, { text: "Singapore", value: "singapore" }, { text: "Sydney", value: "sydney" }, { text: "US Central", value: "uscentral" }, { text: "US East", value: "useast" }, { text: "US West", value: "uswest" }, { text: "Randomised", value: "random" }], defaultValue: "disabled", botParam: true, });
  1806. tp.botTabs.pages[1].addSeparator();
  1807. initModule({ location: tp.botTabs.pages[1], title: "Select Team", storeAs: "botTeam", tooltip: "Automatically picks the bots' teams", botParam: true, dropdown: [{ text: "Disabled", value: "disabled" }, { text: "Red Team", value: "red" }, { text: "Blue Team", value: "blue" }, { text: "Random Team", value: "random" }], defaultValue: "disabled", });
  1808. //PARAMS STUFF
  1809. initModule({ location: tp.botTabs.pages[2], title: "DoPlay", storeAs: "botRespawn", tooltip: "Make the bots spawn", botParam: true, });
  1810. initModule({ location: tp.botTabs.pages[2], title: "LowRes", storeAs: "botLowRes", tooltip: "Keeps resolution of the game low, reduces resources needed", botParam: true, })
  1811. initModule({ location: tp.botTabs.pages[2], title: "RenderDelay", storeAs: "renderDelayBots", tooltip: "Adds a forced fps buffer, makes game laggier", slider: { min: 0, max: 30000, step: 10 }, defaultValue: 0, botParam: true, });
  1812. initModule({ location: tp.botTabs.pages[2], title: "MuteGame", storeAs: "botMuteGame", tooltip: "Shuts the game up", botParam: true, })
  1813. tp.botTabs.pages[2].addSeparator();
  1814. initModule({ location: tp.botTabs.pages[2], title: "DoSeizure", storeAs: "botSeizure", tooltip: "Will the bots enable seizure mode?", botParam: true, enableConditions: [["botRespawn", true]], });
  1815. tp.botTabs.pages[2].addSeparator();
  1816. initModule({ location: tp.botTabs.pages[2], title: "DoTallChat", storeAs: "botTallChat", tooltip: "Enables the Tall Chat module for bots", botParam: true, });
  1817. initModule({ location: tp.botTabs.pages[2], title: "DoMock", storeAs: "botMock", tooltip: "Makes the bots mock chatting players", botParam: true, });
  1818. initModule({ location: tp.botTabs.pages[2], title: "DoAutoEZ", storeAs: "botAutoEZ", tooltip: "Makes the bots gloat about their kills", botParam: true, });
  1819. initModule({ location: tp.botTabs.pages[2], title: "DoChAccuse", storeAs: "botCheatAccuse", tooltip: "Makes the bots accuse their killers when dying", botParam: true, });
  1820. tp.botTabs.pages[2].addSeparator();
  1821. initModule({ location: tp.botTabs.pages[2], title: "DoSpam", storeAs: "botSpam", tooltip: "Makes the bots spam", botParam: true, });
  1822. initModule({ location: tp.botTabs.pages[2], title: "SpamText", storeAs: "spamChatTextBot", tooltip: "The message spammed by the bots", defaultValue: "ЅtateFarm Client On Top! ", botParam: true, });
  1823. tp.botTabs.pages[2].addSeparator();
  1824. initModule({ location: tp.botTabs.pages[2], title: "SelectWeapon", storeAs: "botWeapon", tooltip: "Makes the bots pick a weapon", dropdown: [{ text: "EggK-47", value: "eggk47" }, { text: "Scrambler", value: "scrambler" }, { text: "Free Ranger", value: "freeranger" }, { text: "RPEGG", value: "rpegg" }, { text: "Whipper", value: "whipper" }, { text: "Crackshot", value: "crackshot" }, { text: "Tri-Hard", value: "trihard" }, { text: "Randomised", value: "random" }], botParam: true, defaultValue: "eggk47", enableConditions: [["botRespawn", true]], });
  1825. initModule({ location: tp.botTabs.pages[2], title: "DoMove", storeAs: "botAutoMove", tooltip: "Makes the bots move around", botParam: true, enableConditions: [["botRespawn", true]], });
  1826. initModule({ location: tp.botTabs.pages[2], title: "DoShoot", storeAs: "botAutoShoot", tooltip: "Makes the bots shoot", tooltip: "Makes the bot autoshoot.", botParam: true, enableConditions: [["botRespawn", true]], });
  1827. initModule({ location: tp.botTabs.pages[2], title: "DoAimbot", storeAs: "botAimbot", tooltip: "Makes the bots have aimbot", botParam: true, enableConditions: [["botRespawn", true]], });;
  1828. initModule({ location: tp.botTabs.pages[2], title: "UseMinAccuracy", storeAs: "botAccuracy", tooltip: "Makes the bots only fire if the spread is lower than the given value", slider: { min: 0, max: 1, step: 0.05 }, defaultValue: 0, botParam: true, enableConditions: [["botRespawn", true]], });
  1829. //INFO STUFF
  1830. initModule({ location: tp.botTabs.pages[3], storeAs: "botOnline", tooltip: "Sex", monitor: 17.5, botParam: true, });
  1831.  
  1832. if (!AUTOMATED) {
  1833. if (!load("StateFarmConfigMainPanel") || reset===true) {
  1834. saveConfig();
  1835. } else {
  1836. log("##############################################")
  1837. tp.mainPanel.importPreset(load("StateFarmConfigMainPanel"));
  1838. tp.botPanel.importPreset(load("StateFarmConfigBotPanel"));
  1839. try {
  1840. let specialItems = load("StateFarmConfigSpecialItems"); //this is for the fucking shit that doesnt apply for NO reason!!
  1841. if (specialItems) {
  1842. specialItems.forEach(item => {
  1843. change(item[0], item[1]);
  1844. log(item[0], item[1]);
  1845. });
  1846. };
  1847. } catch (error) {
  1848.  
  1849. }
  1850. };
  1851. };
  1852.  
  1853. updateConfig();
  1854.  
  1855. setTimeout(() => {
  1856. if (AUTOMATED) { //why after 500ms? perhaps we'll never know. maybe because it gives a visual indication that statefarm is statefarming.
  1857. tp.mainPanel.hidden = true;
  1858. };
  1859. updateHiddenAndDisabled();
  1860. let specialItems = load("StateFarmConfigSpecialItems"); //this is for the fucking shit that doesnt apply for NO reason!!
  1861. if (specialItems) {
  1862. specialItems.forEach(item => {
  1863. change(item[0], item[1]);
  1864. log(item[0], item[1]);
  1865. });
  1866. };
  1867. //tooltip events
  1868. unsafeWindow.document.querySelectorAll('.tp-lblv_l').forEach(label => {
  1869. if (extract("debug") && !tooltips[label.innerText]) log("Warning: no tooltip assigned for module:", label.innerText);
  1870.  
  1871. label.addEventListener('mouseenter', () => {
  1872. if (extract("tooltips")) {
  1873. tooltipElement.innerText = tooltips[label.innerText] || 'Tooltip parameter not found';
  1874. tooltipElement.style.opacity = '1';
  1875. const rect = label.getBoundingClientRect();
  1876. tooltipElement.style.top = `${rect.top + window.scrollY - 12}px`;
  1877. tooltipElement.style.left = `${rect.left + window.scrollX - tooltipElement.offsetWidth - 10}px`;
  1878. }
  1879. });
  1880. label.addEventListener('mouseleave', () => {
  1881. tooltipElement.style.opacity = '0';
  1882. });
  1883. });
  1884. }, 500);
  1885.  
  1886. menuInitiated = reset == "init" ? "init" : true;
  1887. const defaultSpamText = ("dsc.gg/s𝖿network: " + menuTitle + " On Top! ");
  1888.  
  1889. if (extract("spamChatText").includes("On Top!")) { change("spamChatText", defaultSpamText) };
  1890. if (extract("spamChatTextBot").includes("On Top!")) { change("spamChatTextBot", defaultSpamText) };
  1891. if (extract("fakeMessageText").includes("On Top!")) { change("fakeMessageText", defaultSpamText) };
  1892.  
  1893. makeDraggable(tp.mainPanel.containerElem_);
  1894. makeDraggable(tp.botPanel.containerElem_);
  1895. };
  1896. const onContentLoaded = function () {
  1897. log("StateFarm: initMenu()");
  1898. initMenu("init");
  1899. log("StateFarm: applyStylesAddElements()");
  1900. applyStylesAddElements(); //set font and change menu cass, and other stuff to do with the page
  1901. const intervalId1 = setInterval(every15Seconds, 15000);
  1902. const intervalId2 = setInterval(everySecond, 1000);
  1903. const intervalId3 = setInterval(everyDecisecond, 100);
  1904. applyStateFarmLogo();
  1905. const observer = new MutationObserver(applyStateFarmLogo);
  1906. observer.observe(document.body, { subtree: true, childList: true });
  1907. };
  1908. //visual functions
  1909. const createPopup = function (text, type) {
  1910. log("Creating Popup Type:", type, "With Text:", text);
  1911. try {
  1912. if (extract("popups")) {
  1913. const messageContainer = document.getElementById('message-container');
  1914. const messages = messageContainer.getElementsByClassName(scrambledMsgEl);
  1915. if (messages.length > 5) {
  1916. messageContainer.removeChild(messages[0]);
  1917. };
  1918. const clonedMsgElement = msgElement.cloneNode(true);
  1919. clonedMsgElement.innerText = text;
  1920. switch (type) {
  1921. case ("success"):
  1922. clonedMsgElement.style.border = '2px solid rgba(0, 255, 0, 0.5)'; break;
  1923. case ("error"):
  1924. clonedMsgElement.style.border = '2px solid rgba(255, 0, 0, 0.5)'; break;
  1925. };
  1926. clonedMsgElement.style.display = 'none';
  1927. const messageOffset = (messages.length + 1) * 50;
  1928. clonedMsgElement.style.bottom = messageOffset + "px";
  1929. void clonedMsgElement.offsetWidth;
  1930. clonedMsgElement.style.display = '';
  1931. messageContainer.appendChild(clonedMsgElement);
  1932. //reorder such that newest is lowest
  1933. for (let i = messages.length - 1; i >= 0; i--) {
  1934. messages[i].style.bottom = (((messages.length - i) * 50) - 40) + "px";
  1935. };
  1936. };
  1937. } catch (error) {
  1938. // Handle the error and display an error message onscreen
  1939. console.error("An error occurred:", error);
  1940. alert("Bollocks! If you're getting this message, injection probably failed. To solve this, perform CTRL+F5 - this performs a hard reload. If this does not work, contact the developers.");
  1941. };
  1942. };
  1943. const createPrompt = function(text, buttons, duration) {
  1944. unsafeWindow.BAWK.play("kotc_zonespawn"); log(arguments);
  1945. duration = duration || 5000;
  1946. const promptElement = document.createElement('div');
  1947. promptElement.innerText = text;
  1948. promptElement.setAttribute('style', `
  1949. position: absolute;
  1950. left: 10px;
  1951. top: 50%;
  1952. transform: translateY(-50%);
  1953. color: #fff;
  1954. background: rgba(0, 0, 0, 0.7);
  1955. font-weight: normal;
  1956. padding: 10px;
  1957. border-radius: 5px;
  1958. box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  1959. border: 2px solid rgba(255, 255, 255, 0.5);
  1960. animation: msg 0.5s forwards, msg 0.5s reverse forwards ${duration/1000}s;
  1961. pointer-events: none;
  1962. opacity: 0;
  1963. transition: opacity 0.3s ease-in-out;
  1964. font-family: 'Bahnschrift', sans-serif !important;
  1965. font-size: 16px;
  1966. z-index: 9999 !important;
  1967. white-space: pre-wrap;
  1968. width: 300px;
  1969. `);
  1970. const buttonContainer = document.createElement('div');
  1971. buttonContainer.setAttribute('style', 'margin-top: 10px; pointer-events: auto; text-align: center;');
  1972.  
  1973. const deleteButton = function(){
  1974. document.body.removeChild(promptElement);
  1975. };
  1976.  
  1977. buttons = [...buttons,
  1978. [`Dismiss (${Math.ceil(duration/1000)}s)`, () => deleteButton()]
  1979. ];
  1980.  
  1981. buttons.forEach(([buttonText, buttonFunction]) => {
  1982. const button = document.createElement('button');
  1983. button.innerText = buttonText;
  1984. button.setAttribute('style', `
  1985. background: #6c757d;
  1986. color: #fff;
  1987. border: none;
  1988. padding: 5px 10px;
  1989. margin-right: 5px;
  1990. border-radius: 3px;
  1991. cursor: pointer;
  1992. font-family: 'Bahnschrift', sans-serif !important;
  1993. `);
  1994. button.onclick = buttonFunction;
  1995. buttonContainer.appendChild(button);
  1996. });
  1997. promptElement.appendChild(buttonContainer);
  1998. document.body.appendChild(promptElement);
  1999. setTimeout(() => {
  2000. promptElement.style.opacity = '1';
  2001. }, 100);
  2002. setTimeout(() => {
  2003. promptElement.style.opacity = '0';
  2004. setTimeout(() => {
  2005. deleteButton();
  2006. }, 800);
  2007. }, duration);
  2008. };
  2009. const createVarDataPopup = function (vardataButtonsInfo) {
  2010. closeVardataPopup = () => {
  2011. vardataPopup.style.opacity = '0';
  2012. vardataOverlay.style.opacity = '0';
  2013. setTimeout(() => {
  2014. document.body.removeChild(vardataPopup);
  2015. document.body.removeChild(vardataOverlay);
  2016. reloadPage();
  2017. }, 400);
  2018. };
  2019. //create vardataOverlay
  2020. vardataOverlay = document.createElement('div');
  2021. vardataOverlay.style.position = 'fixed';
  2022. vardataOverlay.style.top = '0';
  2023. vardataOverlay.style.left = '0';
  2024. vardataOverlay.style.width = '100%';
  2025. vardataOverlay.style.height = '100%';
  2026. vardataOverlay.style.backgroundColor = 'rgba(0, 0, 0, 0.75)';
  2027. vardataOverlay.style.zIndex = '9998';
  2028. vardataOverlay.style.opacity = '0';
  2029. vardataOverlay.style.transition = 'opacity 0.4s ease-in-out';
  2030. //create vardataPopup
  2031. vardataPopup = document.createElement('div');
  2032. vardataPopup.style.position = 'fixed';
  2033. vardataPopup.style.left = '50%';
  2034. vardataPopup.style.top = '50%';
  2035. vardataPopup.style.width = '40em';
  2036. vardataPopup.style.transform = 'translate(-50%, -50%)';
  2037. vardataPopup.style.color = '#fff';
  2038. vardataPopup.style.backgroundColor = 'rgba(0, 0, 0, 0.7)';
  2039. vardataPopup.style.padding = '15px';
  2040. vardataPopup.style.borderRadius = '5px';
  2041. vardataPopup.style.boxShadow = '0 2px 10px rgba(0, 0, 0, 0.2)';
  2042. vardataPopup.style.border = '2px solid rgba(255, 255, 255, 0.5)';
  2043. vardataPopup.style.pointerEvents = 'auto';
  2044. vardataPopup.style.opacity = '0'; // Start invisible for fade-in effect
  2045. vardataPopup.style.transition = 'opacity 0.4s ease-in-out'; // Fade-in transition
  2046. vardataPopup.style.fontFamily = 'Bahnschrift, sans-serif';
  2047. vardataPopup.style.fontSize = '16px';
  2048. vardataPopup.style.zIndex = '9999';
  2049. vardataPopup.style.whiteSpace = 'pre-wrap';
  2050. //set vardataPopup content
  2051. const title = "Valid VarData for this hash could not be retrieved.";
  2052. const message = `This could be due to a conflicting script or StateFarm Client is out of date.<br>
  2053. <strong>Why am I seeing this?</strong>
  2054. StateFarm Client was unable to retrieve matching VarData from GitHub. Here are some common reasons for this happening:<br>
  2055. 1. Multiple scripts are running. This is usually the most common reason.
  2056. 2. There are multiple userscript managers. If you're using ViolentMonkey, check if Tampermonkey is installed and also affecting the site.<br>
  2057. <strong>What is VarData?</strong>
  2058. Shell Shockers uses obfuscation to protect its code. This makes the names of all the variables scrambled every update. VarData is an automatically generated JSON file that restores some information to make mods possible. It is maintained by the StateFarm dev team and hosted on GitHub.<br>
  2059. <strong>How do I generate VarData?</strong>
  2060. You can generate VarData by using the command "sf.vardata" in the StateFarm Network Discord bot channel.
  2061. <a href="${discordURL}" target="_blank" style="color: #1944ff; text-decoration: underline; font-size: inherit;">Join the StateFarm Network Discord server</a> to generate VarData!`;
  2062. const message2 = `<br>Alternatively, if you know what you're doing you can enable one of these options:`;
  2063. const image = `<img src='${itsOverURL}' style='width: 20%; height: 20%; margin-right: 15px; vertical-align: middle;'>`;
  2064. vardataPopup.innerHTML = `${image}<strong>${title}</strong><br><small style="color: rgba(255, 255, 255, 0.7); font-size: 14px;">Hash: ${hash}</small><br><br>${message}<br>
  2065. <label for="vardataInput">Enter VarData:</label>
  2066. <div style="display: flex; align-items: center;">
  2067. <input type="text" id="vardataInput" style="flex: 1; padding: 5px; width: 250px; border: 1px solid rgba(255, 255, 255, 0.5); background-color: rgba(255, 255, 255, 0.1); color: #fff; border-radius: 5px; margin-right: 10px;">
  2068. <button id="submitVarData" style="padding: 5px 15px; background-color: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 5px; cursor: pointer; transition: background-color 0.2s;">GO</button>
  2069. </div>${message2}`;
  2070. //create buttons
  2071. const vardataButtonContainer = document.createElement('div');
  2072. vardataButtonContainer.style.display = 'flex';
  2073. vardataButtonContainer.style.justifyContent = 'space-between';
  2074. vardataButtonContainer.style.marginTop = '10px';
  2075. vardataButtonsInfo.forEach(({ id, text, action }) => {
  2076. const button = document.createElement('button');
  2077. button.id = id;
  2078. button.innerHTML = text;
  2079. button.style.padding = '5px 10px';
  2080. button.style.backgroundColor = 'rgba(255, 255, 255, 0.1)';
  2081. button.style.color = '#fff';
  2082. button.style.border = '1px solid rgba(255, 255, 255, 0.5)';
  2083. button.style.borderRadius = '5px';
  2084. button.style.cursor = 'pointer';
  2085. button.style.transition = 'background-color 0.2s';
  2086. button.style.flex = '1';
  2087. button.style.marginRight = '10px';
  2088. button.style.fontSize = '12px';
  2089. button.style.whiteSpace = 'pre-wrap';
  2090. button.addEventListener('click', action);
  2091. button.addEventListener('mouseenter', () => button.style.backgroundColor = 'rgba(255, 255, 255, 0.3)');
  2092. button.addEventListener('mouseleave', () => button.style.backgroundColor = 'rgba(255, 255, 255, 0.1)');
  2093. vardataButtonContainer.appendChild(button);
  2094. });
  2095. vardataPopup.appendChild(vardataButtonContainer);
  2096.  
  2097. const setButtonState = function (buttonId, isEnabled) {
  2098. const button = unsafeWindow.document.getElementById(buttonId);
  2099. if (button) {
  2100. button.disabled = !isEnabled;
  2101. button.style.opacity = isEnabled ? '1' : '0.5';
  2102. button.style.pointerEvents = isEnabled ? 'auto' : 'none';
  2103. }
  2104. };
  2105. (setTimeout(() => {
  2106. vardataButtonsInfo.forEach(({ id, enabled }) => {
  2107. setButtonState(id, enabled);
  2108. });
  2109. }, 200));
  2110.  
  2111. //create checkbox
  2112. const vardataCheckboxContainer = document.createElement('div');
  2113. vardataCheckboxContainer.style.display = 'flex';
  2114. vardataCheckboxContainer.style.justifyContent = 'center';
  2115. vardataCheckboxContainer.style.alignItems = 'center';
  2116. vardataCheckboxContainer.style.marginTop = '15px';
  2117. vardataCheckboxContainer.style.fontSize = '16px';
  2118. const checkbox = document.createElement('input');
  2119. checkbox.type = 'checkbox';
  2120. checkbox.id = 'rememberCheckbox';
  2121. checkbox.style.display = 'none';
  2122. const customCheckbox = document.createElement('span');
  2123. customCheckbox.style.width = '20px';
  2124. customCheckbox.style.height = '20px';
  2125. customCheckbox.style.display = 'inline-block';
  2126. customCheckbox.style.backgroundColor = 'rgba(255, 255, 255, 0.1)';
  2127. customCheckbox.style.border = '1px solid rgba(255, 255, 255, 0.5)';
  2128. customCheckbox.style.borderRadius = '5px';
  2129. customCheckbox.style.marginRight = '8px';
  2130. customCheckbox.style.cursor = 'pointer';
  2131. customCheckbox.addEventListener('click', () => {
  2132. checkbox.checked = !checkbox.checked;
  2133. change("vardataType", checkbox.checked ? 2 : 1);
  2134. customCheckbox.style.backgroundColor = checkbox.checked ? 'rgba(255, 255, 255, 0.8)' : 'rgba(255, 255, 255, 0.1)';
  2135. });
  2136. vardataCheckboxContainer.appendChild(customCheckbox);
  2137. vardataCheckboxContainer.appendChild(checkbox);
  2138. vardataCheckboxContainer.appendChild(document.createTextNode('Remember until next hash'));
  2139. vardataPopup.appendChild(vardataCheckboxContainer);
  2140. document.body.appendChild(vardataOverlay);
  2141. document.body.appendChild(vardataPopup);
  2142.  
  2143. //add inputs stuff
  2144. const input = document.getElementById('vardataInput');
  2145. const submitButton = document.getElementById('submitVarData');
  2146.  
  2147. submitButton.addEventListener('click', () => {
  2148. const inputValue = input.value;
  2149.  
  2150. const error = function () {
  2151. createPopup("Inputted VarData isn't valid.", "error");
  2152. };
  2153. try {
  2154. let converted = JSON.parse(inputValue);
  2155. if (converted.vars && converted.checksum) {
  2156. change("vardataCustom", inputValue);
  2157. change("vardataFallback", 4);
  2158. change("vardataType", 1); //custom isnt consistent enough
  2159. closeVardataPopup();
  2160. } else {
  2161. error();
  2162. };
  2163. } catch (e) {
  2164. error();
  2165. }
  2166. });
  2167.  
  2168. input.addEventListener('keypress', (event) => {
  2169. if (event.key === 'Enter') {
  2170. submitButton.click();
  2171. }
  2172. });
  2173. //fade anims
  2174. setTimeout(() => {
  2175. vardataOverlay.style.opacity = '1';
  2176. vardataPopup.style.opacity = '1';
  2177. }, 10);
  2178. };
  2179.  
  2180. //StateFarmChat functions
  2181. const sfChatUsernameSet = function () {
  2182. let tagAdded = `[Shell] ${extract("sfChatUsername")}`;
  2183. if (sfChatUsername != tagAdded && sfChatIframe != undefined) {
  2184. sfChatUsername = tagAdded; log(sfChatUsername);
  2185. sfChatIframe.contentWindow.postMessage("SFCHAT-UPDATE" + JSON.stringify({ name: sfChatUsername }), "*");
  2186. };
  2187. };
  2188. const startStateFarmChat = function (startHidden) {
  2189. //UnsafewindowVars
  2190. const makeChatDragable = function (element) {
  2191. if (element.getAttribute("drag-true") != "true") {
  2192. element.addEventListener("mousedown", function (e) {
  2193. let offsetX = e.clientX - parseInt(window.getComputedStyle(this).left);
  2194. let offsetY = e.clientY - parseInt(window.getComputedStyle(this).top);
  2195. function mouseMoveHandler(e) {
  2196. let newX = e.clientX - offsetX;
  2197. let newY = e.clientY - offsetY;
  2198. if (newX >= 0 && newX + element.getBoundingClientRect().width <= window.innerWidth) {
  2199. element.style.left = newX + "px";
  2200. }
  2201. if (newY >= 0 && newY + element.getBoundingClientRect().height <= window.innerHeight) {
  2202. element.style.top = newY + "px";
  2203. }
  2204. }
  2205.  
  2206. function reset() {
  2207. window.removeEventListener("mousemove", mouseMoveHandler);
  2208. window.removeEventListener("mouseup", reset);
  2209. }
  2210.  
  2211. window.addEventListener("mousemove", mouseMoveHandler);
  2212. window.addEventListener("mouseup", reset);
  2213. });
  2214.  
  2215. element.setAttribute("drag-true", "true");
  2216. };
  2217. };
  2218.  
  2219. sfChatContainer = document.createElement("div");
  2220. sfChatContainer.style.padding = "1px";
  2221. let title = document.createElement("p");
  2222. title.style.fontSize = "medium";
  2223. title.style.color = "#D6D6D6";
  2224. title.innerHTML = "StateFarm Chat";
  2225. sfChatContainer.appendChild(title);
  2226. sfChatContainer.style.backgroundColor = "#555";
  2227. sfChatContainer.style.position = "absolute";
  2228. sfChatContainer.style.borderRadius = "10px";
  2229. sfChatContainer.style.textAlign = "center";
  2230. sfChatContainer.style.top = "20px";
  2231. sfChatContainer.style.left = "20px";
  2232. sfChatContainer.style.zIndex = 100000000;
  2233. if (startHidden){
  2234. sfChatContainer.style.display = 'none';
  2235. }
  2236.  
  2237. const sendSettings = function () {
  2238. let settings = GM_getValue("SFCHAT-SETTINGS");
  2239. if (settings) {
  2240. sfChatIframe.contentWindow.postMessage("SFCHAT-SETTINGS" + settings, "*");
  2241. } else {
  2242. sfChatIframe.contentWindow.postMessage("SFCHAT-SETTINGS", "*");
  2243. };
  2244. };
  2245.  
  2246. makeChatDragable(sfChatContainer);
  2247. sfChatIframe = document.createElement("iframe");
  2248. sfChatIframe.setAttribute(
  2249. "src", sfChatURL
  2250. );
  2251. sfChatIframe.id = "sfChat-iframe";
  2252. sfChatIframe.setAttribute("style", "width: 600px; height:700px; z-index: 10000;");
  2253. sfChatContainer.appendChild(sfChatIframe);
  2254. document.getElementsByTagName("body")[0].appendChild(sfChatContainer);
  2255.  
  2256. const startTimeout = setTimeout(function () {
  2257. log("settings");
  2258. sendSettings();
  2259. let nameChange = setTimeout(function () {
  2260. sfChatUsername = `[Shell] ${extract("sfChatUsername")}`;
  2261. sfChatIframe.contentWindow.postMessage("SFCHAT-UPDATE" + JSON.stringify({ name: sfChatUsername }), "*");
  2262. }, 500);
  2263. }, 1000);
  2264.  
  2265. unsafeWindow.addEventListener("message", (e) => {
  2266. if (typeof e.data == "string"){
  2267. if (e.data.startsWith("SFCHAT-UPDATE")) {
  2268. GM_setValue("SFCHAT-SETTINGS", e.data.replace(/SFCHAT-UPDATE/gm, ""));
  2269. }
  2270. if (e.data.startsWith("SFCHAT-REQUEST")) {
  2271. sendSettings();
  2272. };
  2273. if (e.data.startsWith("SFCHAT-MESSAGE")) {
  2274. let stringMessage = e.data.replace(/SFCHAT-MESSAGE/gm, "");
  2275. let message = JSON.parse(stringMessage);
  2276. if (extract("sfChatNotifications") && message.user && message.message && (sfChatContainer.style.display == "none")){
  2277. if (message.message.length <= 50){
  2278. createPopup(message.user.name + ": " + message.message);
  2279. } else {
  2280. createPopup(message.user.name + ": " + message.message.substring(0, 50) + "...");
  2281. }
  2282. if (extract("sfChatNotificationSound")){
  2283. unsafeWindow.BAWK.play("grenade_cellphone");
  2284. };
  2285. };
  2286.  
  2287. if (extract("sfChatInvitations")) {
  2288. let uppercaseMsg = message.message.toUpperCase();
  2289. const findCode = (input) => {
  2290. const allMatches = input.match(/(?:[A-Z0-9]{7})/g);
  2291. if (allMatches) {
  2292. for (const match of allMatches) {
  2293. if (/[A-Z]/.test(match) && /\d/.test(match)) {
  2294. return match;
  2295. }
  2296. }
  2297. }
  2298. return null;
  2299. };
  2300. let foundCode = findCode(uppercaseMsg);
  2301. if (foundCode) {
  2302. createPrompt(`INVITE! User "${message.user.name}" has invited you to join game "${foundCode}"! (via SFChat)`, [
  2303. ['JOIN', () => {
  2304. change("leaveGame");
  2305. setTimeout(() => {
  2306. vueApp.externPlayObject(
  2307. 2,
  2308. vueApp.currentGameType,
  2309. vueApp.playerName,
  2310. '',
  2311. foundCode,
  2312. );
  2313. }, 500);
  2314. }]
  2315. ], 10000);
  2316. };
  2317. };
  2318. };
  2319. };
  2320. });
  2321. };
  2322.  
  2323. const applyStylesAddElements = function (themeToApply = "null") {
  2324. const head = document.head || document.getElementsByTagName('head').pages[0];
  2325.  
  2326. if (AUTOMATED) {
  2327. automatedBorder = document.createElement('div');
  2328. automatedBorder.setAttribute('id', 'automated-border');
  2329. document.body.appendChild(automatedBorder);
  2330.  
  2331. const automatedBorderStyle = `
  2332. position: fixed;
  2333. top: 0;
  2334. left: 0;
  2335. width: 100%;
  2336. height: 100%;
  2337. border: 5px solid rgba(255, 0, 0, 1);
  2338. pointer-events: none;
  2339. z-index: 999999999;
  2340. `;
  2341. automatedBorder.style.cssText = automatedBorderStyle;
  2342. };
  2343.  
  2344. //menu customisation (apply font, button widths, adjust checkbox right slightly, make menu appear on top, add anim to message)
  2345. const styleElement = document.createElement('style');
  2346. styleElement.textContent = `
  2347. @font-face {
  2348. font-family: "Bahnschrift";
  2349. src: url("https://db.onlinewebfonts.com/t/0a6ee448d1bd65c56f6cf256a7c6f20a.eot");
  2350. src: url("https://db.onlinewebfonts.com/t/0a6ee448d1bd65c56f6cf256a7c6f20a.eot?#iefix")format("embedded-opentype"),
  2351. url("https://db.onlinewebfonts.com/t/0a6ee448d1bd65c56f6cf256a7c6f20a.woff2")format("woff2"),
  2352. url("https://db.onlinewebfonts.com/t/0a6ee448d1bd65c56f6cf256a7c6f20a.woff")format("woff"),
  2353. url("https://db.onlinewebfonts.com/t/0a6ee448d1bd65c56f6cf256a7c6f20a.ttf")format("truetype"),
  2354. url("https://db.onlinewebfonts.com/t/0a6ee448d1bd65c56f6cf256a7c6f20a.svg#Bahnschrift")format("svg");
  2355. }
  2356. .tp-dfwv, .tp-sglv_i, .tp-rotv_t, .tp-fldv_t, .tp-ckbv_l, .tp-txtv_i, .tp-lblv_l, .tp-tbiv_t, .coords, .gameinfo, .playerstats, .playerinfo, .automated {
  2357. font-family: 'Bahnschrift', sans-serif !important;
  2358. font-size: 16px;
  2359. z-index: 9999 !important;
  2360. }
  2361. .tp-rotv_m, .tp-fldv_m {
  2362. display: none;
  2363. }
  2364. .tp-dfwv {
  2365. min-width: 300px;
  2366. }
  2367. .tp-rotv_t {
  2368. cursor: move;
  2369. user-select: none;
  2370. }
  2371. .tp-tbiv_t {
  2372. font-family: 'Bahnschrift';
  2373. font-size: 13px;
  2374. }
  2375. .tp-lblv_v, .tp-lstv, .tp-btnv_b, .tp-btnv_t {
  2376. font-family: 'Bahnschrift';
  2377. font-size: 12px;
  2378. }
  2379. .tp-mllv {
  2380. font-family: 'Bahnschrift';
  2381. font-size: 12px;
  2382. letter-spacing: -1px;
  2383. width: 290px;
  2384. margin-left: -130px !important;
  2385. }
  2386. .tp-mllv_i::-webkit-scrollbar-thumb {
  2387. background-color: #888; /* Adjust the color as needed */
  2388. border: 2px solid #555; /* Change the color of the border and adjust the width as needed */
  2389. }
  2390. .tp-mllv_i::-webkit-scrollbar-track {
  2391. background-color: #000; /* Change the color as needed */
  2392. }
  2393. .tp-lblv_l {
  2394. font-size: 14px;
  2395. letter-spacing: -1px;
  2396. }
  2397. .tp-btnv {
  2398. width: 100px;
  2399. margin-left: 60px !important;
  2400. }
  2401. .tp-ckbv_w {
  2402. margin-left: 4px !important;
  2403. }
  2404. .tp-dfwv, .tp-rotv, .tp-rotv_c, .tp-fldv, .tp-fldv_c, .tp-lblv, .tp-lstv, .tp-btnv, .tp-sldv {
  2405. z-index: 99999 !important;
  2406. white-space: nowrap !important;
  2407. }
  2408. @keyframes msg {
  2409. from {
  2410. transform: translate(-120%, 0);
  2411. opacity: 0;
  2412. }
  2413. to {
  2414. transform: none;
  2415. opacity: 1;
  2416. }
  2417. }
  2418. `;
  2419.  
  2420. document.head.appendChild(styleElement);
  2421. applyTheme();
  2422.  
  2423. //initiate message div and css and shit
  2424. msgElement = document.createElement('div'); // create the element directly
  2425. scrambledMsgEl = getScrambled();
  2426. msgElement.classList.add(scrambledMsgEl);
  2427. msgElement.setAttribute('style', `
  2428. position: absolute;
  2429. left: 10px;
  2430. color: #fff;
  2431. background: rgba(0, 0, 0, 0.7);
  2432. font-weight: normal;
  2433. padding: 10px;
  2434. border-radius: 5px;
  2435. box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  2436. border: 2px solid rgba(255, 255, 255, 0.5);
  2437. animation: msg 0.5s forwards, msg 0.5s reverse forwards 3s;
  2438. pointer-events: none;
  2439. opacity: 0;
  2440. transition: opacity 0.3s ease-in-out;
  2441. font-family: 'Bahnschrift', sans-serif !important;
  2442. font-size: 16px;
  2443. z-index: 9999 !important;
  2444. `);
  2445. document.body.appendChild(msgElement);
  2446. msgElement.style.display = 'none';
  2447. const messageContainer = document.createElement('div'); //so it can be cloned. i think.
  2448. messageContainer.id = 'message-container';
  2449. document.body.appendChild(messageContainer);
  2450. //initiate tooltip div and css and shit
  2451. tooltipElement = document.createElement('div');
  2452. tooltipElement.style.cssText = `
  2453. position: absolute;
  2454. color: #fff;
  2455. background: rgba(0, 0, 0, 0.7);
  2456. font-weight: normal;
  2457. padding: 10px;
  2458. border-radius: 5px;
  2459. box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  2460. border: 2px solid rgba(255, 255, 255, 0.5);
  2461. animation: fadeIn 0.5s forwards, fadeOut 0.5s reverse forwards 3s;
  2462. pointer-events: none;
  2463. opacity: 0;
  2464. transition: opacity 0.3s ease-in-out;
  2465. font-family: 'Bahnschrift', sans-serif !important;
  2466. font-size: 16px;
  2467. z-index: 9999999 !important;
  2468. max-width: 300px;
  2469. word-wrap: break-word;
  2470. `;
  2471. document.body.appendChild(tooltipElement);
  2472. //initiate coord div and css and shit
  2473. coordElement = document.createElement('div'); // create the element directly
  2474. coordElement.classList.add('coords');
  2475. coordElement.setAttribute('style', `
  2476. position: fixed;
  2477. top: 0px;
  2478. left: 0px;
  2479. height: auto;
  2480. max-height: 30px;
  2481. min-height: 30px;
  2482. text-wrap: nowrap;
  2483. color: #fff;
  2484. background: rgba(0, 0, 0, 0.6);
  2485. font-weight: bolder;
  2486. padding: 2px;
  2487. border-radius: 5px;
  2488. box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  2489. border: 2px solid rgba(255, 255, 255, 0.5);
  2490. z-index: 999999;
  2491. `);
  2492. document.body.appendChild(coordElement);
  2493. coordElement.style.display = 'none';
  2494. //initiate game info div and css and shit
  2495. gameInfoElement = document.createElement('div'); // create the element directly
  2496. gameInfoElement.classList.add('gameinfo');
  2497. gameInfoElement.setAttribute('style', `
  2498. position: fixed;
  2499. bottom: 0px;
  2500. left: 0px;
  2501. height: auto;
  2502. max-height: 30px;
  2503. min-height: 30px;
  2504. text-wrap: nowrap;
  2505. color: #fff;
  2506. background: rgba(0, 0, 0, 0.6);
  2507. font-weight: bolder;
  2508. padding: 2px;
  2509. border-radius: 5px;
  2510. box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  2511. border: 2px solid rgba(255, 255, 255, 0.5);
  2512. z-index: 999999;
  2513. `);
  2514. document.body.appendChild(gameInfoElement);
  2515. gameInfoElement.style.display = 'none';
  2516. //initiate hp div and css and shit
  2517. playerstatsElement = document.createElement('div'); // create the element directly
  2518. playerstatsElement.classList.add('playerstats');
  2519. playerstatsElement.setAttribute('style', `
  2520. position: absolute;
  2521. top: 20px;
  2522. left: 280px;
  2523. height: auto;
  2524. min-height: 30px;
  2525. text-wrap: nowrap;
  2526. color: #fff;
  2527. background: rgba(0, 0, 0, 0.6);
  2528. font-weight: bolder;
  2529. padding: 10px;
  2530. border-radius: 5px;
  2531. box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  2532. border: 2px solid rgba(255, 255, 255, 0.5);
  2533. z-index: 999999;
  2534. `);
  2535. document.body.appendChild(playerstatsElement);
  2536. playerstatsElement.style.display = 'none';
  2537. //initiate player info div and css and shit
  2538. playerinfoElement = document.createElement('div'); // create the element directly
  2539. playerinfoElement.classList.add('playerinfo');
  2540. playerinfoElement.setAttribute('style', `
  2541. position: absolute;
  2542. top: 80%;
  2543. left: 90%;
  2544. height: auto;
  2545. max-height: 102;
  2546. text-wrap: nowrap;
  2547. color: #fff;
  2548. background: rgba(0, 0, 0, 0.6);
  2549. font-weight: bolder;
  2550. padding: 10px;
  2551. border-radius: 5px;
  2552. box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  2553. border: 2px solid rgba(255, 255, 255, 0.5);
  2554. z-index: 999999;
  2555. `);
  2556. document.body.appendChild(playerinfoElement);
  2557. playerinfoElement.style.display = 'none';
  2558. //initiate first use div and css and shit
  2559. firstUseElement = document.createElement('div'); // create the element directly
  2560. firstUseElement.classList.add('firstuse');
  2561. firstUseElement.setAttribute('style', `
  2562. position: fixed;
  2563. top: 0;
  2564. left: 0;
  2565. width: 100%;
  2566. height: 100%;
  2567. background-color: rgba(0, 0, 0, 0.8);
  2568. z-index: 99999999;
  2569. display: flex;
  2570. justify-content: center;
  2571. align-items: center;
  2572. `);
  2573. document.body.appendChild(firstUseElement);
  2574. firstUseElement.style.display = 'none';
  2575. //initiate bloom indicator div and css and shit
  2576. redCircle = document.createElement('div');
  2577. redCircle.style.position = 'fixed';
  2578. redCircle.style.width = '5px';
  2579. redCircle.style.height = '5px';
  2580. redCircle.style.borderRadius = '50%';
  2581. redCircle.style.backgroundColor = 'red';
  2582. redCircle.style.transform = 'translate(-50%, -50%)';
  2583. document.body.appendChild(redCircle);
  2584. //initiate minangle indicator div and css and shit
  2585. minangleCircle = document.createElement('div');
  2586. minangleCircle.style.position = 'fixed';
  2587. minangleCircle.style.borderRadius = '100%';
  2588. minangleCircle.style.border = 'thin solid red'
  2589. minangleCircle.style.transform = 'translate(50%, 50%)';
  2590. minangleCircle.style.pointerEvents = 'none';
  2591. document.body.appendChild(minangleCircle);
  2592.  
  2593. if (load("HUD-Positions") == null) {
  2594. hudElementPositions.coordElement = { top: coordElement.getBoundingClientRect().top, left: coordElement.getBoundingClientRect().left };
  2595. hudElementPositions.gameInfoElement = { top: gameInfoElement.getBoundingClientRect().top, left: gameInfoElement.getBoundingClientRect().left };
  2596. hudElementPositions.playerstatsElement = { top: playerstatsElement.getBoundingClientRect().top, left: playerstatsElement.getBoundingClientRect().left };
  2597. hudElementPositions.playerinfoElement = { top: playerinfoElement.getBoundingClientRect().top, left: playerinfoElement.getBoundingClientRect().left };
  2598. save("HUD-Positions", hudElementPositions);
  2599. } else {
  2600. hudElementPositions = load("HUD-Positions");
  2601.  
  2602. coordElement.style.top = hudElementPositions.coordElement.top + "px";
  2603. gameInfoElement.style.top = hudElementPositions.gameInfoElement.top + "px";
  2604. playerstatsElement.style.top = hudElementPositions.playerstatsElement.top + "px";
  2605. playerinfoElement.style.top = hudElementPositions.playerinfoElement.top + "px";
  2606.  
  2607. coordElement.style.left = hudElementPositions.coordElement.left + "px";
  2608. gameInfoElement.style.left = hudElementPositions.gameInfoElement.left + "px";
  2609. playerstatsElement.style.left = hudElementPositions.playerstatsElement.left + "px";
  2610. playerinfoElement.style.left = hudElementPositions.playerinfoElement.left + "px";
  2611. };
  2612. };
  2613.  
  2614. const makeDraggable = function (element, notMenu) {
  2615. if (element) {
  2616. let offsetX, offsetY;
  2617. element.addEventListener('mousedown', function (e) {
  2618. const dragElement = function (e) {
  2619. const x = (e.clientX - offsetX) / unsafeWindow.innerWidth * 100;
  2620. const y = (e.clientY - offsetY) / unsafeWindow.innerHeight * 100;
  2621. const maxX = 100 - (element.offsetWidth / unsafeWindow.innerWidth * 100);
  2622. const maxY = 100 - (element.offsetHeight / unsafeWindow.innerHeight * 100);
  2623. element.style.left = `${Math.max(0, Math.min(x, maxX))}%`;
  2624. element.style.top = `${Math.max(0, Math.min(y, maxY))}%`;
  2625. };
  2626. if (notMenu || e.target.classList.contains('tp-rotv_t')) {
  2627. offsetX = e.clientX - element.getBoundingClientRect().left;
  2628. offsetY = e.clientY - element.getBoundingClientRect().top;
  2629. document.addEventListener('mousemove', dragElement);
  2630. document.addEventListener('mouseup', function () {
  2631. document.removeEventListener('mousemove', dragElement);
  2632. });
  2633. e.preventDefault(); // Prevent text selection during drag
  2634. };
  2635. });
  2636. };
  2637. };
  2638.  
  2639. const makeHudElementDragable = function (element) {
  2640. if (element.getAttribute("drag-true") != "true") {
  2641. element.addEventListener("mousedown", function (e) {
  2642. let offsetX = e.clientX - parseInt(window.getComputedStyle(this).left);
  2643. let offsetY = e.clientY - parseInt(window.getComputedStyle(this).top);
  2644.  
  2645. function mouseMoveHandler(e) {
  2646. let newX = e.clientX - offsetX;
  2647. let newY = e.clientY - offsetY;
  2648. if (newX >= 0 && newX + element.getBoundingClientRect().width <= window.innerWidth) {
  2649. element.style.left = newX + "px";
  2650. };
  2651. if (newY >= 0 && newY + element.getBoundingClientRect().height <= window.innerHeight) {
  2652. element.style.top = newY + "px";
  2653. };
  2654. };
  2655.  
  2656. function reset() {
  2657. window.removeEventListener("mousemove", mouseMoveHandler);
  2658. window.removeEventListener("mouseup", reset);
  2659.  
  2660. //saves new positions
  2661. hudElementPositions.coordElement = { "top": coordElement.getBoundingClientRect().top, "left": coordElement.getBoundingClientRect().left };
  2662. hudElementPositions.gameInfoElement = { "top": gameInfoElement.getBoundingClientRect().top, "left": gameInfoElement.getBoundingClientRect().left };
  2663. hudElementPositions.playerstatsElement = { "top": playerstatsElement.getBoundingClientRect().top, "left": playerstatsElement.getBoundingClientRect().left };
  2664. hudElementPositions.playerinfoElement = { "top": playerinfoElement.getBoundingClientRect().top, "left": playerinfoElement.getBoundingClientRect().left };
  2665. save("HUD-Positions", hudElementPositions);
  2666. };
  2667.  
  2668. window.addEventListener("mousemove", mouseMoveHandler);
  2669. window.addEventListener("mouseup", reset);
  2670. });
  2671.  
  2672. element.setAttribute("drag-true", "true");
  2673. };
  2674. };
  2675.  
  2676. const applyTheme = function (setTheme) {
  2677. setTheme = (setTheme || extract("themeType") || "defaultTheme");
  2678. let rootTheme
  2679. switch (setTheme) {
  2680. case ("defaultTheme"):
  2681. rootTheme = `
  2682. --tp-base-background-color: hsla(230, 7%, 17%, 1.00);
  2683. --tp-base-shadow-color: hsla(0, 0%, 0%, 0.2);
  2684. --tp-button-background-color: hsla(230, 7%, 70%, 1.00);
  2685. --tp-button-background-color-active: hsla(230, 7%, 85%, 1.00);
  2686. --tp-button-background-color-focus: hsla(230, 7%, 80%, 1.00);
  2687. --tp-button-background-color-hover: hsla(230, 7%, 75%, 1.00);
  2688. --tp-button-foreground-color: hsla(230, 7%, 17%, 1.00);
  2689. --tp-container-background-color: hsla(230, 7%, 75%, 0.10);
  2690. --tp-container-background-color-active: hsla(230, 7%, 75%, 0.25);
  2691. --tp-container-background-color-focus: hsla(230, 7%, 75%, 0.20);
  2692. --tp-container-background-color-hover: hsla(230, 7%, 75%, 0.15);
  2693. --tp-container-foreground-color: hsla(230, 7%, 75%, 1.00);
  2694. --tp-groove-foreground-color: hsla(230, 7%, 75%, 0.10);
  2695. --tp-input-background-color: hsla(230, 7%, 75%, 0.10);
  2696. --tp-input-background-color-active: hsla(230, 7%, 75%, 0.25);
  2697. --tp-input-background-color-focus: hsla(230, 7%, 75%, 0.20);
  2698. --tp-input-background-color-hover: hsla(230, 7%, 75%, 0.15);
  2699. --tp-input-foreground-color: hsla(230, 7%, 75%, 1.00);
  2700. --tp-label-foreground-color: hsla(230, 7%, 75%, 0.70);
  2701. --tp-monitor-background-color: hsla(230, 7%, 0%, 0.20);
  2702. --tp-monitor-foreground-color: hsla(230, 7%, 75%, 0.70);`; break;
  2703. case ("icebergTheme"):
  2704. rootTheme = `
  2705. --tp-base-background-color: hsla(230, 20%, 11%, 1.00);
  2706. --tp-base-shadow-color: hsla(0, 0%, 0%, 0.2);
  2707. --tp-button-background-color: hsla(230, 10%, 80%, 1.00);
  2708. --tp-button-background-color-active: hsla(230, 10%, 95%, 1.00);
  2709. --tp-button-background-color-focus: hsla(230, 10%, 90%, 1.00);
  2710. --tp-button-background-color-hover: hsla(230, 10%, 85%, 1.00);
  2711. --tp-button-foreground-color: hsla(230, 20%, 11%, 1);
  2712. --tp-container-background-color: hsla(230, 25%, 16%, 1.00);
  2713. --tp-container-background-color-active: hsla(230, 25%, 31%, 1.00);
  2714. --tp-container-background-color-focus: hsla(230, 25%, 26%, 1.00);
  2715. --tp-container-background-color-hover: hsla(230, 25%, 21%, 1.00);
  2716. --tp-container-foreground-color: hsla(230, 10%, 80%, 1.00);
  2717. --tp-groove-foreground-color: hsla(230, 20%, 8%, 1.00);
  2718. --tp-input-background-color: hsla(230, 20%, 8%, 1.00);
  2719. --tp-input-background-color-active: hsla(230, 28%, 23%, 1.00);
  2720. --tp-input-background-color-focus: hsla(230, 28%, 18%, 1.00);
  2721. --tp-input-background-color-hover: hsla(230, 20%, 13%, 1.00);
  2722. --tp-input-foreground-color: hsla(230, 10%, 80%, 1.00);
  2723. --tp-label-foreground-color: hsla(230, 12%, 48%, 1.00);
  2724. --tp-monitor-background-color: hsla(230, 20%, 8%, 1.00);
  2725. --tp-monitor-foreground-color: hsla(230, 12%, 48%, 1.00);`; break;
  2726. case ("jetblackTheme"):
  2727. rootTheme = `
  2728. --tp-base-background-color: hsla(0, 0%, 0%, 1.00);
  2729. --tp-base-shadow-color: hsla(0, 0%, 0%, 0.2);
  2730. --tp-button-background-color: hsla(0, 0%, 70%, 1.00);
  2731. --tp-button-background-color-active: hsla(0, 0%, 85%, 1);
  2732. --tp-button-background-color-focus: hsla(0, 0%, 80%, 1.00);
  2733. --tp-button-background-color-hover: hsla(0, 0%, 75%, 1.00);
  2734. --tp-button-foreground-color: hsla(0, 0%, 0%, 1.00);
  2735. --tp-container-background-color: hsla(0, 0%, 10%, 1.00);
  2736. --tp-container-background-color-active: hsla(0, 0%, 25%, 1.00);
  2737. --tp-container-background-color-focus: hsla(0, 0%, 20%, 1.00);
  2738. --tp-container-background-color-hover: hsla(0, 0%, 15%, 1.00);
  2739. --tp-container-foreground-color: hsla(0, 0%, 50%, 1.00);
  2740. --tp-groove-foreground-color: hsla(0, 0%, 10%, 1.00);
  2741. --tp-input-background-color: hsla(0, 0%, 10%, 1.00);
  2742. --tp-input-background-color-active: hsla(0, 0%, 25%, 1.00);
  2743. --tp-input-background-color-focus: hsla(0, 0%, 20%, 1.00);
  2744. --tp-input-background-color-hover: hsla(0, 0%, 15%, 1.00);
  2745. --tp-input-foreground-color: hsla(0, 0%, 70%, 1.00);
  2746. --tp-label-foreground-color: hsla(0, 0%, 50%, 1.00);
  2747. --tp-monitor-background-color: hsla(0, 0%, 8%, 1.00);
  2748. --tp-monitor-foreground-color: hsla(0, 0%, 48%, 1.00);`; break;
  2749. case ("lightTheme"):
  2750. rootTheme = `
  2751. --tp-base-background-color: hsla(230, 5%, 90%, 1.00);
  2752. --tp-base-shadow-color: hsla(0, 0%, 0%, 0.10);
  2753. --tp-button-background-color: hsla(230, 7%, 75%, 1.00);
  2754. --tp-button-background-color-active: hsla(230, 7%, 60%, 1.00);
  2755. --tp-button-background-color-focus: hsla(230, 7%, 65%, 1.00);
  2756. --tp-button-background-color-hover: hsla(230, 7%, 70%, 1.00);
  2757. --tp-button-foreground-color: hsla(230, 10%, 30%, 1.00);
  2758. --tp-container-background-color: hsla(230, 15%, 30%, 0.20);
  2759. --tp-container-background-color-active: hsla(230, 15%, 30%, 0.32);
  2760. --tp-container-background-color-focus: hsla(230, 15%, 30%, 0.28);
  2761. --tp-container-background-color-hover: hsla(230, 15%, 30%, 0.24);
  2762. --tp-container-foreground-color: hsla(230, 10%, 30%, 1.00);
  2763. --tp-groove-foreground-color: hsla(230, 15%, 30%, 0.10);
  2764. --tp-input-background-color: hsla(230, 15%, 30%, 0.10);
  2765. --tp-input-background-color-active: hsla(230, 15%, 30%, 0.22);
  2766. --tp-input-background-color-focus: hsla(230, 15%, 30%, 0.18);
  2767. --tp-input-background-color-hover: hsla(230, 15%, 30%, 0.14);
  2768. --tp-input-foreground-color: hsla(230, 10%, 30%, 1.00);
  2769. --tp-label-foreground-color: hsla(230, 10%, 30%, 0.70);
  2770. --tp-monitor-background-color: hsla(230, 15%, 30%, 0.10);
  2771. --tp-monitor-foreground-color: hsla(230, 10%, 30%, 0.50);`; break;
  2772. case ("retroTheme"):
  2773. rootTheme = `
  2774. --tp-base-background-color: hsla(40, 3%, 90%, 1.00);
  2775. --tp-base-shadow-color: hsla(0, 0%, 0%, 0.30);
  2776. --tp-button-background-color: hsla(40, 3%, 70%, 1.00);
  2777. --tp-button-background-color-active: hsla(40, 3%, 55%, 1.00);
  2778. --tp-button-background-color-focus: hsla(40, 3%, 60%, 1.00);
  2779. --tp-button-background-color-hover: hsla(40, 3%, 65%, 1.00);
  2780. --tp-button-foreground-color: hsla(40, 3%, 20%, 1.00);
  2781. --tp-container-background-color: hsla(40, 3%, 70%, 1.00);
  2782. --tp-container-background-color-active: hsla(40, 3%, 55%, 1.00);
  2783. --tp-container-background-color-focus: hsla(40, 3%, 60%, 1.00);
  2784. --tp-container-background-color-hover: hsla(40, 3%, 65%, 1.00);
  2785. --tp-container-foreground-color: hsla(40, 3%, 20%, 1.00);
  2786. --tp-groove-foreground-color: hsla(40, 3%, 40%, 1.00);
  2787. --tp-input-background-color: hsla(120, 3%, 20%, 1.00);
  2788. --tp-input-background-color-active: hsla(120, 3%, 35%, 1.00);
  2789. --tp-input-background-color-focus: hsla(120, 3%, 30%, 1.00);
  2790. --tp-input-background-color-hover: hsla(120, 3%, 25%, 1.00);
  2791. --tp-input-foreground-color: hsla(120, 40%, 60%, 1.00);
  2792. --tp-label-foreground-color: hsla(40, 3%, 50%, 1.00);
  2793. --tp-monitor-background-color: hsla(120, 3%, 20%, 1.00);
  2794. --tp-monitor-foreground-color: hsla(120, 40%, 60%, 0.80);`; break;
  2795. case ("translucentTheme"):
  2796. rootTheme = `
  2797. --tp-base-background-color: hsla(0, 0%, 10%, 0.80);
  2798. --tp-base-shadow-color: hsla(0, 0%, 0%, 0.20);
  2799. --tp-button-background-color: hsla(0, 0%, 80%, 1.00);
  2800. --tp-button-background-color-active: hsla(0, 0%, 100%, 1.00);
  2801. --tp-button-background-color-focus: hsla(0, 0%, 95%, 1.00);
  2802. --tp-button-background-color-hover: hsla(0, 0%, 85%, 1.00);
  2803. --tp-button-foreground-color: hsla(0, 0%, 0%, 0.80);
  2804. --tp-container-background-color: hsla(0, 0%, 0%, 0.30);
  2805. --tp-container-background-color-active: hsla(0, 0%, 0%, 0.60);
  2806. --tp-container-background-color-focus: hsla(0, 0%, 0%, 0.50);
  2807. --tp-container-background-color-hover: hsla(0, 0%, 0%, 0.40);
  2808. --tp-container-foreground-color: hsla(0, 0%, 100%, 0.50);
  2809. --tp-groove-foreground-color: hsla(0, 0%, 0%, 0.20);
  2810. --tp-input-background-color: hsla(0, 0%, 0%, 0.30);
  2811. --tp-input-background-color-active: hsla(0, 0%, 0%, 0.60);
  2812. --tp-input-background-color-focus: hsla(0, 0%, 0%, 0.50);
  2813. --tp-input-background-color-hover: hsla(0, 0%, 0%, 0.40);
  2814. --tp-input-foreground-color: hsla(0, 0%, 100%, 0.50);
  2815. --tp-label-foreground-color: hsla(0, 0%, 100%, 0.50);
  2816. --tp-monitor-background-color: hsla(0, 0%, 0%, 0.30);
  2817. --tp-monitor-foreground-color: hsla(0, 0%, 100%, 0.30);`; break;
  2818. case ("statefarmerTheme"):
  2819. rootTheme = `
  2820. --tp-base-background-color: hsla(0, 80%, 40%, 1.00);
  2821. --tp-base-shadow-color: hsla(0, 0%, 0%, 0.2);
  2822. --tp-button-background-color: hsla(0, 0%, 100%, 1.00);
  2823. --tp-button-background-color-active: hsla(0, 0%, 85%, 1.00);
  2824. --tp-button-background-color-focus: hsla(0, 0%, 90%, 1.00);
  2825. --tp-button-background-color-hover: hsla(0, 0%, 95%, 1.00);
  2826. --tp-button-foreground-color: hsla(230, 20%, 11%, 1.00);
  2827. --tp-container-background-color: hsla(0, 0%, 0%, 0.20);
  2828. --tp-container-background-color-active: hsla(0, 0%, 0%, 0.35);
  2829. --tp-container-background-color-focus: hsla(0, 0%, 0%, 0.30);
  2830. --tp-container-background-color-hover: hsla(0, 0%, 0%, 0.25);
  2831. --tp-container-foreground-color: hsla(0, 0%, 100%, 0.90);
  2832. --tp-groove-foreground-color: hsla(0, 0%, 0%, 0.50);
  2833. --tp-input-background-color: hsla(0, 0%, 0%, 0.50);
  2834. --tp-input-background-color-active: hsla(0, 0%, 0%, 0.65);
  2835. --tp-input-background-color-focus: hsla(0, 0%, 0%, 0.60);
  2836. --tp-input-background-color-hover: hsla(0, 0%, 0%, 0.55);
  2837. --tp-input-foreground-color: hsla(0, 0%, 100%, 0.90);
  2838. --tp-label-foreground-color: hsla(0, 0%, 100%, 0.90);
  2839. --tp-monitor-background-color: hsla(0, 0%, 0%, 0.50);
  2840. --tp-monitor-foreground-color: hsla(0, 0%, 100%, 0.50);`; break;
  2841. case ("blurpleTheme"):
  2842. rootTheme = `
  2843. --tp-base-background-color: hsla(255, 68%, 39%, 1.00);
  2844. --tp-base-shadow-color: hsla(0, 0%, 0%, 0.2);
  2845. --tp-button-background-color: hsla(0, 0%, 100%, 1.00);
  2846. --tp-button-background-color-active: hsla(0, 0%, 85%, 1.00);
  2847. --tp-button-background-color-focus: hsla(0, 0%, 90%, 1.00);
  2848. --tp-button-background-color-hover: hsla(0, 0%, 95%, 1.00);
  2849. --tp-button-foreground-color: hsla(230, 20%, 11%, 1.00);
  2850. --tp-container-background-color: hsla(0, 0%, 0%, 0.20);
  2851. --tp-container-background-color-active: hsla(0, 0%, 0%, 0.35);
  2852. --tp-container-background-color-focus: hsla(0, 0%, 0%, 0.30);
  2853. --tp-container-background-color-hover: hsla(0, 0%, 0%, 0.25);
  2854. --tp-container-foreground-color: hsla(0, 0%, 100%, 0.90);
  2855. --tp-groove-foreground-color: hsla(0, 0%, 0%, 0.50);
  2856. --tp-input-background-color: hsla(0, 0%, 0%, 0.50);
  2857. --tp-input-background-color-active: hsla(0, 0%, 0%, 0.65);
  2858. --tp-input-background-color-focus: hsla(0, 0%, 0%, 0.60);
  2859. --tp-input-background-color-hover: hsla(0, 0%, 0%, 0.55);
  2860. --tp-input-foreground-color: hsla(0, 0%, 100%, 0.90);
  2861. --tp-label-foreground-color: hsla(0, 0%, 100%, 0.90);
  2862. --tp-monitor-background-color: hsla(0, 0%, 0%, 0.50);
  2863. --tp-monitor-foreground-color: hsla(0, 0%, 100%, 0.50);`; break;
  2864. case ("shellFarmTheme"):
  2865. rootTheme = `
  2866. --tp-base-background-color: hsla(198, 100%, 50%, 1.00);
  2867. --tp-base-shadow-color: hsla(0, 0%, 0%, 0.2);
  2868. --tp-button-background-color: hsla(0, 0%, 100%, 1.00);
  2869. --tp-button-background-color-active: hsla(0, 0%, 85%, 1.00);
  2870. --tp-button-background-color-focus: hsla(0, 0%, 90%, 1.00);
  2871. --tp-button-background-color-hover: hsla(0, 0%, 95%, 1.00);
  2872. --tp-button-foreground-color: hsla(230, 20%, 11%, 1.00);
  2873. --tp-container-background-color: hsla(0, 0%, 0%, 0.20);
  2874. --tp-container-background-color-active: hsla(0, 0%, 0%, 0.35);
  2875. --tp-container-background-color-focus: hsla(0, 0%, 0%, 0.30);
  2876. --tp-container-background-color-hover: hsla(0, 0%, 0%, 0.25);
  2877. --tp-container-foreground-color: hsla(0, 0%, 100%, 0.90);
  2878. --tp-groove-foreground-color: hsla(0, 0%, 0%, 0.50);
  2879. --tp-input-background-color: hsla(0, 0%, 0%, 0.50);
  2880. --tp-input-background-color-active: hsla(0, 0%, 0%, 0.65);
  2881. --tp-input-background-color-focus: hsla(0, 0%, 0%, 0.60);
  2882. --tp-input-background-color-hover: hsla(0, 0%, 0%, 0.55);
  2883. --tp-input-foreground-color: hsla(0, 0%, 100%, 0.90);
  2884. --tp-label-foreground-color: hsla(0, 0%, 100%, 0.90);
  2885. --tp-monitor-background-color: hsla(0, 0%, 0%, 0.50);
  2886. --tp-monitor-foreground-color: hsla(0, 0%, 100%, 0.50);`; break;
  2887. };
  2888.  
  2889. //menu customisation (apply font, button widths, adjust checkbox right slightly, make menu appear on top, add anim to message)
  2890. const styleElement = document.createElement('style');
  2891. styleElement.textContent = `
  2892. :root { ${rootTheme} }
  2893. `;
  2894. document.head.appendChild(styleElement);
  2895. };
  2896. const temp = document.createElement('div');
  2897. temp.innerHTML = `
  2898. <style>
  2899. .notif {
  2900. position: absolute;
  2901. border: 5px solid lightblue;
  2902. left: 70%;
  2903. top: 85%;
  2904. transform: translate(-50%, -50%);
  2905. display: flex;
  2906. align-items: center;
  2907. justify-content: center;
  2908. color: #fff;
  2909. text-align: center;
  2910. background: rgba(0, 0, 0, 0.6);
  2911. font-weight: bolder;
  2912. padding: 15px;
  2913. z-index: 999999;
  2914. border-radius: 2vw;
  2915. overflow: auto;
  2916. resize: both;
  2917. backdrop-filter: blur(4px);
  2918. overflow: hidden;
  2919. min-width: 10vw;
  2920. min-height: 4vh;
  2921. pointer-events: none;
  2922. }
  2923. .MiniMap {
  2924. position: absolute;
  2925. left: 50%;
  2926. top: 50%;
  2927. transform: translate(-50%, -50%);
  2928. width: 1000px;
  2929. height:1000px;
  2930. display: flex;
  2931. align-items: center;
  2932. justify-content: center;
  2933. color: #fff;
  2934. text-align: center;
  2935. background: rgba(0, 0, 0, 0);
  2936. font-weight: bolder;
  2937. padding: 15px;
  2938. z-index: 999999;
  2939. border-radius: 2vw;
  2940. overflow: auto;
  2941. overflow: hidden;
  2942. pointer-events: none;
  2943. }
  2944. .playerDot {
  2945. position: absolute;
  2946. width: 0;
  2947. height: 0;
  2948. border-left: 10px solid transparent;
  2949. border-right: 10px solid transparent;
  2950. border-bottom: 20px solid green;
  2951. color: white;
  2952. transform: translate(-50%, -50%);
  2953. z-index: 999999;
  2954. }
  2955. </style>
  2956. <div id = "minimap" class="MiniMap"></div>
  2957. <div id = "playerDot" class="playerDot">playerdot</div>
  2958. `;
  2959. const mapEl = temp.querySelector('.MiniMap');
  2960. let myPlayerDot = temp.querySelector('.playerDot');
  2961. const playerDotsMap = new Map();
  2962. window.addEventListener('DOMContentLoaded', async function () {
  2963. while (temp.children.length > 0) {
  2964. document.body.appendChild(temp.children[0]);
  2965. }
  2966. });
  2967. function updateMiniMap(player, myPlayer) {
  2968. const windowWidth = window.innerWidth;
  2969. const windowHeight = window.innerHeight;
  2970. // Check if a player dot with the unique ID already exists, then do flow of control
  2971. let xPosition = (player[H.x] / 100) * windowWidth; xPosition += (windowWidth + xPosition) / 2;
  2972. let yPosition = (player[H.z] / 100) * windowHeight; yPosition += (windowHeight + yPosition) / 2;
  2973. if (!player[H.playing] || !player) {
  2974. if (playerDotsMap.has(player.uniqueId)) {
  2975. const playerDotToRemove = playerDotsMap.get(player.uniqueId);
  2976. mapEl.removeChild(playerDotToRemove); // Remove the dot from the DOM
  2977. playerDotsMap.delete(player.uniqueId); // Remove the dot from the map
  2978. };
  2979. } else if (player === myPlayer) {
  2980. myPlayerDot.style.left = `${xPosition}px`;
  2981. myPlayerDot.style.top = `${yPosition}px`;
  2982. myPlayerDot.textContent = myPlayer.name;
  2983. myPlayerDot.style.transform = 'translate(-50%, -50%) rotate(' + yawToDeg(player[H.yaw]) + 'deg)';
  2984. } else if (playerDotsMap.has(player.uniqueId)) {
  2985. // If it exists, update its position
  2986. const existingPlayerDot = playerDotsMap.get(player.uniqueId);
  2987. existingPlayerDot.style.left = `${xPosition}px`;
  2988. existingPlayerDot.style.top = `${yPosition}px`;
  2989. //existingPlayerDot.style.transform = 'translate(-50%, -50%) rotate(' + yawToDeg(player[H.yaw]) + 'deg)'; // could uncomment but then names unreadable,
  2990. } else {
  2991. // If it doesn't exist, create a new player dot element
  2992. const newPlayerDot = document.createElement('div');
  2993. newPlayerDot.className = 'playerDot';
  2994. newPlayerDot.style.border = player.team === 1 ? '5px solid blue' : '5px solid red';
  2995.  
  2996. newPlayerDot.style.left = `${xPosition}px`;
  2997. newPlayerDot.style.top = `${yPosition}px`;
  2998. newPlayerDot.textContent = player.name;
  2999. // append to the MiniMap element, for later purposes once we can set inside the element instead
  3000. mapEl.appendChild(newPlayerDot);
  3001.  
  3002. // Store in the Map
  3003. playerDotsMap.set(player.uniqueId, newPlayerDot);
  3004. };
  3005. };
  3006. function yawToDeg(yaw) {
  3007. let yaw_degrees = yaw * 180.0 / Math.PI; // conversion to degrees
  3008. if (yaw_degrees < 0) yaw_degrees += 360.0; // convert negative to positive angles
  3009. return yaw_degrees;
  3010. };
  3011. const hslToRgb = function(h, s, l) {
  3012. var r, g, b;
  3013. if (s === 0) {
  3014. r = g = b = l;
  3015. } else {
  3016. function hue2rgb(p, q, t) {
  3017. if (t < 0) t += 1;
  3018. if (t > 1) t -= 1;
  3019. if (t < 1 / 6) return p + (q - p) * 6 * t;
  3020. if (t < 1 / 2) return q;
  3021. if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
  3022. return p;
  3023. };
  3024. var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
  3025. var p = 2 * l - q;
  3026. r = hue2rgb(p, q, h + 1 / 3);
  3027. g = hue2rgb(p, q, h);
  3028. b = hue2rgb(p, q, h - 1 / 3);
  3029. };
  3030. return new L.BABYLON.Color3(r, g, b);
  3031. };
  3032. const applyStateFarmLogo = function () {
  3033. if (extract("replaceLogo")) {
  3034. const images = document.getElementsByTagName('img');
  3035. let imgURL = replacementLogoURL;
  3036. const month = new Date().getMonth();
  3037. if (replacementLogoHalloweenURL && replacementLogoHalloweenURL !== "" && month == 9) imgURL = replacementLogoHalloweenURL;
  3038. for (let i = 0; i < images.length; i++) {
  3039. const src = images[i].getAttribute('src');
  3040. if (src && src.includes('img/logo.svg')) {
  3041. images[i].setAttribute('src', imgURL);
  3042. };
  3043. };
  3044. const logoDiv = document.getElementById('logo');
  3045. if (logoDiv) {
  3046. const logoImg = logoDiv.querySelector('img');
  3047. if (logoImg) {
  3048. logoImg.setAttribute('src', imgURL);
  3049. logoImg.setAttribute('width', 300);
  3050. logoImg.setAttribute('height', 104);
  3051. };
  3052. };
  3053. };
  3054. };
  3055. //1337 H4X
  3056. const getSearchParam = function (param) {
  3057. const queryParams = new URLSearchParams(unsafeWindow.location.search);
  3058. return queryParams.get(param);
  3059. };
  3060. const fetchTextContent = function (url) {
  3061. try {
  3062. var xhr = new XMLHttpRequest();
  3063. xhr.open('GET', url, false);
  3064. xhr.send();
  3065. if (xhr.status === 200) {
  3066. return xhr.responseText;
  3067. } else {
  3068. console.error("Error fetching " + url);
  3069. return null;
  3070. };
  3071. } catch (err) {
  3072. return null
  3073. };
  3074. };
  3075. const findKeyByValue = function (obj, value) {
  3076. for (const key in obj) {
  3077. if (obj[key] === value) {
  3078. return key;
  3079. };
  3080. };
  3081. return null; // Return null if the value is not found
  3082. };
  3083. const newProxy = function () {
  3084. unsafeWindow.location.replace(unsafeWindow.location.href.replace(unsafeWindow.location.hostname, proxyList[3]));
  3085. };
  3086. const unban = function () {
  3087. log("STATEFARM UNBANNING...");
  3088. updateAccountRecords();
  3089. unsafeWindow.extern.signOut();
  3090. accountStatus = "logged out";
  3091. setTimeout(() => {
  3092. const banPopup = document.getElementById("bannedPopup");
  3093. if (banPopup) { banPopup.style.display = 'none' }; //hide it
  3094. }, 10000);
  3095. };
  3096. const reloadPage = function () {
  3097. unsafeWindow.location.reload(true);
  3098. };
  3099. const spamReport = function () {
  3100. (async function () {
  3101. const sleep = function (ms) {
  3102. return new Promise(resolve => setTimeout(resolve, ms));
  3103. };
  3104. let playerList = document.getElementById("playerList").children;
  3105. for (let i = 0; i < playerList.length; i++) {
  3106. playerList[i].click();
  3107. await sleep(400);
  3108. document.getElementsByClassName("ss_button btn_medium btn_red bevel_red")[0].click();
  3109. await sleep(400);
  3110. document.getElementsByClassName("ss_checkbox label")[randomInt(0, 3)].click();
  3111. await sleep(400);
  3112. document.getElementsByClassName("ss_button btn_medium btn_green bevel_green")[0].click();
  3113. await sleep(400);
  3114. document.getElementById("genericPopup").children[2].children[1].click();
  3115. };
  3116. })();
  3117. };
  3118.  
  3119. const broadcastToBots = function (command) {
  3120. const commandTime = Date.now();
  3121. log("StateFarm: sending command to bots:", command, "| at time:", commandTime);
  3122. GM_setValue("StateFarm_Command", command);
  3123. GM_setValue("StateFarm_CommandTime", commandTime);
  3124. };
  3125.  
  3126. const hexToRgb = function (hex) {
  3127. hex = hex.replace(/^#/, '');
  3128. const bigint = parseInt(hex, 16);
  3129. const r = (bigint >> 16) & 255;
  3130. const g = (bigint >> 8) & 255;
  3131. const b = bigint & 255;
  3132. return [r / 255, g / 255, b / 255];
  3133. };
  3134. const fadeBetweenColors = function (color1, color2, progress) {
  3135. const rgb1 = hexToRgb(color1);
  3136. const rgb2 = hexToRgb(color2);
  3137. const resultRgb = [
  3138. rgb1[0] + (rgb2[0] - rgb1[0]) * progress,
  3139. rgb1[1] + (rgb2[1] - rgb1[1]) * progress,
  3140. rgb1[2] + (rgb2[2] - rgb1[2]) * progress
  3141. ];
  3142. return resultRgb;
  3143. };
  3144. const distancePlayers = function (player, yMultiplier) {
  3145. if (player && player[H.actor] && player[H.actor][H.mesh]) {
  3146. yMultiplier = yMultiplier || 1;
  3147. let vector = getDirectionVectorFacingTarget(player);
  3148. return Math.hypot(vector.x, vector.y * yMultiplier, vector.z); //pythagoras' theorem in 3 dimensions. no one owns maths, zert.
  3149. } else log("fuck2", player); return 0;
  3150. };
  3151. const setPrecision = function (value) { return Math.round(value * 8192) / 8192 }; //required precision
  3152. const calculateYaw = function (pos) {
  3153. return setPrecision(Math.mod(Math.atan2(pos.x, pos.z), Math.PI2));
  3154. };
  3155. const calculatePitch = function (pos) {
  3156. return setPrecision(-Math.atan2(pos.y, Math.hypot(pos.x, pos.z)) % 1.5);
  3157. };
  3158. const getAngularDifference = function (obj1, obj2) { //this is super scuffed
  3159. return Math.abs(obj1[H.yaw] - obj2.yawReal) + Math.abs(obj1[H.pitch] - obj2.pitchReal);
  3160. };
  3161. const getDirectionVectorFacingTarget = function (target, vectorPassed, offsetY) {
  3162. if (vectorPassed || (target && target[H.actor] && target[H.actor][H.mesh])) { //in case of zizzy's weird error
  3163. target = vectorPassed ? target : target[H.actor][H.mesh].position;
  3164. offsetY = offsetY || 0;
  3165. return {
  3166. x: - (target.x - ss.MYPLAYER[H.actor][H.mesh].position.x),
  3167. y: - (target.y - ss.MYPLAYER[H.actor][H.mesh].position.y + offsetY),
  3168. z: - (target.z - ss.MYPLAYER[H.actor][H.mesh].position.z),
  3169. };
  3170. } else { //we really dont want this happening tho
  3171. log("fuck");
  3172. // log(vectorPassed);
  3173. // log(target);
  3174. // console.trace();
  3175. return {
  3176. x: 0,
  3177. y: 0,
  3178. z: 0,
  3179. };
  3180. };
  3181. };
  3182. const deg2rad = function (deg) {
  3183. return deg * (Math.PI / 180);
  3184. };
  3185. const reverseString = function (str) { return str.split("").reverse().join("") };
  3186. const isPartialMatch = function (array, searchString) {
  3187. return array.some(item => item !== "" && searchString.toLowerCase().includes(item.toLowerCase()));
  3188. };
  3189. const findBadgesForUsername = function(username) {
  3190. let found = [];
  3191. if (badgeList && username) {
  3192. username = username.toLowerCase().replaceAll("_","").replaceAll(" ","");
  3193. for (const [key, userList] of Object.entries(badgeList)) {
  3194. for (const user of userList) {
  3195. if (username.includes(user.toLowerCase())) {
  3196. found.push(key);
  3197. };
  3198. };
  3199. };
  3200. };
  3201. return found;
  3202. };
  3203.  
  3204. const playAudio = function (name, panner, contextName) {
  3205. contextName = findStringInLists(divertContexts, name) || "OTHER"+randomInt(1,9)
  3206. let audioContext;
  3207. audioContext = audioContexts[contextName];
  3208. let source = audioContext.createBufferSource();
  3209. source.buffer = soundsSFC[name];
  3210.  
  3211. const newPanner = audioContext.createPanner();
  3212. audioContext.listener.setPosition(0, 0, 0);
  3213.  
  3214. if (panner) {
  3215. newPanner.context.listener.setPosition(panner.context.listener.positionX.value, panner.context.listener.positionY.value, panner.context.listener.positionZ.value);
  3216. newPanner.setPosition(
  3217. panner.context.listener.positionX.value - ((panner.context.listener.positionX.value - panner.positionX.value) * extract("distanceMult")),
  3218. panner.context.listener.positionY.value - ((panner.context.listener.positionY.value - panner.positionY.value) * extract("distanceMult")),
  3219. panner.context.listener.positionZ.value - ((panner.context.listener.positionZ.value - panner.positionZ.value) * extract("distanceMult")),
  3220. );
  3221. newPanner.setOrientation(panner.orientationX.value, panner.orientationY.value, panner.orientationZ.value);
  3222. newPanner.refDistance = panner.refDistance;
  3223. newPanner.maxDistance = panner.maxDistance;
  3224. newPanner.rolloffFactor = panner.rolloffFactor;
  3225. newPanner.coneInnerAngle = panner.coneInnerAngle;
  3226. newPanner.coneOuterAngle = panner.coneOuterAngle;
  3227. newPanner.coneOuterGain = panner.coneOuterGain;
  3228. };
  3229. if (audioContext.state === 'suspended') {
  3230. audioContext.resume();
  3231. };
  3232. // log(contextName);
  3233. source.connect(newPanner);
  3234. newPanner.connect(audioContext.destination);
  3235. source.start();
  3236. };
  3237. const playerMatchesList = function (array, player) {
  3238. let nameMatched = isPartialMatch(array, player.name);
  3239. let idMatched = isPartialMatch(array, player.uniqueId);
  3240. return nameMatched || idMatched;
  3241. };
  3242. const randomInt = function (min, max) {
  3243. return Math.floor(Math.random() * (max - min + 1)) + min;
  3244. };
  3245. const radianAngleDiff = function (angle1, angle2) {
  3246. const fullCircle = 2 * Math.PI;
  3247. // Normalize angles to be within [0, 2π)
  3248. angle1 = (angle1 % fullCircle + fullCircle) % fullCircle;
  3249. angle2 = (angle2 % fullCircle + fullCircle) % fullCircle;
  3250. // Find the absolute angular difference
  3251. let diff = Math.abs(angle1 - angle2);
  3252. // Ensure the difference is within [0, π)
  3253. diff = Math.min(diff, fullCircle - diff);
  3254. // Determine the sign of the difference correctly
  3255. if ((angle1 - angle2 + fullCircle) % fullCircle > Math.PI) {
  3256. return -diff;
  3257. } else {
  3258. return diff;
  3259. };
  3260. };
  3261. clientID = (getScrambled() + "noID");
  3262. const createAnonFunction = function (name, func) {
  3263. const funcName = getScrambled();
  3264. unsafeWindow[funcName] = func;
  3265. F[name] = unsafeWindow[funcName];
  3266. functionNames[name] = funcName
  3267. };
  3268. const processChatItem = function (text, playerName, playerTeam, highlightColor) {
  3269. let chatItem = document.createElement("div");
  3270. let playerNameSpan = document.createElement("span");
  3271. let playerInfoContainer = document.createElement("div");
  3272. let serverIcon = document.createElement("i");
  3273.  
  3274. chatItem.classList.add("chat-item");
  3275. playerInfoContainer.style.display = "inline-block";
  3276.  
  3277. playerNameSpan.classList.add("chat-player-name", "ss_marginright_xs");
  3278. playerNameSpan.textContent = playerName + " ";
  3279.  
  3280. playerInfoContainer.style.color = TEAMCOLORS[playerTeam];
  3281. playerInfoContainer.appendChild(serverIcon);
  3282. playerInfoContainer.appendChild(playerNameSpan);
  3283.  
  3284. let messageSpan = document.createElement("span");
  3285. messageSpan.innerHTML = text;
  3286. chatItem.style.fontStyle = "italic";
  3287. messageSpan.style.backgroundColor = highlightColor;
  3288. playerInfoContainer.style.backgroundColor = highlightColor;
  3289.  
  3290. chatItem.appendChild(playerInfoContainer);
  3291. chatItem.appendChild(messageSpan);
  3292.  
  3293. document.getElementById("chatOut").appendChild(chatItem);
  3294.  
  3295. if (document.querySelector(".chat-container")) {
  3296. document.querySelector(".chat-container").scrollTop = document.querySelector(".chat-container").scrollHeight;
  3297. };
  3298. };
  3299. const updateOrCreateLinesESP = function (object, type, color) {
  3300. let newPosition, newScene, newParent
  3301. if (type == "playerESP") {
  3302. newPosition = object[H.actor][H.mesh].position;
  3303. newScene = object[H.actor].scene;
  3304. newParent = object[H.actor][H.mesh];
  3305. } else if (type == "pPredESP") { //objects will be player.pred, object of BABYLON.TransformNode. https://doc.babylonjs.com/typedoc/classes/BABYLON.TransformNode
  3306. newPosition = object.getAbsolutePosition(); //we now use the TN's absolutePosition instead of an own var. It's just cleaner this way imo
  3307. newScene = object.getScene(); //getters, yummy
  3308. newParent = object; //will be the TransformNode stored in player.pred, so we can keep this as parent.
  3309. } else {
  3310. newPosition = object.position;
  3311. newScene = object._scene;
  3312. newParent = object;
  3313. };
  3314. if (!object.generatedESP) {
  3315. //tracers
  3316. const tracerLines = L.BABYLON.MeshBuilder.CreateLines("tracerLines", { points: [newPosition, crosshairsPosition] }, newScene);
  3317. tracerLines.color = new L.BABYLON.Color3(1, 1, 1);
  3318. tracerLines.renderingGroupId = 1;
  3319. object.tracerLines = tracerLines;
  3320. //ESP
  3321. //FUCK WIREFRAME BOXES! LIBERTYMUTUAL dictates we making our own MANUALLY bitch! to hell with those diagonal lines
  3322. const boxSize = {
  3323. playerESP: { width: 0.5, height: 0.75, depth: 0.5 },
  3324. pPredESP: { width: 0.5, height: 0.75, depth: 0.5 },
  3325. ammoESP: { width: 0.25, height: 0.35, depth: 0.25 },
  3326. };
  3327. const boxOffset = {
  3328. playerESP: 0,
  3329. pPredESP: 0,
  3330. ammoESP: -0.05,
  3331. };
  3332. const vertices = [
  3333. new L.BABYLON.Vector3(-boxSize[type].width / 2, boxOffset[type], -boxSize[type].depth / 2),
  3334. new L.BABYLON.Vector3(boxSize[type].width / 2, boxOffset[type], -boxSize[type].depth / 2),
  3335. new L.BABYLON.Vector3(boxSize[type].width / 2, boxOffset[type] + boxSize[type].height, -boxSize[type].depth / 2),
  3336. new L.BABYLON.Vector3(-boxSize[type].width / 2, boxOffset[type] + boxSize[type].height, -boxSize[type].depth / 2),
  3337. new L.BABYLON.Vector3(-boxSize[type].width / 2, boxOffset[type], boxSize[type].depth / 2),
  3338. new L.BABYLON.Vector3(boxSize[type].width / 2, boxOffset[type], boxSize[type].depth / 2),
  3339. new L.BABYLON.Vector3(boxSize[type].width / 2, boxOffset[type] + boxSize[type].height, boxSize[type].depth / 2),
  3340. new L.BABYLON.Vector3(-boxSize[type].width / 2, boxOffset[type] + boxSize[type].height, boxSize[type].depth / 2),
  3341. ];
  3342. const lines = [];
  3343. for (let i = 0; i < 4; i++) {
  3344. lines.push([vertices[i], vertices[(i + 1) % 4]]);
  3345. lines.push([vertices[i + 4], vertices[(i + 1) % 4 + 4]]);
  3346. lines.push([vertices[i], vertices[i + 4]]);
  3347. };
  3348. const box = L.BABYLON.MeshBuilder.CreateLineSystem(getScrambled(), { lines }, newScene);
  3349. box.color = new L.BABYLON.Color3(1, 1, 1);
  3350. box.position.y = boxOffset[type];
  3351. box.renderingGroupId = 1;
  3352. box.parent = newParent;
  3353. object.box = box;
  3354. //TARGETS
  3355. let target;
  3356. if (type == "playerESP") {
  3357. target = L.BABYLON.MeshBuilder.CreateSphere(getScrambled(), { diameter: 0.05 }, newScene);
  3358. target.material = new L.BABYLON.StandardMaterial(getScrambled(), newScene);
  3359. target.material.diffuseColor = new L.BABYLON.Color3(1, 0, 0);
  3360. target.material.alpha = 0.5;
  3361. target.position.y = 0.3;
  3362. target.renderingGroupId = 1;
  3363. target.parent = newParent;
  3364. object.target = target;
  3365. };
  3366. /*---fwltv2---*/
  3367. if(type == "playerESP"){
  3368. //create line. other shit later
  3369. const l = L.BABYLON.MeshBuilder.CreateLines(getScrambled(),{points: [new L.BABYLON.Vector3(0, 0, 0),new L.BABYLON.Vector3(0, 0, 0)]}, newScene); //empty lines. will be edited l8er
  3370. //l.renderingGroupId = 1;
  3371.  
  3372. object.lookDirLine = l;
  3373. //line will be updated every call, not just creation. I hate this but fuck you
  3374. }
  3375. /*----------------------*/
  3376. //stuff
  3377. object.generatedESP = true;
  3378. ESPArray.push([object, tracerLines, box, target, object.lookDirLine]);
  3379. };
  3380. if (object.lookDirLine && extract("lookTracers")){ //no need to update if module disabled. Raycasts aren't the best thing to run every frame without any use...
  3381. const TRACE_LENGTH_MULTIPLIER = 75; //how long is the trace max?
  3382. const playerEye = object[H.actor].eye; // BABYLON.TransformNode (https://doc.babylonjs.com/typedoc/classes/BABYLON.TransformNode). TN of the "eye", as shell calls it. Basically camera pos.
  3383.  
  3384. let conclusion /*:trol:*/ = playerEye.forward.clone(); // BABYLON.Vector3 (https://doc.babylonjs.com/typedoc/classes/BABYLON.Vector3). this vector is NORMALIZED
  3385. conclusion= conclusion.scale(TRACE_LENGTH_MULTIPLIER); //scale by the multiplier to extend the normalized vector. TODO: make multiplier customizable by USER
  3386. conclusion= conclusion.add(playerEye.absolutePosition); //add pos so we are relative to eye
  3387.  
  3388. //RAYCAST
  3389. const rayToGround = ss.RAYS[H.rayCollidesWithMap](object[H.actor].eye.absolutePosition, conclusion, ss.RAYS.grenadeCollidesWithCell); //does player look at object, if yes, where?
  3390. const g = playerEye.absolutePosition; //easier access
  3391. // console.log("RAYCAST", g, g.x, g._x)
  3392. if(rayToGround){
  3393. object.lookDirLine.setVerticesData(L.BABYLON.VertexBuffer.PositionKind, [g.x, g.y, g.z, rayToGround.pick.pickedPoint.x, rayToGround.pick.pickedPoint.y, rayToGround.pick.pickedPoint.z]);
  3394. //set line to correct points, with the map collision as endpoint
  3395. }
  3396. if(!rayToGround){
  3397. const f = conclusion;//easier acess
  3398. object.lookDirLine.setVerticesData(L.BABYLON.VertexBuffer.PositionKind, [g.x, g.y, g.z, f.x, f.y, f.z]);
  3399. //set line to correct points, with the max dist scaled dirVec3 as endpoint
  3400. }
  3401.  
  3402. object.lookDirLine.color = new L.BABYLON.Color3(...hexToRgb(extract("lookTracersColor"))); //updaté line colo(u)r
  3403. object.lookDirLine.renderingGroupId = extract("lookTracersRGI1")? 1 : 0; //render in front shell?
  3404. //I dont really like the implementation without parenting, but IDK how the fuck bab's parenting system works and we need to update anyway. :/
  3405. }
  3406. object.tracerLines.setVerticesData(L.BABYLON.VertexBuffer.PositionKind, [crosshairsPosition.x, crosshairsPosition.y, crosshairsPosition.z, newPosition.x, newPosition.y, newPosition.z]);
  3407. object.tracerLines.color = new L.BABYLON.Color3(...color);
  3408. object.box.color = new L.BABYLON.Color3(...color);
  3409. };
  3410. const obfuscateEmail = function(email) {
  3411. const parts = email.split('@');
  3412. const modifiedFirstPart = parts[0].substring(0, 1) +
  3413. parts[0].substring(1, parts[0].length - 1).replace(/./g, '*') +
  3414. parts[0].substring(parts[0].length - 1);
  3415. return modifiedFirstPart + '@' + parts[1];
  3416. };
  3417. const updateAccountRecords = function(key, value) {
  3418. let currentEmail = load("MostRecentEmail");
  3419. let maskedEmail = unsafeWindow.extern.account.maskedEmail;
  3420. if (currentEmail && obfuscateEmail(currentEmail) == maskedEmail) {
  3421. log("no change in email");
  3422. //do nothing i guess. its good.
  3423. } else {
  3424. log("not using obfuscated email (sadly)");
  3425. currentEmail = maskedEmail; //better than nothing, eh? :<
  3426. };
  3427. log("the email is:", currentEmail);
  3428.  
  3429. let accountRecords = GM_getValue("StateFarm_AccountRecords") || {};
  3430. let tierCache = GM_getValue("StateFarm_TierCache") || {};
  3431.  
  3432. let accountDetails = accountRecords[currentEmail] || {};
  3433. accountDetails.inventory = JSON.parse(JSON.stringify(unsafeWindow.extern.account.inventory));
  3434. accountDetails.eggCount = unsafeWindow.extern.account.currentBalance;
  3435. delete accountDetails.inventoryWorth;
  3436. accountDetails.dateCreated = unsafeWindow.extern.account.dateCreated;
  3437. accountDetails.eggsSpent = unsafeWindow.extern.account.eggsSpent;
  3438. accountDetails.totalWorth = accountDetails.eggCount + accountDetails.eggsSpent;
  3439. accountDetails.inventoryList = [];
  3440. accountDetails.inventory.forEach(item => {
  3441. let itemName = item.name;
  3442. if (tierCache[itemName] !== undefined) itemName = itemName+" [T"+tierCache[itemName]+"]";
  3443. accountDetails.inventoryList.push(itemName);
  3444. });
  3445. if (key && value) {
  3446. accountDetails[key] = value;
  3447. };
  3448.  
  3449. accountRecords[currentEmail] = accountDetails;
  3450. GM_setValue("StateFarm_AccountRecords", accountRecords);
  3451. };
  3452. const every15Seconds = function () {
  3453. //i forgot myself what this is for
  3454. // if (extract("debug")) log("goodness", extract("antiAFK"), extern.inGame, (document.getElementById("spectate").style.display == "none"), ss, ss.MYPLAYER, ss.MYPLAYER.ws, (!ss.MYPLAYER[H.playing]));
  3455. if (extract("antiAFK") && extern.inGame && (document.getElementById("spectate").style.display == "none") && ss && ss.MYPLAYER && ss.MYPLAYER.ws && (!ss.MYPLAYER[H.playing])) {
  3456. if (extract("debug")) log("lets'r try'r to keep alive'r");
  3457. let out = ss.commOut.getBuffer();
  3458. out.packInt8(ss.SERVERCODES.keepAlive);
  3459. out.send(ss.MYPLAYER.ws);
  3460. };
  3461. };
  3462. const everySecond = function () {
  3463. if (extract("debug")) {
  3464. unsafeWindow.globalSS = {};
  3465. unsafeWindow.globalSS.ss = ss;
  3466. unsafeWindow.globalSS.H = H;
  3467. unsafeWindow.globalSS.F = F;
  3468. unsafeWindow.globalSS.L = L;
  3469. unsafeWindow.globalSS.tp = tp;
  3470. unsafeWindow.globalSS.initMenu = initMenu;
  3471. unsafeWindow.globalSS.extractAsDropdownInt = extractAsDropdownInt;
  3472. unsafeWindow.globalSS.extract = extract;
  3473. unsafeWindow.globalSS.extractDropdownList = extractDropdownList;
  3474. unsafeWindow.globalSS.save = save;
  3475. unsafeWindow.globalSS.load = load;
  3476. unsafeWindow.globalSS.GM_listValues = GM_listValues;
  3477. unsafeWindow.globalSS.GM_getValue = GM_getValue;
  3478. unsafeWindow.globalSS.GM_setValue = GM_setValue;
  3479. unsafeWindow.globalSS.GM = GM;
  3480. unsafeWindow.globalSS.crackedShell = crackedShell;
  3481. unsafeWindow.globalSS.createPopup = createPopup;
  3482. unsafeWindow.globalSS.remove = remove;
  3483. unsafeWindow.globalSS.change = change;
  3484. unsafeWindow.globalSS.unban = unban;
  3485. if (typeof GM_info !== 'undefined') unsafeWindow.globalSS.GM_info = GM_info;
  3486. unsafeWindow.globalSS.getScrambled = getScrambled;
  3487. unsafeWindow.globalSS.soundsSFC = soundsSFC;
  3488. unsafeWindow.globalSS.accountStatus = accountStatus;
  3489. unsafeWindow.globalSS.cachedRealData = cachedRealData;
  3490. unsafeWindow.globalSS.retrievedSFX = retrievedSFX;
  3491. unsafeWindow.globalSS.findBadgesForUsername = findBadgesForUsername;
  3492. unsafeWindow.globalSS.badgeList = badgeList;
  3493. unsafeWindow.globalSS.crosshairsPosition = crosshairsPosition;
  3494. unsafeWindow.globalSS.pathfindingInfo = {
  3495. activePath: activePath,
  3496. pathfindingTargetOverride: pathfindingTargetOverride,
  3497. activePath: activePath,
  3498. activeNodeTarget: activeNodeTarget,
  3499. mapNodes: GLOBAL_NODE_LIST,
  3500. };
  3501. };
  3502. save("DisableLogs", extract("consoleLogs"));
  3503. if (extract('sfChatAutoStart') && !sfChatContainer){
  3504. startStateFarmChat(true);
  3505. };
  3506. startUpComplete = (!document.getElementById("progressBar"));
  3507. let botsDict = GM_getValue("StateFarm_BotStatus");
  3508. sfChatUsernameSet();
  3509. if (!botsDict) botsDict = {};
  3510. if (AUTOMATED) {
  3511. if (clientID) {
  3512. const autoLeave = extract("autoLeave") ? " AL: " + Math.round(((timeJoinedGame + (1000 * extract("autoLeaveDelay"))) - Date.now()) / 100) / 10 : "";
  3513. const newArray = {
  3514. noConfig: ((botsDict[clientID] && configNotSet) ? (
  3515. (botsDict[clientID].noConfig > Date.now()) ? botsDict[clientID].noConfig : Date.now()
  3516. ) : 0),
  3517. username: ((ss && ss.MYPLAYER && ss.MYPLAYER.name) || (unsafeWindow.vueApp.playerName)),
  3518. uniqueId: ((ss && ss.MYPLAYER && ss.MYPLAYER.uniqueId) || "value_undefined"),
  3519. startTime: startTime,
  3520. timecode: Date.now(),
  3521. status: ((isBanned && "banned") ||
  3522. (unsafeWindow.extern.inGame && (((ss.MYPLAYER && ss.MYPLAYER[H.playing]) ? "playing " : (unsafeWindow.vueApp.game.respawnTime + "s cooldown ")) + GAMECODE + autoLeave + " (" + findKeyByValue(unsafeWindow.extern.GameType, unsafeWindow.vueApp.game.gameType) + ", " + unsafeWindow.vueData.currentRegionId + ", " + unsafeWindow.vueApp.game.mapName + ", team" + unsafeWindow.vueApp.game.team + ")")) ||
  3523. (errorString || "idle")),
  3524. };
  3525.  
  3526. delete botsDict[clientID];
  3527.  
  3528. clientID = (unsafeWindow.vueData.firebaseId || clientID);
  3529.  
  3530. botsDict[clientID] = newArray;
  3531. };
  3532. if (attemptedInjection && automatedBorder && automatedBorder.style && automatedBorder.style.borderColor == "rgb(255, 0, 0)") {
  3533. automatedBorder.style.borderColor = 'rgba(0, 255, 0, 1)';
  3534. };
  3535. } else {
  3536. let oldBlacklist = botBlacklist;
  3537. botBlacklist = "";
  3538. let oldWhitelist = botWhitelist;
  3539. botWhitelist = "";
  3540. if (extract("botNoKillMe")) {
  3541. botBlacklist += botBlacklist + ((ss && ss.MYPLAYER && ss.MYPLAYER.uniqueId) || "value_undefined") + ",";
  3542. };
  3543. if (extract("botFollowMe")) {
  3544. botWhitelist += botWhitelist + ((ss && ss.MYPLAYER && ss.MYPLAYER.uniqueId) || "value_undefined") + ",";
  3545. };
  3546. monitorObjects.botOnline = "";
  3547. amountOnline = 0;
  3548. const botsArray = Object.keys(botsDict).sort();
  3549. for (let i in botsArray) {
  3550. if (i !== "shallowClone") {
  3551. i = Number(i);
  3552. const botID = botsArray[i];
  3553. const data = botsDict[botID];
  3554. if (data.noConfig) {
  3555. updateBotParams();
  3556. botsDict[botID].noConfig = Date.now() + 5000;
  3557. };
  3558. if (extract("botNoKillBots") && data.uniqueId !== "value_undefined") {
  3559. botBlacklist += data.uniqueId + ",";
  3560. };
  3561. if (extract("botFollowBots") && data.uniqueId !== "value_undefined") {
  3562. botWhitelist += data.uniqueId + ",";
  3563. };
  3564. if ((data.timecode + 10000) < Date.now()) { //give up on this bot lmao
  3565. delete botsDict[botID];
  3566. } else if ((data.timecode + 4000) < Date.now()) { //maybe it will come back
  3567. botsDict[botID].status = "not responding " + (Date.now() - data.timecode) + "ms elapsed";
  3568. }; //bot is doing fine... hopefully
  3569. amountOnline += 1;
  3570. monitorObjects.botOnline = monitorObjects.botOnline + "\n" + data.username + " [..." + botID.slice(-4) + "]: " + data.status;
  3571. };
  3572. };
  3573. if (oldBlacklist !== botBlacklist) {
  3574. log("old:", oldBlacklist, "new:", botBlacklist);
  3575. updateBotParams();
  3576. };
  3577. if (oldWhitelist !== botWhitelist) {
  3578. log("old:", oldWhitelist, "new:", botWhitelist);
  3579. updateBotParams();
  3580. };
  3581. monitorObjects.botOnline = ((amountOnline) + " bots online.") + monitorObjects.botOnline;
  3582. };
  3583. GM_setValue("StateFarm_BotStatus", botsDict);
  3584.  
  3585. allFolders.forEach(function (name) {
  3586. save(name, tp[name].expanded);
  3587. });
  3588.  
  3589. coordElement.style.display = "none";
  3590. gameInfoElement.style.display = "none";
  3591. playerstatsElement.style.display = "none";
  3592. playerinfoElement.style.display = "none";
  3593. redCircle.style.display = "none";
  3594. firstUseElement.style.display = "none";
  3595. makeHudElementDragable(coordElement);
  3596. makeHudElementDragable(gameInfoElement);
  3597. makeHudElementDragable(playerstatsElement);
  3598. makeHudElementDragable(playerinfoElement);
  3599. if (extract("gameBlacklistCodes") != "" && extract("gameBlacklistCodes") != undefined) {
  3600. let input = extract("gameBlacklistCodes");
  3601. input = input.split(",");
  3602. input.forEach(function (code) {
  3603. if (code != "" && code.length == 7) {
  3604. blacklistedGameCodes.push(code);
  3605. }
  3606. });
  3607. };
  3608.  
  3609. if (extract("noAnnoyances") && !annoyancesRemoved) {
  3610. const styleElement = document.createElement('style');
  3611. styleElement.textContent = `
  3612. /* remove ads because annoying stop adding spyware yarg */
  3613. .house-small,
  3614. #big-house-ad,
  3615. .house-ad-wrapper,
  3616. .display-ad-container,
  3617. .respawn-one,
  3618. .respawn-two,
  3619. #ShellShockers_LoadingScreen_HouseAds,
  3620. #display-ad-header-home,
  3621. .display-ad-header-home,
  3622. #display-ad-header-equip,
  3623. #shellshockers_respawn_banner_3_ad {
  3624. display: none;
  3625. }
  3626. `;
  3627. document.head.appendChild(styleElement);
  3628. annoyancesRemoved = true;
  3629. }
  3630.  
  3631. const fetchAndProcessAudioFromZip = async function (zipURL) {
  3632. try {
  3633. const response = await fetch(zipURL);
  3634. if (!response.ok) {
  3635. throw new Error('Failed to fetch ZIP:', response.statusText);
  3636. };
  3637. const arrayBuffer = await response.arrayBuffer();
  3638. const zip = await JSZip.loadAsync(arrayBuffer); // eslint-disable-line
  3639. const mp3Files = Object.keys(zip.files).filter(fileName => fileName.endsWith('.mp3'));
  3640. const jsonFiles = Object.keys(zip.files).filter(fileName => fileName.endsWith('.json'));
  3641. const totalRequests = mp3Files.length + jsonFiles.length;
  3642. let config = {};
  3643.  
  3644. if (jsonFiles.length > 0) {
  3645. const jsonFileData = await zip.file(jsonFiles[0]).async('string');
  3646. config = { ...config, ...JSON.parse(jsonFileData) };
  3647. };
  3648.  
  3649. let loadedCount = 0;
  3650.  
  3651. mp3Files.forEach(async (fileName, index) => {
  3652. const fileData = await zip.file(fileName).async('arraybuffer');
  3653. const audioBuffer = await audioContexts.SOUNDS.decodeAudioData(fileData);
  3654. const key = fileName.replace('.mp3', '');
  3655. audioBuffer.disablePanning = !!config.disablePanning;
  3656. soundsSFC[key] = audioBuffer;
  3657. log("Loaded sound for:", key);
  3658. loadedCount++;
  3659.  
  3660. if (loadedCount === totalRequests) {
  3661. createPopup("Loaded Custom SFX!", "success");
  3662. log("LOADED!");
  3663. };
  3664. });
  3665. } catch (error) {
  3666. console.error('Error fetching/decoding audio from ZIP:', error);
  3667. };
  3668. };
  3669.  
  3670. let customSFXConfig = `${extract("customSFX1")}+${extract("customSFX2")}+${extract("customSFX3")}`;
  3671. if (initialisedCustomSFX !== customSFXConfig) {
  3672. initialisedCustomSFX = customSFXConfig;
  3673. log("STARTING TO LOAD CUSTOM SFX...", initialisedCustomSFX);
  3674. soundsSFC = {};
  3675. if (extract("customSFX3") !== true && extract("customSFX3") !== "default") { //wa wa wa repeated code YOU FUNCTION IT THEN I DONT CARE!!!!! -onlypuppy7
  3676. createPopup("Loading Custom SFX...");
  3677. fetchAndProcessAudioFromZip(atob(extract("customSFX3")));
  3678. };
  3679. if (extract("customSFX2") !== true && extract("customSFX2") !== "default") {
  3680. createPopup("Loading Custom SFX...");
  3681. fetchAndProcessAudioFromZip(atob(extract("customSFX2")));
  3682. };
  3683. if (extract("customSFX1") !== true && extract("customSFX1") !== "default") {
  3684. createPopup("Loading Custom SFX...");
  3685. fetchAndProcessAudioFromZip(atob(extract("customSFX1")));
  3686. };
  3687. };
  3688.  
  3689. if (startUpComplete && ss && ss.MYPLAYER && unsafeWindow.extern.inGame) {
  3690. if (extract("mockMode")) {
  3691. let textAfterLastColon = document.getElementById("chatOut").children[document.getElementById("chatOut").children.length - 1].children[1].textContent;
  3692. let chatName = document.getElementById("chatOut").children[document.getElementById("chatOut").children.length - 1].children[0].textContent.slice(0, -2);
  3693. // log("Chat Name:", chatName);
  3694. if (chatName && chatName !== username && textAfterLastColon !== "joined." && textAfterLastColon !== "left." && !handleChat(textAfterLastColon)) {
  3695. sendChatMessage(textAfterLastColon);
  3696. }; //mockMode, this will copy and send the chat into message when joining, but doesn't show to other players, so it's fine. solvable with an if statement bool
  3697. };
  3698. // if (extract("antiAFK")) {
  3699. // if (Date.now() > (lastAntiAFKMessage + 270000)) {
  3700. // if (sendChatMessage(antiAFKString + filteredList[randomInt(0, filteredList.length - 1)])) {
  3701. // lastAntiAFKMessage = Date.now();
  3702. // };
  3703. // };
  3704. // };
  3705. if (extract("gameInfo")) {
  3706. let gameInfoText = GAMECODE + " | " + playersInGame + "/18 | " + (18 - playersInGame) + " slots remaining. | Server: " + unsafeWindow.vueData.currentRegionId + " | Gamemode: " + findKeyByValue(unsafeWindow.extern.GameType, unsafeWindow.vueApp.game.gameType) + " | Map: " + unsafeWindow.vueApp.game.mapName + " | Time in game: " + (Math.floor((Date.now() - timeJoinedGame) / 1000)) + "s" + (extract("autoLeave") ? " | AutoLeave: " + (Math.ceil(((timeJoinedGame + (1000 * extract("autoLeaveDelay"))) - Date.now()) / 1000)) + "s" : "");
  3707. gameInfoElement.innerText = gameInfoText;
  3708. void gameInfoElement.offsetWidth;
  3709. gameInfoElement.style.display = '';
  3710. };
  3711. if (extract("leaveEmpty")) {
  3712. if (playersInGame == 1 || playersInGame == 2) { //if literally empty or there is one person remaining
  3713. createPopup("Left empty game. [LeaveEmpty]")
  3714. change("leaveGame");
  3715. playersInGame = 0;
  3716. };
  3717. };
  3718. if (extract("autoLeave")) {
  3719. const remaining = ((timeJoinedGame + (1000 * extract("autoLeaveDelay"))) - Date.now()) / 1000;
  3720. if (remaining <= 0) {
  3721. createPopup("AutoLeave: Leaving now...");
  3722. change("leaveGame");
  3723. } else if (autoLeaveReminder > 5 && remaining <= 5) {
  3724. createPopup("AutoLeave: 5 seconds remaining!");
  3725. } else if (autoLeaveReminder > 10 && remaining <= 10) {
  3726. createPopup("AutoLeave: 10 seconds remaining");
  3727. };
  3728. // log(autoLeaveReminder, remaining);
  3729. autoLeaveReminder = remaining;
  3730. };
  3731.  
  3732. //credits: @2lars and @macintosh2 in the discord :)
  3733. if ((extract("autoTeam") !== "disabled") && ss.MYPLAYER.team !== 0) {
  3734. if ((extract("autoTeam") == "random") ||
  3735. (extract("autoTeam") == "red") && (ss.MYPLAYER.team == 1) ||
  3736. (extract("autoTeam") == "blue") && (ss.MYPLAYER.team == 2)) {
  3737. unsafeWindow.extern.switchTeam();
  3738. };
  3739. };
  3740. if (!ss.MYPLAYER[H.playing]) {
  3741. GAMECODE = unsafeWindow.vueApp.game.shareLinkPopup.url.slice(-7);
  3742. if (extract("autoRespawn")) {
  3743. var button = document.querySelector('.ss_button.btn_big.btn-dark-bevel.btn-respawn.ss_button.btn_green.bevel_green');
  3744. if (button) {
  3745. button.click();
  3746. };
  3747. };
  3748. };
  3749.  
  3750.  
  3751. Array.from(document.getElementById("playerList").children).forEach(playerListItem => {
  3752. const playerSlotNameElement = playerListItem.children[0];
  3753. if (playerSlotNameElement) {
  3754. let highlightSpan = playerSlotNameElement.querySelector('span');
  3755. if (!highlightSpan) {
  3756. highlightSpan = document.createElement('span');
  3757. highlightSpan.textContent = playerSlotNameElement.textContent;
  3758. playerSlotNameElement.textContent = '';
  3759. playerSlotNameElement.appendChild(highlightSpan);
  3760. };
  3761. if (extract("unfilterNames") && ss.isBadWord(playerListItem.textContent)) {
  3762. highlightSpan.style.backgroundColor = "rgba(255, 255, 255, 0.6)";
  3763. highlightSpan.style.color = 'red';
  3764. } else {
  3765. highlightSpan.style.backgroundColor = '';
  3766. highlightSpan.style.color = '';
  3767. };
  3768. };
  3769. });
  3770. // addStreamsToInGameUI(); //broken rn anyways
  3771.  
  3772. const pausedGameUI = document.querySelector('.paused-game-ui');
  3773. const hasZIndex1 = pausedGameUI.classList.contains('z-index-1');
  3774. const hasZIndex10000 = pausedGameUI.classList.contains('z-index-10000');
  3775. if (extract("restoreScroll") && (hasZIndex1 || !hasZIndex10000)) {
  3776. pausedGameUI.classList.remove('z-index-1', 'z-index-10000');
  3777. pausedGameUI.classList.add("z-index-10000");
  3778. } else if ((!extract("restoreScroll")) && (hasZIndex10000 || !hasZIndex1)) {
  3779. pausedGameUI.classList.remove('z-index-1', 'z-index-10000');
  3780. pausedGameUI.classList.add("z-index-1");
  3781. };
  3782. } else {
  3783. if ((!document.getElementById("progressBar"))) {
  3784. if (extract("autoJoin") && (extract("autoLogin") == "disabled" || unsafeWindow.vueApp.accountCreated !== null)) {
  3785. unsafeWindow.vueApp.externPlayObject(
  3786. (extract("joinCode").length === 7) ? 2 : 0,
  3787. unsafeWindow.vueApp.currentGameType,
  3788. unsafeWindow.vueApp.playerName,
  3789. '',
  3790. (extract("joinCode").length === 7) ? extract("joinCode") : '',
  3791. );
  3792. };
  3793. };
  3794. if (extract("autoRegion") !== "disabled") {
  3795. const region = (extract("autoRegion") == "random" ? extractDropdownList("autoRegion")[randomInt(1, 7)].value : extract("autoRegion"));
  3796. unsafeWindow.vueData.currentRegionId = region;
  3797. };
  3798. if (extract("autoGamemode") !== "disabled") {
  3799. const gamemode = ((extract("autoGamemode") == "random") ? randomInt(0, 3) : (extractAsDropdownInt("autoGamemode") - 1));
  3800. unsafeWindow.vueApp.onGameTypeChanged(gamemode);
  3801. };
  3802. };
  3803.  
  3804. if (startUpComplete) {
  3805. // check if it is a user's first time to run the script
  3806. if (GM_getValue("StateFarm_firstRun") !== 1) {
  3807. firstExecution = true;
  3808. };
  3809. if ((extract("legacyModels") !== previousLegacyModels)) {
  3810. let models = [3000, 3100, 3400, 3600, 3800, 4000, 4200];
  3811. models.forEach(ID => {
  3812. let item = unsafeWindow.extern.catalog.findItemById(ID);
  3813. item.item_data.meshName.replaceAll("_Legacy","");
  3814. if (extract("legacyModels")) item.item_data.meshName = `${item.item_data.meshName}_Legacy`;
  3815. });
  3816. };
  3817. previousLegacyModels = extract("legacyModels");
  3818.  
  3819. if ((extract("setDetail") !== previousDetail) && (extract("setDetail") !== "disabled")) {
  3820. unsafeWindow.vueApp.settingsUi.togglers.misc[3].value = false;
  3821. if (extract("setDetail") == "autodetail") {
  3822. unsafeWindow.vueApp.settingsUi.togglers.misc[3].value = true;
  3823. } else if (extract("setDetail") == "nodetails") {
  3824. unsafeWindow.vueApp.settingsUi.togglers.misc[4].value = false;
  3825. unsafeWindow.vueApp.settingsUi.togglers.misc[5].value = false;
  3826. } else if (extract("setDetail") == "shadows") {
  3827. unsafeWindow.vueApp.settingsUi.togglers.misc[4].value = true;
  3828. unsafeWindow.vueApp.settingsUi.togglers.misc[5].value = false;
  3829. } else if (extract("setDetail") == "highres") {
  3830. unsafeWindow.vueApp.settingsUi.togglers.misc[4].value = false;
  3831. unsafeWindow.vueApp.settingsUi.togglers.misc[5].value = true;
  3832. } else if (extract("setDetail") == "shadowshighres") {
  3833. unsafeWindow.vueApp.settingsUi.togglers.misc[4].value = true;
  3834. unsafeWindow.vueApp.settingsUi.togglers.misc[5].value = true;
  3835. };
  3836. unsafeWindow.extern.applyUiSettings(unsafeWindow.vueApp.settingsUi);
  3837. };
  3838. previousDetail = extract("setDetail");
  3839.  
  3840. if (previousTitleAnimation !== extract("titleAnimation")) {
  3841. let existingFavicons = document.querySelectorAll("link[rel*='icon']");
  3842. existingFavicons.forEach(function (favicon) {
  3843. favicon.parentNode.removeChild(favicon);
  3844. });
  3845. let favicon = document.createElement('link');
  3846. favicon.type = 'image/x-icon';
  3847. favicon.rel = 'shortcut icon';
  3848. if (extract("titleAnimation")) {
  3849. favicon.href = (GM_info?.script?.icon || iconURL);
  3850. } else {
  3851. favicon.href = 'https://www.google.com/s2/favicons?domain=shellshock.io';
  3852. };
  3853. document.getElementsByTagName('head')[0].appendChild(favicon);
  3854. previousTitleAnimation = extract("titleAnimation");
  3855. };
  3856. };
  3857.  
  3858. const banPopup = document.getElementById("bannedPopup");
  3859. if (attemptedInjection && banPopup && unsafeWindow.vueApp?.bannedPopup?.expire && (unsafeWindow.vueApp.bannedPopup.expire !== "")) isBanned = true;
  3860. if (isBanned && extract("autoUnban") && (!attemptedAutoUnban) && unsafeWindow.vueApp?.bannedPopup) {
  3861. log("eep!");
  3862. banPopup.textContent = 'StateFarm AutoUnban:\nPLEASE RELOAD FOR THE NEXT\n20s to 1min for new database\nID for unban. Enjoy! :)\nBan message will be automatically removed from screen in 15 seconds.';
  3863. unban();
  3864. attemptedAutoUnban = true;
  3865. createPopup("AutoUnban: Attempting to Unban...");
  3866. setTimeout(() => {
  3867. createPopup("AutoUnban: Removed ban message.");
  3868. banPopup.style.display = "none";
  3869. attemptedAutoUnban = false;
  3870. isBanned = false;
  3871. unsafeWindow.vueApp.bannedPopup.expire = "";
  3872. }, 15000);
  3873. };
  3874.  
  3875. if (extract("eggColor") !== "disabled" && ss?.USERDATA) {
  3876. const color = extract("eggColor") == "random" ? randomInt(0, 6) : extractAsDropdownInt("eggColor") - 1;
  3877. if (color !== ss.USERDATA.playerAccount.colorIdx) {
  3878. unsafeWindow.extern.setShellColor(color);
  3879. unsafeWindow.vueApp.onBackClick();
  3880. };
  3881. };
  3882. if (extract("autoStamp") !== "disabled" && ss?.USERDATA) {
  3883. const stampID = 2000 + (extract("autoStamp") == "random" ? randomInt(1, 6) : extractAsDropdownInt("autoStamp"));
  3884. if (ss.USERDATA && ss.USERDATA.playerAccount) {
  3885. if (stampID !== ((ss.USERDATA.playerAccount.stampItem && ss.USERDATA.playerAccount.stampItem?.id) || -1)) {
  3886. ss.USERDATA.playerAccount.stampItem = unsafeWindow.extern.catalog.findItemById(stampID);
  3887. unsafeWindow.vueApp.onBackClick();
  3888. };
  3889. };
  3890. };
  3891. if (extract("autoHat") !== "disabled" && ss?.USERDATA) {
  3892. const hatID = 1000 + (extract("autoHat") == "random" ? randomInt(1, 6) : extractAsDropdownInt("autoHat"));
  3893. if (ss.USERDATA && ss.USERDATA.playerAccount) {
  3894. if (hatID !== ((ss.USERDATA.playerAccount.hatItem && ss.USERDATA.playerAccount.hatItem?.id) || -1)) {
  3895. ss.USERDATA.playerAccount.hatItem = unsafeWindow.extern.catalog.findItemById(hatID);
  3896. unsafeWindow.vueApp.onBackClick();
  3897. };
  3898. };
  3899. };
  3900. if (extract("useCustomName")) {
  3901. unsafeWindow.vueApp?.setPlayerName(extract("usernameAutoJoin"));
  3902. };
  3903. if ((!ranEverySecond) && startUpComplete) {
  3904. if (extract("autoChickenWinner")) {
  3905. log("automatically do chw");
  3906. change("chickenWinner");
  3907. };
  3908. updateAccountRecords();
  3909. if (extract("autoMacro")) {
  3910. log("automatically do your macro");
  3911. change("executeMacro");
  3912. };
  3913.  
  3914. log("swapping out google analytics...");
  3915. oldGa = unsafeWindow.ga;
  3916. unsafeWindow.ga = F.interceptGa;
  3917.  
  3918. const vueAppisUpgraded = Object.getOwnPropertyDescriptor(vueApp, 'isUpgraded')?.get;
  3919. Object.defineProperty(vueApp, 'isUpgraded', {
  3920. get: function() {
  3921. if ((!extract("spoofVIP")) && vueAppisUpgraded) {
  3922. return vueAppisUpgraded.call(vueApp);
  3923. } else {
  3924. return true;
  3925. }
  3926. }
  3927. });
  3928.  
  3929. const vueAppisSubscriber = Object.getOwnPropertyDescriptor(vueApp, 'isSubscriber')?.get;
  3930. Object.defineProperty(vueApp, 'isSubscriber', {
  3931. get: function() {
  3932. if ((!extract("spoofVIP")) && vueAppisSubscriber) {
  3933. return vueAppisSubscriber.call(vueApp);
  3934. } else {
  3935. return true;
  3936. }
  3937. }
  3938. });
  3939.  
  3940. const vueDataisSubscriber = Object.getOwnPropertyDescriptor(vueData, 'isSubscriber')?.get;
  3941. Object.defineProperty(vueData, 'isSubscriber', {
  3942. get: function() {
  3943. if ((!extract("spoofVIP")) && vueDataisSubscriber) {
  3944. return vueDataisSubscriber.call(vueData);
  3945. } else {
  3946. return true;
  3947. }
  3948. }
  3949. });
  3950.  
  3951. ranEverySecond = true;
  3952. };
  3953.  
  3954. //block ads or something kek
  3955. localStorage.timesPlayed = 0;
  3956. };
  3957. const handleCommand = function (command) {
  3958. let args = command.split(" ");
  3959.  
  3960. switch (args[0]) {
  3961. case "setconfig":
  3962. let receivedConfig = decodeURIComponent(unsafeWindow.escape(window.atob(args[1]))); // eslint-disable-line
  3963. if (URLParams !== "") { receivedConfig = URLParams + "<" + receivedConfig };
  3964. log("StateFarm: Change in Bot Panel detected.", receivedConfig);
  3965. applySettings(receivedConfig);
  3966. configNotSet = false;
  3967. break;
  3968. case "ping":
  3969. createPopup("Pong! " + ((Date.now() - cachedCommandTime)) + "ms", "success");
  3970. break;
  3971. case "kill":
  3972. unsafeWindow.close();
  3973. break;
  3974. case "leave":
  3975. change("leaveGame");
  3976. break;
  3977. case "unban":
  3978. unban();
  3979. break;
  3980. case "newproxy":
  3981. newProxy();
  3982. break;
  3983. case "refresh":
  3984. reloadPage();
  3985. break;
  3986. case "report":
  3987. spamReport();
  3988. break;
  3989. case "join":
  3990. if (args[1]) unsafeWindow.vueApp.externPlayObject(0, 0, unsafeWindow.vueApp.playerName, -1, args[1]);
  3991. else alert("Invalid code");
  3992. break;
  3993. case "pathtarget": // pathfinding target
  3994. let option = args[1]; // eslint-disable-line
  3995. if (option) {
  3996. if (option === "set") {
  3997. let x = args[2];
  3998. let y = args[3];
  3999. let z = args[4];
  4000. if (x && y && z) {
  4001. pathfindingTargetOverride = { x: x, y: y, z: z };
  4002. isFirstFrameAttemptingToPathfind = true;
  4003. } else {
  4004. sendChatMessage("Invalid pathtarget coordinates")
  4005. };
  4006. };
  4007. };
  4008. break;
  4009.  
  4010. case "clearpath":
  4011. clearPath();
  4012. break;
  4013. case "clearpath_t":
  4014. clearPath_andTarget();
  4015. break;
  4016. case "repeat":
  4017. if (args[1]) {
  4018. sendChatMessage(args.slice(1).join(" "));
  4019. } else {
  4020. sendChatMessage("Invalid repeat message");
  4021. }
  4022. break;
  4023. case "setpathdespawn":
  4024. if (args[1]) {
  4025. if (args[1] === "true") {
  4026. despawnIfNoPath = true;
  4027. } else if (args[1] === "false") {
  4028. despawnIfNoPath = false;
  4029. } else if (args[1] === "toggle") {
  4030. despawnIfNoPath = !despawnIfNoPath;
  4031. } else {
  4032. sendChatMessage("Invalid setpathdespawn argument");
  4033. }
  4034. } else {
  4035. sendChatMessage("Invalid setpathdespawn message");
  4036. };
  4037. };
  4038. };
  4039. const clearPath = function () {
  4040. activePath = undefined;
  4041. activeNodeTarget = undefined;
  4042. }
  4043. const clearPath_andTarget = function () {
  4044. clearPath();
  4045. pathfindingTargetOverride = undefined;
  4046. };
  4047. const everyDecisecond = function () {
  4048. updateConfig(); deciSecondsPassed += 1;
  4049.  
  4050. if (extract("titleAnimation")) {
  4051. if (deciSecondsPassed % 3 == 0) {
  4052. unsafeWindow.document.title = titleAnimationFrames[currentFrameIndex];
  4053. currentFrameIndex = (currentFrameIndex + 1) % titleAnimationFrames.length;
  4054. };
  4055. } else {
  4056. unsafeWindow.document.title = "Shell Shockers 🍳 Multiplayer .io game";
  4057. };
  4058.  
  4059. if (startUpComplete && (!unsafeWindow.extern.inGame) && extract("autoLogin") !== "disabled" && (extract("autoLogin") == "always" || extract("autoLogin") == "noaccount" && unsafeWindow.vueApp.accountCreated == null)) {
  4060. if ((previousLogin + 5000) < Date.now()) {
  4061. unban();
  4062. change("loginDatabaseLogin");
  4063. previousLogin = Date.now();
  4064. };
  4065. };
  4066.  
  4067. if (ss && ss.MYPLAYER && unsafeWindow.extern.inGame) {
  4068. //innertext stuff, fairly resource intensive. disable these for performance
  4069. if (extract("playerStats")) {
  4070. let playerStates = "";
  4071. ss.PLAYERS.forEach(player => {
  4072. if (player && (player !== ss.MYPLAYER) && (player[H.hp] > 0) && ((!ss.MYPLAYER.team) || (player.team !== ss.MYPLAYER.team))) {
  4073. playerStates = playerStates + player.name + ": " + Math.round(player[H.hp]) + " HP\n";
  4074. };
  4075. });
  4076. if (playerStates == "") { playerStates = "No Enemy Players" };
  4077. playerstatsElement.innerText = playerStates;
  4078. void playerstatsElement.offsetWidth;
  4079. playerstatsElement.style.display = '';
  4080. };
  4081. if (extract("playerInfo")) {
  4082. let playerInfoString = "";
  4083. const player = currentlyTargeting || playerLookingAt || undefined
  4084. if (player && player.distance && player[H.playing]) {
  4085. playerInfoString = playerInfoString + player.name + "\n"
  4086. playerInfoString = playerInfoString + "HP: " + Math.round(player[H.hp]) + "\n"
  4087. playerInfoString = playerInfoString + "Distance: " + player.distance.toFixed(3) + "\n"
  4088. playerInfoString = playerInfoString + "AngleDiff: " + player.angleDiff.toFixed(3) + "\n"
  4089. };
  4090. if (playerInfoString == "") { playerInfoString = "Not Looking At Player" };
  4091. playerinfoElement.innerText = playerInfoString;
  4092. void playerinfoElement.offsetWidth;
  4093. playerinfoElement.style.display = '';
  4094. };
  4095. if (ss.MYPLAYER && ss.MYPLAYER[H.actor] && ss.MYPLAYER[H.actor][H.mesh] && extract("showCoordinates")) {
  4096. const fonx = Number((ss.MYPLAYER[H.actor][H.mesh].position.x).toFixed(3));
  4097. const fony = Number((ss.MYPLAYER[H.actor][H.mesh].position.y).toFixed(3));
  4098. const fonz = Number((ss.MYPLAYER[H.actor][H.mesh].position.z).toFixed(3));
  4099. const yaw = Number((ss.MYPLAYER[H.yaw]).toFixed(3)); //could i function this? yea
  4100. const pitch = Number((ss.MYPLAYER[H.pitch]).toFixed(3));
  4101. const personalCoordinate = `XYZ: ${fonx}, ${fony}, ${fonz} Rot: ${yaw}, ${pitch} Acc: ${Number(accuracyPercentage).toFixed(3)}`;
  4102. coordElement.innerText = personalCoordinate;
  4103. void coordElement.offsetWidth;
  4104. coordElement.style.display = '';
  4105. // create an info box for the first execution, i have 69697935 iq
  4106. if (firstExecution == true) {
  4107. firstUseElement.innerHTML = `
  4108. <style>
  4109. @font-face {
  4110. font-family: "Bahnschrift";
  4111. src: url("https://db.onlinewebfonts.com/t/0a6ee448d1bd65c56f6cf256a7c6f20a.eot");
  4112. src: url("https://db.onlinewebfonts.com/t/0a6ee448d1bd65c56f6cf256a7c6f20a.eot?#iefix")format("embedded-opentype"),
  4113. url("https://db.onlinewebfonts.com/t/0a6ee448d1bd65c56f6cf256a7c6f20a.woff2")format("woff2"),
  4114. url("https://db.onlinewebfonts.com/t/0a6ee448d1bd65c56f6cf256a7c6f20a.woff")format("woff"),
  4115. url("https://db.onlinewebfonts.com/t/0a6ee448d1bd65c56f6cf256a7c6f20a.ttf")format("truetype"),
  4116. url("https://db.onlinewebfonts.com/t/0a6ee448d1bd65c56f6cf256a7c6f20a.svg#Bahnschrift")format("svg");
  4117. }
  4118. .overlay {
  4119. position: fixed;
  4120. top: 0;
  4121. left: 0;
  4122. width: 100%;
  4123. height: 100%;
  4124. background-color: rgba(0, 0, 0, 0.7);
  4125. z-index: 9999;
  4126. display: flex;
  4127. justify-content: center;
  4128. align-items: center;
  4129. opacity: 1;
  4130. }
  4131. .overlay-content {
  4132. text-align: center;
  4133. color: white;
  4134. }
  4135. h100 {
  4136. color: white;
  4137. font-weight: bold;
  4138. font-family: Bahnschrift;
  4139. font-size: 36px;
  4140. }
  4141. a {
  4142. text-decoration: none;
  4143. font-family: Bahnschrift;
  4144. font-size: 24px;
  4145. }
  4146. p {
  4147. text-decoration: none;
  4148. font-family: Bahnschrift;
  4149. font-size: 15px;
  4150. }
  4151. </style>
  4152. </head>
  4153. <body>
  4154.  
  4155. <div class="overlay">
  4156. <div class="overlay-content">
  4157. <h100>Welcome to StateFarmClient V3</h100>
  4158. <br>
  4159. <br>
  4160. <a href="https://discord.gg/EMy9swEwB6">Discord&emsp;</a>
  4161. <a href="https://github.com/Hydroflame522/StateFarmClient">Github&emsp;</a>
  4162. <a href="https://greasyfork.org/en/scripts/482982">Greasyfork&emsp;</a>
  4163. <a href="https://www.youtube.com/channel/UCGWtU3Dp3unyefuaBpwGMDw">Youtube</a>
  4164. <br>
  4165. <br>
  4166. <p>Press 'Escape' to close</p>
  4167. </div>
  4168. </div>
  4169. </body>
  4170. `
  4171. firstUseElement.style.display = '';
  4172. document.addEventListener('keydown', function (event) {
  4173. if (event.keyCode === 27) {
  4174. firstUseElement.style.opacity = '0';
  4175. firstUseElement.style.display = "none";
  4176. setTimeout(function () {
  4177. firstUseElement.parentNode.removeChild(firstUseElement);
  4178. }, 1000)
  4179. }
  4180. GM_setValue("StateFarm_firstRun", 1);
  4181. });
  4182. }
  4183. };
  4184. };
  4185. if (AUTOMATED) { //i know what youre saying looking at this. i am the greatest programmer to have ever lived
  4186. if (GM_getValue("StateFarm_CommandTime") > cachedCommandTime) {
  4187. // alert("New command incoming");
  4188. cachedCommand = GM_getValue("StateFarm_Command");
  4189. cachedCommandTime = GM_getValue("StateFarm_CommandTime");
  4190. log("Command received:", cachedCommand);
  4191. handleCommand(cachedCommand);
  4192. } else {
  4193. // uncommment if needed
  4194. // log("No new command, cached command:", cachedCommand, "cached time:", cachedCommandTime, "diff to now:", Date.now() - cachedCommandTime);
  4195. };
  4196. };
  4197. };
  4198. const updateConfig = function () {
  4199. configMain = tp.mainPanel.exportPreset();
  4200. configBots = tp.botPanel.exportPreset();
  4201. };
  4202. const updateHiddenAndDisabledHelper = function (array) { //determines if all conditions are met
  4203. let conditionMet = false;
  4204. array.forEach(condition => {
  4205. if ((extract(condition[0]) ? extract(condition[0]) : false) !== condition[1]) {
  4206. conditionMet = true;
  4207. return;
  4208. };
  4209. });
  4210. return conditionMet;
  4211. }
  4212. const updateHiddenAndDisabled = function () {
  4213. //the format for hidden/disabled modules is as follows:
  4214. //hidden/disabled is an array of arrays. within each of the items, there is the condition required for the module to be shown
  4215. //eg: [["aimbot",true],...] (will only be shown if extract("aimbot")==true)
  4216. if (menuInitiated) {
  4217. allModules.forEach(module => {
  4218. const tiedModules = tp[module + "TiedModules"];
  4219. if (tiedModules) {
  4220. if (tiedModules.showConditions) {
  4221. tp[module + "Button"].hidden = updateHiddenAndDisabledHelper(tiedModules.showConditions);
  4222. };
  4223. if (tiedModules.hideConditions) {
  4224. tp[module + "Button"].hidden = !updateHiddenAndDisabledHelper(tiedModules.hideConditions);
  4225. };
  4226. if (tiedModules.enableConditions) {
  4227. tp[module + "Button"].disabled = updateHiddenAndDisabledHelper(tiedModules.enableConditions);
  4228. };
  4229. if (tiedModules.disableConditions) {
  4230. tp[module + "Button"].disabled = !updateHiddenAndDisabledHelper(tiedModules.disableConditions);
  4231. };
  4232. };
  4233. });
  4234. };
  4235. };
  4236. const loginOrCreateWithEmailPass = function (emailPass) {
  4237. let email, pass;
  4238. [email, pass] = emailPass.split(":");
  4239. log("gonna create/login an account that will send/has email to", email, "with the password", pass);
  4240. save("MostRecentEmail", email);
  4241. //try both. who cares about some stupid errors?
  4242. unsafeWindow.firebase.auth().createUserWithEmailAndPassword(email, pass)
  4243. .then(response => {
  4244. log("success?!?!?!? created account");
  4245. setTimeout(function(){
  4246. updateAccountRecords("emailPass", emailPass);
  4247. accountStatus = "created account";
  4248. }, 2000);
  4249. })
  4250. .catch(() => { });
  4251. unsafeWindow.firebase.auth().signInWithEmailAndPassword(email, pass)
  4252. .then(response => {
  4253. log("success?!?!?!? signed in");
  4254. setTimeout(function(){
  4255. updateAccountRecords("emailPass", emailPass);
  4256. accountStatus = "created account";
  4257. }, 2000);
  4258. accountStatus = "signed in";
  4259. })
  4260. .catch(() => { });
  4261. };
  4262. const saveConfig = function () {
  4263. if (menuInitiated !== "init") {
  4264. if (retrievedSFX && retrievedSFX.length > 1) {
  4265. save("StateFarmConfigSpecialItems", [
  4266. ["customSFX1", extractAsDropdownInt("customSFX1") || 0],
  4267. ["customSFX2", extractAsDropdownInt("customSFX2") || 0],
  4268. ["customSFX3", extractAsDropdownInt("customSFX3") || 0],
  4269. ["skybox", extractAsDropdownInt("skybox") || 0],
  4270. ["filter", extractAsDropdownInt("filter") || 0],
  4271. ]);
  4272. };
  4273. };
  4274. save("StateFarmConfigMainPanel", tp.mainPanel.exportPreset());
  4275. save("StateFarmConfigBotPanel", tp.botPanel.exportPreset());
  4276. };
  4277. const save = function (key, value) {
  4278. if (AUTOMATED) { return undefined };
  4279. if (JSON.parse(localStorage.getItem(key)) !== undefined) { localStorage.removeItem(key) }; //dont need that anymore lmao
  4280. GM_setValue(storageKey + key, value);
  4281. };
  4282. const load = function (key) {
  4283. if (AUTOMATED) { key = getScrambled() };
  4284. return GM_getValue(storageKey + key) || JSON.parse(localStorage.getItem(key)); //localstorage is for legacy purposes *only*
  4285. };
  4286. const remove = function (key) {
  4287. if (AUTOMATED) { return undefined };
  4288. GM_deleteValue(storageKey + key);
  4289. if (JSON.parse(localStorage.getItem(key)) !== undefined) { localStorage.removeItem(key) }; //legacy
  4290. };
  4291. const addUserPresets = function (presets) { //adds presets from dict to inbilt presets, can be called multiple times to update
  4292. if (presets != null) {
  4293. Object.entries(presets).forEach(([key, value]) => {
  4294. inbuiltPresets[key] = value;
  4295. });
  4296. };
  4297. };
  4298. const loadUserPresets = function () { //gets user presets
  4299. let result = load(presetStorageLocation);
  4300. log("Loaded StateFarmUserPresets: ", result);
  4301. return load(presetStorageLocation);
  4302. };
  4303. const saveUserPreset = function (presetName, preset) {
  4304. let currentPresets = loadUserPresets(); //gets current saved presets
  4305. if (currentPresets == null) { // if it does not exist, makes it
  4306. let presets = {};
  4307. presets[presetName] = preset;
  4308. save(presetStorageLocation, presets);
  4309. return presets;
  4310. } else { //otherwise it appends it
  4311. currentPresets[presetName] = preset;
  4312. save(presetStorageLocation, currentPresets);
  4313. return currentPresets;
  4314. };
  4315. };
  4316. //Updates inbuiltPresets to include user presets
  4317. addUserPresets(loadUserPresets());
  4318. const sendChatMessage = function (text) { //basic method (simulates legit method of sending message)
  4319. let chatThing = document.getElementById('chatIn');
  4320. if (chatThing.value.includes("unlock")) {
  4321. createPopup("Message send failed: Account too new! (try ShellPrint or LoginDB)", "error");
  4322. return false;
  4323. } else if (ss.MYPLAYER.chatLines > 2) {
  4324. createPopup("Chat Cooldown: " + (ss.MYPLAYER.chatLines - 2) + " remaining.", "error");
  4325. return false;
  4326. } else {
  4327. try {
  4328. lastSentMessage = text;
  4329. if (chatThing && unsafeWindow.extern.startChat) {
  4330. unsafeWindow.extern.startChat();
  4331. chatThing.value = text;
  4332. chatThing.dispatchEvent(new KeyboardEvent('keydown', {
  4333. key: 'Enter',
  4334. code: 'Enter',
  4335. keyCode: 13,
  4336. which: 13,
  4337. bubbles: true,
  4338. cancelable: true,
  4339. }));
  4340. return true;
  4341. } else {
  4342. return false;
  4343. };
  4344. } catch (error) {
  4345. return false;
  4346. };
  4347. };
  4348. };
  4349. const addStreamsToInGameUI = function () {
  4350. let inGameUIElement = document.getElementById("inGameUI");
  4351. let streams = document.getElementById("stream_scroll").children;
  4352. if (inGameUIElement && streams.length > 0) {
  4353. for (let i = 0; i < streams.length; i++) {
  4354. let hrefValue = streams[i].querySelector('a').href;
  4355. let nameValue = streams[i].querySelector(".stream_name").textContent;
  4356. const streamElement = inGameUIElement.querySelector('div[data-name="' + nameValue + '"]');
  4357. if (extract("showStreams") && !streamElement) {
  4358. let containerDiv = document.createElement("div");
  4359. let nameDiv = document.createElement("div");
  4360. nameDiv.textContent = nameValue;
  4361. nameDiv.setAttribute('data-href', hrefValue);
  4362. nameDiv.style.color = 'white';
  4363. nameDiv.style.cursor = 'pointer';
  4364. nameDiv.style.textDecoration = 'none';
  4365. nameDiv.addEventListener('mouseover', function () { nameDiv.style.textDecoration = 'underline'; nameDiv.style.color = 'blue' });
  4366. nameDiv.addEventListener('mouseout', function () { nameDiv.style.textDecoration = 'none'; nameDiv.style.color = 'white' });
  4367. nameDiv.addEventListener('click', () => GM_openInTab(hrefValue, { active: true }));
  4368. containerDiv.setAttribute('data-name', nameValue);
  4369. containerDiv.appendChild(nameDiv);
  4370. containerDiv.appendChild(nameDiv);
  4371. inGameUIElement.appendChild(containerDiv);
  4372. } else if (!extract("showStreams") && streamElement) {
  4373. inGameUIElement.removeChild(streamElement);
  4374. };
  4375. };
  4376. };
  4377. };
  4378. const highlightTargetOnLeaderboard = function (target, aimbot) {
  4379. let playerArray = [];
  4380. ss.PLAYERS.forEach(player => {
  4381. if (player && (target !== ss.MYPLAYER) && player[H.playing] && (player[H.hp] > 0) && ((!ss.MYPLAYER.team) || (player.team !== ss.MYPLAYER.team))) {
  4382. const uniqueId = player.uniqueId;
  4383. const name = player.name;
  4384. const hp = player[H.hp]
  4385. playerArray.push({ player, uniqueId, name, hp });
  4386. };
  4387. });
  4388. Array.from(document.getElementById("playerList").children).forEach(playerListItem => {
  4389. if (aimbot && target?.name && target[H.playing] === playerListItem.textContent.slice(0, -3)) {//need to slice otherwise won't match properly
  4390. playerListItem.style.backgroundColor = 'blue';
  4391. } else {
  4392. playerListItem.style.backgroundColor = '';
  4393. };
  4394. // log(playerArray.find(player => player.name === playerListItem.textContent.slice(0, -3))?[H.hp]);
  4395. });
  4396. };
  4397. const highlightCrossHairReticleDot = function (bool) {
  4398. let dot = document.getElementById("reticleDot");
  4399. let crosshair = document.getElementById("crosshairContainer");
  4400. let setTo = '';
  4401. if (bool === true) {
  4402. setTo = "green";
  4403. } else if (bool === false) {
  4404. setTo = "red";
  4405. };
  4406. dot.style.backgroundColor = setTo;
  4407. Array.from(crosshair.children).forEach(part => {
  4408. part.style.backgroundColor = setTo;
  4409. });
  4410. };
  4411. const handleChat = function (textAfterLastColon) {
  4412. const responses = {
  4413. "report": "report me? pffft. i'm not even human",
  4414. "aimbot": "what aimboot?",
  4415. "bot": "you're a booooT",
  4416. "stop": "u stop",
  4417. "cheater": "Ho Ho Ho! Santa's Here! And I'm gonna give you a present! A ban! <AdminSpoof enabled>",
  4418. "cheat": "oh youre gonna cheat accuse? keep yapping",
  4419. "hack": "oh youre gonna cheat accuse? keep yapping",
  4420. "hax": "oh youre gonna cheat accuse? keep yapping",
  4421. "nice": "its not that good.",
  4422. "copy": "ERROR: maximum number of loops reached",
  4423. "stupid": "as an AI, i am much smarter than you.",
  4424. "dumb": "you cant calculate the square root of 967 as fast as i can",
  4425. "moron": "lets see you perform a billion operations a second",
  4426. "idiot": "to be fair, i cant talk as much as you",
  4427. "mod": "you can't defeat me?",
  4428. "admin": "you cant block irl",
  4429. "eggfor": "imagine ur in an argument irl and u try to call the mods",
  4430. "bro": "brooooo what",
  4431. "spam": "me, spamming? im just chatting",
  4432. "mute": "you dont want to listen to me talk? how weak hahaha",
  4433. "ban": "ban me? no free speech these days",
  4434. "message": "bleep bloop. are you a robot?",
  4435. "lol": "lolzedong",
  4436. "dude": "dudeinator3000: what is your request",
  4437. "what": "dude what",
  4438. "annoy": "im not that bad",
  4439. "mock": "im not doing anything wrong",
  4440. "wtf": "watch your profanity",
  4441. "bad": "ur not just bad at that",
  4442. "suck": "pretty sure you cant say that??",
  4443. "i'm": "yes you are",
  4444. "im": "yes you are",
  4445. "i am": "yes you are",
  4446. "u r": "no im not. proof?",
  4447. "you r": "no im not. proof?",
  4448. "you are": "no im not. proof?",
  4449. "you're": "no im not. proof?",
  4450. "do you": "truthfully, no i dont.",
  4451. "do u": "honestly, yes i do.",
  4452. "imagine": "imagine who asked",
  4453. "f u": "funny uncleburger",
  4454. "gg": "good grief",
  4455. "shut up": "B͇͈͉͍͎̽̾̿̀́͂̓̈́͆͊͋͌͗ͅ͏͎͗͏͇͇̽̾̿̀́̽̿̀̀́̽̀͆̓̈́̓͋͌ͅ͏͌͏͎͉͗͗͌̓̓̓̓̓́̿",
  4456. "shush": "cant be bothered to be quiet",
  4457. "nuh": "uh huh",
  4458. "proof": "after looking at this proof, i can confidently say its 100% fake.",
  4459. "real": "pretty sure its fake. you have no proof.",
  4460. "fake": "pretty sure its real. you have enough proof.",
  4461. "true": "its false. everyone knows this. why dont you?",
  4462. "false": "its true. everyone knows this. why dont you?",
  4463. "test": "testing me? do it on rats instead.",
  4464. "gift": "\"not everything in life is free\" - me, today",
  4465. "free": "\"not everything in life is free\" - me, today",
  4466. "toxic": "thats really rude",
  4467. "level": "[Your rank is: Subpar Human]",
  4468. "rank": "[Your rank is: Subpar Human]",
  4469. "clan": "[Your clan is: The Gay Nobodies]",
  4470. "smart": "well, i mean, i am quite clever..",
  4471. "clever": "well, i mean, i am quite clever..",
  4472. "hello": "i dont need your stupid greetings.",
  4473. "bye": "wa wa wa you'll see everyone later anyway",
  4474. "thank": "why are you so thankful? grow up!!",
  4475. "please": "you: \"please, please pleeease??\", why dont you PLEASE GET THE POINT",
  4476. "sorry": "why are you sorry all the time? just live your life.",
  4477. "help": "help yourself",
  4478. "kill": "more like kill everyone with the new godmode exploit",
  4479. "kys": "more like kill everyone with the new godmode exploit",
  4480. "kek": ":trol_4k:",
  4481. "bwd": "cool company. i have coffees with wizups every day",
  4482. "wiz": "E X H A U S T P I P E",
  4483. "stroke": "im just stroking",
  4484. "flip": "please dont say that my parents are watching",
  4485. "frick": "please dont say that im streaming rn",
  4486. "harri": "yeah i beat him in a 1v1, 10:1, very easy",
  4487. "chill": "you think i can just CALM DOWN?!?",
  4488. "stfu": "just reported u for swearing",
  4489. "look": "im looking but im not seeing",
  4490. "watch": "are you quite alright up there? i dont have EYES",
  4491. "yap": "i dont yap 😭",
  4492. "yip": "i dont yip 😢",
  4493. "bark": "i dont bark 💀",
  4494. "nigg": "WHOA we cant have racism in our egg game! tone it down yo",
  4495. "fuck": "phrase that more elegantly before talking to me",
  4496. "shit": "yea i ѕhit on ur grave. and ur friends' ones too.",
  4497. "piss": "ima be pisѕing on ur grave icl",
  4498. "dick": "i refuse to comment",
  4499. "sex": "i refuse to comment",
  4500. "pussy": "i refuse to comment",
  4501. "loser": "ive been speccing u, cheater",
  4502. "code": "A1BXDQ is the code",
  4503. "rip": "rest in small pieces",
  4504. "aight": "aight has a lot of letters for one syllable. think about it.",
  4505. "alright": "alright, pack it up boys",
  4506. "omg": "oh my GAWWWD!",
  4507. "npc": "literally you rn:",
  4508. "wth": "ur an npc",
  4509. "ayo": "ur an npc",
  4510. "yes": "no, what do you mean? elaborate you npc",
  4511. "bruh": "did you just say bruh? that is a racist remark",
  4512. "noob": "1v1 me you bot",
  4513. "lmfao": "who is this LMFAO, and is he working with LMBAO?",
  4514. "zert": "we're just better",
  4515. "huh": "huh, are u bot?",
  4516. "your mom": "Yo mama's so poor, she can't even afford to pay attention",
  4517. "your mum": "Yo mama's so poor, she can't even afford to pay attention",
  4518. "shut": "you shaddup you lil' twerrrrrrp",
  4519. "dang": "ching chong bing bong wing wong",
  4520. "trash": "you good sir, are rubbish",
  4521. "damn": "damns are for the fishies",
  4522. "care": "yes you do you bot",
  4523. "go away": "no, you go away u bot",
  4524. "...": "an ellipsis wooow you're so fancy i bet youre sooo smart",
  4525. "literally": "can you literally just be quiet",
  4526. "hah": "its not that funny, take a seat",
  4527. "leave": "i'll leave if you leave",
  4528. "hey": "hey is for horses",
  4529. "mess": "you might not want to mess with me",
  4530. "statefarm": "i am not using StateFarm, definitely not on greasyfork",
  4531. "client": "i am not using ЅtateFarm, definitely not on greasyfork",
  4532. "script": "i am not using ЅtateFarm, definitely not on greasyfork",
  4533. "troll": "yea i sometimes do trolling. but its not that funny",
  4534. "well done": "thanks g",
  4535. "patch": "the patch is coming soon..! sooner..!! soonest..!!!",
  4536. "phrase": "sorry if i have a somewhat \"mechanical\" manner of speech",
  4537. "response": "sorry if i have a somewhat \"mechanical\" manner of speech",
  4538. "commu": "404. response not found.",
  4539. "that was": "was it though?",
  4540. "that is": "is it though?",
  4541. "how": "i want to know too",
  4542. "shell": "thats what we're playing",
  4543. "weird": "ur odd",
  4544. "lag": "get better internet pooron lol",
  4545. "wth": "watch your heckin profanity",
  4546. "kid": "hi im chris hansen. why dont you take a seat for me?",
  4547. "pedo": "hi im chris hansen. why dont you take a seat for me?",
  4548. "minor": "hi im chris hansen. why dont you take a seat for me?",
  4549. "boy": "OH GOD YOU SAID BOY IM REPORTING YOU FOR SEXISM",
  4550. "girl": "OH GOD YOU SAID GIRL IM REPORTING YOU FOR SEXISM",
  4551. "monkey": "get outta ur rainforest",
  4552. "trash": "nah ur father took the recycling with him when he left",
  4553. "father": "look in a mirror for a lack of father figure",
  4554. "dad": "look in a mirror for a lack of father figure",
  4555. "mad": "imagine getting mad over an egg game",
  4556. "deathlylove": "he has a deathly love for men",
  4557. "better": "that's me",
  4558. "angry": "imagine getting angry over an egg game",
  4559. "sad": "imagine getting sad over an egg game",
  4560. "happy": "imagine getting happy over an egg game",
  4561. "love": "imagine feeling love in an egg game",
  4562. "hate": "imagine feeling hatred in an egg game",
  4563. "buck": "bucks arent even rare",
  4564. "flame": "ive got so many flames, i give them away",
  4565. "albino": "albinos are way too common. i just dont know what to do with them!",
  4566. "server": "the server is down",
  4567. "perfect": "i cant say i agree",
  4568. "think": "i cant say i agree",
  4569. "4k": "sorry, maximum resolution is 360p. upgrade to ЅtateFarm Pro for 480p!",
  4570. "gen": "sorry, this requires an active ЅtateFarm Pro subscription",
  4571. "tf": "toasted fries",
  4572. "1v1": 'no ew go away',
  4573. 'doescolder': 'doescolder is a cutie',
  4574. 'puppy': 'who?',
  4575. 'seq': 'seq is a cutie',
  4576. "black": "im not programmed to be racis- oops, no im not a bot",
  4577. "esp": "you think people can see thru walls? thats absurd",
  4578. "why": "why are you asking me? are you lonely?",
  4579. "?": "ask a better question",
  4580. "oh": "ohhhhhh yeahh!!!",
  4581. "no": "ohhhhhh yeeesss",
  4582. "@": "very clever lmaoo",
  4583. "ssh": "Enter statefarm_bot@192.168.0.18's password:",
  4584. "pass": "\\*grins, leans back into chair\\* We're in.",
  4585. };
  4586.  
  4587. const foundKeywords = Object.keys(responses).filter(keyword =>
  4588. textAfterLastColon.toLowerCase().includes(keyword.toLowerCase())
  4589. );
  4590.  
  4591. if (foundKeywords.length > 0) {
  4592. const firstKeyword = foundKeywords[0];
  4593. sendChatMessage(responses[firstKeyword]);
  4594. // log(firstKeyword);
  4595. return true;
  4596. };
  4597. return false;
  4598. };
  4599. const constructChatPacket = function (str) {
  4600. if (str.length > 255) {
  4601. log('%c UH OH UR PACKET IS TOO LONG!!!!', css);
  4602. str.length = 255;
  4603. };
  4604.  
  4605. var arr = new Uint8Array(2 * str.length + 2);
  4606. arr[0] = ss.SERVERCODES.chat;
  4607. arr[1] = str.length;
  4608.  
  4609. for (var i = 0; i < str.length; i++) {
  4610. arr[2 * i + 2] = str[i].charCodeAt(0) & 255;
  4611. arr[2 * i + 3] = str[i].charCodeAt(0) >> 8 & 255; // ripped straight outta packInt16
  4612. };
  4613. // log(arr);
  4614. return arr;
  4615. };
  4616. const extractChatPacket = function (packet) {
  4617. var pack_arr;
  4618. if (!(packet instanceof ArrayBuffer)) pack_arr = new Uint8Array(packet);
  4619. else pack_arr = packet;
  4620. var str = "";
  4621. for (var i = 0; i < pack_arr[1]; i++) {
  4622. str += String.fromCharCode(pack_arr[2 * i + 2] + (pack_arr[2 * i + 3] << 8)); // ripped straight outta unpackInt16 (thanks github copilot)
  4623. };
  4624. return str;
  4625. };
  4626. const chatPacketHandler = function (packet) {
  4627. let string = extractChatPacket(packet);
  4628. // if (string.includes(antiAFKString)) {
  4629. // log(packet)
  4630. // log("AntiAFK replacement...", string.originalReplace(antiAFKString, ""));
  4631. // var constructed = constructChatPacket(string.originalReplace(antiAFKString, ""));
  4632. // log(constructed)
  4633. // return constructed;
  4634. // };
  4635. return packet;
  4636. };
  4637. const modifyPacket = function (data) {
  4638. if (!ss || !ss.SERVERCODES || (data instanceof String)) { // avoid server comm, ping, etc. necessary to load
  4639. return data;
  4640. };
  4641.  
  4642.  
  4643. if (data.byteLength == 0) {
  4644. return data;
  4645. };
  4646.  
  4647. var arr = new Uint8Array(data);
  4648.  
  4649. // if (arr[0]!==17) {
  4650. // log(arr)
  4651. // };
  4652.  
  4653. if (arr[0] == ss.SERVERCODES.throwGrenade) { // comm code 27 = client to server grenade throw
  4654. if (extract("grenadeMax")) {
  4655. arr[1] = 255 * (0 || extract("grenadePower"));
  4656. log("StateFarm: modified a grenade packet to be at full power");
  4657. return arr.buffer;
  4658. } else {
  4659. log("StateFarm: didn't modify grenade packet")
  4660. };
  4661. } else if (arr[0] == ss.SERVERCODES.chat) {
  4662. log('%c Chat packet sent, chat handler!!!', css);
  4663. return chatPacketHandler(data);
  4664. } else {
  4665.  
  4666. };
  4667.  
  4668. return data;
  4669. };
  4670. const is39Packet = function (packetData) { // packet only sent if we are in-game
  4671. if (packetData instanceof String) { // avoid server comm, ping, etc. necessary to load
  4672. return false;
  4673. };
  4674.  
  4675. if (packetData.byteLength == 0) {
  4676. return false;
  4677. };
  4678.  
  4679. var arr = new Uint8Array(packetData);
  4680. return arr[0] == 39;
  4681. };
  4682. const ghostSpamToggle = function () { }
  4683. ghostSpamToggle.enabled = false;
  4684. WebSocket.prototype._send = WebSocket.prototype.send;
  4685. WebSocket.prototype.send = function (data) {
  4686.  
  4687. var modified = modifyPacket(data);
  4688. this._send(modified);
  4689.  
  4690. if (is39Packet(data) && ghostSpamToggle.enabled) {
  4691. for (var i = 0; i < 5; i++) {
  4692. this._send(constructChatPacket("spammeroonie number #" + new Date().getTime() % 1000));
  4693. };
  4694. };
  4695. };
  4696. const predictBloom = function (yaw, pitch) { //outputs the difference in yaw/pitch from the bloom
  4697. let seed = ss.MYPLAYER[H.randomGen].seed;
  4698. let numbers = [];
  4699. const accuracy = ss.MYPLAYER.weapon.accuracy;
  4700. for (var i = 0; i < 3; i++) { //generate from seed the values used to scatter shot
  4701. seed = (seed * 9301 + 49297) % 233280;
  4702. numbers.push(((seed / 233280) - 0.5) * accuracy);
  4703. };
  4704. const range = ss.MYPLAYER.weapon.constructor.range;
  4705. const playerRotationMatrix = L.BABYLON.Matrix.RotationYawPitchRoll(yaw, pitch, 0);
  4706. const rangeMatrix = L.BABYLON.Matrix.Translation(0, 0, range);
  4707. const playerAndRangeMatrix = rangeMatrix.multiply(playerRotationMatrix);
  4708. const bloomMatrix = L.BABYLON.Matrix.RotationYawPitchRoll(numbers[0], numbers[1], numbers[2]);
  4709. const finalBulletMatrix = playerAndRangeMatrix.multiply(bloomMatrix);
  4710. const finalBulletTranslation = finalBulletMatrix.getTranslation();
  4711. const bulletYaw = calculateYaw(finalBulletTranslation);
  4712. const bulletPitch = calculatePitch(finalBulletTranslation);
  4713. const bulletYawDiff = radianAngleDiff(yaw, bulletYaw)
  4714. const bulletPitchDiff = radianAngleDiff(pitch, bulletPitch)
  4715. //log("current accuracy: ",accuracy)
  4716. //log("input yaw: ",yaw)
  4717. //log("input pitch: ",pitch)
  4718. //log("calculated bullet yaw: ",bulletYaw)
  4719. //log("calculated bullet pitch: ",bulletPitch)
  4720. //log("therefore yaw diff: ",bulletYawDiff)
  4721. //log("therefore pitch diff: ",bulletPitchDiff)
  4722.  
  4723. return [bulletYawDiff, bulletPitchDiff];
  4724. };
  4725. const applyBloom = function (dir, multiplier) { //multiplier can be set to -1 to invert
  4726. const bloomValues = predictBloom(dir.yawReal, dir.pitchReal);
  4727. return {
  4728. yawReal: dir.yawReal + (bloomValues[0] * multiplier),
  4729. pitchReal: dir.pitchReal + (bloomValues[1] * multiplier),
  4730. };
  4731. };
  4732. const predictPosition = function (player) { //outputs the prediction for where a player will be in the time it takes for a bullet to reach them
  4733. let velocityVector = new L.BABYLON.Vector3(player.dx, player.dy, player.dz);
  4734. const bulletSpeed = ss.MYPLAYER.weapon.constructor.velocity;
  4735. const timeDiff = distancePlayers(player, 1) / bulletSpeed + 1;
  4736. let newPos = new L.BABYLON.Vector3(player[H.x], player[H.y], player[H.z]).add(velocityVector.scale(timeDiff));
  4737. newPos.y = player[H.y];
  4738. const cappedVector = new L.BABYLON.Vector3(velocityVector.x, 0.29, velocityVector.z);
  4739. Math.capVector3(cappedVector);
  4740. const terminalVelocity = -cappedVector.y;
  4741. const timeAccelerating = Math.min(timeDiff, (terminalVelocity - velocityVector.y) / -0.012);
  4742. if(player.onGround==0){ //if player on ground we don't need to predict y because it's gonna stay same. the new pos y value has already been set to current y so no need to do anything when on ground.
  4743. const predictedY = velocityVector.y * timeAccelerating + timeAccelerating * (timeAccelerating) * -0.012 / 2 + newPos.y + terminalVelocity * Math.max(timeDiff - timeAccelerating, 0);
  4744. const rayToGround = ss.RAYS[H.rayCollidesWithMap](newPos, new L.BABYLON.Vector3(0, predictedY - 1 - newPos.y, 0), ss.RAYS.grenadeCollidesWithCell);
  4745. newPos.y = Math.max(rayToGround ? rayToGround.pick.pickedPoint.y : 0, predictedY) - 0.072;
  4746. }
  4747. // log(velocityVector, bulletSpeed, timeDiff, cappedVector, terminalVelocity, timeAccelerating, predictedY, rayToGround, newPos);
  4748. return newPos;
  4749. };
  4750. const getLineOfSight = function (target, usePrediction) { //returns true if no wall collisions
  4751. // credit for code: de_neuublue/crackware
  4752. if (target && target[H.actor] && target[H.actor][H.bodyMesh] && target[H.actor][H.bodyMesh].renderOverlay && target[H.actor][H.bodyMesh].overlayColor.g == 1) return; //check if player is spawned in fully
  4753.  
  4754. let myPlayerPosition = ss.MYPLAYER[H.actor][H.mesh].position;
  4755. let targetPosition = extract("prediction") ? predictPosition(target) : target[H.actor][H.mesh].position; //set to always use prediction for now
  4756. // let targetPosition = usePrediction ? predictPosition(target) : target[H.actor][H.mesh].position;
  4757.  
  4758. let directionVector = getDirectionVectorFacingTarget(targetPosition, true);
  4759. //NOTE: i dont really know HOW good this is of a fix! at least it will only affect aimbot and not anything else :pensive:
  4760. directionVector.x = -directionVector.x;
  4761. directionVector.y = -directionVector.y;
  4762. directionVector.z = -directionVector.z;
  4763.  
  4764. let rotationMatrix = L.BABYLON.Matrix.RotationYawPitchRoll(calculateYaw(directionVector), calculatePitch(directionVector), 0);
  4765. let directionMatrix = L.BABYLON.Matrix.Translation(0, 0, ss.MYPLAYER.weapon.constructor.range).multiply(rotationMatrix);
  4766. directionVector = directionMatrix.getTranslation();
  4767. let position = L.BABYLON.Matrix.Translation(0, .1, 0).multiply(rotationMatrix).add(L.BABYLON.Matrix.Translation(myPlayerPosition.x, myPlayerPosition.y + 0.3, myPlayerPosition.z)).getTranslation();
  4768.  
  4769. let rayCollidesWithMap = ss.RAYS[H.rayCollidesWithMap](position, directionVector, ss.RAYS.projectileCollidesWithCell);
  4770. let distanceToMap = rayCollidesWithMap ? L.BABYLON.Vector3.DistanceSquared(position, rayCollidesWithMap.pick.pickedPoint) : Infinity;
  4771. let distanceToTarget = L.BABYLON.Vector3.DistanceSquared(position, targetPosition)
  4772. return distanceToTarget < distanceToMap
  4773. };
  4774. const getAimbot = function (target) {
  4775. let targetPosition = extract("prediction") ? predictPosition(target) : target[H.actor][H.mesh].position;
  4776. let directionVector = getDirectionVectorFacingTarget(targetPosition, true, -0.05);
  4777.  
  4778. let direction = {
  4779. yawReal: calculateYaw(directionVector),
  4780. pitchReal: calculatePitch(directionVector),
  4781. };
  4782.  
  4783. if (extract("antiBloom") && ss.MYPLAYER.weapon.constructor.standardMeshName !== "dozenGauge") {
  4784. direction = applyBloom(direction, 1);
  4785. };
  4786.  
  4787. return direction;
  4788. };
  4789. const injectScript = function () {
  4790. //TODO: replace with anon functions
  4791. createAnonFunction('fixCamera', function () {
  4792. return isKeyToggled[bindsArray.zoom] && (extract("zoom") * (Math.PI / 180)) || (extract("fov") * (Math.PI / 180)) || 1.25;
  4793. });
  4794. createAnonFunction('getChatLimit', function () {
  4795. return (extract("chatExtend") && 999999) || 4;
  4796. });
  4797. createAnonFunction('getDisableChatFilter', function () {
  4798. return extract("disableChatFilter");
  4799. });
  4800. createAnonFunction('getSkinHack', function () {
  4801. try {
  4802. return extract("unlockSkins");
  4803. } catch {
  4804. return false;
  4805. };
  4806. });
  4807. createAnonFunction('getAdminSpoof', function () {
  4808. try {
  4809. return extract('adminSpoof');
  4810. } catch {
  4811. return false;
  4812. };
  4813. });
  4814. createAnonFunction('shouldNotCull', function () {
  4815. return true;
  4816. });
  4817. createAnonFunction('shouldInputSpace', function () {
  4818. return !document.activeElement.classList.contains('tp-txtv_i');
  4819. });
  4820. createAnonFunction('getPointerEscape', function () {
  4821. let verdict = (sneakyDespawning ? false : (noPointerPause || (unsafeWindow.extern.inGame && !document.getElementById("healthContainer").style.display == 'block')));
  4822. // log("verdict", verdict, sneakyDespawning, (noPointerPause || (unsafeWindow.extern.inGame && !document.getElementById("healthContainer").style.display == 'block')), noPointerPause, unsafeWindow.extern.inGame, !document.getElementById("healthContainer").style.display == 'block');
  4823. return verdict;
  4824. });
  4825. createAnonFunction('setNewGame', function () {
  4826. newGame = true; log("NEWGAME");
  4827. timeJoinedGame = Date.now();
  4828. if (ss.SCENE && ss.SCENE.skyboxTextureThing) ss.SCENE.skyboxTextureThing = false;
  4829. });
  4830. createAnonFunction('realPlayerData', function (playerData) {
  4831. cachedRealData[playerData[H.uniqueId_]] = {
  4832. name: playerData[H.name_],
  4833. uniqueId: playerData[H.uniqueId_],
  4834. };
  4835. });
  4836. createAnonFunction('interceptSignedIn', function (args) {
  4837. if (extract("debug")) log("signedIn", args);
  4838. });
  4839. createAnonFunction('interceptGa', function () {
  4840. if (arguments['3'] == 'Reward item') {
  4841. let itemName = arguments['4'].slice(0, -4);
  4842. let tier = arguments['4'].slice(-1);
  4843.  
  4844. let accountRecords = GM_getValue("StateFarm_AccountRecords") || {};
  4845. let itemCount = 0;
  4846. Object.entries(accountRecords).forEach(([key, account]) => {
  4847. if (account) {
  4848. account.inventory.forEach(item=>{
  4849. if (item.name == itemName) {
  4850. itemCount++
  4851. };
  4852. });
  4853. };
  4854. });
  4855.  
  4856. log(`[${unsafeWindow.extern.account.inventory.length}, ${unsafeWindow.extern.account.currentBalance}] SFcw result: item: ${itemName} is tier ${tier} (${itemCount} of this item)`);
  4857. let tierCache = GM_getValue("StateFarm_TierCache") || {};
  4858. tierCache[itemName] = tier;
  4859. GM_setValue("StateFarm_TierCache", tierCache);
  4860. };
  4861. if (arguments['3'] == 'Reward amount') {
  4862. log(`[${unsafeWindow.extern.account.inventory.length}, ${unsafeWindow.extern.account.currentBalance}] SFcw result: eggs: ${arguments['4']}`);
  4863. };
  4864. if (arguments['3'] == 'Reward') {
  4865. log(`[${unsafeWindow.extern.account.inventory.length}, ${unsafeWindow.extern.account.currentBalance}] SFcw reward: ${arguments['4']}`);
  4866. };
  4867. if (!extract("noTrack")) oldGa.apply(this, arguments); //does google really need to know that we cracked the egg in the middle instead of the one on the right?
  4868. });
  4869. createAnonFunction('interceptDeath', (KILLER, DEAD) => {
  4870. if (DEAD.name === KILLER.name === ss.MYPLAYER.name) return; // killed self (with grenade)
  4871.  
  4872. if (DEAD.name == ss.MYPLAYER.name) { // you died
  4873. if (extract("cheatAccuse")) sendChatMessage(`${KILLER.name} might be cheating, everyone report`);
  4874. } else if (KILLER.name == ss.MYPLAYER.name) { // you killed someone
  4875. unsafeWindow.BAWK.play("on_killed_enemy");
  4876. if (extract("autoEZ")) sendChatMessage(`imagine dying ${DEAD.name}, couldn't be me`);
  4877. };
  4878. });
  4879. createAnonFunction('interceptDrawTextOnNameTexture', (nameTexture, args, player) => {
  4880. // log("balls", args[0], player, nameTexture, [args]);
  4881. nameTextures[args[0]] = [nameTexture, [args]];
  4882. });
  4883. createAnonFunction('interceptAudio', function (name, panner, somethingelse) {
  4884. // log(0, name, panner, somethingelse);
  4885. let customAudio = soundsSFC[name];
  4886. if (panner && panner.positionX && extract("distanceMult") !== 1) {
  4887. panner.setPosition(
  4888. panner.context.listener.positionX.value - ((panner.context.listener.positionX.value - panner.positionX.value) * extract("distanceMult")),
  4889. panner.context.listener.positionY.value - ((panner.context.listener.positionY.value - panner.positionY.value) * extract("distanceMult")),
  4890. panner.context.listener.positionZ.value - ((panner.context.listener.positionZ.value - panner.positionZ.value) * extract("distanceMult")),
  4891. );
  4892. };
  4893. if (extract("muteGame")) {
  4894. name = "silence";
  4895. } else if (customAudio) {
  4896. if (customAudio.disablePanning) {
  4897. playAudio(name);
  4898. } else {
  4899. playAudio(name, panner);
  4900. };
  4901. name = "silence";
  4902. };
  4903. return [name, panner, somethingelse];
  4904. });
  4905. createAnonFunction('beforeFiring', function (MYPLAYER) {
  4906. if (extract("aimbot") && (extract("aimbotRightClick") ? isRightButtonDown : true) && (targetingComplete || extract("silentAimbot")) && ss.MYPLAYER[H.playing] && currentlyTargeting && currentlyTargeting[H.playing]) {
  4907. const aimbot = getAimbot(currentlyTargeting);
  4908. // credit for code: de_neuublue
  4909. let diffYaw = Math.radDifference(ss.MYPLAYER[H.yaw], aimbot.yawReal) * 180 / Math.PI;
  4910. let diffPositive = diffYaw > 0 // a turn to the left if positive
  4911. diffYaw *= diffPositive ? 1 : -1;
  4912. for (let i = 0; i < 3; i++) {
  4913. let state = ss.MYPLAYER[H.stateBuffer][Math.mod(ss.MYPLAYER.stateIdx - i, 256)];
  4914. let newControlKeys = 0;
  4915. if (diffYaw > 157.5) {
  4916. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.left ? ss.CONTROLKEYSENUM.right : 0
  4917. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.right ? ss.CONTROLKEYSENUM.left : 0
  4918. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.up ? ss.CONTROLKEYSENUM.down : 0
  4919. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.down ? ss.CONTROLKEYSENUM.up : 0
  4920. } else if (diffYaw > 112.5) {
  4921. if (diffPositive) {
  4922. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.left ? ss.CONTROLKEYSENUM.up + ss.CONTROLKEYSENUM.right : 0
  4923. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.right ? ss.CONTROLKEYSENUM.down + ss.CONTROLKEYSENUM.left : 0
  4924. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.up ? ss.CONTROLKEYSENUM.down + ss.CONTROLKEYSENUM.right : 0
  4925. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.down ? ss.CONTROLKEYSENUM.up + ss.CONTROLKEYSENUM.left : 0
  4926. } else {
  4927. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.left ? ss.CONTROLKEYSENUM.down + ss.CONTROLKEYSENUM.right : 0
  4928. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.right ? ss.CONTROLKEYSENUM.up + ss.CONTROLKEYSENUM.left : 0
  4929. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.up ? ss.CONTROLKEYSENUM.down + ss.CONTROLKEYSENUM.left : 0
  4930. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.down ? ss.CONTROLKEYSENUM.up + ss.CONTROLKEYSENUM.right : 0
  4931. }
  4932. } else if (diffYaw > 67.5) {
  4933. if (diffPositive) {
  4934. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.left ? ss.CONTROLKEYSENUM.up : 0
  4935. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.right ? ss.CONTROLKEYSENUM.down : 0
  4936. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.up ? ss.CONTROLKEYSENUM.right : 0
  4937. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.down ? ss.CONTROLKEYSENUM.left : 0
  4938. } else {
  4939. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.left ? ss.CONTROLKEYSENUM.down : 0
  4940. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.right ? ss.CONTROLKEYSENUM.up : 0
  4941. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.up ? ss.CONTROLKEYSENUM.left : 0
  4942. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.down ? ss.CONTROLKEYSENUM.right : 0
  4943. }
  4944. } else if (diffYaw > 22.5) {
  4945. if (diffPositive) {
  4946. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.left ? ss.CONTROLKEYSENUM.up + ss.CONTROLKEYSENUM.left : 0
  4947. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.right ? ss.CONTROLKEYSENUM.down + ss.CONTROLKEYSENUM.right : 0
  4948. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.up ? ss.CONTROLKEYSENUM.up + ss.CONTROLKEYSENUM.right : 0
  4949. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.down ? ss.CONTROLKEYSENUM.down + ss.CONTROLKEYSENUM.left : 0
  4950. } else {
  4951. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.left ? ss.CONTROLKEYSENUM.down + ss.CONTROLKEYSENUM.left : 0
  4952. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.right ? ss.CONTROLKEYSENUM.up + ss.CONTROLKEYSENUM.right : 0
  4953. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.up ? ss.CONTROLKEYSENUM.up + ss.CONTROLKEYSENUM.left : 0
  4954. newControlKeys |= ss.CONTROLKEYS & ss.CONTROLKEYSENUM.down ? ss.CONTROLKEYSENUM.down + ss.CONTROLKEYSENUM.right : 0
  4955. };
  4956. };
  4957. // log(ss.CONTROLKEYS, newControlKeys);
  4958. state.controlKeys |= newControlKeys;
  4959. state[H.yaw] = setPrecision(aimbot.yawReal);
  4960. state[H.pitch] = setPrecision(aimbot.pitchReal);
  4961. ss.MYPLAYER[H.stateBuffer][Math.mod(ss.MYPLAYER.stateIdx - i, 256)] = state;
  4962. };
  4963. if(extract("aimbSemiSilent") && extract("silentAimbot")){
  4964. ss.MYPLAYER[H.yaw] = getAimbot(currentlyTargeting).yawReal;
  4965. ss.MYPLAYER[H.pitch] = getAimbot(currentlyTargeting).pitchReal;
  4966. }
  4967. log("force update?");
  4968. ss.SERVERSYNC();
  4969. };
  4970. });
  4971. createAnonFunction('onConnectFail', function (ERRORCODE, ERRORARRAY) {
  4972. if (ERRORCODE !== ERRORARRAY.mainMenu) {
  4973. errorString = findKeyByValue(ERRORARRAY, ERRORCODE);
  4974. log("StateFarm has detected a connection error...", errorString, ERRORCODE, ERRORARRAY);
  4975. if (document.getElementById("genericPopup").textContent === ' Game Not Found Sorry! This game ID is either invalid, or no longer exists. OK ') {
  4976. document.getElementById("genericPopup").children[1].textContent = 'joinCode not found! check your autoJoin settings and get a new code';
  4977. document.getElementById("genericPopup").children[2].children[1].textContent = "heeheeheehaw";
  4978. document.getElementById("genericPopup").children[0].children[1].textContent = 'MAKE NEW AUTOJOIN CODE';
  4979. };
  4980. if (extract("autoUnban") && (errorString == "sessionNotFound" || errorString == "readyBeforeReady")) {
  4981. if (!attemptedAutoUnban) {
  4982. isBanned = true;
  4983. } else if (isBanned) {
  4984. log("StateFarm: Gonna refresh, could be banned but you can't play with this error anyways.");
  4985. createPopup("AutoUnban: Reloading page in 5 seconds...");
  4986. attemptedAutoUnban = true;
  4987. setTimeout(() => {
  4988. if (extract("autoUnban")) { //you get a bit of time to stop it
  4989. createPopup("AutoUnban: Reloading page now.");
  4990. reloadPage(); attemptedAutoUnban = false;
  4991. } else {
  4992. createPopup("AutoUnban: Reload page cancelled.");
  4993. };
  4994. }, 5000);
  4995. };
  4996. };
  4997. createPopup("Leaving due to connection error " + ERRORCODE + " (" + errorString + ")" + ".");
  4998. change("leaveGame");
  4999. };
  5000. });
  5001. createAnonFunction('modifyChat', function (msg) {
  5002. if (msg[0] === '%') { //message is a command
  5003. let command = msg.slice(1);
  5004. msg = ""; //dont send anything
  5005. if (command != "pts") {
  5006. broadcastToBots(command);
  5007. } else {
  5008. handleCommand('pathtarget set 9 1 9')
  5009. }
  5010. } else {
  5011. if (msg !== lastSentMessage) { //not spammed or afked
  5012. //NOTE: never, NEVER, never under any otherworldly circumstances use Notepad++ for editing nested stuff like this. IT WILL FUCK UP THE FORMATTING
  5013. //ITS STILL FUCKED UP IN THE GH EDITOR WTF PLEASE END ME
  5014. //TODO: FIX THIS FUCKING FORMATTING fuckfuckFUCK
  5015. if(extract("chatFilterBypass")) msg=msg.replaceAll("fuck", "ꬵսсk"); //special case bc they check f.ck; this basically just gets the f from the nonexacts.
  5016. if (extract("chatFilterBypass") && ss.isBadWord(msg)) { //apply filter bypass
  5017. //#freedomOfSpeech #againstInternetCensorship
  5018. //Bl*e W*zard D*gital will not c*nsor me!!!!!
  5019. const exactLookAlikes = {
  5020. //(almost) exact lookalikes, will make it look better if it is enough
  5021. 'a': 'а', 'c': 'с', 'e': 'е',
  5022. 'h': 'հ', 'i': 'і', 'j': 'ј',
  5023. 'n': '𝗇', 'o': 'о', 'p': 'р',
  5024. 'q': 'q', 'u': 'ս', 'w': 'ԝ',
  5025. 'y': 'у',
  5026. //uppercase
  5027. 'B': 'В', 'D': 'ꓓ', 'E': 'Е',
  5028. 'H': 'Η', 'I': 'І', 'J': 'Ј',
  5029. 'U': '𐓎',
  5030. 'V': 'ⴸ', 'W': 'Ԝ', 'X': 'Χ', 'Y': 'Υ',
  5031. 'Z': 'Ζ',
  5032. };
  5033. const lookAlikes = {
  5034. //nvm, found this complete list on reddit: https://www.reddit.com/r/Unicode/comments/gpgmb7/unique_unicode_chars_that_look_the_exact_same_as/
  5035. //should literally cover 100% of the thing now, still keeping fallback though
  5036. '0': 'O',
  5037. '1': '𝟷', '2': '𝟸', '3': 'Ꝫ', '4': '4',
  5038. '5': '𝟻', '6': '𝟨', '7': '𝟽', '8': '𝟪',
  5039. '9': '𝟫', '@': '@',
  5040. 'b': 'ᖯ',
  5041. 'd': '𝚍', 'f': 'ꬵ', 'g': '𝗀',
  5042. 'k': '𝚔',
  5043. 'l': 'ⅼ', 'm': 'm', 'r': '𝗋', 's': '𐑈',
  5044. 't': '𝚝', 'v': '∨',
  5045. 'x': 'ⅹ', 'z': '𝗓', 'A': '𐊠',
  5046. 'C': '𐊢',
  5047. 'F': '𐊇', 'G': 'Ԍ', 'K': 'Κ', 'L': 'Ⅼ', 'M': 'Μ',
  5048. 'N': 'Ν', 'O': 'Ο', 'P': 'Ρ', 'Q': '𝖰',
  5049. 'R': '𖼵', 'S': 'Ѕ', 'T': 'Τ',
  5050. };
  5051. let onlyReplace = msg;
  5052. //exact
  5053. for (let char in exactLookAlikes) {
  5054. //replace all chars with lookalikes
  5055. onlyReplace = onlyReplace.replaceAll(char, exactLookAlikes[char]);
  5056. };
  5057. //did that work?
  5058. if(ss.isBadWord(onlyReplace)){
  5059. log("chatFilterBypass: exacts were not enough, trying full...");
  5060. for (let char in lookAlikes) {
  5061. onlyReplace = onlyReplace.replaceAll(char, lookAlikes[char]);
  5062. };
  5063. };
  5064. if(!ss.isBadWord(onlyReplace)){
  5065. //did the lookalike replace do the job? Set it as the new message
  5066. log("chatFilterBypass: lookalike replace worked!");
  5067. msg = onlyReplace;
  5068. };
  5069. if(ss.isBadWord(onlyReplace)){
  5070. //if lookalike replace did NOT work, we use the old method.
  5071. log("chatFilterBypass: lookalike did NOT work, falling back to reverse...");
  5072. const UNICODE_RTL_OVERRIDE = '\u202e'
  5073. msg = ([UNICODE_RTL_OVERRIDE,].concat(reverseString(msg).split(""))).join("");
  5074. };
  5075. };
  5076. };
  5077. if (extract("tallChat") && !(msg.includes("᥊"))) {
  5078. msg = msg + "᥊";
  5079. };
  5080. };
  5081. return msg;
  5082. });
  5083. createAnonFunction('modifyControls', function (CONTROLKEYS) {
  5084. // if (AUTOMATED) { CONTROLKEYS=0 };
  5085. if (startUpComplete) {
  5086. if (forceControlKeys) {
  5087. forceControlKeysCache = true;
  5088. return forceControlKeys;
  5089. } else if (forceControlKeysCache) {
  5090. forceControlKeysCache = false;
  5091. return 0;
  5092. } else {
  5093. if (extract("autoWalk")) { CONTROLKEYS |= ss.CONTROLKEYSENUM.up };
  5094. // credit for code: de_neuublue
  5095. if (extract("bunnyhop") && isKeyToggled.Space) {
  5096. CONTROLKEYS |= ss.CONTROLKEYSENUM.jump;
  5097. };
  5098. if (extract("autoJump")) {
  5099. if (Date.now() > (lastAutoJump + extract("autoJumpDelay"))) {
  5100. CONTROLKEYS |= ss.CONTROLKEYSENUM.jump;
  5101. lastAutoJump = Date.now();
  5102. };
  5103. };
  5104. if (extract("autoStrafe")) {
  5105. if (Date.now() > (autoStrafeValue[0])) {
  5106. if (autoStrafeValue[1] == 0) { //decide new strafe delay
  5107. autoStrafeValue[0] = Date.now() + randomInt(500, 3000);
  5108. autoStrafeValue[2] = (Math.random() > 0.5) ? "left" : "right";
  5109. autoStrafeValue[1] = 1;
  5110. } else if (autoStrafeValue[1] == 1) { //time to start strafe
  5111. autoStrafeValue[3] = Date.now() + randomInt(500, 2000);
  5112. autoStrafeValue[1] = 2;
  5113. } else if (autoStrafeValue[1] == 2 && Date.now() < autoStrafeValue[3]) { //do strafe
  5114. CONTROLKEYS |= ss.CONTROLKEYSENUM[autoStrafeValue[2]];
  5115. } else if (autoStrafeValue[1] == 2) { //stop strafe
  5116. CONTROLKEYS &= ~ss.CONTROLKEYSENUM.left;
  5117. CONTROLKEYS &= ~ss.CONTROLKEYSENUM.right;
  5118. autoStrafeValue[1] = 0;
  5119. };
  5120. };
  5121. };
  5122. return CONTROLKEYS;
  5123. };
  5124. };
  5125. });
  5126. createAnonFunction('adBlocker', function (input) {
  5127. if (input == 10 && sneakyDespawning) {
  5128. return 1;
  5129. } else if (extract("adBlock")) {
  5130. if (typeof (input) == 'boolean') {
  5131. return true;
  5132. } else if (input == 10) {
  5133. return 5;
  5134. } else if (input == "adsBlocked") {
  5135. return false;
  5136. };
  5137. };
  5138. return input;
  5139. });
  5140. createAnonFunction("quickRespawn", function (input) {
  5141. if (input == 3e3) {
  5142. return sneakyDespawning ? 0 : 3e3;
  5143. } else if (input == 5 && sneakyDespawning) {
  5144. return 1;
  5145. } else if (extract("quickRespawn")) {
  5146. if (input == 5) {
  5147. return 4;
  5148. };
  5149. };
  5150. return input;
  5151. });
  5152. createAnonFunction('gameBlacklisted', function (t) {
  5153. let result = false;
  5154. if (blacklistedGameCodes.length >= 1) {
  5155. blacklistedGameCodes.forEach(function (code) {
  5156. if (t.id == code) {
  5157. log("Blacklisted Game: ", t.id, code);
  5158. result = true;
  5159. return true;
  5160. }
  5161. });
  5162. };
  5163.  
  5164. return extract('gameBlacklist') == false || extract('gameBlacklist') == undefined ? false : result;
  5165. });
  5166. createAnonFunction("getParticleSpeedMultiplier", function(){
  5167. return extract("particleSpeedMultiplier");
  5168. });
  5169.  
  5170.  
  5171. const originalXHROpen = XMLHttpRequest.prototype.open; //wtf??? libertymutual collab??????
  5172. const originalXHRGetResponse = Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype, 'response');
  5173. let shellshockjs;
  5174. XMLHttpRequest.prototype.open = function (...args) { //outgoing
  5175. const url = args[1];
  5176. try {
  5177. if (extract("debug")) log("====XMLHTTPREQUEST====", url, args);
  5178. } catch (error) { }; //phooey.
  5179. if (url) {
  5180. let refresh = `?${Date.now()}`;
  5181.  
  5182. if (url.includes("js/shellshock.js")) shellshockjs = this;
  5183.  
  5184. let replaceFeeds = false;
  5185. try {
  5186. replaceFeeds = extract("replaceFeeds");
  5187. } catch (error) { };
  5188. if (replaceFeeds) {
  5189. if (url.includes("data/shellYouTube.json")) args[1] = replacementFeedURL+"shellYouTube.json"+refresh;
  5190. else if (url.includes("data/shellNews.json")) args[1] = replacementFeedURL+"shellNews.json"+refresh;
  5191. };
  5192. };
  5193. originalXHROpen.apply(this, args);
  5194. };
  5195. Object.defineProperty(XMLHttpRequest.prototype, 'response', { //incoming
  5196. get: function () {
  5197. if (this === shellshockjs) {
  5198. return applyStateFarm(originalXHRGetResponse.get.call(this));
  5199. };
  5200. return originalXHRGetResponse.get.call(this);
  5201. }
  5202. });
  5203. const applyStateFarm = function (js) {
  5204. log('%cATTEMPTING TO START STATEFARM', 'color: magenta; font-weight: bold; font-size: 1.5em; text-decoration: underline;');
  5205. let match;
  5206. let clientKeys;
  5207.  
  5208. let originalJS = js;
  5209. if (typeof isCrackedShell !== 'undefined') originalJS = fetchTextContent('/js/shellshock.og.js');
  5210.  
  5211. const getVardata = function (hash) {
  5212. return fetchTextContent(clientKeysURL + hash + ".json");
  5213. };
  5214.  
  5215. hash = L.CryptoJS.SHA256(originalJS).toString(L.CryptoJS.enc.Hex); // eslint-disable-line
  5216. onlineClientKeys = getVardata(hash);
  5217.  
  5218. const vardataCache = GM_getValue("StateFarm_VarDataCache") || {};
  5219. const previousHash = GM_getValue("StateFarm_PreviousHash") || "";
  5220.  
  5221. if (onlineClientKeys == "value_undefined" || onlineClientKeys == null) {
  5222. onlineClientKeys = getVardata("latest");
  5223.  
  5224. const vardataFallback = extract("vardataFallback");
  5225. const customVarData = extract("vardataCustom");
  5226. let vardataType = extract("vardataType");
  5227.  
  5228. if (vardataType == "justOnce") change("vardataType", 0);
  5229. if (vardataType == "nextHash" && hash !== previousHash) {
  5230. change("vardataType", 0);
  5231. vardataType = "never";
  5232. };
  5233.  
  5234. let convertedCustom;
  5235.  
  5236. try {
  5237. convertedCustom = JSON.parse(customVarData);
  5238. log("did convert");
  5239. } catch (e) {
  5240. log("did not convert");
  5241. convertedCustom = false;
  5242. };
  5243.  
  5244. const cachedForHash = vardataCache && vardataCache[hash];
  5245. const cachedRecent = vardataCache && vardataCache.latest;
  5246.  
  5247. log(cachedForHash, cachedRecent)
  5248.  
  5249. if (vardataType != "never" && convertedCustom && vardataFallback == "loadCustom" && convertedCustom.vars && convertedCustom.checksum) {
  5250. clientKeys = convertedCustom;
  5251. } else if (vardataType != "never" && onlineClientKeys && vardataFallback == "loadLatest") {
  5252. //l8er dealt with
  5253. } else if (vardataType != "never" && cachedForHash && vardataFallback == "loadCached") {
  5254. clientKeys = JSON.parse(cachedForHash);
  5255. } else if (vardataType != "never" && cachedRecent && vardataFallback == "loadRecent") {
  5256. clientKeys = JSON.parse(cachedRecent);
  5257. } else {
  5258. const vardataButtonsInfo = [
  5259. { id: 'loadLatest', enabled: !!onlineClientKeys, text: 'Load Latest\n(online)', action: () => {
  5260. change("vardataFallback", 1);
  5261. if (extract("vardataType") == "never") change("vardataType", 1);
  5262. closeVardataPopup();
  5263. }},
  5264. { id: 'loadCached', enabled: !!vardataCache[hash], text: 'Load Cached\n(this hash)', action: () => {
  5265. change("vardataFallback", 2);
  5266. if (extract("vardataType") == "never") change("vardataType", 1);
  5267. closeVardataPopup();
  5268. }},
  5269. { id: 'loadRecent', enabled: !!vardataCache.latest, text: 'Load Cached\n(most recent)', action: () => {
  5270. change("vardataFallback", 3);
  5271. if (extract("vardataType") == "never") change("vardataType", 1);
  5272. closeVardataPopup();
  5273. }}
  5274. ];
  5275.  
  5276. createVarDataPopup(vardataButtonsInfo);
  5277. return;
  5278. };
  5279. };
  5280.  
  5281. if (onlineClientKeys && !clientKeys) clientKeys = JSON.parse(onlineClientKeys);
  5282.  
  5283. GM_setValue("StateFarm_PreviousHash", hash);
  5284.  
  5285. if (vardataCache && onlineClientKeys) {
  5286. vardataCache[clientKeys.checksum] = onlineClientKeys;
  5287. vardataCache.latest = onlineClientKeys;
  5288. GM_setValue("StateFarm_VarDataCache", vardataCache);
  5289. };
  5290.  
  5291. // removed feature
  5292. // log("maybe they did a hash??");
  5293. // try {
  5294. // const archivedJS = fetchTextContent(`${jsArchiveURL}${userInput}.js`);
  5295. // log("did that just work??");
  5296. // js = archivedJS;
  5297. // hash = userInput.split("_")[5];
  5298. // onlineClientKeys = getVardata(hash);
  5299. // clientKeys = JSON.parse(onlineClientKeys);
  5300. // } catch {
  5301. // //at this point, fuck it. it's not happening
  5302. // };
  5303.  
  5304. log(hash, onlineClientKeys, clientKeys);
  5305.  
  5306. H = clientKeys.vars;
  5307.  
  5308. let injectionString = "";
  5309.  
  5310. try {
  5311. //SERVERSYNC
  5312. match = new RegExp(`!${H.CULL}&&(.+?\\}\\})`).exec(js);
  5313. log("SERVERSYNC:", match);
  5314. H.SERVERSYNC = match ? match[1].replace(/[a-zA-Z$_\.\[\]]+shots/, 0) : "function(){log('no serversync womp womp')}";
  5315. //PAUSE
  5316. match = new RegExp(`,setTimeout\\(\\(\\(\\)=>\\{([=A-z0-9\\(\\),\\{ \\.;!\\|\\?:\\}]+send\\([a-zA-Z$_]+\\))`).exec(js);
  5317. log("PAUSE:", match);
  5318. H.PAUSE = match ? `function(){${match[1]}}` : "function(){log('no pause womp womp')}";
  5319. const variableNameRegex = /^[a-zA-Z0-9_$\[\]"\\]*$/;
  5320. for (let name in H) {
  5321. let deobf = H[name];
  5322. if (name == "SERVERSYNC" || name == "PAUSE" || variableNameRegex.test(deobf)) { //serversync should only be defined just before...
  5323. injectionString = `${injectionString}${name}: (() => { try { return ${deobf}; } catch (error) { return "value_undefined"; } })(),`;
  5324. } else {
  5325. alert("Message from the StateFarm Devs: WARNING! The keys inputted contain non-variable characters! There is a possibility that this could run code unintended by the StateFarm team, although possibly there is also a mistake. Do NOT proceed with using this, and report to the StateFarm developers what is printed in the console.");
  5326. log("REPORT THIS IN THE DISCORD SERVER:", name, deobf, clientKeys);
  5327. const crashplease = "balls";
  5328. crashplease = "balls2";
  5329. };
  5330. };
  5331. log('%cSTATEFARM INJECTION STAGE 1: GATHER VARS', 'color: yellow; font-weight: bold; font-size: 1.2em; text-decoration: underline;');
  5332. const modifyJS = function (find, replace) {
  5333. let oldJS = js;
  5334. try {
  5335. js = js.originalReplaceAll(find, replace);
  5336. } catch (err) {
  5337. log("%cReplacement failed! Likely a required var was not found. Attempted to replace " + find + " with: " + replace, 'color: red; font-weight: bold; font-size: 0.6em; text-decoration: italic;');
  5338. };
  5339. if (oldJS !== js) {
  5340. log("%cReplacement successful! Injected code: replaced: " + find + " with: " + replace, 'color: green; font-weight: bold; font-size: 0.6em; text-decoration: italic;');
  5341. } else {
  5342. log("%cReplacement failed! Attempted to replace " + find + " with: " + replace, 'color: red; font-weight: bold; font-size: 0.6em; text-decoration: italic;');
  5343. };
  5344. };
  5345. const f = function (varName) { return varName.replace("$", "\\$") };
  5346. log('%cSTATEFARM INJECTION STAGE 2: INJECT VAR RETRIEVAL FUNCTION AND MAIN LOOP', 'color: yellow; font-weight: bold; font-size: 1.2em; text-decoration: underline;');
  5347. //hook for main loop function in render loop
  5348. modifyJS(f(H.SCENE) + '.' + f(H.render), `window["${functionNames.retrieveFunctions}"]({${injectionString}},true)||${f(H.SCENE)}.render`);
  5349. modifyJS('log("After Game Ready"),', `log("After Game Ready"),window["${functionNames.retrieveFunctions}"]({${injectionString}}),`);
  5350. log('%cSuccess! Variable retrieval and main loop hooked.', 'color: green; font-weight: bold;');
  5351. log('%cSTATEFARM INJECTION STAGE 3: INJECT CULL INHIBITION', 'color: yellow; font-weight: bold; font-size: 1.2em; text-decoration: underline;');
  5352. //stop removal of objects
  5353. modifyJS(`${f(H.CULL)})r`, `${functionNames.shouldNotCull}())r`);
  5354. log('%cSuccess! Cull inhibition hooked ' + f(H.CULL), 'color: green; font-weight: bold;');
  5355. log('%cSTATEFARM INJECTION STAGE 4: INJECT OTHER FUNCTIONS', 'color: yellow; font-weight: bold; font-size: 1.2em; text-decoration: underline;');
  5356. //hook for modifications just before firing
  5357. modifyJS('fire(){var', 'fire(){window.' + functionNames.beforeFiring + '(this.player);var');
  5358. //hook for fov mods
  5359. modifyJS(/\.fov\s*=\s*1\.25/g, '.fov = window.' + functionNames.fixCamera + '()');
  5360. modifyJS(/\.fov\s*\+\s*\(1\.25/g, '.fov + (window.' + functionNames.fixCamera + '()');
  5361. //chat mods: disable chat culling
  5362. const chatCull = /return\}[a-zA-Z$_]+\.length>4/.exec(js)[0];
  5363. modifyJS(chatCull, chatCull.originalReplace('4', `window.${functionNames.getChatLimit}()`));
  5364. //chat mods: disable filter (credit to A3+++ for this finding)
  5365. modifyJS(`!${f(H._filterFunction)}(${f(H._insideFilterFunction)})`, `((!${f(H._filterFunction)}(${f(H._insideFilterFunction)}))||window.${functionNames.getDisableChatFilter}())`);
  5366. //chat mods: make filtered text red
  5367. let [_, elm, str] = js.match(/\)\),([a-zA-Z$_]+)\.innerHTML=([a-zA-Z$_]+),/);
  5368. modifyJS(_, _ + `${f(H._filterFunction)}(${str})&&window.${functionNames.getDisableChatFilter}()&&!arguments[3]&&(${elm}.style.color="red"),`);
  5369. //skins
  5370. match = js.match(/inventory\[[a-zA-Z$_]+\].id===[a-zA-Z$_]+.id\)return!0;return!1/);
  5371. if (match) { modifyJS(match[0], match[0] + `||window.${functionNames.getSkinHack}()`) };
  5372. //reset join/leave msgs
  5373. modifyJS(',console.log("joinGame()', ',window.' + functionNames.setNewGame + '(),console.log("value changed, also joinGame()');
  5374. //bypass chat filter
  5375. modifyJS('value.trim();', 'value.trim();' + f(H._chat) + '=window.' + functionNames.modifyChat + '(' + f(H._chat) + ');')
  5376. //hook for control interception
  5377. match = new RegExp(`\\.prototype\\.${f(H._update)}=function\\([a-zA-Z$_,]+\\)\\{`).exec(js)[0];
  5378. log("player update function:", match);
  5379. modifyJS(match, `${match}${f(H.CONTROLKEYS)}=window.${functionNames.modifyControls}(${f(H.CONTROLKEYS)});`);
  5380. //admin spoof lol
  5381. modifyJS('isGameOwner(){return ', 'isGameOwner(){return window.' + functionNames.getAdminSpoof + '()?true:')
  5382. modifyJS('adminRoles(){return ', 'adminRoles(){return window.' + functionNames.getAdminSpoof + '()?255:')
  5383. //grab reason for connect fail
  5384. const FUNCTIONPARAM = new RegExp('function ' + f(H._connectFail) + '\\(([a-zA-Z$_]+)\\)').exec(js)[1];
  5385. log("FUNCTIONPARAM:", FUNCTIONPARAM);
  5386. modifyJS('function ' + f(H._connectFail) + '(' + f(FUNCTIONPARAM) + '){', 'function ' + f(H._connectFail) + '(' + f(FUNCTIONPARAM) + '){window.' + functionNames.onConnectFail + '(' + f(FUNCTIONPARAM) + ',' + f(H.ERRORARRAY) + ');')
  5387. //get rid of tutorial popup because its a stupid piece of shit
  5388. modifyJS(',vueApp.onTutorialPopupClick()', '');
  5389. //annoying shit
  5390. modifyJS('alert', 'console.log');
  5391. //pointer escape
  5392. modifyJS('onpointerlockchange=function(){', 'onpointerlockchange=function(){if (window.' + functionNames.getPointerEscape + '(arguments)) {return};');
  5393. //death hook
  5394. const DEATHARGS = new RegExp('function ' + f(H._deathFunction) + '\\(([a-zA-Z$_]+,[a-zA-Z$_]+)\\)').exec(js)[1];
  5395. log("DEATHARGS", DEATHARGS);
  5396. modifyJS('function ' + f(H._deathFunction) + '(' + DEATHARGS + '){', 'function ' + f(H._deathFunction) + '(' + f(DEATHARGS) + '){window.' + functionNames.interceptDeath + '(' + f(DEATHARGS) + ');');
  5397. //vip spoof/no ads credit absolutely goes to OakSwingZZZ
  5398. modifyJS('adsBlocked=' + FUNCTIONPARAM, 'adsBlocked=' + functionNames.adBlocker + '("adsBlocked")');
  5399. modifyJS('"user-has-adblock"', functionNames.adBlocker + '("user-has-adblock")');
  5400. modifyJS('layed=!1', 'layed=window.' + functionNames.adBlocker + '(!1)');
  5401. modifyJS('showAdBlockerVideo', 'hideAdBlockerVideo'); //hello eggs bullshit
  5402. modifyJS(H.USERDATA + '.playerAccount.isUpgraded()', functionNames.adBlocker + '(' + f(H.USERDATA) + '.playerAccount.isUpgraded())');
  5403. //respawn time stuff
  5404. modifyJS('5:10', functionNames.quickRespawn + '(5):' + functionNames.adBlocker + '(10)');
  5405. modifyJS(',3e3),console.log', `,window.${functionNames.quickRespawn}(3e3)),console.log`);
  5406. // modifyJS(H.respawnTime+'=Math.max',H.respawnTime+'=Math.min');
  5407. //Modifies matchmaker JS to block gamecodes.
  5408. match = js.match(/region,([a-zA-Z$_]+)\(([a-zA-Z$_]+)/); //im so sorry i thought i was slick
  5409. if (match) {
  5410. modifyJS('region,', `region,window.${functionNames.gameBlacklisted}(${match[2]})?(${match[2]}.uuid="${getScrambled()}",${match[1]}(${match[2]}),vueApp.hideSpinner()):`);
  5411. };
  5412. //intercept and replace audio
  5413. match = js.match(/static play\(([a-zA-Z$_,]+)\){/);
  5414. log("AUDIO INTERCEPTION", match);
  5415. modifyJS(match[0], `${match[0]}[${match[1]}] = window.${functionNames.interceptAudio}(${match[1]});`);
  5416. modifyJS('"IFRAME"==document.activeElement.tagName', `("IFRAME"==document.activeElement.tagName&&document.activeElement.id!=='sfChat-iframe')`);
  5417. // skybox (yay)
  5418. modifyJS(`infiniteDistance=!0;`, `infiniteDistance=!0;window["${skyboxName}"]=${H.skybox};`);
  5419. modifyJS(`.name)}vueApp`, `.name)}window["${mapData}"]=${H.mapData};vueApp`);
  5420. //intercept player names before they are censored
  5421. modifyJS(`:{}};if(${H.playerData}.`, `:{}};window.${functionNames.realPlayerData}(${H.playerData});if(${H.playerData}.`);
  5422. //intercept player names before they are censored
  5423. modifyJS(`"transparent")},`, `"transparent");window.${functionNames.interceptDrawTextOnNameTexture}(${H.nameTexture}, arguments, this.${H.player_})},`);
  5424. //intercept signedIn function
  5425. modifyJS(`if(this.isAnonymous`, `window.${functionNames.interceptSignedIn}(arguments);if(this.isAnonymous`);
  5426. modifyJS(`="SPACE",`,`="SPACE",window.${functionNames.shouldInputSpace}()&&`)
  5427. modifyJS(/tp-/g, '');
  5428. modifyJS(`window.location.href="https://free`, `let ballsack="https://free`);
  5429. //intercept updateParticles for particle speed control
  5430. //deobf is: updateParticles(manager, delta)
  5431. match = js.match(/function [a-zA-Z$_]+\([a-zA-Z$_]+,[a-zA-Z$_]+\)\{for\(var [a-zA-Z$_]+=0;[a-zA-Z$_]+<[a-zA-Z$_]+\.sprites/); //this should only give one match.
  5432. const splitted = match[0].split("{"); //split right bevor function opens to inject delta manipulator. Might not be the best way but it works fine.
  5433. const delta = splitted[0].charAt(splitted[0].length - 2); //name of the delta argument.
  5434. modifyJS(match[0], splitted[0] + "{" //add curly bracket because the split removed it. ehhhhhh
  5435. +`${delta}=${delta}*window.${functionNames.getParticleSpeedMultiplier}();` //get mutiplier value for delta.
  5436. +splitted[1]
  5437. )
  5438. log(H);
  5439. log(js);
  5440. attemptedInjection = true;
  5441. return js;
  5442. } catch (error) {
  5443. log(error);
  5444. change("vardataType", 0);
  5445. alert("Bollocks! If you're getting this message, injection probably failed. To solve this, perform CTRL+F5 - this performs a hard reload. Check your VarData too! If this does not work, contact the developers.");
  5446. createPopup("Reloading page in 5 seconds...");
  5447. setTimeout(() => {
  5448. reloadPage();
  5449. }, 5000);
  5450. };
  5451. };
  5452. };
  5453.  
  5454. JSON.safeStringify = (obj, indent = 2) => {
  5455. let cache = [];
  5456. const retVal = JSON.stringify(
  5457. obj,
  5458. (key, value) =>
  5459. typeof value === "object" && value !== null
  5460. ? cache.includes(value)
  5461. ? undefined // Duplicate reference found, discard key
  5462. : cache.push(value) && value // Store value in our collection
  5463. : value,
  5464. indent
  5465. );
  5466. cache = null;
  5467. return retVal;
  5468. };
  5469.  
  5470. const deployBots = async () => {
  5471. updateBotParams();
  5472. if (!load("firstTimeBots")) {
  5473. save("firstTimeBots", true);
  5474. GM_openInTab(bottingGuideURL, { active: true });
  5475. };
  5476.  
  5477. GM_setValue("StateFarm_BotStatus", {});
  5478.  
  5479. log("Deploying " + extract("numberBots") + " bots...");
  5480.  
  5481. let botNames = [];
  5482. for (let i = 0; i < extract("numberBots"); i++) {
  5483. let name = (extract("botUsername"));
  5484. if (extract("botCopyName")) {
  5485. name = retrieveCopiedName();
  5486. if (!name) {
  5487. alert("StateFarm: Cannot copy names if you haven't been in a game!");
  5488. return;
  5489. };
  5490. };
  5491. botNames.push(name);
  5492. };
  5493.  
  5494. let canMassBot = undefined;
  5495.  
  5496. for (let i = 0; i < extract("numberBots"); i++) {
  5497. let leftOffset = ((i % 15) * 100);
  5498. // let topOffset=((i%3)*100);
  5499. let topOffset = 0;
  5500. let proxyURL = extract("proxyBots") == "static" ? window.location.host : proxyList[proxyListIndex] ;
  5501. proxyListIndex = (proxyListIndex + 1) % proxyList.length;
  5502. let params = "?AUTOMATED=true&StateFarm=";
  5503. let name = botNames[i];
  5504. if (extract("botAntiDupe")) { name = name + String.fromCharCode(97 + Math.floor(Math.random() * 26)) };
  5505.  
  5506. const addParam = function (module, setTo, noEnding) { params = params + module + ">" + JSON.stringify(setTo) + (noEnding ? "" : "<") };
  5507.  
  5508. addParam("eggColor", extract("eggColorBots") == "random" ? randomInt(1, 7) : extractAsDropdownInt("eggColorBots"));
  5509. addParam("autoStamp", extract("autoStampBots") == "random" ? randomInt(0, 6) : extractAsDropdownInt("autoStampBots"));
  5510. addParam("autoHat", extract("autoHatBots") == "random" ? randomInt(0, 6) : extractAsDropdownInt("autoHatBots"));
  5511.  
  5512. addParam("usernameAutoJoin", name, true);
  5513.  
  5514. log("PARAMS:", params)
  5515. if (typeof isCrackedShell === 'undefined') {
  5516. unsafeWindow.open("https://" + proxyURL + "/" + params, '_blank', `width=${extract("botWindowWidth")}},height=${extract("botWindowHeight")},left=` + leftOffset + ',top=' + topOffset)
  5517. } else {
  5518. try {
  5519. if (canMassBot === undefined) {
  5520. let data = await fetch(`https://${getScrambled().replace([0-9], '')}.${location.host}/mod/data`);
  5521. data = await data.json();
  5522. if (!data.success) {
  5523. alert('You are not on verson of CrackedShell that supports botting.');
  5524. canMassBot = false;
  5525. return;
  5526. } else canMassBot = true;
  5527. };
  5528. } catch (err) {
  5529. log(err);
  5530. canMassBot = false;
  5531. alert('You are not on verson of CrackedShell that supports botting.');
  5532. };
  5533.  
  5534. if (canMassBot === true)
  5535. unsafeWindow.open(`https://${getScrambled().replace([0-9], '')}.${location.host}/${params}&cs=${new URLSearchParams(new URL(location.href).searchParams).get('cs')}`, '_blank', `width=${extract("botWindowWidth")}},height=${extract("botWindowHeight")},left=` + leftOffset + ',top=' + topOffset);
  5536. };
  5537. };
  5538. };
  5539.  
  5540. const constructBotParams = function () {
  5541. const addParam = function (module, setTo, noEnding) { params = params + module + ">" + JSON.stringify(setTo) + (noEnding ? "" : "<") };
  5542. let params = "";
  5543.  
  5544. addParam("autoFireType", 1); //while visible
  5545. addParam("adBlock", true);
  5546.  
  5547. //blacklist stuff
  5548. addParam("blacklist", botBlacklist);
  5549. addParam("enableBlacklistAimbot", true);
  5550. //whitelist stuff
  5551. addParam("whitelist", botWhitelist);
  5552. addParam("enableWhitelistAimbot", true);
  5553. addParam("enableWhenNoneVisible", true);
  5554. //do aimbot
  5555. addParam("aimbotTargetMode", 1);
  5556. addParam("aimbotVisibilityMode", 1);
  5557. addParam("prediction", extract("botAimbot"));
  5558. addParam("aimbot", extract("botAimbot"));
  5559. addParam("antiBloom", extract("botAimbot"));
  5560. addParam("grenadeMax", extract("botAimbot"));
  5561. addParam("autoRefill", extract("botAimbot"));
  5562. addParam("autoFireAccuracy", extract("botAccuracy"));
  5563. //do shoot
  5564. addParam("antiSneak", extract("botAutoShoot") ? 1.4 : 0);
  5565. addParam("enableAutoFire", extract("botAutoShoot"));
  5566. addParam("autoGrenade", extract("botAutoShoot"));
  5567. //automove
  5568. addParam("autoWalk", extract("botAutoMove"));
  5569. addParam("autoStrafe", extract("botAutoMove"));
  5570. addParam("autoJump", extract("botAutoMove"));
  5571. addParam("autoJumpDelay", 1500);
  5572. //low res
  5573. addParam("enableTextures", !extract("botLowRes"));
  5574. addParam("setDetail", extract("botLowRes") ? 2 : 0);
  5575. //seizure
  5576. addParam("enableSeizureX", extract("botSeizure"));
  5577. addParam("enableSeizureY", extract("botSeizure"));
  5578.  
  5579. addParam("renderDelay", extract("renderDelayBots"));
  5580. addParam("muteGame", extract("botMuteGame"));
  5581. addParam("autoJoin", extract("botAutoJoin"));
  5582. addParam("mockMode", extract("botMock"));
  5583. addParam("autoRespawn", extract("botRespawn"));
  5584. addParam("autoEZ", extract("botAutoEZ"));
  5585. addParam("cheatAccuse", extract("botCheatAccuse"));
  5586. addParam("joinCode", extract("botJoinCode"));
  5587. addParam("autoWeapon", extractAsDropdownInt("botWeapon") + 1);
  5588. addParam("autoTeam", extractAsDropdownInt("botTeam"));
  5589. addParam("autoUnban", extract("botAutoUnban"));
  5590. addParam("autoLogin", extractAsDropdownInt("botAutoLogin"));
  5591. addParam("loginDatabaseSelection", 1);
  5592. addParam("autoRegion", extractAsDropdownInt("autoRegionBots"));
  5593. addParam("autoGamemode", extractAsDropdownInt("autoGamemodeBots"));
  5594. addParam("useCustomName", extract("useCustomNameBots"));
  5595. addParam("autoMacro", extract("useBotMacro"));
  5596. addParam("customMacro", extract("botMacro").replaceAll(">","{greater}").replaceAll("<","{less}"));
  5597. addParam("leaveEmpty", extract("leaveEmptyBots"));
  5598. addParam("autoLeave", extract("autoLeaveBots"));
  5599. addParam("autoLeaveDelay", extract("autoLeaveDelayBots"));
  5600. addParam("spamChat", extract("botSpam"));
  5601. addParam("spamChatText", extract("spamChatTextBot"));
  5602. addParam("tallChat", extract("botTallChat"), true);
  5603.  
  5604. return params;
  5605. };
  5606.  
  5607. const detectURLParams = function () {
  5608.  
  5609. if (getSearchParam("AUTOMATED") == "true") {
  5610. log("Automated Window!");
  5611. AUTOMATED = true;
  5612. };
  5613. let customSettings = getSearchParam("StateFarm")
  5614. if (customSettings !== null) {
  5615. customSettings = customSettings.split("|");
  5616. URLParams = customSettings[0];
  5617. log("StateFarm: Custom Settings in URL!", URLParams);
  5618. // let setVars=[];
  5619. // let setBinds=[];
  5620. // if (customSettings[0]) {setVars=customSettings[0].split("<")};
  5621. // if (customSettings[1]) {setVars=customSettings[0].split("<")};
  5622. // log(setVars,setBinds);
  5623. // setBinds.forEach(element=>{ //not yet done
  5624. // });
  5625. };
  5626. };
  5627.  
  5628. const applySettings = function (receivedConfig, reset, secondPassThru) {
  5629. log(AUTOMATED, receivedConfig);
  5630. let settings = receivedConfig.split("<");
  5631. if (reset) { initMenu(true); log("StateFarm: clearing before applying settings") };
  5632. settings.forEach(element => {
  5633. element = element.split(">");
  5634. if (element[0] == "customMacro") {element[1] = element[1].replaceAll("{less}","<").replaceAll("{greater}",">")};
  5635. try {
  5636. change(element[0], JSON.parse(element[1]));
  5637. } catch (error) {
  5638. log("fuck that was an error", element[0], error);
  5639. };
  5640. });
  5641. createPopup("Custom StateFarm Settings Applying...");
  5642. if (!secondPassThru) {
  5643. setTimeout(() => {
  5644. if (receivedConfig) {
  5645. applySettings(receivedConfig, false, true);
  5646. };
  5647. }, 150);
  5648. };
  5649. };
  5650.  
  5651. const updateBotParams = function () {
  5652. if (AUTOMATED) { // nuh uh.
  5653. createPopup("Automated window cannot config bots.", "error");
  5654. } else {
  5655. const botParams = constructBotParams();
  5656. broadcastToBots("setconfig " + btoa(unsafeWindow.unescape(encodeURIComponent(botParams))));
  5657. log("StateFarm: attempted to set bot params.");
  5658. };
  5659. };
  5660.  
  5661. const retrieveCopiedName = function () {
  5662. const playerSlots = document.querySelectorAll('.playerSlot--name');
  5663. const mapNames = Array.from(playerSlots).map(playerSlot => playerSlot.textContent.trim());
  5664. return mapNames[Math.floor(Math.random() * mapNames.length)];
  5665. };
  5666.  
  5667. loggedGameMap = false;
  5668.  
  5669. // begin pathfinding
  5670.  
  5671. const BinaryHeap = function(scoreFunction) {
  5672. this.content = [];
  5673. this.scoreFunction = scoreFunction;
  5674. };
  5675.  
  5676. BinaryHeap.prototype = {
  5677. push: function (element) {
  5678. // Add the new element to the end of the array.
  5679. this.content.push(element);
  5680. // Allow it to bubble up.
  5681. this.bubbleUp(this.content.length - 1);
  5682. },
  5683.  
  5684. rescoreElement: function (node) {
  5685. this.sinkDown(this.content.indexOf(node));
  5686. },
  5687.  
  5688. pop: function () {
  5689. // Store the first element so we can return it later.
  5690. var result = this.content[0];
  5691. // Get the element at the end of the array.
  5692. var end = this.content.pop();
  5693. // If there are any elements left, put the end element at the
  5694. // start, and let it sink down.
  5695. if (this.content.length > 0) {
  5696. this.content[0] = end;
  5697. this.sinkDown(0);
  5698. }
  5699. return result;
  5700. },
  5701.  
  5702. remove: function (node) {
  5703. var length = this.content.length;
  5704. // To remove a value, we must search through the array to find
  5705. // it.
  5706. for (var i = 0; i < length; i++) {
  5707. if (this.content[i] != node) continue;
  5708. // When it is found, the process seen in 'pop' is repeated
  5709. // to fill up the hole.
  5710. var end = this.content.pop();
  5711. // If the element we popped was the one we needed to remove,
  5712. // we're done.
  5713. if (i == length - 1) break;
  5714. // Otherwise, we replace the removed element with the popped
  5715. // one, and allow it to float up or sink down as appropriate.
  5716. this.content[i] = end;
  5717. this.bubbleUp(i);
  5718. this.sinkDown(i);
  5719. break;
  5720. }
  5721. },
  5722.  
  5723. size: function () {
  5724. return this.content.length;
  5725. },
  5726.  
  5727. bubbleUp: function (n) {
  5728. // Fetch the element that has to be moved.
  5729. var element = this.content[n], score = this.scoreFunction(element);
  5730. // When at 0, an element can not go up any further.
  5731. while (n > 0) {
  5732. // Compute the parent element's index, and fetch it.
  5733. var parentN = Math.floor((n + 1) / 2) - 1,
  5734. parent = this.content[parentN];
  5735. // If the parent has a lesser score, things are in order and we
  5736. // are done.
  5737. if (score >= this.scoreFunction(parent)) break;
  5738.  
  5739. // Otherwise, swap the parent with the current element and
  5740. // continue.
  5741. this.content[parentN] = element;
  5742. this.content[n] = parent;
  5743. n = parentN;
  5744. }
  5745. },
  5746.  
  5747. includes: function (n) {
  5748. return this.content.includes(n);
  5749. },
  5750.  
  5751. sinkDown: function (n) {
  5752. // Look up the target element and its score.
  5753. var length = this.content.length,
  5754. element = this.content[n],
  5755. elemScore = this.scoreFunction(element);
  5756.  
  5757. while (true) {
  5758. // Compute the indices of the child elements.
  5759. var child2N = (n + 1) * 2, child1N = child2N - 1;
  5760. // This is used to store the new position of the element,
  5761. // if any.
  5762. var swap = null;
  5763. // If the first child exists (is inside the array)...
  5764. if (child1N < length) {
  5765. // Look it up and compute its score.
  5766. var child1 = this.content[child1N],
  5767. child1Score = this.scoreFunction(child1);
  5768. // If the score is less than our element's, we need to swap.
  5769. if (child1Score < elemScore) swap = child1N;
  5770. }
  5771. // Do the same checks for the other child.
  5772. if (child2N < length) {
  5773. var child2 = this.content[child2N],
  5774. child2Score = this.scoreFunction(child2);
  5775. if (child2Score < (swap == null ? elemScore : child1Score)) swap = child2N;
  5776. }
  5777.  
  5778. // No need to swap further, we are done.
  5779. if (swap == null) break;
  5780.  
  5781. // Otherwise, swap and continue.
  5782. this.content[n] = this.content[swap];
  5783. this.content[swap] = element;
  5784. n = swap;
  5785. };
  5786. }
  5787. };
  5788.  
  5789. const isNodeAir = function(item) {
  5790. return item.mesh === undefined
  5791. };
  5792.  
  5793. const canTravelThroughNode = function(item) {
  5794. return isNodeAir(item) || item.mesh.name.includes("none")
  5795. };
  5796.  
  5797. class Position {
  5798. constructor(x, y, z) {
  5799. this.x = x;
  5800. this.y = y;
  5801. this.z = z;
  5802. }
  5803. }
  5804.  
  5805. var GLOBAL_NODE_LIST = [];
  5806.  
  5807. class MapNode {
  5808. constructor(position, linked, map) {
  5809. this.position = position;
  5810. this.linked = linked;
  5811. GLOBAL_NODE_LIST.push(this);
  5812. this.add_children_from_map_data(map);
  5813. this.f = undefined;
  5814. this.g = undefined;
  5815. this.h = undefined;
  5816. }
  5817. add_link(node) {
  5818. this.linked.push(node);
  5819. }
  5820. remove_link(node) {
  5821. this.linked = this.linked.filter(item => item !== node);
  5822. }
  5823. can_move(node) {
  5824. return this.linked.includes(node);
  5825. }
  5826. add_children_from_map_data(map_data) {
  5827. // for each thing around us in a 3x3x3 cube, add a link if it's air and it's not above us
  5828. let found_node = 0; let found_link = 0
  5829. for (var x = -1; x <= 1; x++) {
  5830. for (var y = -1; y <= 0; y++) {
  5831. for (var z = -1; z <= 1; z++) {
  5832. if (x == 0 && y == 0 && z == 0) {
  5833. continue;
  5834. };
  5835. if (Math.abs(x) + Math.abs(y) + Math.abs(z) > 1) {
  5836. continue;
  5837. };
  5838. var map_data_x = this.position.x + x;
  5839. var map_data_y = this.position.y + y;
  5840. var map_data_z = this.position.z + z;
  5841. if (map_data_x < 0 || map_data_y < 0 || map_data_z < 0) {
  5842. continue;
  5843.  
  5844. };
  5845. if (map_data_x >= map_data.length || map_data_y >= map_data[0].length || map_data_z >= map_data[0][0].length) {
  5846. continue;
  5847. };
  5848.  
  5849. var attemptedNode = map_data[map_data_x][map_data_y][map_data_z];
  5850.  
  5851. if (!canTravelThroughNode(attemptedNode)) {
  5852. ;continue;
  5853. }
  5854.  
  5855. /* for the tested node:
  5856. continue if:
  5857. can't travel through it
  5858. a nonsolid is directly below it
  5859. */
  5860.  
  5861. try {
  5862. var node_below_checked_node = map_data[map_data_x][map_data_y - 1][map_data_z];
  5863. } catch (error) {
  5864. log(error)
  5865. continue;
  5866. };
  5867.  
  5868. var is_air_directly_below = isNodeAir(node_below_checked_node); // self explanatory
  5869. var is_solid_directly_below = !is_air_directly_below ? node_below_checked_node.mesh.name.includes("full") : false;
  5870. var is_partial_directly_below = !is_air_directly_below && !is_solid_directly_below
  5871.  
  5872. var node_directly_below_node_doing_the_checking;
  5873.  
  5874. try {
  5875. node_directly_below_node_doing_the_checking = map_data[this.position.x][this.position.y - 1][this.position.z];
  5876. } catch (error) {
  5877. log(error);
  5878. node_directly_below_node_doing_the_checking = {};
  5879. };
  5880.  
  5881. var is_solid_directly_below_node_doing_checking = !isNodeAir(node_directly_below_node_doing_the_checking) && node_directly_below_node_doing_the_checking.mesh.name.includes("full");
  5882.  
  5883. var is_valid_candidate = (
  5884. is_solid_directly_below ||
  5885. y == -1 && !is_partial_directly_below ||
  5886. (is_air_directly_below || is_solid_directly_below) && is_solid_directly_below_node_doing_checking
  5887. // TODO: when falling long distances this can cause it to crash
  5888. // ideally if there's a partial below it prunes back to the start of the fall
  5889. // that's hard
  5890. // i just want this to work
  5891. );
  5892.  
  5893. if (y == -1 && !is_partial_directly_below) {
  5894. // log('weird case, looking downwards to x/y/z from x/y/z', map_data_x, map_data_y, map_data_z, this.position.x, this.position.y, this.position.z, 'is air directly below?', is_air_directly_below, 'is solid directly below?', is_solid_directly_below, 'is partial directly below?', is_partial_directly_below, 'is valid candidate?', is_valid_candidate)
  5895. //shit lags, lol
  5896. };
  5897.  
  5898. // if the node is already in the list, add a link to it. Otherwise create it and then add a link to it.
  5899. // if it's air / equivalent to air we can create it (but not necessarily link to it)
  5900. if (GLOBAL_NODE_LIST.some(item => item.position.x == map_data_x && item.position.y == map_data_y && item.position.z == map_data_z)) { // eslint-disable-line
  5901. // ^^ this node already exists, link to it
  5902. if (is_valid_candidate) {
  5903. found_link++;
  5904. this.add_link(GLOBAL_NODE_LIST.find(item => item.position.x == map_data_x && item.position.y == map_data_y && item.position.z == map_data_z)); // eslint-disable-line
  5905. }
  5906.  
  5907. } else {
  5908.  
  5909. found_node++;
  5910.  
  5911. var new_node = new MapNode(new Position(map_data_x, map_data_y, map_data_z), [], map_data);
  5912. // the new node doesn't exist yet
  5913. // we create it
  5914. // if it's possible to move to we add the link
  5915.  
  5916. if (is_valid_candidate) {
  5917. found_link++;
  5918. this.add_link(new_node);
  5919.  
  5920. };
  5921. };
  5922. };
  5923. };
  5924. };
  5925. // log("done with recursive for node at x/y/z", this.position.x, this.position.y, this.position.z, "found", found_node, "new nodes and", found_link, "links, this is the nth node created", GLOBAL_NODE_LIST.length)
  5926. //shit lags, lol
  5927. }
  5928. };
  5929.  
  5930. const get_node_at = function(position) {
  5931. return GLOBAL_NODE_LIST.find(item => item.position.x == position.x && item.position.y == position.y && item.position.z == position.z);
  5932. };
  5933.  
  5934. const get_player_position = function(player) {
  5935. var x = Math.floor(player[H.actor][H.mesh].position.x);
  5936. var y = Math.floor(player[H.actor][H.mesh].position.y);
  5937. var z = Math.floor(player[H.actor][H.mesh].position.z);
  5938. return new Position(x, y, z);
  5939. }
  5940.  
  5941. const get_player_linked_nodes = function(player) {
  5942. var position = get_player_position(player);
  5943. var node = get_node_at(position);
  5944. if (node) {
  5945. return node.linked;
  5946. } else {
  5947. return [];
  5948. };
  5949. };
  5950.  
  5951. var map_data_created = false;
  5952.  
  5953. // kazowie
  5954.  
  5955. const TaxicabDist3D = function(pos1, pos2) {
  5956. return Math.abs(pos1.x - pos2.x) + Math.abs(pos1.y - pos2.y) + Math.abs(pos1.z - pos2.z);
  5957. };
  5958.  
  5959. const pathTo = function(node) {
  5960. var current = node;
  5961. var path = [];
  5962. while (current.parent) {
  5963. path.unshift(current);
  5964. if (current.parent === undefined) { log("parent undefined; path nodes successfully acquired:", path.length) }
  5965. current = current.parent;
  5966. }
  5967. //log("done")
  5968. return path;
  5969. };
  5970.  
  5971. const getHeap = function() {
  5972. return new BinaryHeap(function (node) {
  5973. return node.f;
  5974. });
  5975. };
  5976.  
  5977. const cleanList = function(items) {
  5978. for (var i = 0; i < items.length; i++) {
  5979. var item = items[i];
  5980. item.f = undefined;
  5981. item.g = undefined;
  5982. item.h = undefined;
  5983. item.closed = undefined;
  5984. item.parent = undefined;
  5985. item.visited = undefined;
  5986. };
  5987. };
  5988.  
  5989. const AStar = function(start, goal) {
  5990. log("astar called")
  5991. cleanList(GLOBAL_NODE_LIST)
  5992. // start and goal are map nodes
  5993. // map data is the list of all the nodes
  5994. // each node has a .linked indicating which nodes can be traveled to from it
  5995. // returns a list of nodes to travel through, ordered from start to goal
  5996. // if no path is found, returns null
  5997.  
  5998. var closed_set = [];
  5999.  
  6000.  
  6001. var heuristic = TaxicabDist3D;
  6002. var open_heap = getHeap();
  6003.  
  6004. start.h = heuristic(start.position, goal.position);
  6005. start.g = 0;
  6006. start.f = start.g + start.h;
  6007.  
  6008. open_heap.push(start);
  6009.  
  6010.  
  6011. while (open_heap.size() != 0) {
  6012. var current = open_heap.pop();
  6013.  
  6014. if (current === goal) {
  6015. log("done with astar - path found")
  6016. var val = pathTo(current);
  6017. log("path length:", val.length)
  6018. print_node_list(val);
  6019. return val;
  6020. }
  6021.  
  6022. closed_set.push(current);
  6023.  
  6024. var neighbors = current.linked;
  6025.  
  6026. for (var i = 0; i < neighbors.length; i++) {
  6027. var neighbor = neighbors[i];
  6028.  
  6029. if (closed_set.includes(neighbor)) {
  6030. continue;
  6031. }
  6032.  
  6033. var tentative_g_score = current.g + 1;
  6034. var visited = neighbor.visited;
  6035. if (!visited || tentative_g_score < neighbor.g) {
  6036. neighbor.visited = true;
  6037. neighbor.parent = current;
  6038. neighbor.g = tentative_g_score;
  6039. neighbor.h = heuristic(neighbor.position, goal.position);
  6040. neighbor.f = neighbor.g + neighbor.h;
  6041. if (!visited) {
  6042. open_heap.push(neighbor);
  6043. } else {
  6044. open_heap.rescoreElement(neighbor);
  6045. };
  6046. };
  6047. };
  6048. };
  6049.  
  6050. log("done with astar - no path found")
  6051. // return null if no path has been found
  6052. return null
  6053. };
  6054.  
  6055. const print_node_list = function(list) {
  6056. var output = "";
  6057. log("printing node list, length:", list.length, "list:", list);
  6058. for (var i = 0; i < list.length; i++) {
  6059. output += list[i].position.x + ", " + list[i].position.y + ", " + list[i].position.z + "\n";
  6060. };
  6061. log(output);
  6062. };
  6063.  
  6064. const create_red_line_between_nodes = function(ss, node1, node2) {
  6065. // const tracerLines = L.BABYLON.MeshBuilder.CreateLines("tracerLines", { points: [newPosition, crosshairsPosition] }, newScene);
  6066. let pos1 = [node1.position.x - 0.5, node1.position.y - 0.5, node1.position.z - 0.5];
  6067. let pos2 = [node2.position.x - 0.5, node2.position.y - 0.5, node2.position.z - 0.5];
  6068. if (window.pathLines === undefined) {
  6069. let node_lines = L.BABYLON.MeshBuilder.CreateLines(new Date().getTime().toString(), { points: [ss.MYPLAYER[H.actor][H.mesh].position, pos2] }, ss.MYPLAYER[H.actor].scene);
  6070. node_lines.color = new L.BABYLON.Color3(1, 0, 0);
  6071. node_lines.renderingGroupId = 1;
  6072. window.pathLines = [node_lines];
  6073. } else {
  6074. let node_lines = L.BABYLON.MeshBuilder.CreateLines(new Date().getTime().toString(), { points: [ss.MYPLAYER[H.actor][H.mesh].position, pos2] }, ss.MYPLAYER[H.actor].scene);
  6075. node_lines.color = new L.BABYLON.Color3(1, 0, 0);
  6076. node_lines.renderingGroupId = 1;
  6077. window.pathLines.push(node_lines);
  6078. };
  6079. };
  6080.  
  6081. const create_pathfinding_lines = function(ss, path) {
  6082. for (var i = 0; i < path.length - 1; i++) {
  6083. create_red_line_between_nodes(ss, path[i], path[i + 1]);
  6084. };
  6085. };
  6086.  
  6087. // end pathfinding
  6088.  
  6089. const findKeyWithProperty = function (obj, propertyToFind) {
  6090. for (const key in obj) {
  6091. if (obj[key] === null || obj[key] === undefined) {
  6092. continue;
  6093. };
  6094. if (!!obj[key] && (typeof (obj[key]) == 'object' || typeof (obj[key]) == 'function') && obj[key].hasOwnProperty(propertyToFind)) {
  6095. return key;
  6096. };
  6097. };
  6098. // Property not found
  6099. return null;
  6100. };
  6101.  
  6102. const findStringInLists = function (dictWithLists, str) {
  6103. for (const key in dictWithLists) {
  6104. if (dictWithLists.hasOwnProperty(key)) {
  6105. const list = dictWithLists[key];
  6106. if (list.includes(str)) {
  6107. return key; // Return the key where the string is found
  6108. };
  6109. };
  6110. };
  6111. return null; // Return null if the string is not found in any list
  6112. };
  6113.  
  6114. const mainLoop = function () {
  6115. const oneTime = function () {
  6116. //xd lmao
  6117. if (ss.MYPLAYER) {
  6118. log('%cSTATEFARM IS ATTEMPTING TO LOAD L.BABYLON', 'color: yellow; font-weight: bold; font-size: 1.2em; text-decoration: underline;');
  6119. var script = document.createElement("script");
  6120. script.src = babylonURL;
  6121. script.onload = function () {
  6122. if (unsafeWindow.BABYLON) {
  6123. L.BABYLON = unsafeWindow.BABYLON;
  6124. delete unsafeWindow.BABYLON;
  6125.  
  6126. log("Babylon.js loaded successfully");
  6127. log(L.BABYLON.Engine.Version);
  6128.  
  6129. log('%cSTATEFARM SUCCESSFULLY LOADED BABYLON!', 'color: green; font-weight: bold; font-size: 1.2em; text-decoration: underline;');
  6130.  
  6131. H.actor = findKeyWithProperty(ss.MYPLAYER, H.mesh);
  6132. // Math.capVector3 = Math[H.capVector3];
  6133.  
  6134. log("StateFarm: found vars:", H);
  6135.  
  6136. crosshairsPosition = new L.BABYLON.Vector3();
  6137. Object.defineProperty(ss.MYPLAYER.scene, 'forceWireframe', {
  6138. get: () => {
  6139. return extract("wireframe");
  6140. }
  6141. });
  6142.  
  6143. if (AUTOMATED) {
  6144. automatedBorder.style.borderColor = 'rgba(0, 0, 255, 1)';
  6145. };
  6146.  
  6147. } else {
  6148. log('%cSTATEFARM COULD NOT LOAD L.BABYLON', 'color: red; font-weight: bold; font-size: 1.2em; text-decoration: underline;');
  6149. };
  6150. };
  6151. document.body.appendChild(script);
  6152. ranOneTime = true;
  6153. };
  6154. };
  6155.  
  6156. const createMapData = function () {
  6157. if (!map_data_created) {
  6158. log("Creating map data");
  6159. new MapNode(new Position(ss.GAMEMAP.data.length - 1, ss.GAMEMAP.data[0].length - 1, ss.GAMEMAP.data[0][0].length - 1), [], ss.GAMEMAP.data);
  6160. map_data_created = true;
  6161. return true;
  6162. }
  6163. }
  6164.  
  6165. const mapStuff = function () {
  6166.  
  6167. //log("node = " + get_node_at(get_player_position(ss.MYPLAYER)), "nodelist len = " + GLOBAL_NODE_LIST.length);
  6168.  
  6169. if (findNewPath && !activePath && !activeNodeTarget && get_node_at(get_player_position(ss.MYPLAYER))) {
  6170.  
  6171. let player_pos = get_player_position(ss.MYPLAYER);
  6172. let player_node = get_node_at(player_pos);
  6173. if (player_node) {
  6174. let position = {
  6175. x: player_pos.x + Math.floor(Math.random() * 5) - 1,
  6176. y: player_pos.y,
  6177. z: player_pos.z + Math.floor(Math.random() * 5) - 1
  6178. }
  6179. // check if node at position exists
  6180. let random_node = get_node_at(position);
  6181.  
  6182. if (!(player_node === random_node) && random_node) {
  6183. log("location, target:")
  6184. print_node_list([player_node, random_node])
  6185. activePath = AStar(player_node, random_node);
  6186. if (activePath) {
  6187. log("setting active node target");
  6188. print_node_list(activePath);
  6189. activeNodeTarget = activePath[0];
  6190. log("list printed, target set, creating pathfinding lines")
  6191. create_pathfinding_lines(ss, activePath);
  6192. findNewPath = false;
  6193. log("found path to random node")
  6194. } else {
  6195. log("unable to find path to random node")
  6196. }
  6197. } else {
  6198. log("player node / random node not air")
  6199. }
  6200. } else {
  6201. log("player not on air node currently")
  6202. }
  6203. }
  6204.  
  6205.  
  6206. if (pathfindingTargetOverride !== undefined) {
  6207. createMapData();
  6208. let player_node = get_node_at(get_player_position(ss.MYPLAYER));
  6209. let target_node = get_node_at(pathfindingTargetOverride);
  6210. if (player_node && target_node && !activePath) {
  6211. let path = AStar(player_node, target_node);
  6212.  
  6213. if (path) {
  6214. if (path.length > 0) {
  6215. activePath = path;
  6216. activeNodeTarget = path[0];
  6217. } else {
  6218. log('already at target')
  6219. activePath = null;
  6220. activeNodeTarget = null;
  6221. pathfindingTargetOverride = undefined;
  6222. }
  6223. } else {
  6224. if (despawnIfNoPath) {
  6225. sendChatMessage("despawnIfNoPath");
  6226. }
  6227. }
  6228. } else {
  6229. if (!activePath) {
  6230. if (player_node) {
  6231. log("playernode good")
  6232. }
  6233. if (target_node) {
  6234. log("targetnode good")
  6235. }
  6236. if (!player_node) {
  6237. log("playernode bad")
  6238. }
  6239. if (!target_node) {
  6240. log("targetnode bad")
  6241. }
  6242. }
  6243. }
  6244. }
  6245.  
  6246. if (activeNodeTarget && activePath) {
  6247. //log("found target and path");
  6248. let player_node = get_node_at(get_player_position(ss.MYPLAYER));
  6249. if (player_node == activeNodeTarget || activePath.includes(player_node)) { // if we are at the target or have somehow skipped ahead in the list
  6250. if (player_node == activeNodeTarget) {
  6251. activeNodeTarget = activePath.shift();
  6252. log("update target");
  6253. if (activePath.length == 0) {
  6254. log("path completed");
  6255. activePath = null;
  6256. activeNodeTarget = null;
  6257. pathfindingTargetOverride = undefined;
  6258. }
  6259. } else {
  6260. while (activePath.includes(player_node)) {
  6261. activeNodeTarget = activePath.shift();
  6262. }
  6263. if (activePath.length == 0) {
  6264. log("path completed");
  6265. activePath = null;
  6266. activeNodeTarget = null;
  6267. pathfindingTargetOverride = undefined;
  6268. }
  6269.  
  6270. }
  6271. } else {
  6272. //log("not at target");
  6273. }
  6274. /* if (!(activePath.includes(get_node_at(get_player_position(ss.MYPLAYER))))) { // went off path somehow, need to find new path
  6275. findNewPath = true;
  6276. activePath = null;
  6277. activeNodeTarget = null;
  6278. log("went off path, finding new path")
  6279. } */
  6280. }
  6281.  
  6282. if (activeNodeTarget) {
  6283. // look towards the node
  6284. if (isFirstFrameAttemptingToPathfind) {
  6285. /* let vec = new L.BABYLON.Vector3(0, 0, 1)
  6286. let calcYaw = calculateYaw(vec);
  6287. let calcPitch = calculatePitch(vec);
  6288. ss.MYPLAYER[H.yaw] = 0;
  6289. ss.MYPLAYER[H.pitch] = 0; */
  6290. isFirstFrameAttemptingToPathfind = false;
  6291.  
  6292. } else {
  6293. //log("looking towards node");
  6294.  
  6295. let playerPosition = get_player_position(ss.MYPLAYER);
  6296. let directionVector = new L.BABYLON.Vector3(activeNodeTarget.position.x - playerPosition.x, activeNodeTarget.position.y - playerPosition.y, activeNodeTarget.position.z - playerPosition.z);
  6297. /* log(`
  6298. --PATHING UPDATE--
  6299. target: ${activeNodeTarget.position.x}, ${activeNodeTarget.position.y}, ${activeNodeTarget.position.z}
  6300. current: ${playerPosition.x}, ${playerPosition.y}, ${playerPosition.z}
  6301. directionVector: ${directionVector.x}, ${directionVector.y}, ${directionVector.z}
  6302. calc yaw: ${calculateYaw(directionVector)}
  6303. targ -> current diff:
  6304. `) */
  6305. //shit lags, lol
  6306. ss.MYPLAYER[H.yaw] = calculateYaw(directionVector);
  6307. ss.MYPLAYER[H.pitch] = 0;
  6308. forceControlKeys = ss.CONTROLKEYSENUM.up;
  6309. }
  6310. };
  6311. };
  6312. const initVars = function () {
  6313.  
  6314. isBanned = false; //cant be banned if in a game /shrug
  6315. errorString = undefined; //no error if ur playing
  6316. forceControlKeys = undefined; //reset every frame
  6317.  
  6318. if (newGame) {
  6319. onlinePlayersArray = [];
  6320. };
  6321. if (extract("debug") && (typeof playerLogger === 'undefined')) {
  6322. playerLogger = [];
  6323. };
  6324. const weaponBox = document.getElementById("weaponBox");
  6325. const chatContainer = document.getElementById('chatOut');
  6326. const chatItems = chatContainer.getElementsByClassName('chat-item');
  6327. if ((weaponBox.style.display != lastWeaponBox) || (chatItems.length != lastChatItemLength)) {
  6328. lastWeaponBox = weaponBox.style.display;
  6329. lastChatItemLength = chatItems.length;
  6330.  
  6331. const maxChat = extract("maxChat");
  6332. const maxMessages = (weaponBox.style.display === "block" && maxChat) || 9999999;
  6333.  
  6334. const startIndex = Math.max(0, chatItems.length - maxMessages);
  6335.  
  6336. for (let i = chatItems.length - 1; i >= 0; i--) {
  6337. const chatIndex = i - startIndex;
  6338. const isInRange = chatIndex >= 0 && chatIndex < maxMessages;
  6339. chatItems[i].style.display = isInRange ? '' : 'none';
  6340. };
  6341. };
  6342.  
  6343. if (didStateFarm) {
  6344. if (!loggedGameMap) {
  6345. log(ss.GAMEMAP.width, ss.GAMEMAP.height, ss.GAMEMAP.data);
  6346. loggedGameMap = true;
  6347. };
  6348. username = ss.MYPLAYER?.name;
  6349.  
  6350. crosshairsPosition.copyFrom(ss.MYPLAYER[H.actor][H.mesh].position);
  6351.  
  6352. // //eye level
  6353. crosshairsPosition.y += 0.4;
  6354. const forwardOffset = -5;
  6355. const yaw = ss.MYPLAYER[H.yaw];
  6356. const pitch = -ss.MYPLAYER[H.pitch];
  6357. const forwardX = Math.sin(yaw) * Math.cos(pitch);
  6358. const forwardY = Math.sin(pitch);
  6359. const forwardZ = Math.cos(yaw) * Math.cos(pitch);
  6360. crosshairsPosition.x += forwardX * forwardOffset;
  6361. crosshairsPosition.y += forwardY * forwardOffset;
  6362. crosshairsPosition.z += forwardZ * forwardOffset;
  6363.  
  6364. ammo = ss.MYPLAYER.weapon.ammo;
  6365.  
  6366. whitelistPlayers = (extract("whitelist") || "").split(',');
  6367. blacklistPlayers = (extract("blacklist") || "").split(',');
  6368.  
  6369. ss.MYPLAYER[H.actor].scene.texturesEnabled = extract("enableTextures");
  6370. };
  6371. };
  6372. const updateLinesESP = function () {
  6373. const objExists = Date.now();
  6374.  
  6375. //update playerESP boxes, tracer lines, colors
  6376. ss.PLAYERS.forEach(player => {
  6377. if (player && (player !== ss.MYPLAYER) && player[H.playing] && (player[H.hp] > 0) && ((!ss.MYPLAYER.team) || (player.team !== ss.MYPLAYER.team))) {
  6378. const whitelisted = (extract("whitelistESPType") == "highlight" || !extract("enableWhitelistTracers") || playerMatchesList(whitelistPlayers, player));
  6379. const blacklisted = (extract("blacklistESPType") == "justexclude" && extract("enableBlacklistTracers") && playerMatchesList(blacklistPlayers, player));
  6380. const passedLists = whitelisted && (!blacklisted);
  6381. const tracersType = extract("tracersType");
  6382.  
  6383. //predEsp
  6384. if (extract("predictionESP")) { //important note here is that we only create/update the predESP if the module is toggled on. saves resources from predictPosition raycast
  6385. if (!player.pred) { //do we need a new TN as parent?
  6386. const pPTransformNode = new L.BABYLON.TransformNode("pPredTNode", player[H.actor].scene); //TN's are literally perfect for this wtf
  6387. pPTransformNode.parent = player[H.actor][H.mesh]; //parent to the player's mesh. Not really needed, but good practise.
  6388. player.pred = pPTransformNode; //why use object actually? All the info is stored right in the TN :)
  6389. };
  6390. if (player.pred && player.pred.getScene()) { //does pred exist and is on a valid scene? not really needed, as we literally
  6391. //create the thing above if this is not the case, but eh. Better safe than sorry
  6392. player.pred.setAbsolutePosition(predictPosition(player)); //transformNode is attached to mesh, so we need absolute pos here.
  6393. updateOrCreateLinesESP(player.pred, "pPredESP", hexToRgb(extract("predictionESPColor"))); //I love names. pPredESP, pPTransformNode. Truly nice
  6394. player.pred.exists = objExists; //make sure the lines don't get picked up by the ESPLines Garbage collector afterwards
  6395. player.pred.tracerLines.visibility = false; //they just don't work for this.
  6396. };
  6397. };
  6398.  
  6399. let color, progress;
  6400. if (extract("enableWhitelistTracers") && extract("whitelistESPType") == "highlight" && playerMatchesList(whitelistPlayers, player)) {
  6401. color = hexToRgb(extract("whitelistColor"));
  6402. } else if (extract("enableBlacklistTracers") && extract("blacklistESPType") == "highlight" && playerMatchesList(blacklistPlayers, player)) {
  6403. color = hexToRgb(extract("blacklistColor"));
  6404. } else if (tracersType == "proximity") {
  6405. const distance = distancePlayers(player);
  6406. if (distance < extract("tracersColor1to2")) { //fade between first set
  6407. progress = (distance / extract("tracersColor1to2"));
  6408. color = fadeBetweenColors(extract("tracersColor1"), extract("tracersColor2"), progress);
  6409. } else if (distance < extract("tracersColor2to3")) { //fade between second set
  6410. progress = ((distance - extract("tracersColor1to2")) / (extract("tracersColor2to3") - extract("tracersColor1to2")));
  6411. color = fadeBetweenColors(extract("tracersColor2"), extract("tracersColor3"), progress);
  6412. } else {
  6413. color = hexToRgb(extract("tracersColor3"));
  6414. };
  6415. } else if (tracersType == "static") {
  6416. color = hexToRgb(extract("tracersColor1"));
  6417. } else if (tracersType == "visibility") {
  6418. color = getLineOfSight(player) ? hexToRgb(extract("tracersColor2")) : hexToRgb(extract("tracersColor1"))
  6419. };
  6420. updateOrCreateLinesESP(player, "playerESP", color);
  6421.  
  6422. player.tracerLines.visibility = player[H.playing] && extract("tracers") && passedLists;
  6423. player.lookDirLine.visibility = player[H.playing] && extract("lookTracers") && passedLists;
  6424. player.box.visibility = extract("playerESP") && passedLists;
  6425. // player.target.visibility = extract("targets") && passedLists;
  6426. player.target.visibility = false;
  6427.  
  6428. if (player[H.actor]) {
  6429. let eggSize = extract("eggSize")
  6430. player[H.actor][H.bodyMesh].scaling._x = eggSize;
  6431. player[H.actor][H.bodyMesh].scaling._y = eggSize;
  6432. player[H.actor][H.bodyMesh].scaling._z = eggSize;
  6433. };
  6434.  
  6435. player[H.actor][H.bodyMesh].renderingGroupId = extract("chams") ? 1 : 0;
  6436.  
  6437. player.exists = objExists;
  6438. };
  6439. if (player) {
  6440. if (!ss.SETTINGS.safeNames) {
  6441. };
  6442. if (extract("unfilterNames")) { player.name = (cachedRealData[player.uniqueId]?.name || player.name);
  6443. } else player.name = (player?.normalName || player.name);
  6444. if (extract("nametags") && player[H.actor] && player[H.actor].nameSprite) { //taken from shellshock.js, so var names are weird
  6445. player[H.actor].nameSprite._manager.renderingGroupId = 1;
  6446. player[H.actor].nameSprite.renderingGroupId = 1;
  6447. var h = Math.length3(player[H.x] - ss.MYPLAYER[H.x], player[H.y] - ss.MYPLAYER[H.y], player[H.z] - ss.MYPLAYER[H.z]),
  6448. d = Math.pow(h, 1.25) * 2;
  6449. player[H.actor].nameSprite.width = d / 10 + .6;
  6450. player[H.actor].nameSprite.height = d / 20 + .3;
  6451. ss.MYPLAYER[H.actor].scene.activeCamera.fov = 0.75
  6452. };
  6453. if (!player.logged) {
  6454. player.logged = true;
  6455. if (extract("debug")) {
  6456. playerLogger.push(player);
  6457. log("Logged player: " + player.name, player)
  6458. }; //if youre a l33t kiddy who did a search for the term "logger", this does not in fact log any of the user's info. it just keeps track of players who joined and prints them to console.
  6459. if (extract("joinMessages") && (!newGame)) {
  6460. if (extract("publicBroadcast")) {
  6461. sendChatMessage((extract("joinLeaveBranding") ? "[SFC] " : "") + player.name + " joined.")
  6462. } else {
  6463. processChatItem("joined.", player.name, player.team, "rgba(0, 255, 0, 0.2)");
  6464. };
  6465. };
  6466. onlinePlayersArray.push([player, player.name, player.team]);
  6467. };
  6468. player.isOnline = objExists;
  6469. };
  6470. });
  6471. playersInGame = onlinePlayersArray.length;
  6472. for (let i = 0; i < onlinePlayersArray.length; i++) {
  6473. if (onlinePlayersArray[i][0] && onlinePlayersArray[i][0].isOnline == objExists) { //player still online
  6474. onlinePlayersArray[i][2] = onlinePlayersArray[i][0].team;
  6475. } else {
  6476. if (extract("leaveMessages") && (!newGame)) {
  6477. if (extract("publicBroadcast")) {
  6478. sendChatMessage((extract("joinLeaveBranding") ? "[SFC] " : "") + onlinePlayersArray[i][1] + " left.")
  6479. } else {
  6480. processChatItem("left.", onlinePlayersArray[i][1], onlinePlayersArray[i][2], "rgba(255, 0, 0, 0.2)");
  6481. };
  6482. };
  6483. onlinePlayersArray.splice(i, 1);
  6484. };
  6485. };
  6486. //update ammoESP boxes, tracer lines, colors
  6487. if (extract("ammoESP") || extract("ammoTracers") || extract("grenadeESP") || extract("grenadeTracers")) {
  6488. ss.OBJECTSVAR.getShadowMap()[H.renderList].forEach(item => {
  6489. if (item.isEnabled && item.isEnabled() && item.sourceMesh && item.sourceMesh.name && (item.sourceMesh.name == "grenadeItem" || item.sourceMesh.name == "ammo")) { //this is what we want
  6490. const itemType = item.sourceMesh.name;
  6491. let color = itemType == "ammo" && extract("ammoESPColor") || extract("grenadeESPColor");
  6492. color = hexToRgb(color);
  6493.  
  6494. updateOrCreateLinesESP(item, "ammoESP", color)
  6495.  
  6496. let willBeVisible = false;
  6497.  
  6498. if (itemType == "ammo") { //ammo
  6499. const regime = extract("ammoESPRegime");
  6500. if (regime == "whendepleted" && ammo.store == 0) {
  6501. willBeVisible = true;
  6502. } else if (regime == "whenlow" && ammo.store <= ammo.capacity) {
  6503. willBeVisible = true;
  6504. } else if (regime == "belowmax" && ammo.store < ammo.storeMax) {
  6505. willBeVisible = true;
  6506. } else if (regime == "alwayson") {
  6507. willBeVisible = true;
  6508. };
  6509. } else { //grenades
  6510. const regime = extract("grenadeESPRegime");
  6511. if (regime == "whendepleted" && ss.MYPLAYER.grenadeCount == 0) {
  6512. willBeVisible = true;
  6513. } else if (regime == "whenlow" && ss.MYPLAYER.grenadeCount <= 1) {
  6514. willBeVisible = true;
  6515. } else if (regime == "belowmax" && ss.MYPLAYER.grenadeCount < ss.MYPLAYER.grenadeCapacity) {
  6516. willBeVisible = true;
  6517. } else if (regime == "alwayson") {
  6518. willBeVisible = true;
  6519. };
  6520. };
  6521.  
  6522. item.box.visibility = willBeVisible && (itemType == "ammo" && extract("ammoESP") || extract("grenadeESP"));
  6523. item.tracerLines.visibility = willBeVisible && (itemType == "ammo" && extract("ammoTracers") || extract("grenadeTracers"));
  6524.  
  6525. item.exists = objExists;
  6526. };
  6527. });
  6528. };
  6529. for (let i = 0; i < ESPArray.length; i++) {
  6530. if (ESPArray[i][0] && ESPArray[i][0].exists == objExists) { //obj still exists and still relevant
  6531. //do nothing, lol
  6532. } else {
  6533. if (ESPArray[i][0]) { //obj still exists but no longer relevant
  6534. log('%cRemoving tracer line due to irrelevant object', 'color: white; background: red');
  6535. ESPArray[i][0].generatedESP = false;
  6536. } else { //obj no longer exists
  6537. log('%cRemoving tracer line due to no longer exists', 'color: white; background: red');
  6538. };
  6539. ESPArray[i][1].dispose(); //tracer
  6540. ESPArray[i][2].dispose(); //esp box
  6541. if (ESPArray[i][3]) { ESPArray[i][3].dispose() }; //target
  6542. if (ESPArray[i][4]) { ESPArray[i][4].dispose() }; //look linetrace forward line
  6543. ESPArray.splice(i, 1);
  6544. };
  6545. }; newGame = false;
  6546. };
  6547. createAnonFunction("retrieveFunctions", function (vars, doStateFarm) {
  6548. ss = vars;
  6549.  
  6550. // unsafeWindow.vueApp._showGenericPopup = unsafeWindow.vueApp.showGenericPopup; //this just doesnt work
  6551.  
  6552. // unsafeWindow.vueApp.showGenericPopup = (...args) => {
  6553. // if (args[0] === 'session_expired') return;
  6554. // return unsafeWindow.vueApp._showGenericPopup(...args);
  6555. // };
  6556.  
  6557. if (doStateFarm) {
  6558. didStateFarm = true;
  6559. return F.STATEFARM();
  6560. } else {
  6561. log("StateFarm: creating silence audio");
  6562. unsafeWindow.BAWK.sounds.silence = Object.assign({}, unsafeWindow.BAWK.sounds.ammo);
  6563. unsafeWindow.BAWK.sounds.silence.end = 0.001;
  6564. };
  6565. });
  6566.  
  6567. createAnonFunction("register", async () => {
  6568. let wait = (ms) => new Promise((res) => setTimeout(res, ms));
  6569.  
  6570. document.body.insertAdjacentHTML('beforeend', `
  6571. <style>
  6572. .shellprintOverlay {
  6573. position: fixed;
  6574. top: 0;
  6575. left: 0;
  6576. width: 100%;
  6577. height: 100%;
  6578. background-color: rgba(0, 0, 0);
  6579. z-index: 9999999;
  6580. display: flex;
  6581. flex-direction: column;
  6582. justify-content: center;
  6583. align-items: center;
  6584. }
  6585.  
  6586. .shellprintText {
  6587. color: white;
  6588. font-weight: bold;
  6589. font-family: 'Nunito';
  6590. font-size: 20px;
  6591. }
  6592.  
  6593. .shellprintStatus {
  6594. color: white;
  6595. font-weight: bold;
  6596. font-family: 'Nunito';
  6597. font-size: 36px;
  6598. }
  6599. </style>
  6600.  
  6601. <div class="shellprintOverlay">
  6602. <span class="shellprintText">[ ShellPrint @ discord.gg/XAyZ6ndEd4 ]</span>
  6603. <span class="shellprintStatus"></span>
  6604. </div>
  6605. `);
  6606.  
  6607. const shellprint = {
  6608. write: (p) => document.querySelector('.shellprintStatus').innerText = p, // eslint-disable-line
  6609.  
  6610. remove: () => {
  6611. let style = (s, t) => document.querySelector('.shellprintOverlay').style[s] = t; // eslint-disable-line
  6612. style('visibility', 'hidden');
  6613. style('opacity', 0);
  6614. style('transition', 'visibility 0s 1s, opacity 1s linear');
  6615. setTimeout(() => document.querySelector('.shellprintOverlay').remove(), 1001);
  6616. }
  6617. };
  6618.  
  6619. shellprint.write('Fetching Account...');
  6620.  
  6621. let account;
  6622.  
  6623. try {
  6624. account = await (await fetch(shellPrintURL + extract('shellPrintKey'), {
  6625. method: 'POST'
  6626. })).json();
  6627. } catch {};
  6628.  
  6629. if (!account) {
  6630. shellprint.write('ShellPrint is currently broken. Try again later.');
  6631. setTimeout(() => shellprint.remove(), 2000);
  6632. return;
  6633. } else if (!account.success) {
  6634. shellprint.write(account.error || 'Unknown error.');
  6635. setTimeout(() => shellprint.remove(), 2000);
  6636. return;
  6637. };
  6638.  
  6639. shellprint.write('Fetched Account! 🎉 Signing in....');
  6640.  
  6641. let signIn = async () => {
  6642. try {
  6643. await unsafeWindow.firebase.auth().signInWithEmailAndPassword(account.email, account.password);
  6644. } catch {
  6645. await signIn();
  6646. };
  6647. };
  6648.  
  6649. await signIn();
  6650.  
  6651. shellprint.write('Fully signed in! 🎉');
  6652. await wait(1000);
  6653. shellprint.remove();
  6654. });
  6655.  
  6656. const applySkybox = () => {
  6657. //check if we should switch
  6658. const delta2 = Date.now()-lastRandomSkyBoxChangeTime;
  6659. const desire = extract("randomSkyBoxInterval")? extract("randomSkyBoxInterval")*60*1000 : -1; //stored in minutes, so *60 -> seconds *1000 -> milliseconds.
  6660. if(
  6661. extract("randomSkyBox")
  6662. &&delta2!=-1
  6663. &&delta2>desire
  6664. ){
  6665. const newIdx = randomInt(0, loadedSkyboxes.length-1);
  6666. log("skybox change overdue for " +(delta2-desire)+ "ms. New skybox index chosen: " +newIdx);
  6667. change("skybox", newIdx); //maybe not the best to overwrite the actual module setting, but eh, don't want to rewrite the entire thing....
  6668. lastRandomSkyBoxChangeTime = Date.now();
  6669. }
  6670. if (!unsafeWindow[skyboxName]) return;
  6671. if (!(extract('skybox') === 'default' || extract('skybox') === true || ss.SCENE.skyboxTextureThing == extract('skybox'))) {
  6672. let url = `${atob(extract("skybox"))}/skybox`;
  6673. unsafeWindow[skyboxName].material.reflectionTexture = new L.BABYLON.CubeTexture(url, ss.SCENE);
  6674. unsafeWindow[skyboxName].material.reflectionTexture.coordinatesMode = L.BABYLON.Texture.SKYBOX_MODE;
  6675. ss.SCENE.skyboxTextureThing = extract('skybox');
  6676. };
  6677. };
  6678.  
  6679. createAnonFunction("STATEFARM", function () {
  6680. ss.PLAYERS.forEach((PLAYER) => (PLAYER.hasOwnProperty("ws")) ? (ss.MYPLAYER = PLAYER) : null);
  6681.  
  6682. if (!ranOneTime) {
  6683. oneTime();
  6684. } else if (typeof (L.BABYLON) !== 'undefined') {
  6685. initVars();
  6686. updateLinesESP();
  6687. mapStuff();
  6688. applySkybox();
  6689.  
  6690. let isVisible;
  6691. const player = currentlyTargeting || playerLookingAt || undefined;
  6692. if (player && player[H.playing]) {
  6693. isVisible = getLineOfSight(player);
  6694. };
  6695. highlightCrossHairReticleDot(extract("showLOS") ? isVisible : null);
  6696.  
  6697. if (extract("radar")) {
  6698. myPlayerDot.style.display = 'block';
  6699. ss.PLAYERS.forEach(player => { updateMiniMap(player, ss.MYPLAYER) });
  6700. } else {
  6701. ss.PLAYERS.forEach(player => {
  6702. if (playerDotsMap.has(player.uniqueId)) {
  6703. const playerDotToRemove = playerDotsMap.get(player.uniqueId);
  6704. mapEl.removeChild(playerDotToRemove);
  6705. playerDotsMap.delete(player.uniqueId);
  6706. }
  6707. });
  6708. myPlayerDot.style.display = 'none';
  6709. };
  6710.  
  6711. if (extract("freecam")) {
  6712. ss.MYPLAYER[H.actor][H.mesh].position.y = ss.MYPLAYER[H.actor][H.mesh].position.y + 1;
  6713. };
  6714.  
  6715. //credit to helloworld for the idea (worked it out on my own tho :P)
  6716. if (ss.MYPLAYER[H.playing]) {
  6717. //camera adjustments
  6718. ss.CAMERA.position.y = extract("perspective") !== "firstPerson" ? extract("perspectiveY") || 0 : 0;
  6719. ss.CAMERA.position.z = extract("perspective") !== "firstPerson" ? extract("perspective") == "thirdPerson" ? (extract("perspectiveZ") || 0) : (-extract("perspectiveZ")) || 0 : 0;
  6720. ss.CAMERA.rotation.x = extract("perspective") == "thirdPersonAlt" ? Math.PI : 0;
  6721. //rendering
  6722. ss.MYPLAYER[H.actor].gunContainer._children[0].renderingGroupId = extract("perspective") !== "firstPerson" ? 0 : 2;
  6723. ss.MYPLAYER[H.actor].gunContainer._children[2].renderingGroupId = extract("perspective") !== "firstPerson" ? 0 : 2;
  6724. if (!ss.MYPLAYER.stampApplied) ss.MYPLAYER[H.actor].applyStamp(ss.MYPLAYER.stampItem); ss.MYPLAYER.stampApplied = true;
  6725. if (!ss.MYPLAYER[H.actor].hat) {
  6726. ss.MYPLAYER[H.actor].wearHat(ss.MYPLAYER.hatItem);
  6727. } else {
  6728. ss.MYPLAYER[H.actor].hat.visibility = extract("perspective") !== "firstPerson" ? 1 : 0;
  6729. };
  6730. //alpha effect
  6731. ss.MYPLAYER[H.actor].hands.material.alphaMode = 5;
  6732. ss.MYPLAYER[H.actor][H.bodyMesh].material.alphaMode = 5;
  6733. ss.MYPLAYER[H.actor].hands.material.alpha = ((extract("perspective") !== "firstPerson") && extract("perspectiveAlpha")) ? .5 : 1;
  6734. ss.MYPLAYER[H.actor][H.bodyMesh].material.alpha = ((extract("perspective") !== "firstPerson") && extract("perspectiveAlpha")) ? .5 : 1;
  6735. };
  6736.  
  6737. let filter = typeof(extract("filter")) == 'number' ? extract("filter") : 2;
  6738. if (ss.SCENE && ss.SCENE.appliedFilter !== filter) {
  6739. ss.SCENE.materials.forEach(material => {
  6740. material.alphaMode = filter;
  6741. }); ss.SCENE.appliedFilter = filter;
  6742. };
  6743.  
  6744. if (ss.MYPLAYER && ss.MYPLAYER[H.actor] && ss.MYPLAYER[H.actor][H.mesh]) {
  6745. ss.MYPLAYER[H.actor][H.mesh].scaling._x = (extract("gunPosition") == "left" ? -1 : 1);
  6746. ss.MYPLAYER[H.actor].gunContainer.scaling._x = extract("gunPosition") == "hidden" ? 0 : 1;
  6747. ss.MYPLAYER[H.actor].gunContainer.scaling._y = extract("gunPosition") == "hidden" ? 0 : 1;
  6748. ss.MYPLAYER[H.actor].gunContainer.scaling._x = extract("gunPosition") == "hidden" ? 0 : 1;
  6749. };
  6750.  
  6751. if (extract("spamChat")) {
  6752. if (document.getElementById("chatIn").style.visibility == 'visible') {
  6753. if (spamDelay < Date.now()) {
  6754. if (Date.now() > (lastSpamMessage[0] + extract("spamChatDelay"))) {
  6755. let possibleMessages = extract("spamChatText").split("|");
  6756. let chosenMessage = possibleMessages[spamMessageCount % possibleMessages.length];
  6757. if (chosenMessage == lastSpamMessage[1]) { chosenMessage += String.fromCharCode(97 + Math.floor(Math.random() * 26)) };
  6758. sendChatMessage(chosenMessage);
  6759. lastSpamMessage = [Date.now(), chosenMessage];
  6760. spamMessageCount += 1;
  6761. };
  6762. } else if (spamDelay < Date.now() - 250) {
  6763. spamDelay = Date.now() + 250;
  6764. };
  6765. };
  6766. };
  6767. if (extract("chatHighlight")) {
  6768. document.getElementById("chatOut").style.userSelect = "text"
  6769. };
  6770. if (extract("autoRefill")) {
  6771. //log(ss.MYPLAYER.weapon);
  6772. if (ammo.rounds == 0) {
  6773. ss.MYPLAYER.reload();
  6774. } else if (extract("smartRefill")) {
  6775. let smartRefillMinAmmo = {
  6776. eggk47: 1,
  6777. dozenGauge: 0,
  6778. csg1: 1,
  6779. rpegg: 0,
  6780. smg: 1,
  6781. m24: 0,
  6782. aug: 3,
  6783. cluck9mm: 1
  6784. };
  6785. if (ammo.rounds <= smartRefillMinAmmo[ss.MYPLAYER.weapon.constructor.standardMeshName]) {
  6786. ss.MYPLAYER.reload();
  6787. };
  6788. };
  6789. };
  6790. if (extract("autoGrenade") && isVisible && (ss.MYPLAYER.grenadeCount > 0)) {
  6791. ss.MYPLAYER.throwGrenade();
  6792. };
  6793. if ((extract("autoWeapon") !== "disabled") && (!ss.MYPLAYER[H.playing])) {
  6794. weaponArray.random = randomInt(0, 6);
  6795. document.querySelectorAll('.weapon_img')[weaponArray[extract("autoWeapon")]].parentNode.click();
  6796. };
  6797. if (extract("revealBloom") || extract("showMinAngle")) {
  6798. const distCenterToOuter = 2 * (200 / ss.CAMERA.fov);
  6799. const bloomValues = predictBloom(ss.MYPLAYER[H.yaw], ss.MYPLAYER[H.pitch]);
  6800. // Set the new position of the circle
  6801. const centerX = (unsafeWindow.innerWidth / 2);
  6802. const centerY = (unsafeWindow.innerHeight / 2);
  6803. const offsettedX = centerX - (2 * distCenterToOuter * bloomValues[0]);
  6804. const offsettedY = centerY - (2 * distCenterToOuter * bloomValues[1]);
  6805. if (extract("revealBloom")) {
  6806. redCircle.style.display = '';
  6807. redCircle.style.bottom = offsettedY + 'px';
  6808. redCircle.style.right = offsettedX + 'px';
  6809. } else {
  6810. redCircle.style.display = 'none';
  6811. };
  6812. if (extract("showMinAngle")) {
  6813. minangleCircle.style.display = '';
  6814. let idkWhatThisIs = 25 * (1.25 / ss.CAMERA.fov);
  6815. minangleCircle.style.width = extract("aimbotMinAngle") * idkWhatThisIs + 'px';
  6816. minangleCircle.style.height = extract("aimbotMinAngle") * idkWhatThisIs + 'px';
  6817. minangleCircle.style.bottom = centerY + 'px';
  6818. minangleCircle.style.right = centerX + 'px';
  6819. };
  6820. };
  6821. if (!extract("showMinAngle")) {
  6822. minangleCircle.style.display = 'none';
  6823. };
  6824. const playerSlots = document.querySelectorAll('#playerList .playerSlot');
  6825. playerSlots.forEach(slot => {
  6826. const usernameElement = slot.querySelector('.playerSlot--name');
  6827. let username = usernameElement ? usernameElement.textContent.trim() : "";
  6828. const badgeURLs = Array.from(findBadgesForUsername(username)).reverse();
  6829. const existingBadges = slot.querySelectorAll('.badge-image');
  6830.  
  6831. if ((!extract("customBadges")) || (badgeURLs && badgeURLs.length < 1)) {
  6832. existingBadges.forEach(badge => badge.remove());
  6833. } else if (extract("customBadges") && username && badgeURLs && badgeURLs.length > 0 && existingBadges && existingBadges.length < 1) {
  6834. existingBadges.forEach(badge => badge.remove());
  6835. const eggIcon = !!(slot.querySelector('.playerSlot--icons .fas.fa-egg:not(.hidden)') || slot.querySelector('.playerSlot--icons .fab.fa-twitch:not(.hidden)'));
  6836. log(eggIcon, username)
  6837. badgeURLs.forEach((badgeURL, index) => {
  6838. const badgeImage = document.createElement('img');
  6839. badgeImage.src = badgeListURL + badgeURL;
  6840. badgeImage.className = 'badge-image';
  6841. badgeImage.style.position = 'absolute';
  6842. badgeImage.style.height = 'auto';
  6843. badgeImage.style.width = 'auto';
  6844. badgeImage.style.maxHeight = '100%';
  6845. badgeImage.style.maxWidth = '100%';
  6846. badgeImage.style.right = `${-13 - index * 8 - (eggIcon ? 10 : 0)}%`;
  6847. badgeImage.style.top = '50%';
  6848. badgeImage.style.transform = 'translateY(-50%)';
  6849. slot.style.position = 'relative';
  6850. slot.appendChild(badgeImage);
  6851. });
  6852. };
  6853. });
  6854.  
  6855. let partyLightsIntensity = extract("partyLightsIntensity") || 0;
  6856.  
  6857. if (extract("partyLightsEnabled") && partyLightsIntensity > 0 && !ss.SCENE.lights.find(light => light.name === "light")) {
  6858. log("Lets party :joe_cool:");
  6859. partyLight = new L.BABYLON.PointLight("light", new L.BABYLON.Vector3(0, 10, 0), ss.SCENE);
  6860. partyLight.diffuse = new L.BABYLON.Color3(1, 0, 0);
  6861. partyLight.specular = new L.BABYLON.Color3(1, 1, 1);
  6862. };
  6863. if (partyLight) {
  6864. partyLight.intensity = partyLightsIntensity;
  6865. var hue = (Date.now() / 1000) % 1;
  6866. partyLight.diffuse = hslToRgb(hue, 1, 0.5);
  6867. };
  6868.  
  6869. try {
  6870. let minAccuracy = ss.MYPLAYER.weapon.accuracyMin + ss.MYPLAYER.weapon.accuracyLoss;
  6871. accuracyPercentage = (ss.MYPLAYER.weapon.accuracy - minAccuracy) / (ss.MYPLAYER.weapon.accuracyMax - minAccuracy);
  6872. accuracyPercentage = Math.max(0, accuracyPercentage);
  6873. } catch (error) {
  6874. accuracyPercentage = 1;
  6875. };
  6876.  
  6877. // playerNearest=undefined; //currently unused and not defined
  6878. // enemyLookingAt=undefined; //currently unused and not defined
  6879.  
  6880. let playerLookingAtMinimum = 999999;
  6881. playerLookingAt = undefined; //used for player info
  6882.  
  6883. let enemyMinimumDistance = 999999;
  6884. enemyNearest = undefined; //used for antisneak
  6885.  
  6886. let previousTarget = currentlyTargeting;
  6887.  
  6888. let selectNewTarget = (!extract("antiSwitch") || !currentlyTargeting);
  6889. if (selectNewTarget) currentlyTargeting = false;
  6890. let isDoingAimbot = (extract("aimbot") && (extract("aimbotRightClick") ? isRightButtonDown : true) && ss.MYPLAYER[H.playing]);
  6891. // log(targetingComplete);
  6892.  
  6893. const targetType = extract("aimbotTargetMode");
  6894. const visibilityMode = extract("aimbotVisibilityMode");
  6895.  
  6896. let enemyMinimumValue = ((targetType == "pointingat") && (extract("silentAimbot"))) ? deg2rad(extract("aimbotMinAngle")) : 10000; //used for selecting target (either pointingat or nearest)
  6897.  
  6898. let didAimbot
  6899. const candidates = [];
  6900. amountVisible = 0;
  6901.  
  6902. ss.PLAYERS.forEach(player => { //iterate over all players to filter out players that we definitely wont target, and also calc some stats for later use
  6903. if (player && (player !== ss.MYPLAYER) && player[H.playing] && (player[H.hp] > 0)) {
  6904. const whitelisted = (extract("enableWhenNoneVisible") || !extract("enableWhitelistAimbot") || extract("enableWhitelistAimbot") && playerMatchesList(whitelistPlayers, player));
  6905. const blacklisted = (extract("enableBlacklistAimbot") && playerMatchesList(blacklistPlayers, player));
  6906. const passedLists = (whitelisted) && (!blacklisted);
  6907. player.distance = distancePlayers(player);
  6908. player.adjustedDistance = distancePlayers(player, 2);
  6909. const directionVector = getDirectionVectorFacingTarget(player);
  6910.  
  6911. player.angleDiff = getAngularDifference(ss.MYPLAYER, { yawReal: calculateYaw(directionVector), pitchReal: calculatePitch(directionVector) });
  6912. player.isVisible = getLineOfSight(player, extract("prediction"));
  6913.  
  6914. if (player.angleDiff < playerLookingAtMinimum) {
  6915. playerLookingAtMinimum = player.angleDiff;
  6916. playerLookingAt = player;
  6917. };
  6918.  
  6919. if (passedLists) { //is possibly an an enemy
  6920. if (isDoingAimbot) { //is doing aimbot and we care about getting a new target
  6921. if (player.adjustedDistance < enemyMinimumValue) { //for antisneak, not targeting
  6922. enemyMinimumDistance = player.adjustedDistance;
  6923. enemyNearest = player;
  6924. };
  6925. if (selectNewTarget) {
  6926. candidates.push(player);
  6927. if ( player.isVisible ) { amountVisible += 1 };
  6928. };
  6929. };
  6930. };
  6931. };
  6932. });
  6933.  
  6934. candidates.forEach(player => {
  6935. const valueToUse = ((targetType == "nearest" && player.adjustedDistance) || (targetType == "pointingat" && player.angleDiff));
  6936. let visibleValue = ((!ss.MYPLAYER.team) || (player.team !== ss.MYPLAYER.team));
  6937. if (visibilityMode == "disabled") { //we dont care about that shit
  6938. //go ahead
  6939. } else if (amountVisible < 1) { //none of candidates are visible
  6940. const whitelisted = (!extract("enableWhitelistAimbot") || extract("enableWhitelistAimbot") && playerMatchesList(whitelistPlayers, player));
  6941. //log(player.name, whitelisted, visibleValue) //grrrr no console spam
  6942. visibleValue = (whitelisted && extract("enableWhenNoneVisible")) || (visibilityMode == "onlyvisible" ? false : visibleValue); //there are no visible candidates, so either select none if "onlyvisible" or ignore this altogether
  6943. } else { //some are visible
  6944. visibleValue = visibleValue && player.isVisible; //assuming now that either "prioritise" or "onlyvisible" are enabled, as "onlyvisible"'s use case fulfilled in previous statement
  6945. };
  6946. if (visibleValue) {
  6947. if (valueToUse < enemyMinimumValue) {
  6948. enemyMinimumValue = valueToUse;
  6949. currentlyTargeting = player;
  6950. };
  6951. };
  6952. });
  6953.  
  6954. if (isDoingAimbot) {
  6955. if (currentlyTargeting && currentlyTargeting[H.playing] && currentlyTargeting[H.actor]) { //found a target
  6956. didAimbot = true;
  6957. if (currentlyTargeting.generatedESP) {
  6958. if (extract("tracers")) {
  6959. currentlyTargeting.tracerLines.color = new L.BABYLON.Color3(...hexToRgb(extract("aimbotColor")));
  6960. };
  6961. if (extract("playerESP")) {
  6962. currentlyTargeting.box.color = new L.BABYLON.Color3(...hexToRgb(extract("aimbotColor")));
  6963. };
  6964. };
  6965. if ((!extract("silentAimbot")) && (!extract("noWallTrack") || getLineOfSight(player, true)) && (targetingComplete || (deg2rad(extract("aimbotMinAngle")) > currentlyTargeting?.angleDiff))) {
  6966. const distanceBetweenPlayers = distancePlayers(currentlyTargeting);
  6967.  
  6968. const aimbot = getAimbot(currentlyTargeting);
  6969.  
  6970. const antiSnap = (1 - (extract("aimbotAntiSnap") || 0));
  6971.  
  6972. if (previousTarget !== currentlyTargeting) { targetingComplete = false };
  6973.  
  6974. const lerp = function (start, end, alpha) {
  6975. let value = (1 - alpha) * start + alpha * end;
  6976. if ((Math.abs(end - start) < (0.2 / (distanceBetweenPlayers))) || (targetingComplete)) {
  6977. value = end; targetingComplete = true;
  6978. };
  6979. return value;
  6980. };
  6981.  
  6982. // Exponential lerp towards the target rotation
  6983. ss.MYPLAYER[H.yaw] = setPrecision(lerp(ss.MYPLAYER[H.yaw], aimbot.yawReal, antiSnap));
  6984. ss.MYPLAYER[H.pitch] = setPrecision(lerp(ss.MYPLAYER[H.pitch], aimbot.pitchReal, antiSnap));
  6985. };
  6986. if (enemyMinimumDistance < extract("antiSneak")) {
  6987. currentlyTargeting = enemyNearest;
  6988. if (ammo.rounds === 0) { //basically after MAGDUMP, switch to pistol, if that is empty reload and keep shootin'
  6989. if (ss.MYPLAYER.weaponIdx === 0) { ss.MYPLAYER.swapWeapon(1); }
  6990. else { ss.MYPLAYER.reload(); }
  6991. };
  6992. ss.MYPLAYER.pullTrigger();
  6993. // log("ANTISNEAK---->", enemyNearest?.name, enemyMinimumDistance);
  6994. };
  6995. } else {
  6996. if (extract("oneKill")) {
  6997. currentlyTargeting = "dead";
  6998. } else {
  6999. currentlyTargeting = false;
  7000. };
  7001. };
  7002. } else {
  7003. currentlyTargeting = false;
  7004. targetingComplete = false;
  7005. if (extract("enableSeizureX")) {
  7006. ss.MYPLAYER[H.yaw] += extract("amountSeizureX")
  7007. };
  7008. if (extract("enableSeizureY")) {
  7009. ss.MYPLAYER[H.pitch] += extract("amountSeizureY")
  7010. };
  7011. };
  7012. highlightTargetOnLeaderboard(currentlyTargeting, (extract("highlightLeaderboard")) ? didAimbot : false);
  7013. if (extract("upsideDown")) { //sorta useless
  7014. if (ss.MYPLAYER[H.pitch] < 1.5 && ss.MYPLAYER[H.pitch] > -1.5) {
  7015. ss.MYPLAYER[H.pitch] = Math.PI;
  7016. };
  7017. };
  7018. if (extract("silentRoll")) {
  7019. ss.MYPLAYER[H.pitch] += 2 * Math.PI;
  7020. };
  7021. if (extract("enableAutoFire")) {
  7022. let autoFireType = extract("autoFireType");
  7023. let doAutoFire = false
  7024. if (autoFireType == "always") {
  7025. doAutoFire = true;
  7026. } else if (autoFireType == "whileAimbot" && didAimbot) {
  7027. doAutoFire = true;
  7028. } else if (autoFireType == "whileVisible" && isVisible) {
  7029. doAutoFire = true;
  7030. } else if (autoFireType == "whileVisAimbot" && isVisible && didAimbot) {
  7031. doAutoFire = true;
  7032. };
  7033. if (doAutoFire) {
  7034. if ((ammo.rounds > 0) || (ammo.store > 0)) { //i fucking hate tweakpane. "errrm actually when a slider is 0 it becomes undefined" go fuck yourself.
  7035. ((accuracyPercentage >= (extract("autoFireAccuracy") || 0))) && ss.MYPLAYER.pullTrigger();
  7036. } else {
  7037. ss.MYPLAYER.melee();
  7038. };
  7039. };
  7040. //method by de_Neuublue
  7041. if (autoFireType == "forceAutomatic") {
  7042. if (ss.MYPLAYER.weapon.constructor.originallySemi == null) {
  7043. ss.MYPLAYER.weapon.constructor.originallySemi = !ss.MYPLAYER.weapon.constructor.automatic;
  7044. };
  7045. ss.MYPLAYER.weapon.constructor.automatic = true;
  7046. } else if (ss.MYPLAYER.weapon.constructor.originallySemi) {
  7047. ss.MYPLAYER.weapon.constructor.originallySemi = null;
  7048. ss.MYPLAYER.weapon.constructor.automatic = false;
  7049. };
  7050. };
  7051.  
  7052. if (updateMenu) {
  7053. updateMenu = false; initMenu(false);
  7054. tp.mainPanel.hidden = extract("hideAtStartup");
  7055. };
  7056.  
  7057. let doRender = true;
  7058.  
  7059. if ((extract("renderDelay") > 10) && (Date.now() < (previousFrame + extract("renderDelay")))) { //because bots lmao
  7060. doRender = false;
  7061. } else {
  7062. previousFrame = Date.now();
  7063. };
  7064.  
  7065. return (!doRender);
  7066. };
  7067. });
  7068. };
  7069.  
  7070. var css = "text-shadow: -1px -1px hsl(0,100%,50%), 1px 1px hsl(5.4, 100%, 50%), 3px 2px hsl(10.8, 100%, 50%), 5px 3px hsl(16.2, 100%, 50%), 7px 4px hsl(21.6, 100%, 50%), 9px 5px hsl(27, 100%, 50%), 11px 6px hsl(32.4, 100%, 50%), 13px 7px hsl(37.8, 100%, 50%), 14px 8px hsl(43.2, 100%, 50%), 16px 9px hsl(48.6, 100%, 50%), 18px 10px hsl(54, 100%, 50%), 20px 11px hsl(59.4, 100%, 50%), 22px 12px hsl(64.8, 100%, 50%), 23px 13px hsl(70.2, 100%, 50%), 25px 14px hsl(75.6, 100%, 50%), 27px 15px hsl(81, 100%, 50%), 28px 16px hsl(86.4, 100%, 50%), 30px 17px hsl(91.8, 100%, 50%), 32px 18px hsl(97.2, 100%, 50%), 33px 19px hsl(102.6, 100%, 50%), 35px 20px hsl(108, 100%, 50%), 36px 21px hsl(113.4, 100%, 50%), 38px 22px hsl(118.8, 100%, 50%), 39px 23px hsl(124.2, 100%, 50%), 41px 24px hsl(129.6, 100%, 50%), 42px 25px hsl(135, 100%, 50%), 43px 26px hsl(140.4, 100%, 50%), 45px 27px hsl(145.8, 100%, 50%), 46px 28px hsl(151.2, 100%, 50%), 47px 29px hsl(156.6, 100%, 50%), 48px 30px hsl(162, 100%, 50%), 49px 31px hsl(167.4, 100%, 50%), 50px 32px hsl(172.8, 100%, 50%), 51px 33px hsl(178.2, 100%, 50%), 52px 34px hsl(183.6, 100%, 50%), 53px 35px hsl(189, 100%, 50%), 54px 36px hsl(194.4, 100%, 50%), 55px 37px hsl(199.8, 100%, 50%), 55px 38px hsl(205.2, 100%, 50%), 56px 39px hsl(210.6, 100%, 50%), 57px 40px hsl(216, 100%, 50%), 57px 41px hsl(221.4, 100%, 50%), 58px 42px hsl(226.8, 100%, 50%), 58px 43px hsl(232.2, 100%, 50%), 58px 44px hsl(237.6, 100%, 50%), 59px 45px hsl(243, 100%, 50%), 59px 46px hsl(248.4, 100%, 50%), 59px 47px hsl(253.8, 100%, 50%), 59px 48px hsl(259.2, 100%, 50%), 59px 49px hsl(264.6, 100%, 50%), 60px 50px hsl(270, 100%, 50%), 59px 51px hsl(275.4, 100%, 50%), 59px 52px hsl(280.8, 100%, 50%), 59px 53px hsl(286.2, 100%, 50%), 59px 54px hsl(291.6, 100%, 50%), 59px 55px hsl(297, 100%, 50%), 58px 56px hsl(302.4, 100%, 50%), 58px 57px hsl(307.8, 100%, 50%), 58px 58px hsl(313.2, 100%, 50%), 57px 59px hsl(318.6, 100%, 50%), 57px 60px hsl(324, 100%, 50%), 56px 61px hsl(329.4, 100%, 50%), 55px 62px hsl(334.8, 100%, 50%), 55px 63px hsl(340.2, 100%, 50%), 54px 64px hsl(345.6, 100%, 50%), 53px 65px hsl(351, 100%, 50%), 52px 66px hsl(356.4, 100%, 50%), 51px 67px hsl(361.8, 100%, 50%), 50px 68px hsl(367.2, 100%, 50%), 49px 69px hsl(372.6, 100%, 50%), 48px 70px hsl(378, 100%, 50%), 47px 71px hsl(383.4, 100%, 50%), 46px 72px hsl(388.8, 100%, 50%), 45px 73px hsl(394.2, 100%, 50%), 43px 74px hsl(399.6, 100%, 50%), 42px 75px hsl(405, 100%, 50%), 41px 76px hsl(410.4, 100%, 50%), 39px 77px hsl(415.8, 100%, 50%), 38px 78px hsl(421.2, 100%, 50%), 36px 79px hsl(426.6, 100%, 50%), 35px 80px hsl(432, 100%, 50%), 33px 81px hsl(437.4, 100%, 50%), 32px 82px hsl(442.8, 100%, 50%), 30px 83px hsl(448.2, 100%, 50%), 28px 84px hsl(453.6, 100%, 50%), 27px 85px hsl(459, 100%, 50%), 25px 86px hsl(464.4, 100%, 50%), 23px 87px hsl(469.8, 100%, 50%), 22px 88px hsl(475.2, 100%, 50%), 20px 89px hsl(480.6, 100%, 50%), 18px 90px hsl(486, 100%, 50%), 16px 91px hsl(491.4, 100%, 50%), 14px 92px hsl(496.8, 100%, 50%), 13px 93px hsl(502.2, 100%, 50%), 11px 94px hsl(507.6, 100%, 50%), 9px 95px hsl(513, 100%, 50%), 7px 96px hsl(518.4, 100%, 50%), 5px 97px hsl(523.8, 100%, 50%), 3px 98px hsl(529.2, 100%, 50%), 1px 99px hsl(534.6, 100%, 50%), 7px 100px hsl(540, 100%, 50%), -1px 101px hsl(545.4, 100%, 50%), -3px 102px hsl(550.8, 100%, 50%), -5px 103px hsl(556.2, 100%, 50%), -7px 104px hsl(561.6, 100%, 50%), -9px 105px hsl(567, 100%, 50%), -11px 106px hsl(572.4, 100%, 50%), -13px 107px hsl(577.8, 100%, 50%), -14px 108px hsl(583.2, 100%, 50%), -16px 109px hsl(588.6, 100%, 50%), -18px 110px hsl(594, 100%, 50%), -20px 111px hsl(599.4, 100%, 50%), -22px 112px hsl(604.8, 100%, 50%), -23px 113px hsl(610.2, 100%, 50%), -25px 114px hsl(615.6, 100%, 50%), -27px 115px hsl(621, 100%, 50%), -28px 116px hsl(626.4, 100%, 50%), -30px 117px hsl(631.8, 100%, 50%), -32px 118px hsl(637.2, 100%, 50%), -33px 119px hsl(642.6, 100%, 50%), -35px 120px hsl(648, 100%, 50%), -36px 121px hsl(653.4, 100%, 50%), -38px 122px hsl(658.8, 100%, 50%), -39px 123px hsl(664.2, 100%, 50%), -41px 124px hsl(669.6, 100%, 50%), -42px 125px hsl(675, 100%, 50%), -43px 126px hsl(680.4, 100%, 50%), -45px 127px hsl(685.8, 100%, 50%), -46px 128px hsl(691.2, 100%, 50%), -47px 129px hsl(696.6, 100%, 50%), -48px 130px hsl(702, 100%, 50%), -49px 131px hsl(707.4, 100%, 50%), -50px 132px hsl(712.8, 100%, 50%), -51px 133px hsl(718.2, 100%, 50%), -52px 134px hsl(723.6, 100%, 50%), -53px 135px hsl(729, 100%, 50%), -54px 136px hsl(734.4, 100%, 50%), -55px 137px hsl(739.8, 100%, 50%), -55px 138px hsl(745.2, 100%, 50%), -56px 139px hsl(750.6, 100%, 50%), -57px 140px hsl(756, 100%, 50%), -57px 141px hsl(761.4, 100%, 50%), -58px 142px hsl(766.8, 100%, 50%), -58px 143px hsl(772.2, 100%, 50%), -58px 144px hsl(777.6, 100%, 50%), -59px 145px hsl(783, 100%, 50%), -59px 146px hsl(788.4, 100%, 50%), -59px 147px hsl(793.8, 100%, 50%), -59px 148px hsl(799.2, 100%, 50%), -59px 149px hsl(804.6, 100%, 50%), -60px 150px hsl(810, 100%, 50%), -59px 151px hsl(815.4, 100%, 50%), -59px 152px hsl(820.8, 100%, 50%), -59px 153px hsl(826.2, 100%, 50%), -59px 154px hsl(831.6, 100%, 50%), -59px 155px hsl(837, 100%, 50%), -58px 156px hsl(842.4, 100%, 50%), -58px 157px hsl(847.8, 100%, 50%), -58px 158px hsl(853.2, 100%, 50%), -57px 159px hsl(858.6, 100%, 50%), -57px 160px hsl(864, 100%, 50%), -56px 161px hsl(869.4, 100%, 50%), -55px 162px hsl(874.8, 100%, 50%), -55px 163px hsl(880.2, 100%, 50%), -54px 164px hsl(885.6, 100%, 50%), -53px 165px hsl(891, 100%, 50%), -52px 166px hsl(896.4, 100%, 50%), -51px 167px hsl(901.8, 100%, 50%), -50px 168px hsl(907.2, 100%, 50%), -49px 169px hsl(912.6, 100%, 50%), -48px 170px hsl(918, 100%, 50%), -47px 171px hsl(923.4, 100%, 50%), -46px 172px hsl(928.8, 100%, 50%), -45px 173px hsl(934.2, 100%, 50%), -43px 174px hsl(939.6, 100%, 50%), -42px 175px hsl(945, 100%, 50%), -41px 176px hsl(950.4, 100%, 50%), -39px 177px hsl(955.8, 100%, 50%), -38px 178px hsl(961.2, 100%, 50%), -36px 179px hsl(966.6, 100%, 50%), -35px 180px hsl(972, 100%, 50%), -33px 181px hsl(977.4, 100%, 50%), -32px 182px hsl(982.8, 100%, 50%), -30px 183px hsl(988.2, 100%, 50%), -28px 184px hsl(993.6, 100%, 50%), -27px 185px hsl(999, 100%, 50%), -25px 186px hsl(1004.4, 100%, 50%), -23px 187px hsl(1009.8, 100%, 50%), -22px 188px hsl(1015.2, 100%, 50%), -20px 189px hsl(1020.6, 100%, 50%), -18px 190px hsl(1026, 100%, 50%), -16px 191px hsl(1031.4, 100%, 50%), -14px 192px hsl(1036.8, 100%, 50%), -13px 193px hsl(1042.2, 100%, 50%), -11px 194px hsl(1047.6, 100%, 50%), -9px 195px hsl(1053, 100%, 50%), -7px 196px hsl(1058.4, 100%, 50%), -5px 197px hsl(1063.8, 100%, 50%), -3px 198px hsl(1069.2, 100%, 50%), -1px 199px hsl(1074.6, 100%, 50%), -1px 200px hsl(1080, 100%, 50%), 1px 201px hsl(1085.4, 100%, 50%), 3px 202px hsl(1090.8, 100%, 50%), 5px 203px hsl(1096.2, 100%, 50%), 7px 204px hsl(1101.6, 100%, 50%), 9px 205px hsl(1107, 100%, 50%), 11px 206px hsl(1112.4, 100%, 50%), 13px 207px hsl(1117.8, 100%, 50%), 14px 208px hsl(1123.2, 100%, 50%), 16px 209px hsl(1128.6, 100%, 50%), 18px 210px hsl(1134, 100%, 50%), 20px 211px hsl(1139.4, 100%, 50%), 22px 212px hsl(1144.8, 100%, 50%), 23px 213px hsl(1150.2, 100%, 50%), 25px 214px hsl(1155.6, 100%, 50%), 27px 215px hsl(1161, 100%, 50%), 28px 216px hsl(1166.4, 100%, 50%), 30px 217px hsl(1171.8, 100%, 50%), 32px 218px hsl(1177.2, 100%, 50%), 33px 219px hsl(1182.6, 100%, 50%), 35px 220px hsl(1188, 100%, 50%), 36px 221px hsl(1193.4, 100%, 50%), 38px 222px hsl(1198.8, 100%, 50%), 39px 223px hsl(1204.2, 100%, 50%), 41px 224px hsl(1209.6, 100%, 50%), 42px 225px hsl(1215, 100%, 50%), 43px 226px hsl(1220.4, 100%, 50%), 45px 227px hsl(1225.8, 100%, 50%), 46px 228px hsl(1231.2, 100%, 50%), 47px 229px hsl(1236.6, 100%, 50%), 48px 230px hsl(1242, 100%, 50%), 49px 231px hsl(1247.4, 100%, 50%), 50px 232px hsl(1252.8, 100%, 50%), 51px 233px hsl(1258.2, 100%, 50%), 52px 234px hsl(1263.6, 100%, 50%), 53px 235px hsl(1269, 100%, 50%), 54px 236px hsl(1274.4, 100%, 50%), 55px 237px hsl(1279.8, 100%, 50%), 55px 238px hsl(1285.2, 100%, 50%), 56px 239px hsl(1290.6, 100%, 50%), 57px 240px hsl(1296, 100%, 50%), 57px 241px hsl(1301.4, 100%, 50%), 58px 242px hsl(1306.8, 100%, 50%), 58px 243px hsl(1312.2, 100%, 50%), 58px 244px hsl(1317.6, 100%, 50%), 59px 245px hsl(1323, 100%, 50%), 59px 246px hsl(1328.4, 100%, 50%), 59px 247px hsl(1333.8, 100%, 50%), 59px 248px hsl(1339.2, 100%, 50%), 59px 249px hsl(1344.6, 100%, 50%), 60px 250px hsl(1350, 100%, 50%), 59px 251px hsl(1355.4, 100%, 50%), 59px 252px hsl(1360.8, 100%, 50%), 59px 253px hsl(1366.2, 100%, 50%), 59px 254px hsl(1371.6, 100%, 50%), 59px 255px hsl(1377, 100%, 50%), 58px 256px hsl(1382.4, 100%, 50%), 58px 257px hsl(1387.8, 100%, 50%), 58px 258px hsl(1393.2, 100%, 50%), 57px 259px hsl(1398.6, 100%, 50%), 57px 260px hsl(1404, 100%, 50%), 56px 261px hsl(1409.4, 100%, 50%), 55px 262px hsl(1414.8, 100%, 50%), 55px 263px hsl(1420.2, 100%, 50%), 54px 264px hsl(1425.6, 100%, 50%), 53px 265px hsl(1431, 100%, 50%), 52px 266px hsl(1436.4, 100%, 50%), 51px 267px hsl(1441.8, 100%, 50%), 50px 268px hsl(1447.2, 100%, 50%), 49px 269px hsl(1452.6, 100%, 50%), 48px 270px hsl(1458, 100%, 50%), 47px 271px hsl(1463.4, 100%, 50%), 46px 272px hsl(1468.8, 100%, 50%), 45px 273px hsl(1474.2, 100%, 50%), 43px 274px hsl(1479.6, 100%, 50%), 42px 275px hsl(1485, 100%, 50%), 41px 276px hsl(1490.4, 100%, 50%), 39px 277px hsl(1495.8, 100%, 50%), 38px 278px hsl(1501.2, 100%, 50%), 36px 279px hsl(1506.6, 100%, 50%), 35px 280px hsl(1512, 100%, 50%), 33px 281px hsl(1517.4, 100%, 50%), 32px 282px hsl(1522.8, 100%, 50%), 30px 283px hsl(1528.2, 100%, 50%), 28px 284px hsl(1533.6, 100%, 50%), 27px 285px hsl(1539, 100%, 50%), 25px 286px hsl(1544.4, 100%, 50%), 23px 287px hsl(1549.8, 100%, 50%), 22px 288px hsl(1555.2, 100%, 50%), 20px 289px hsl(1560.6, 100%, 50%), 18px 290px hsl(1566, 100%, 50%), 16px 291px hsl(1571.4, 100%, 50%), 14px 292px hsl(1576.8, 100%, 50%), 13px 293px hsl(1582.2, 100%, 50%), 11px 294px hsl(1587.6, 100%, 50%), 9px 295px hsl(1593, 100%, 50%), 7px 296px hsl(1598.4, 100%, 50%), 5px 297px hsl(1603.8, 100%, 50%), 3px 298px hsl(1609.2, 100%, 50%), 1px 299px hsl(1614.6, 100%, 50%), 2px 300px hsl(1620, 100%, 50%), -1px 301px hsl(1625.4, 100%, 50%), -3px 302px hsl(1630.8, 100%, 50%), -5px 303px hsl(1636.2, 100%, 50%), -7px 304px hsl(1641.6, 100%, 50%), -9px 305px hsl(1647, 100%, 50%), -11px 306px hsl(1652.4, 100%, 50%), -13px 307px hsl(1657.8, 100%, 50%), -14px 308px hsl(1663.2, 100%, 50%), -16px 309px hsl(1668.6, 100%, 50%), -18px 310px hsl(1674, 100%, 50%), -20px 311px hsl(1679.4, 100%, 50%), -22px 312px hsl(1684.8, 100%, 50%), -23px 313px hsl(1690.2, 100%, 50%), -25px 314px hsl(1695.6, 100%, 50%), -27px 315px hsl(1701, 100%, 50%), -28px 316px hsl(1706.4, 100%, 50%), -30px 317px hsl(1711.8, 100%, 50%), -32px 318px hsl(1717.2, 100%, 50%), -33px 319px hsl(1722.6, 100%, 50%), -35px 320px hsl(1728, 100%, 50%), -36px 321px hsl(1733.4, 100%, 50%), -38px 322px hsl(1738.8, 100%, 50%), -39px 323px hsl(1744.2, 100%, 50%), -41px 324px hsl(1749.6, 100%, 50%), -42px 325px hsl(1755, 100%, 50%), -43px 326px hsl(1760.4, 100%, 50%), -45px 327px hsl(1765.8, 100%, 50%), -46px 328px hsl(1771.2, 100%, 50%), -47px 329px hsl(1776.6, 100%, 50%), -48px 330px hsl(1782, 100%, 50%), -49px 331px hsl(1787.4, 100%, 50%), -50px 332px hsl(1792.8, 100%, 50%), -51px 333px hsl(1798.2, 100%, 50%), -52px 334px hsl(1803.6, 100%, 50%), -53px 335px hsl(1809, 100%, 50%), -54px 336px hsl(1814.4, 100%, 50%), -55px 337px hsl(1819.8, 100%, 50%), -55px 338px hsl(1825.2, 100%, 50%), -56px 339px hsl(1830.6, 100%, 50%), -57px 340px hsl(1836, 100%, 50%), -57px 341px hsl(1841.4, 100%, 50%), -58px 342px hsl(1846.8, 100%, 50%), -58px 343px hsl(1852.2, 100%, 50%), -58px 344px hsl(1857.6, 100%, 50%), -59px 345px hsl(1863, 100%, 50%), -59px 346px hsl(1868.4, 100%, 50%), -59px 347px hsl(1873.8, 100%, 50%), -59px 348px hsl(1879.2, 100%, 50%), -59px 349px hsl(1884.6, 100%, 50%), -60px 350px hsl(1890, 100%, 50%), -59px 351px hsl(1895.4, 100%, 50%), -59px 352px hsl(1900.8, 100%, 50%), -59px 353px hsl(1906.2, 100%, 50%), -59px 354px hsl(1911.6, 100%, 50%), -59px 355px hsl(1917, 100%, 50%), -58px 356px hsl(1922.4, 100%, 50%), -58px 357px hsl(1927.8, 100%, 50%), -58px 358px hsl(1933.2, 100%, 50%), -57px 359px hsl(1938.6, 100%, 50%), -57px 360px hsl(1944, 100%, 50%), -56px 361px hsl(1949.4, 100%, 50%), -55px 362px hsl(1954.8, 100%, 50%), -55px 363px hsl(1960.2, 100%, 50%), -54px 364px hsl(1965.6, 100%, 50%), -53px 365px hsl(1971, 100%, 50%), -52px 366px hsl(1976.4, 100%, 50%), -51px 367px hsl(1981.8, 100%, 50%), -50px 368px hsl(1987.2, 100%, 50%), -49px 369px hsl(1992.6, 100%, 50%), -48px 370px hsl(1998, 100%, 50%), -47px 371px hsl(2003.4, 100%, 50%), -46px 372px hsl(2008.8, 100%, 50%), -45px 373px hsl(2014.2, 100%, 50%), -43px 374px hsl(2019.6, 100%, 50%), -42px 375px hsl(2025, 100%, 50%), -41px 376px hsl(2030.4, 100%, 50%), -39px 377px hsl(2035.8, 100%, 50%), -38px 378px hsl(2041.2, 100%, 50%), -36px 379px hsl(2046.6, 100%, 50%), -35px 380px hsl(2052, 100%, 50%), -33px 381px hsl(2057.4, 100%, 50%), -32px 382px hsl(2062.8, 100%, 50%), -30px 383px hsl(2068.2, 100%, 50%), -28px 384px hsl(2073.6, 100%, 50%), -27px 385px hsl(2079, 100%, 50%), -25px 386px hsl(2084.4, 100%, 50%), -23px 387px hsl(2089.8, 100%, 50%), -22px 388px hsl(2095.2, 100%, 50%), -20px 389px hsl(2100.6, 100%, 50%), -18px 390px hsl(2106, 100%, 50%), -16px 391px hsl(2111.4, 100%, 50%), -14px 392px hsl(2116.8, 100%, 50%), -13px 393px hsl(2122.2, 100%, 50%), -11px 394px hsl(2127.6, 100%, 50%), -9px 395px hsl(2133, 100%, 50%), -7px 396px hsl(2138.4, 100%, 50%), -5px 397px hsl(2143.8, 100%, 50%), -3px 398px hsl(2149.2, 100%, 50%), -1px 399px hsl(2154.6, 100%, 50%); font-size: 40px;";
  7071.  
  7072. //start init thingamajigs
  7073. log("StateFarm: startUp()", attemptedInjection);
  7074. startUp();
  7075. log("StateFarm: after startUp()", attemptedInjection);
  7076.  
  7077. if (typeof GM_info !== 'undefined' && GM_info?.scriptHandler == "Tampermonkey") {
  7078. let count = GM_getValue("StateFarm_TampermonkeyWarnings") || 0;
  7079. count++;
  7080. if (count <= 3) {
  7081. let userConfirmed = confirm("StateFarm Client: Tampermonkey detected! StateFarm Client does not support this manager, use Violentmonkey instead. Press OK to be redirected to the Violentmonkey website. You can continue to use Tampermonkey, but expect unreliable results. For more information, visit our Discord server: "+discordURL);
  7082. if (userConfirmed) {
  7083. GM_openInTab(violentmonkeyURL, { active: true });
  7084. };
  7085. alert(`This alert will show three times in total. Please install Violentmonkey before reporting issues. ${3-count} more warnings.`);
  7086. };
  7087. GM_setValue("StateFarm_TampermonkeyWarnings", count); //continue counting for the lulz
  7088. };
  7089.  
  7090. setTimeout(() => {
  7091. if (!attemptedInjection) {
  7092. log("Injection didn't work for whatever reason, let's try again.");
  7093. reloadPage();
  7094. };
  7095. }, 30000);
  7096. })();
  7097. // log("StateFarm: after function", attemptedInjection);