Random script i found?

much better than before Press [=] for instructions also my discord not Trollers xD#0961

  1.  
  2. // ==UserScript==
  3. // @name Random script i found?
  4. // @namespace Don't use console for this!
  5. // @version v2.6.6
  6. // @description much better than before Press [=] for instructions also my discord not Trollers xD#0961
  7. // @license TC Meadow
  8. // @author TC Meadow
  9. // @match *://zombs.io/*
  10. // @require https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js
  11. // ==/UserScript==
  12. /*
  13. ######### CHANGELOG:
  14. 1.0.0 -> 1.79.9 === Unknown, this was too far before the changelog was created
  15. 1.80.0 -> 1.90.0 ==== UI fixes
  16. 1.90.1 -> 1.93.2 ===== Menu and score logger styling
  17. 1.93.3 -> 1.97.2 ====== User agent adjusts on CSS margin values and basic user agent detection to prevent inaccuracy over different screen resolutions
  18. 1.97.3 ======= Created Changelog
  19. 1.97.4 ======== Map styling
  20. 1.97.5 -> 1.97.9 ========= Fixed bugs with the onEnterWorld handlers and similar
  21. 1.98.1 -> 1.98.9 ========== Made it so that it blurs the game canvas and score logger when you open the menu
  22. 1.99.0 -> 1.99.5 =========== Created an algorithm for moving to a specific position on the map. Will be implemented later
  23. 1.99.5 -> 2.0.0 === Fixed bugs, and finally v2!
  24. 2.0.0 -> 2.1.6 ==== Made the MapMover stop when it gets to the destination
  25. 2.1.7 -> 2.1.9 ===== Optimized code and performance
  26. 2.2.0 -> 2.3.1 ====== Added new features to MapMover, for example being able to cancel the process, and a restart at a new click. Also fixed some bugs with it.
  27. 2.3.2 -> 2.3.7 ======= Better performance, also made game blurring and focusing more accurate when you open the menu. A couple other minor changes but thats pretty much it
  28. 2.3.7 -> 2.3.9 ======== Optimization, eHaxx watermark, and cross-compatability on different devices
  29. 2.3.9 -> 2.4.1 ========= Added confirmation when you wanted to MapMove
  30. 2.4.1 -> 2.4.3 ========== Added coordinates to bottom left of game, and fixed some styling issues
  31. 2.4.4 ===== Fixed some bugs with MapMover 4 minute timeouts
  32. 2.4.4 -> 2.4.6 ====== Made the script load with less glitches in styling
  33. 2.4.6 -> 2.6.6 ======= Added region capacity as to adapt to the new server population patches
  34. */
  35. let serverCapacity;
  36. let capacity = new XMLHttpRequest();
  37. capacity.open("GET", "http://zombs.io/capacity", true);
  38. capacity.onreadystatechange = () => {
  39. if(capacity.readyState === 4) {
  40. if(capacity.status === 200) {
  41. serverCapacity = JSON.parse(capacity.responseText);
  42. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-form > select > optgroup:nth-child(1)").label = `US East [${serverCapacity.regions["US East"].players} / ${serverCapacity.regions["US East"].capacity}]`;
  43. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-form > select > optgroup:nth-child(2)").label = `US West [${serverCapacity.regions["US West"].players} / ${serverCapacity.regions["US West"].capacity}]`;
  44. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-form > select > optgroup:nth-child(3)").label = `Europe [${serverCapacity.regions["Europe"].players} / ${serverCapacity.regions["Europe"].capacity}]`;
  45. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-form > select > optgroup:nth-child(4)").label = `Asia [${serverCapacity.regions["Asia"].players} / ${serverCapacity.regions["Asia"].capacity}]`;
  46. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-form > select > optgroup:nth-child(5)").label = `Australia [${serverCapacity.regions["Australia"].players} / ${serverCapacity.regions["Australia"].capacity}]`;
  47. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-form > select > optgroup:nth-child(6)").label = `South America [${serverCapacity.regions["South America"].players} / ${serverCapacity.regions["South America"].capacity}]`;
  48. };
  49. };
  50. };
  51. capacity.send();
  52. const lololololol = `eHaxx`
  53. let mapTimeouts = [];
  54. function createCoordinates() {
  55. let x = document.createElement('div')
  56. x.innerHTML = `<p id="coords" style="color:brown;">     X: 0, Y: 0</p>
  57. `
  58. x.style.textAlign = "center"
  59. document.querySelector("#hud > div.hud-bottom-left").append(x)
  60. }
  61. let mapMouseX;
  62. let mapMouseY;
  63. let hasBeenInWorld = false;
  64. const uAgent = navigator.userAgent;
  65. const isChromeOS = uAgent.includes('CrOS');
  66. const isMac = uAgent.includes('Macintosh');
  67. const isWindows = uAgent.includes('Windows');
  68. function blurText(path) {
  69. document.querySelector(path)
  70. .style.color = "transparent";
  71. document.querySelector(path)
  72. .style.textShadow = "0 0 5px rgba(0,0,0,0.5)";
  73. }
  74. function focusText(path, originalColor) {
  75. document.querySelector(path)
  76. .style.color = originalColor;
  77. document.querySelector(path)
  78. .style.textShadow = "none";
  79. }
  80. setInterval(() => {
  81. try {
  82. if (window.isInMenu) {
  83. blurText('#scorelog')
  84. blurCanvas()
  85. } else {
  86. focusText('#scorelog', 'black')
  87. focusCanvas()
  88. }
  89. } catch (err) {
  90. // console.log('Cannot blur or focus canvas. This is most likely because the score logger has not been loaded yet. Error: ' + err);
  91. }
  92. _isInChatbox = document.querySelector('.hud-chat')
  93. .classList.contains('is-focused')
  94. if (botMode) {
  95. if (parseInt((getEntitiesByModel('Tree')[0][1].targetTick.position.x - game.world.getEntityByUid(game.world.getMyUid())
  96. .targetTick.position.x)
  97. .toString()
  98. .replaceAll('-', '')) < 250) {
  99. game.network.sendRpc({
  100. name: "SendChatMessage",
  101. channel: "Local",
  102. message: "Tree @ Angle (in radians): " + getNearestTreeAngle()
  103. })
  104. danceRandom = false;
  105. } else {
  106. danceRandom = true;
  107. }
  108. if (parseInt((getEntitiesByModel('Stone')[0][1].targetTick.position.x - game.world.getEntityByUid(game.world.getMyUid())
  109. .targetTick.position.x)
  110. .toString()
  111. .replaceAll('-', '')) < 250) {
  112. game.network.sendRpc({
  113. name: "SendChatMessage",
  114. channel: "Local",
  115. message: "Stone @ Angle (in radians): " + getNearestStoneAngle()
  116. })
  117. }
  118. }
  119. }, 2.5)
  120. function blurCanvas() {
  121. document.querySelector('canvas')
  122. .style.filter = "blur(8px)";
  123. }
  124. function focusCanvas() {
  125. document.querySelector('canvas')
  126. .style.filter = "none";
  127. }
  128. const version = "2.4.6";
  129. const authors = "eh#6968 and Sirr0m";
  130. document.getElementsByClassName('hud-intro-name')[0].setAttribute('maxlength', 29);
  131. console.log('%ceHaxx', 'color: green; background: yellow; font-size: 30px');
  132. game.network.addEnterWorldHandler(function () {
  133. setTimeout(() => {
  134. game.network.sendRpc({
  135. name: "SendChatMessage",
  136. channel: "Local",
  137. message: "eHaxx v" + version + " (✓) made by " + authors
  138. })
  139. }, 500)
  140. document.querySelector("#hud > div.hud-bottom-center").style.textAlign = "center"
  141. document.querySelector("#hud > div.hud-bottom-center").style.color = "rgba(192, 192, 192, 0.75)"
  142. document.querySelector("#hud > div.hud-bottom-center").style.fontSize = "30px"
  143. setInterval(() => {
  144. document.querySelector("#hud > div.hud-top-right")
  145. .style.backgroundColor = "rgba(0, 0, 0, 0.25)";
  146. document.querySelector("#hud > div.hud-top-right")
  147. .style.border = "5px solid rgba(0, 0, 0, 0.30)";
  148. document.querySelector("#hud-spell-icons")
  149. .style.border = "5px solid rgba(0, 0, 0, 0.30)";
  150. document.querySelector("#hud-menu-icons")
  151. .style.border = "5px solid rgba(0, 0, 0, 0.30)";
  152. document.querySelector("#hud-menu-icons")
  153. .childNodes.forEach((item) => (item.innerHTML = ""));
  154. document.querySelectorAll(".hud-toolbar-building")
  155. .forEach((item) => {
  156. (item.style.border = "5px solid rgba(0, 0, 0, 0.30)"), (item.style.babsdsd = "25%");
  157. });
  158. document.querySelector("#hud-debug")
  159. .style.color = "grey";
  160. document.querySelector("#hud-toolbar > div.hud-toolbar-inventory > a:nth-child(1)")
  161. .style.backgroundColor = "rgba(0, 0, 0, 0.45)";
  162. document.querySelector("#hud-toolbar > div.hud-toolbar-inventory > a:nth-child(2)")
  163. .style.backgroundColor = "rgba(0, 0, 0, 0.45)";
  164. document.querySelector("#hud-toolbar > div.hud-toolbar-inventory > a:nth-child(3)")
  165. .style.backgroundColor = "rgba(0, 0, 0, 0.45)";
  166. document.querySelector("#hud-toolbar > div.hud-toolbar-inventory > a:nth-child(4)")
  167. .style.backgroundColor = "rgba(0, 0, 0, 0.45)";
  168. document.querySelector("#hud-toolbar > div.hud-toolbar-inventory > a:nth-child(5)")
  169. .style.backgroundColor = "rgba(0, 0, 0, 0.45)";
  170. document.querySelector("#hud-toolbar > div.hud-toolbar-inventory > a:nth-child(6)")
  171. .style.backgroundColor = "rgba(0, 0, 0, 0.25)";
  172. document.querySelector("#hud-toolbar > div.hud-toolbar-inventory > a:nth-child(1)")
  173. .style.border = "3px solid lightBlue";
  174. document.querySelector("#hud-toolbar > div.hud-toolbar-inventory > a:nth-child(2)")
  175. .style.border = "3px solid lightBlue";
  176. document.querySelector("#hud-toolbar > div.hud-toolbar-inventory > a:nth-child(3)")
  177. .style.border = "3px solid lightBlue";
  178. document.querySelector("#hud-toolbar > div.hud-toolbar-inventory > a:nth-child(4)")
  179. .style.border = "3px solid lightBlue";
  180. document.querySelector("#hud-toolbar > div.hud-toolbar-inventory > a:nth-child(5)")
  181. .style.border = "3px solid lightBlue";
  182. document.querySelector("#hud-toolbar > div.hud-toolbar-inventory > a:nth-child(6)")
  183. .style.border = "3px solid lightBlue";
  184. if (isChromeOS) {
  185. document.querySelector("#hud-menu-icons")
  186. .style.marginBottom = "120px";
  187. }
  188. document.querySelector("#hud-map")
  189. .style.backgroundColor = "rgba(0, 0, 0, 0.25)";
  190. document.querySelector("#hud-map")
  191. .style.border = "5px solid rgba(0, 0, 0, 0.40)";
  192. }, 250);
  193. setTimeout(() => {
  194. if (!hasBeenInWorld) {
  195. var scoreLogged = 0;
  196. if(!hasBeenInWorld) {
  197. hasBeenInWorld = true
  198. setInterval(() => {
  199. document.querySelector('#scorelog')
  200. .innerText = `Score in Last Wave: ${scoreLogged}`
  201. document.querySelector("#coords")
  202. .innerText = `      X: ${game.world.localPlayer.entity.targetTick.position.x}, Y: ${game.world.localPlayer.entity.targetTick.position.y}`
  203. }, 100)
  204. createCoordinates()
  205. }
  206. hasBeenInWorld = true;
  207. document.querySelector("#hud > div.hud-bottom-center").append('eHaxx ')
  208. var oldScore = Game.currentGame.ui.playerTick.score,
  209. newScore = 0;
  210. Game.currentGame.network.addRpcHandler("DayCycle", () => {
  211. newScore = Game.currentGame.ui.playerTick.score;
  212. scoreLogged = ((newScore - oldScore)
  213. .toLocaleString("en"));
  214. oldScore = Game.currentGame.ui.playerTick.score;
  215. });
  216. const topCenter = document.querySelector("#hud > div.hud-top-center");
  217. let logElem;
  218. logElem = document.createElement('div');
  219. logElem.innerHTML = `<h1 id="scorelog" style="color:white;">Score in Last Wave: 0</h1>`;
  220. topCenter.append(logElem);
  221. }
  222. }, 500)
  223. })
  224. var changeChat = true;
  225. var hoverOver;
  226. var mousemove;
  227. addEventListener('mousemove', (e) => {
  228. mousemove = e;
  229. })
  230. function roundTenThousands(x) {
  231. if (x > 10000) {
  232. return x.toString()
  233. .slice(0, 3) + "00"
  234. } else {
  235. return x.toString()
  236. }
  237. }
  238. function roundMyPosition(e) {
  239. return {
  240. x: roundTenThousands(e.getPositionX()),
  241. y: roundTenThousands(e.getPositionY())
  242. }
  243. }
  244. /*
  245. var mouseOverInterval = setInterval(() => {
  246. if (game.world.inWorld) {
  247. Object.entries(game.world.entities)
  248. .forEach((item => {
  249. if (roundMyPosition(item[1])
  250. .x == parseInt(roundTenThousands(game.renderer.screenToWorld(mousemove.clientX, mousemove.clientY)
  251. .x)) && roundMyPosition(item[1])
  252. .y == parseInt(roundTenThousands(game.renderer.screenToWorld(mousemove.clientX, mousemove.clientY)
  253. .y))) {
  254. hoverOver = 'Hovering over entity: ' + JSON.stringify(item[1].targetTick)
  255. } else {
  256. hoverOver = 'Hovering over no entities.'
  257. }
  258. }))
  259. document.querySelector('#hoverOver')
  260. .innerText = hoverOver;
  261. }
  262. }, 100)
  263. */
  264. var isSpamming = 0;
  265. function pauseChatSpam(e) {
  266. if (!isSpamming) {
  267. if (e == "") {
  268. // e = "<-=_eHaxx_=->"
  269. e = lololololol
  270. }
  271. window.spammer = setInterval(() => {
  272. game.network.sendRpc({
  273. name: "SendChatMessage",
  274. channel: "Local",
  275. message: e
  276. })
  277. }, 100)
  278. } else if (isSpamming) {
  279. clearInterval(window.spammer)
  280. }
  281. isSpamming = !isSpamming
  282. }
  283. window.rainbowwww = false;
  284. function degreesToYaw(deg) {
  285. let ans;
  286. if ((deg - 90) < 90) {
  287. ans = deg - 90
  288. } else if (deg == 90) {
  289. ans = deg + 90
  290. } else if (deg > 90) {
  291. ans = deg + 90
  292. }
  293. if (ans < 0) {
  294. ans = Math.abs(ans)
  295. }
  296. }
  297. if (localStorage.timesEhacked == undefined) {
  298. localStorage.timesEhacked = 1;
  299. } else {
  300. localStorage.timesEhacked++;
  301. }
  302. document.title = "eHaxx | Times Played: " + localStorage.timesEhacked
  303. var autoRespawn = false
  304. let hue = 10
  305. var settingsRainbow = document.querySelector("#hud-menu-settings")
  306. function changeHue() {
  307. if (window.rainbowwww) {
  308. hue -= 20
  309. }
  310. }
  311. function getEntitiesByModel(type) {
  312. let entities = []
  313. Object.entries(game.world.entities)
  314. .forEach((item => {
  315. if (item[1].targetTick.model == type) {
  316. entities.push(item)
  317. }
  318. }))
  319. return entities;
  320. }
  321. function moveUp() {
  322. game.inputPacketScheduler.scheduleInput({
  323. down: 0,
  324. up: 1
  325. })
  326. }
  327. function moveDown() {
  328. game.inputPacketScheduler.scheduleInput({
  329. up: 0,
  330. down: 1
  331. })
  332. }
  333. function moveLeft() {
  334. game.inputPacketScheduler.scheduleInput({
  335. right: 0,
  336. left: 1
  337. })
  338. }
  339. function moveRight() {
  340. game.inputPacketScheduler.scheduleInput({
  341. left: 0,
  342. right: 1
  343. })
  344. }
  345. var danceCounter = 0
  346. var danceRandom = true
  347. var botMode = false
  348. var danceInterval = setInterval(() => {
  349. if (botMode) {
  350. if (danceCounter < moves.length) {
  351. moves[danceCounter]()
  352. if (danceRandom) {
  353. danceCounter = Math.floor(Math.random() * moves.length)
  354. } else {
  355. danceCounter++
  356. }
  357. } else {
  358. danceCounter = 0;
  359. }
  360. }
  361. }, 500)
  362. var respawnInterval = setInterval(() => {
  363. if (document.querySelector('.hud-respawn')
  364. .style.display == "block" && autoRespawn) {
  365. game.inputPacketScheduler.scheduleInput({
  366. respawn: 1
  367. })
  368. document.querySelector('.hud-respawn')
  369. .style.display = "none"
  370. }
  371. }, 10)
  372. var moves = [moveUp, moveRight, moveDown, moveLeft]
  373. function getNearestStoneAngle() {
  374. let stoneEntities = getEntitiesByModel('Stone');
  375. let firstStone = stoneEntities[0][1].targetTick;
  376. let player = game.world.localPlayer.entity.targetTick
  377. return Math.atan2(player.position.y - firstStone.position.y / 2,
  378. player.position.x - firstStone.position.x)
  379. }
  380. function getNearestTreeAngle() {
  381. return Math.atan2(game.world.entities[game.world.getMyUid()].targetTick.position.y - getEntitiesByModel('Tree')[0][1].targetTick.position.y / 2, game.world
  382. .entities[game.world.getMyUid()].targetTick.position.x - getEntitiesByModel('Tree')[0][1].targetTick.position.x)
  383. }
  384. function scanServer() {
  385. var current = []
  386. Object.entries(game.ui.getComponent('Leaderboard')
  387. .playerNames)
  388. .forEach((item => {
  389. current.push(item)
  390. }))
  391. return JSON.stringify(current)
  392. }
  393. var leaveChats = ['POP', 'BING', 'TONG', 'RIIING', 'POOF']
  394. function leaveChat() {
  395. let counter = 0;
  396. window.leaveChatInterval = setInterval(() => {
  397. if (counter < leaveChats.length) {
  398. doNewSend(['ch', [leaveChats[counter]]]);
  399. counter++;
  400. } else {
  401. counter = 0;
  402. clearInterval(window.leaveChatInterval);
  403. Game.currentGame.network.disconnect();
  404. };
  405. }, 1500);
  406. };
  407. window.startaito = false;
  408. window.useSamePI = false
  409. addEventListener('keyup', function (e) {
  410. if (e.key == "`" && !_isInChatbox) {
  411. game.inputManager.onKeyRelease({
  412. keyCode: 117
  413. })
  414. }
  415. }) // debug info
  416. var bw1 = "😈 Boss Waves [1/2]: 9, 17, 25, 33, 41, 49, 57, 65, 73, 81 😈"
  417. var bw2 = "😈 Boss Waves [2/2]: 89, 97, 105, 121 😈"
  418. window.ajsd = Math.random()
  419. .toString()
  420. .slice(0, 6)
  421. console.log(window.ajsd)
  422. var users = [
  423. {
  424. "name": "☭ 𝑒𝒽 ✨ ツ ✓",
  425. "roles": ['Owner', 'Admin']
  426. }
  427. , {
  428. "name": "u7🤗ツ✔",
  429. "roles": ['Co-Owner', 'Admin']
  430. }
  431. , {
  432. "name": "☢₦Ʉ₵ⱠɆ₳Ɽ☣✔",
  433. "roles": ['Co-Owner', 'Admin']
  434. }
  435. , {
  436. "name": "⦕NR⦖☭𝑒𝒽✨ツ✓",
  437. "roles": ['Owner', 'Admin']
  438. }
  439. , {
  440. "name": "Potato Bot",
  441. "roles": ['Admin', 'Leaker']
  442. }
  443. , {
  444. "name": "⦕NR⦖ F3AR ツ",
  445. "roles": ['Admin', 'Official']
  446. }
  447. , {
  448. "name": "Yazeet",
  449. "roles": ['Stealer']
  450. }
  451. ]
  452. var q = [
  453. {
  454. word: "is",
  455. answers: ['Naw', 'Yup.'],
  456. random: true
  457. }
  458. , {
  459. word: "will",
  460. answers: ['Outlook good.', 'Perhaps.', 'Yup.', 'Naw'],
  461. random: true
  462. }
  463. , {
  464. word: "when",
  465. answers: ['Soon.', 'Never.'],
  466. random: true
  467. }
  468. , {
  469. word: "are",
  470. answers: ['Yup.', 'Naw', 'Perhaps.'],
  471. random: true
  472. }]
  473. let ppInterval = setInterval(() => { // show private parties
  474. if (document.querySelector('#showpp')
  475. .checked) {
  476. document.querySelectorAll('.hud-party-link')
  477. .forEach((elem => {
  478. if (elem.style.display == "none") {
  479. elem.style.display = "block"
  480. elem.childNodes[0].innerText = elem.childNodes[0].innerText + "[PRIVATE]"
  481. elem.addEventListener('click', function () {
  482. game.ui.getComponent('PopupOverlay')
  483. .showHint('Cannot join this party as it is private', 1e4)
  484. })
  485. }
  486. }))
  487. }
  488. }, 3000) // show private parties
  489. window.lpSave = []
  490. const altSpace = " " // alternate space character
  491. String.prototype.multiChatSpaces = function () {
  492. return this.replaceAll(' ', altSpace)
  493. }
  494. var chatAnims = {
  495. makeRect: [
  496. "________________________"
  497. , "| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |"
  498. , "________________________"
  499. ],
  500. makeCircle: [
  501. " ╱‾‾‾‾‾╲"
  502. , " / \\"
  503. , " | |"
  504. , " \\ /"
  505. , " ╲_____╱"
  506. ]
  507. } // :D
  508. window.use_di = true;
  509. window.isInMenu = false;
  510. function doorWall() {
  511. var stashPosition = getGoldStash()
  512. PlaceBuilding(stashPosition.x + 0, stashPosition.y + 0, 'GoldStash', 180);
  513. PlaceBuilding(stashPosition.x + -96, stashPosition.y + -96, 'GoldMine', 180);
  514. PlaceBuilding(stashPosition.x + 0, stashPosition.y + -96, 'GoldMine', 180);
  515. PlaceBuilding(stashPosition.x + 96, stashPosition.y + -96, 'GoldMine', 180);
  516. PlaceBuilding(stashPosition.x + 96, stashPosition.y + -192, 'GoldMine', 180);
  517. PlaceBuilding(stashPosition.x + 0, stashPosition.y + -192, 'GoldMine', 180);
  518. PlaceBuilding(stashPosition.x + -96, stashPosition.y + -192, 'GoldMine', 180);
  519. PlaceBuilding(stashPosition.x + -96, stashPosition.y + -288, 'GoldMine', 180);
  520. PlaceBuilding(stashPosition.x + -24, stashPosition.y + -840, 'Door', 180);
  521. PlaceBuilding(stashPosition.x + -72, stashPosition.y + -840, 'Door', 180);
  522. PlaceBuilding(stashPosition.x + -120, stashPosition.y + -840, 'Door', 180);
  523. PlaceBuilding(stashPosition.x + -168, stashPosition.y + -840, 'Door', 180);
  524. PlaceBuilding(stashPosition.x + -216, stashPosition.y + -840, 'Door', 180);
  525. PlaceBuilding(stashPosition.x + -264, stashPosition.y + -840, 'Door', 180);
  526. PlaceBuilding(stashPosition.x + -312, stashPosition.y + -840, 'Door', 180);
  527. PlaceBuilding(stashPosition.x + -360, stashPosition.y + -840, 'Door', 180);
  528. PlaceBuilding(stashPosition.x + -408, stashPosition.y + -840, 'Door', 180);
  529. PlaceBuilding(stashPosition.x + -456, stashPosition.y + -840, 'Door', 180);
  530. PlaceBuilding(stashPosition.x + -504, stashPosition.y + -840, 'Door', 180);
  531. PlaceBuilding(stashPosition.x + -552, stashPosition.y + -840, 'Door', 180);
  532. PlaceBuilding(stashPosition.x + 24, stashPosition.y + -840, 'Door', 180);
  533. PlaceBuilding(stashPosition.x + 72, stashPosition.y + -840, 'Door', 180);
  534. PlaceBuilding(stashPosition.x + 120, stashPosition.y + -840, 'Door', 180);
  535. PlaceBuilding(stashPosition.x + 168, stashPosition.y + -840, 'Door', 180);
  536. PlaceBuilding(stashPosition.x + 216, stashPosition.y + -840, 'Door', 180);
  537. PlaceBuilding(stashPosition.x + 264, stashPosition.y + -840, 'Door', 180);
  538. PlaceBuilding(stashPosition.x + -600, stashPosition.y + -840, 'Door', 180);
  539. PlaceBuilding(stashPosition.x + -648, stashPosition.y + -840, 'Door', 180);
  540. PlaceBuilding(stashPosition.x + -696, stashPosition.y + -840, 'Door', 180);
  541. PlaceBuilding(stashPosition.x + -744, stashPosition.y + -840, 'Door', 180);
  542. PlaceBuilding(stashPosition.x + -792, stashPosition.y + -840, 'Door', 180);
  543. PlaceBuilding(stashPosition.x + -840, stashPosition.y + -840, 'Door', 180);
  544. PlaceBuilding(stashPosition.x + -840, stashPosition.y + -792, 'Door', 180);
  545. PlaceBuilding(stashPosition.x + -840, stashPosition.y + -744, 'Door', 180);
  546. PlaceBuilding(stashPosition.x + -840, stashPosition.y + -696, 'Door', 180);
  547. PlaceBuilding(stashPosition.x + -840, stashPosition.y + -648, 'Door', 180);
  548. PlaceBuilding(stashPosition.x + -840, stashPosition.y + -600, 'Door', 180);
  549. PlaceBuilding(stashPosition.x + -840, stashPosition.y + -552, 'Door', 180);
  550. PlaceBuilding(stashPosition.x + -840, stashPosition.y + -504, 'Door', 180);
  551. PlaceBuilding(stashPosition.x + -840, stashPosition.y + -456, 'Door', 180);
  552. PlaceBuilding(stashPosition.x + -840, stashPosition.y + -408, 'Door', 180);
  553. PlaceBuilding(stashPosition.x + -840, stashPosition.y + -360, 'Door', 180);
  554. PlaceBuilding(stashPosition.x + -840, stashPosition.y + -312, 'Door', 180);
  555. PlaceBuilding(stashPosition.x + -840, stashPosition.y + -264, 'Door', 180);
  556. PlaceBuilding(stashPosition.x + -840, stashPosition.y + -216, 'Door', 180);
  557. PlaceBuilding(stashPosition.x + -840, stashPosition.y + -168, 'Door', 180);
  558. PlaceBuilding(stashPosition.x + -840, stashPosition.y + -120, 'Door', 180);
  559. PlaceBuilding(stashPosition.x + -840, stashPosition.y + -72, 'Door', 180);
  560. PlaceBuilding(stashPosition.x + -840, stashPosition.y + -24, 'Door', 180);
  561. PlaceBuilding(stashPosition.x + -840, stashPosition.y + 24, 'Door', 180);
  562. PlaceBuilding(stashPosition.x + -840, stashPosition.y + 72, 'Door', 180);
  563. PlaceBuilding(stashPosition.x + -840, stashPosition.y + 120, 'Door', 180);
  564. PlaceBuilding(stashPosition.x + -840, stashPosition.y + 168, 'Door', 180);
  565. PlaceBuilding(stashPosition.x + -840, stashPosition.y + 216, 'Door', 180);
  566. PlaceBuilding(stashPosition.x + -840, stashPosition.y + 264, 'Door', 180);
  567. PlaceBuilding(stashPosition.x + -840, stashPosition.y + 312, 'Door', 180);
  568. PlaceBuilding(stashPosition.x + -840, stashPosition.y + 360, 'Door', 180);
  569. PlaceBuilding(stashPosition.x + -840, stashPosition.y + 408, 'Door', 180);
  570. PlaceBuilding(stashPosition.x + -840, stashPosition.y + 456, 'Door', 180);
  571. PlaceBuilding(stashPosition.x + -840, stashPosition.y + 504, 'Door', 180);
  572. PlaceBuilding(stashPosition.x + -840, stashPosition.y + 552, 'Door', 180);
  573. PlaceBuilding(stashPosition.x + -840, stashPosition.y + 600, 'Door', 180);
  574. PlaceBuilding(stashPosition.x + -840, stashPosition.y + 648, 'Door', 180);
  575. PlaceBuilding(stashPosition.x + -840, stashPosition.y + 696, 'Door', 180);
  576. PlaceBuilding(stashPosition.x + -840, stashPosition.y + 744, 'Door', 180);
  577. PlaceBuilding(stashPosition.x + -840, stashPosition.y + 792, 'Door', 180);
  578. PlaceBuilding(stashPosition.x + -840, stashPosition.y + 840, 'Door', 180);
  579. PlaceBuilding(stashPosition.x + -792, stashPosition.y + 840, 'Door', 180);
  580. PlaceBuilding(stashPosition.x + -744, stashPosition.y + 840, 'Door', 180);
  581. PlaceBuilding(stashPosition.x + -696, stashPosition.y + 840, 'Door', 180);
  582. PlaceBuilding(stashPosition.x + -648, stashPosition.y + 840, 'Door', 180);
  583. PlaceBuilding(stashPosition.x + -600, stashPosition.y + 840, 'Door', 180);
  584. PlaceBuilding(stashPosition.x + -552, stashPosition.y + 840, 'Door', 180);
  585. PlaceBuilding(stashPosition.x + -504, stashPosition.y + 840, 'Door', 180);
  586. PlaceBuilding(stashPosition.x + -456, stashPosition.y + 840, 'Door', 180);
  587. PlaceBuilding(stashPosition.x + -408, stashPosition.y + 840, 'Door', 180);
  588. PlaceBuilding(stashPosition.x + -360, stashPosition.y + 840, 'Door', 180);
  589. PlaceBuilding(stashPosition.x + -216, stashPosition.y + 840, 'Door', 180);
  590. PlaceBuilding(stashPosition.x + -168, stashPosition.y + 840, 'Door', 180);
  591. PlaceBuilding(stashPosition.x + -72, stashPosition.y + 840, 'Door', 180);
  592. PlaceBuilding(stashPosition.x + 24, stashPosition.y + 840, 'Door', 180);
  593. PlaceBuilding(stashPosition.x + -312, stashPosition.y + 840, 'Door', 180);
  594. PlaceBuilding(stashPosition.x + -264, stashPosition.y + 840, 'Door', 180);
  595. PlaceBuilding(stashPosition.x + -120, stashPosition.y + 840, 'Door', 180);
  596. PlaceBuilding(stashPosition.x + -24, stashPosition.y + 840, 'Door', 180);
  597. PlaceBuilding(stashPosition.x + 72, stashPosition.y + 840, 'Door', 180);
  598. PlaceBuilding(stashPosition.x + 120, stashPosition.y + 840, 'Door', 180);
  599. PlaceBuilding(stashPosition.x + 168, stashPosition.y + 840, 'Door', 180);
  600. PlaceBuilding(stashPosition.x + 216, stashPosition.y + 840, 'Door', 180);
  601. PlaceBuilding(stashPosition.x + 264, stashPosition.y + 840, 'Door', 180);
  602. PlaceBuilding(stashPosition.x + 312, stashPosition.y + 840, 'Door', 180);
  603. PlaceBuilding(stashPosition.x + 360, stashPosition.y + 840, 'Door', 180);
  604. PlaceBuilding(stashPosition.x + 456, stashPosition.y + 840, 'Door', 180);
  605. PlaceBuilding(stashPosition.x + 408, stashPosition.y + 840, 'Door', 180);
  606. PlaceBuilding(stashPosition.x + 504, stashPosition.y + 840, 'Door', 180);
  607. PlaceBuilding(stashPosition.x + 552, stashPosition.y + 840, 'Door', 180);
  608. PlaceBuilding(stashPosition.x + 600, stashPosition.y + 840, 'Door', 180);
  609. PlaceBuilding(stashPosition.x + 648, stashPosition.y + 840, 'Door', 180);
  610. PlaceBuilding(stashPosition.x + 696, stashPosition.y + 840, 'Door', 180);
  611. PlaceBuilding(stashPosition.x + 744, stashPosition.y + 840, 'Door', 180);
  612. PlaceBuilding(stashPosition.x + 792, stashPosition.y + 840, 'Door', 180);
  613. PlaceBuilding(stashPosition.x + 840, stashPosition.y + 840, 'Door', 180);
  614. PlaceBuilding(stashPosition.x + 840, stashPosition.y + 792, 'Door', 180);
  615. PlaceBuilding(stashPosition.x + 840, stashPosition.y + 744, 'Door', 180);
  616. PlaceBuilding(stashPosition.x + 840, stashPosition.y + 696, 'Door', 180);
  617. PlaceBuilding(stashPosition.x + 840, stashPosition.y + 648, 'Door', 180);
  618. PlaceBuilding(stashPosition.x + 840, stashPosition.y + 600, 'Door', 180);
  619. PlaceBuilding(stashPosition.x + 840, stashPosition.y + 552, 'Door', 180);
  620. PlaceBuilding(stashPosition.x + 840, stashPosition.y + 504, 'Door', 180);
  621. PlaceBuilding(stashPosition.x + 840, stashPosition.y + 456, 'Door', 180);
  622. PlaceBuilding(stashPosition.x + 840, stashPosition.y + 408, 'Door', 180);
  623. PlaceBuilding(stashPosition.x + 840, stashPosition.y + 360, 'Door', 180);
  624. PlaceBuilding(stashPosition.x + 840, stashPosition.y + 312, 'Door', 180);
  625. PlaceBuilding(stashPosition.x + 840, stashPosition.y + 264, 'Door', 180);
  626. PlaceBuilding(stashPosition.x + 840, stashPosition.y + 216, 'Door', 180);
  627. PlaceBuilding(stashPosition.x + 840, stashPosition.y + 168, 'Door', 180);
  628. PlaceBuilding(stashPosition.x + 840, stashPosition.y + 120, 'Door', 180);
  629. PlaceBuilding(stashPosition.x + 840, stashPosition.y + 72, 'Door', 180);
  630. PlaceBuilding(stashPosition.x + 840, stashPosition.y + 24, 'Door', 180);
  631. PlaceBuilding(stashPosition.x + 840, stashPosition.y + -24, 'Door', 180);
  632. PlaceBuilding(stashPosition.x + 840, stashPosition.y + -72, 'Door', 180);
  633. PlaceBuilding(stashPosition.x + 840, stashPosition.y + -168, 'Door', 180);
  634. PlaceBuilding(stashPosition.x + 840, stashPosition.y + -264, 'Door', 180);
  635. PlaceBuilding(stashPosition.x + 840, stashPosition.y + -312, 'Door', 180);
  636. PlaceBuilding(stashPosition.x + 840, stashPosition.y + -360, 'Door', 180);
  637. PlaceBuilding(stashPosition.x + 840, stashPosition.y + -408, 'Door', 180);
  638. PlaceBuilding(stashPosition.x + 840, stashPosition.y + -456, 'Door', 180);
  639. PlaceBuilding(stashPosition.x + 840, stashPosition.y + -504, 'Door', 180);
  640. PlaceBuilding(stashPosition.x + 840, stashPosition.y + -552, 'Door', 180);
  641. PlaceBuilding(stashPosition.x + 840, stashPosition.y + -600, 'Door', 180);
  642. PlaceBuilding(stashPosition.x + 840, stashPosition.y + -648, 'Door', 180);
  643. PlaceBuilding(stashPosition.x + 840, stashPosition.y + -216, 'Door', 180);
  644. PlaceBuilding(stashPosition.x + 840, stashPosition.y + -120, 'Door', 180);
  645. PlaceBuilding(stashPosition.x + 312, stashPosition.y + -840, 'Door', 180);
  646. PlaceBuilding(stashPosition.x + 360, stashPosition.y + -840, 'Door', 180);
  647. PlaceBuilding(stashPosition.x + 408, stashPosition.y + -840, 'Door', 180);
  648. PlaceBuilding(stashPosition.x + 456, stashPosition.y + -840, 'Door', 180);
  649. PlaceBuilding(stashPosition.x + 504, stashPosition.y + -840, 'Door', 180);
  650. PlaceBuilding(stashPosition.x + 552, stashPosition.y + -840, 'Door', 180);
  651. PlaceBuilding(stashPosition.x + 600, stashPosition.y + -840, 'Door', 180);
  652. PlaceBuilding(stashPosition.x + 648, stashPosition.y + -840, 'Door', 180);
  653. PlaceBuilding(stashPosition.x + 696, stashPosition.y + -840, 'Door', 180);
  654. PlaceBuilding(stashPosition.x + 744, stashPosition.y + -840, 'Door', 180);
  655. PlaceBuilding(stashPosition.x + 792, stashPosition.y + -840, 'Door', 180);
  656. PlaceBuilding(stashPosition.x + 840, stashPosition.y + -840, 'Door', 180);
  657. PlaceBuilding(stashPosition.x + 840, stashPosition.y + -792, 'Door', 180);
  658. PlaceBuilding(stashPosition.x + 840, stashPosition.y + -744, 'Door', 180);
  659. PlaceBuilding(stashPosition.x + 840, stashPosition.y + -696, 'Door', 180);
  660. }
  661. var animChat = {
  662. makeRect: function () {
  663. let counter = 0;
  664. let rectInterval = setInterval(() => {
  665. if (counter < chatAnims.makeRect.length) {
  666. doNewSend(['ch', [chatAnims.makeRect[counter].multiChatSpaces()]])
  667. counter++
  668. } else {
  669. counter = 0
  670. clearInterval(rectInterval)
  671. }
  672. }, 3000)
  673. },
  674. makeCircle: function () {
  675. let counter = 0;
  676. let circleInterval = setInterval(() => {
  677. if (counter < chatAnims.makeCircle.length) {
  678. doNewSend(['ch', [chatAnims.makeCircle[counter].multiChatSpaces()]])
  679. counter++
  680. } else {
  681. counter = 0
  682. clearInterval(circleInterval)
  683. }
  684. }, 3000)
  685. }
  686. }
  687. function btnChatCircle() {
  688. animChat.makeCircle()
  689. }
  690. function btnChatRect() {
  691. animChat.makeRect()
  692. }
  693. function upgradeAll() {
  694. var entities = Game.currentGame.world.entities;
  695. for (var uid in entities) {
  696. if (!entities.hasOwnProperty(uid)) continue;
  697. var obj = entities[uid];
  698. Game.currentGame.network.sendRpc({
  699. name: "UpgradeBuilding",
  700. uid: obj.fromTick.uid
  701. })
  702. }
  703. doNewSend(['ch', ['♦️ Upgraded All! ♦️']])
  704. }
  705. function movePlayer(e) {
  706. if (!_isInChatbox) {
  707. switch (e.toLowerCase()
  708. .replaceAll(' ', '')) {
  709. case "a":
  710. Game.currentGame.network.sendInput({
  711. left: 1
  712. })
  713. break;
  714. case "d":
  715. Game.currentGame.network.sendInput({
  716. right: 1
  717. })
  718. break;
  719. case "w":
  720. Game.currentGame.network.sendInput({
  721. up: 1
  722. })
  723. break;
  724. case "s":
  725. Game.currentGame.network.sendInput({
  726. down: 1
  727. })
  728. break;
  729. }
  730. }
  731. }
  732. var emojis = [
  733. {
  734. text: ":happy:",
  735. char: "😄"
  736. }
  737. , {
  738. text: ":sad:",
  739. char: "😥"
  740. }
  741. , {
  742. text: ":angry:",
  743. char: "😠"
  744. }
  745. , {
  746. text: ":laughing:",
  747. char: "😂"
  748. }
  749. , {
  750. text: ":stop:",
  751. char: "🛑"
  752. }
  753. , {
  754. text: ":revenge:",
  755. char: "😈"
  756. }
  757. , {
  758. text: ":smiley:",
  759. char: "ヅ"
  760. }
  761. , {
  762. text: ":pog:",
  763. char: "ÌŠ<ÌŠ"
  764. }]
  765. function heal() {
  766. Game.currentGame.network.sendRpc({
  767. "name": "BuyItem",
  768. "itemName": "HealthPotion",
  769. "tier": 1
  770. })
  771. Game.currentGame.network.sendRpc({
  772. "name": "EquipItem",
  773. "itemName": "HealthPotion",
  774. "tier": 1
  775. })
  776. Game.currentGame.network.sendRpc({
  777. "name": "BuyItem",
  778. "itemName": "PetHealthPotion",
  779. "tier": 1
  780. })
  781. Game.currentGame.network.sendRpc({
  782. "name": "EquipItem",
  783. "itemName": "PetHealthPotion",
  784. "tier": 1
  785. })
  786. }
  787. function getGoldStash() {
  788. let entities = Game.currentGame.ui.buildings
  789. for (let uid in entities) {
  790. if (!entities.hasOwnProperty(uid)) {
  791. continue
  792. }
  793. let obj = entities[uid]
  794. if (obj.type == "GoldStash") {
  795. return obj
  796. }
  797. }
  798. }
  799. function PlaceBuilding(x, y, building, yaw) {
  800. Game.currentGame.network.sendRpc({
  801. name: "MakeBuilding",
  802. x: x,
  803. y: y,
  804. type: building,
  805. yaw: yaw
  806. })
  807. }
  808. var isBowing = false;
  809. var slotChars = [
  810. {
  811. char: "7️⃣",
  812. value: 33
  813. }
  814. , {
  815. char: "🍎",
  816. value: 10
  817. }
  818. , {
  819. char: "🍔",
  820. value: 25
  821. }
  822. , {
  823. char: "🥓",
  824. value: 15
  825. }
  826. , {
  827. char: "âš½",
  828. value: 12
  829. }
  830. , {
  831. char: "🐾",
  832. value: 10
  833. }
  834. , {
  835. char: "1️⃣",
  836. value: 27
  837. }
  838. , {
  839. char: "💡",
  840. value: 30
  841. }]
  842. console.log(slotChars)
  843. window.generateSlots = function () { // fp is the returned array, fs is the joined | fp string, pp is the score
  844. let fp = [];
  845. let fs = "";
  846. let pp = 0;
  847. var f1 = slotChars[Math.floor(Math.random() * slotChars.length)]
  848. fp.push(f1.char)
  849. pp += f1.value
  850. var f2 = slotChars[Math.floor(Math.random() * slotChars.length)]
  851. fp.push(f2.char)
  852. pp += f2.value
  853. var f3 = slotChars[Math.floor(Math.random() * slotChars.length)]
  854. fp.push(f3.char)
  855. pp += f3.value
  856. fs = [fp.join('|'), pp + " / 99"]
  857. return fs;
  858. }
  859. function ahrc1() { // 1 ahrc (collect and refuel), used in lpinterval
  860. var entities = Game.currentGame.world.entities
  861. for (let uid in entities) {
  862. if (!entities.hasOwnProperty(uid)) continue;
  863. let obj = entities[uid];
  864. Game.currentGame.network.sendRpc({
  865. name: "CollectHarvester",
  866. uid: obj.fromTick.uid
  867. });
  868. if (obj.fromTick.model == "Harvester" && obj.fromTick.tier == 1) {
  869. Game.currentGame.network.sendRpc({
  870. name: "AddDepositToHarvester",
  871. uid: obj.fromTick.uid,
  872. deposit: 0.07
  873. });
  874. }
  875. if (obj.fromTick.model == "Harvester" && obj.fromTick.tier == 2) {
  876. Game.currentGame.network.sendRpc({
  877. name: "AddDepositToHarvester",
  878. uid: obj.fromTick.uid,
  879. deposit: 0.11
  880. });
  881. }
  882. if (obj.fromTick.model == "Harvester" && obj.fromTick.tier == 3) {
  883. Game.currentGame.network.sendRpc({
  884. name: "AddDepositToHarvester",
  885. uid: obj.fromTick.uid,
  886. deposit: 0.17
  887. });
  888. }
  889. if (obj.fromTick.model == "Harvester" && obj.fromTick.tier == 4) {
  890. Game.currentGame.network.sendRpc({
  891. name: "AddDepositToHarvester",
  892. uid: obj.fromTick.uid,
  893. deposit: 0.22
  894. });
  895. }
  896. if (obj.fromTick.model == "Harvester" && obj.fromTick.tier == 5) {
  897. Game.currentGame.network.sendRpc({
  898. name: "AddDepositToHarvester",
  899. uid: obj.fromTick.uid,
  900. deposit: 0.25
  901. });
  902. }
  903. if (obj.fromTick.model == "Harvester" && obj.fromTick.tier == 6) {
  904. Game.currentGame.network.sendRpc({
  905. name: "AddDepositToHarvester",
  906. uid: obj.fromTick.uid,
  907. deposit: 0.28
  908. });
  909. }
  910. if (obj.fromTick.model == "Harvester" && obj.fromTick.tier == 7) {
  911. Game.currentGame.network.sendRpc({
  912. name: "AddDepositToHarvester",
  913. uid: obj.fromTick.uid,
  914. deposit: 0.42
  915. });
  916. }
  917. if (obj.fromTick.model == "Harvester" && obj.fromTick.tier == 8) {
  918. Game.currentGame.network.sendRpc({
  919. name: "AddDepositToHarvester",
  920. uid: obj.fromTick.uid,
  921. deposit: 0.65
  922. });
  923. }
  924. }
  925. }
  926. var lpinterval = setInterval(function () { // loaded player info, ahrc, isInMenu, noob = chatbot
  927. document.querySelector('#lpi')
  928. .innerText = "Loaded Player Info: " + JSON.stringify(window.loadedIDS())
  929. if (window.ahrc) {
  930. ahrc1()
  931. }
  932. window.isInMenu = document.querySelector('#hud-menu-settings')
  933. .style.display == "block" ? true : false
  934. if ((window.lpSave[window.lpSave.length - 1] !== loadedPlayers()[loadedPlayers()
  935. .length - 1]) && document.querySelector('#noobchat')
  936. .checked) {
  937. doNewSend(['ch', ['NOOB = ' + loadedPlayers()[Math.floor(Math.random() * loadedPlayers()
  938. .length)]]])
  939. window.lpSave = loadedPlayers()
  940. }
  941. document.querySelector("#hud-menu-party > div.hud-party-grid > div.hud-party-joining")
  942. .style.display = "none"
  943. }, 250)
  944. // enable/disable chat
  945. // 🟩 🟥
  946. function enDisAbleEmj(bool, txt) {
  947. return bool ? "🟩 " + txt + " Enabled 🟩" : "🟥 " + txt + " Disabled 🟥"
  948. }
  949. // disable enable in chat
  950. window.cmdsEnabled = true
  951. // these are all button event listeners --->
  952. function toggleCmds() {
  953. window.cmdsEnabled = !window.cmdsEnabled
  954. if (changeChat) {
  955. doNewSend(['ch', [enDisAbleEmj(window.cmdsEnabled, "Commands")]])
  956. }
  957. document.querySelector('#togglecmd')
  958. .innerText = window.cmdsEnabled ? "Disable Commands" : "Enable Commands"
  959. }
  960. function sellAll() {
  961. var entities = Game.currentGame.world.entities;
  962. for (var uid in entities) {
  963. if (!entities.hasOwnProperty(uid)) continue;
  964. var obj = entities[uid];
  965. if (obj.fromTick.model !== "GoldStash") {
  966. Game.currentGame.network.sendRpc({
  967. name: "DeleteBuilding",
  968. uid: obj.fromTick.uid
  969. });
  970. }
  971. }
  972. doNewSend(['ch', ['💰 Sold All 💰']])
  973. }
  974. function sellWalls() {
  975. var entities = Game.currentGame.world.entities;
  976. for (var uid in entities) {
  977. if (!entities.hasOwnProperty(uid)) continue;
  978. var obj = entities[uid];
  979. if (obj.fromTick.model == "Wall") {
  980. Game.currentGame.network.sendRpc({
  981. name: "DeleteBuilding",
  982. uid: obj.fromTick.uid
  983. })
  984. }
  985. }
  986. doNewSend(['ch', ['💰 Sold Walls 💰']])
  987. }
  988. function sellBombTowers() {
  989. var entities = Game.currentGame.world.entities;
  990. for (var uid in entities) {
  991. if (!entities.hasOwnProperty(uid)) continue;
  992. var obj = entities[uid];
  993. if (obj.fromTick.model == "BombTower") {
  994. Game.currentGame.network.sendRpc({
  995. name: "DeleteBuilding",
  996. uid: obj.fromTick.uid
  997. });
  998. }
  999. }
  1000. doNewSend(['ch', ['💰 Sold Bomb Towers 💰']])
  1001. }
  1002. function sellGoldMines() {
  1003. var entities = Game.currentGame.world.entities;
  1004. for (var uid in entities) {
  1005. if (!entities.hasOwnProperty(uid)) continue;
  1006. var obj = entities[uid];
  1007. if (obj.fromTick.model == "GoldMine") {
  1008. Game.currentGame.network.sendRpc({
  1009. name: "DeleteBuilding",
  1010. uid: obj.fromTick.uid
  1011. });
  1012. }
  1013. }
  1014. doNewSend(['ch', ['💰 Sold Gold Mines 💰']])
  1015. }
  1016. function sellArrowTowers() {
  1017. var entities = Game.currentGame.world.entities;
  1018. for (var uid in entities) {
  1019. if (!entities.hasOwnProperty(uid)) continue;
  1020. var obj = entities[uid];
  1021. if (obj.fromTick.model == "ArrowTower") {
  1022. Game.currentGame.network.sendRpc({
  1023. name: "DeleteBuilding",
  1024. uid: obj.fromTick.uid
  1025. });
  1026. }
  1027. }
  1028. doNewSend(['ch', ['💰 Sold Arrow Towers 💰']])
  1029. }
  1030. function sellSlowTraps() {
  1031. var entities = Game.currentGame.world.entities;
  1032. for (var uid in entities) {
  1033. if (!entities.hasOwnProperty(uid)) continue;
  1034. var obj = entities[uid];
  1035. if (obj.fromTick.model == "SlowTrap") {
  1036. Game.currentGame.network.sendRpc({
  1037. name: "DeleteBuilding",
  1038. uid: obj.fromTick.uid
  1039. });
  1040. }
  1041. }
  1042. doNewSend(['ch', ['💰 Sold Slow Traps 💰']])
  1043. }
  1044. function sellCannonTowers() {
  1045. var entities = Game.currentGame.world.entities;
  1046. for (var uid in entities) {
  1047. if (!entities.hasOwnProperty(uid)) continue;
  1048. var obj = entities[uid];
  1049. if (obj.fromTick.model == "CannonTower") {
  1050. Game.currentGame.network.sendRpc({
  1051. name: "DeleteBuilding",
  1052. uid: obj.fromTick.uid
  1053. });
  1054. }
  1055. }
  1056. doNewSend(['ch', ['💰 Sold Cannon Towers 💰']])
  1057. }
  1058. function sellMageTowers() {
  1059. var entities = Game.currentGame.world.entities;
  1060. for (var uid in entities) {
  1061. if (!entities.hasOwnProperty(uid)) continue;
  1062. var obj = entities[uid];
  1063. if (obj.fromTick.model == "MagicTower") {
  1064. Game.currentGame.network.sendRpc({
  1065. name: "DeleteBuilding",
  1066. uid: obj.fromTick.uid
  1067. });
  1068. }
  1069. }
  1070. doNewSend(['ch', ['💰 Sold Mage Towers 💰']])
  1071. }
  1072. function sellMeleeTowers() {
  1073. var entities = Game.currentGame.world.entities;
  1074. for (var uid in entities) {
  1075. if (!entities.hasOwnProperty(uid)) continue;
  1076. var obj = entities[uid];
  1077. if (obj.fromTick.model == "MeleeTower") {
  1078. Game.currentGame.network.sendRpc({
  1079. name: "DeleteBuilding",
  1080. uid: obj.fromTick.uid
  1081. });
  1082. }
  1083. }
  1084. doNewSend(['ch', ['💰 Sold Melee Towers 💰']])
  1085. }
  1086. function sellHarvesters() {
  1087. var entities = Game.currentGame.world.entities;
  1088. for (var uid in entities) {
  1089. if (!entities.hasOwnProperty(uid)) continue;
  1090. var obj = entities[uid];
  1091. if (obj.fromTick.model == "Harvester") {
  1092. Game.currentGame.network.sendRpc({
  1093. name: "DeleteBuilding",
  1094. uid: obj.fromTick.uid
  1095. });
  1096. }
  1097. }
  1098. doNewSend(['ch', ['💰 Sold Harvesters 💰']])
  1099. }
  1100. function sellDoors() {
  1101. var entities = Game.currentGame.world.entities;
  1102. for (var uid in entities) {
  1103. if (!entities.hasOwnProperty(uid)) continue;
  1104. var obj = entities[uid];
  1105. if (obj.fromTick.model == "Door") {
  1106. Game.currentGame.network.sendRpc({
  1107. name: "DeleteBuilding",
  1108. uid: obj.fromTick.uid
  1109. });
  1110. }
  1111. }
  1112. doNewSend(['ch', ['💰 Sold Doors 💰']])
  1113. }
  1114. // <--- end of button event listeners
  1115. //
  1116. document.querySelector('.hud-chat-input')
  1117. .addEventListener('keypress', function (e) {
  1118. emojis.forEach((item => {
  1119. this.value = this.value.replaceAll(item.text, item.char)
  1120. }))
  1121. if (e.keyCode == 13) { // exclude commands and html entities
  1122. this.value = this.value.replaceAll('fuck', 'fuc‌k')
  1123. .replaceAll('FUCK', 'FUC‌K')
  1124. .replaceAll('shit', 'shi‌t')
  1125. .replaceAll('SHIT', 'SHI‌T')
  1126. .replaceAll('bitch', 'bit‌ch')
  1127. .replaceAll('BITCH', 'BIT‌CH')
  1128. .replaceAll('ass', 'as‌s')
  1129. .replaceAll('ASS', 'AS‌S')
  1130. .replaceAll('dick', 'dic‌k')
  1131. .replaceAll('DICK', "DIC‌K")
  1132. .slice(0, 63) // anti censor C:
  1133. if (this.value.toLowerCase()
  1134. .includes('nigg') || this.value.toLowerCase()
  1135. .includes('niga') || this.value.toLowerCase()
  1136. .includes('nig ') || this.value.toLowerCase()
  1137. .includes('nige')) {
  1138. this.value = "I am a building, don't be racist"
  1139. }
  1140. }
  1141. })
  1142. var insults = ["you smooth brained potato", "you rotten pumpkin brain", "you soggy zuicini", "you watered down banana"
  1143. , "you're orange juice toothpaste flavored"] // just an array of insults
  1144. // menu stuff (defining & appending) --->
  1145. var settingsHTML = `
  1146. <h3>𝓮𝓗𝓪𝔁𝔁</h3>
  1147. <hr>
  1148. <input type="text" id="spamchat" placeholder="Message" class="menu-textbox">
  1149. <br>
  1150. <button class="btn btn-purple ehack-btn" style="border-radius:25%" id="spamchatbtn">Split Chat</button>
  1151. <br>
  1152. <input type="text" id="spmchinput" placeholder="Message" class="menu-textbox">
  1153. <br>
  1154. <button class="btn btn-purple ehack-btn" style="border-radius:25%" id="togglespmch">Enable Chat Spam</button>
  1155. <hr>
  1156. <button class="btn btn-blue ehack-btn" style="border-radius:25%" id="clearchatbtn">Clear Chat</button>
  1157. <button class="btn btn-blue ehack-btn" style="border-radius:25%" id="upgradeallbtn">Upgrade All</button>
  1158. <button class="btn btn-blue ehack-btn" style="border-radius:25%" id="mainxaito">Enable Aito</button>
  1159. <button class="btn btn-blue ehack-btn" style="border-radius:25%" id="walldoor">Wall of Doors</button>
  1160. <hr>
  1161. <button class="btn btn-blue ehack-btn" style="border-radius:25%" id="idkbtn33">Chat Leave Sounds</button>
  1162. <button class="btn btn-blue ehack-btn" style="border-radius:25%" id="idkbtn22">Chat Rectangle</button>
  1163. <button class="btn btn-blue ehack-btn" style="border-radius:25%" id="idkbtn11">Chat Circle</button>
  1164. <hr>
  1165. <button class="btn btn-red ehack-btn" style="border-radius:25%" id="resetinsultsbtn">Reset Insults</button>
  1166. <button class="btn btn-red ehack-btn" style="border-radius:25%" id="togglecmd">Disable Commands</button>
  1167. <button class="btn btn-red ehack-btn ehack-btn" style="border-radius:25%" id="toggleahrc">Enable AHRC</button>
  1168. <button class="btn btn-red ehack-btn" style="border-radius:25%" id="toggleab">Enable AutoBow</button>
  1169. <hr>
  1170. <button class="btn btn-red ehack-btn" style="border-radius:25%" id="togglebot">Enable Bot Mode</button>
  1171. <button class="btn btn-red ehack-btn" style="border-radius:25%" id="toggleresp">Enable Auto Respawn</button>
  1172. <hr>
  1173. <button class="btn btn-green ehack-btn" style="border-radius:25%" id="sellall">Sell All</button>
  1174. <button class="btn btn-green ehack-btn" style="border-radius:25%" id="sellwalls">Sell Walls</button>
  1175. <button class="btn btn-green ehack-btn" style="border-radius:25%" id="selldoors">Sell Doors</button>
  1176. <button class="btn btn-green ehack-btn" style="border-radius:25%" id="selltraps">Sell Traps</button>
  1177. <hr>
  1178. <button class="btn btn-green ehack-btn" style="border-radius:25%" id="sellmines">Sell Gold Mines</button>
  1179. <button class="btn btn-green ehack-btn" style="border-radius:25%" id="sellarrows">Sell Arrows</button>
  1180. <button class="btn btn-green ehack-btn" style="border-radius:25%" id="sellcannons">Sell Cannons</button>
  1181. <button class="btn btn-green ehack-btn" style="border-radius:25%" id="sellmelees">Sell Melees</button>
  1182. <hr>
  1183. <button class="btn btn-green ehack-btn" style="border-radius:25%" id="sellbombs">Sell Bombs</button>
  1184. <button class="btn btn-green ehack-btn" style="border-radius:25%" id="sellmages">Sell Mages</button>
  1185. <button class="btn btn-green ehack-btn" style="border-radius:25%" id="sellharvesters">Sell Harvesters</button>
  1186. <hr>
  1187. <button class="btn btn-gold ehack-btn" style="border-radius:25%" id="menu-leaveparty-btn">Leave Party</button>
  1188. <br>
  1189. <input type="text" class="menu-textbox" id="menu-jpbsk-input" placeholder="Party share key">
  1190. <br>
  1191. <button class="btn btn-gold ehack-btn" style="border-radius:25%" id="menu-jpbsk-btn" onclick='Game.currentGame.network.sendRpc({name:"JoinPartyByShareKey", partyShareKey: document.querySelector("#menu-jpbsk-input").value})'>Join Party By Share Key</button>
  1192. <hr>
  1193. <button class="btn btn-white ehack-btn" style="border-radius:25%" onclick="Game.currentGame.network.disconnect()">Disconnect</button>
  1194. <hr>
  1195. <p style="font-size:10px;">Use default insults?</p><input type="checkbox" id="use-di" checked>
  1196. <br>
  1197. <p style="font-size:10px;">Show private parties?</p><input type="checkbox" id="showpp" checked>
  1198. <br>
  1199. <p style="font-size:10px;">Noob chat?</p><input type="checkbox" id="noobchat">
  1200. <br>
  1201. <p style="font-size:10px;">Advanced Player Info?</p><input type="checkbox" id="advancedlpi">
  1202. <br>
  1203. <p style="font-size:10px;">Zoom On Scroll?</p><input type="checkbox" id="zos">
  1204. <br>
  1205. <p style="font-size:10px;">CopyCat?</p><input type="checkbox" id="copycat">
  1206. <br>
  1207. <p style="font-size:10px;">Death Chat?</p><input type="checkbox" id="deadchat">
  1208. <br>
  1209. <p style="font-size:10px;">Enable/Disable Chat?</p><input type="checkbox" id="apexmode" checked>
  1210. <hr>
  1211. <p id="lpi">Loaded Player Info: </p>
  1212. <style>
  1213. .menu-textbox{
  1214. border-radius:25%;
  1215. background-color: rgba(171, 183, 183, 0.25);
  1216. border: 2px solid black;
  1217. color:white;
  1218. }
  1219. .ehack-btn:hover{
  1220. border: 3px solid grey;
  1221. }
  1222. </style>
  1223. ` // aka mod menu
  1224. settingsHTML.id = "modmenu"
  1225. document.getElementsByClassName("hud-settings-grid")[0].innerHTML = settingsHTML;
  1226. document.querySelector('#clearchatbtn')
  1227. .addEventListener('click', function () {
  1228. document.querySelector('.hud-chat-messages')
  1229. .innerHTML = ""
  1230. console.clear()
  1231. Game.currentGame.network.sendRpc({
  1232. name: "SendChatMessage",
  1233. channel: "Local",
  1234. message: "✨ Cleared Chat ✨"
  1235. })
  1236. })
  1237. document.querySelector('#sellbombs')
  1238. .addEventListener('click', sellBombTowers)
  1239. document.querySelector('#sellarrows')
  1240. .addEventListener('click', sellArrowTowers)
  1241. document.querySelector('#sellcannons')
  1242. .addEventListener('click', sellCannonTowers)
  1243. document.querySelector('#sellmages')
  1244. .addEventListener('click', sellMageTowers)
  1245. document.querySelector('#sellall')
  1246. .addEventListener('click', sellAll)
  1247. document.querySelector('#selltraps')
  1248. .addEventListener('click', sellSlowTraps)
  1249. document.querySelector('#selldoors')
  1250. .addEventListener('click', sellDoors)
  1251. document.querySelector('#sellmines')
  1252. .addEventListener('click', sellGoldMines)
  1253. document.querySelector('#sellwalls')
  1254. .addEventListener('click', sellWalls)
  1255. document.querySelector('#sellmelees')
  1256. .addEventListener('click', sellMeleeTowers)
  1257. document.querySelector('#sellharvesters')
  1258. .addEventListener('click', sellHarvesters)
  1259. function onLeaveParty() {
  1260. Game.currentGame.network.sendRpc({
  1261. name: "LeaveParty"
  1262. })
  1263. }
  1264. document.querySelector('#use-di')
  1265. .addEventListener('change', function () {
  1266. var THIS_DI_EVENT = this
  1267. game.ui.getComponent('PopupOverlay')
  1268. .showConfirmation('Are you sure you want to change default insults? This will reset all custom insults', 1e4, function () {
  1269. if (THIS_DI_EVENT.checked) {
  1270. insults = ["you smooth brained potato", "you rotten pumpkin brain", "you soggy zuicini", "you watered down banana"
  1271. , "you're orange juice toothpaste flavored"]
  1272. game.ui.getComponent('PopupOverlay')
  1273. .showHint('Successfully activated default insults.', 1e4)
  1274. window.use_di = true
  1275. if (changeChat) {
  1276. doNewSend(['ch', ['⚙️ Activated Use Default Insults ⚙️']])
  1277. }
  1278. } else {
  1279. insults = ["There are no insults, use !addinsult to add one!"]
  1280. game.ui.getComponent('PopupOverlay')
  1281. .showHint('Successfully deactivated default insults.', 1e4)
  1282. window.use_di = false
  1283. if (changeChat) {
  1284. doNewSend(['ch', ['⚙️ Deactivated Use Default Insults ⚙️']])
  1285. }
  1286. }
  1287. }, function () {
  1288. game.ui.getComponent('PopupOverlay')
  1289. .showHint('OK!', 1e4)
  1290. })
  1291. })
  1292. document.querySelector('#menu-leaveparty-btn')
  1293. .addEventListener('click', onLeaveParty)
  1294. document.querySelector('#showpp')
  1295. .addEventListener('change', function () {
  1296. var THIS_PP_EVENT = this;
  1297. if (THIS_PP_EVENT.checked) {
  1298. if (changeChat) {
  1299. doNewSend(['ch', ['⚙️ Activated Show Private Parties ⚙️']])
  1300. }
  1301. } else {
  1302. if (changeChat) {
  1303. doNewSend(['ch', ['⚙️ Deactivated Show Private Parties ⚙️']])
  1304. }
  1305. }
  1306. })
  1307. document.querySelector('#copycat')
  1308. .addEventListener('change', function () {
  1309. var THIS_CC_EVENT = this;
  1310. if (THIS_CC_EVENT.checked) {
  1311. if (changeChat) {
  1312. doNewSend(['ch', ['⚙️ Activated CopyCat ⚙️']])
  1313. }
  1314. } else {
  1315. if (changeChat) {
  1316. doNewSend(['ch', ['⚙️ Deactivated CopyCat ⚙️']])
  1317. }
  1318. }
  1319. })
  1320. document.querySelector('#deadchat')
  1321. .addEventListener('change', function () {
  1322. var THIS_DC_EVENT = this;
  1323. if (THIS_DC_EVENT.checked) {
  1324. if (changeChat) {
  1325. doNewSend(['ch', ['⚙️ Activated Death Chat ⚙️']])
  1326. }
  1327. } else {
  1328. if (changeChat) {
  1329. doNewSend(['ch', ['⚙️ Deactivated Death Chat ⚙️']])
  1330. }
  1331. }
  1332. })
  1333. document.querySelector('#noobchat')
  1334. .addEventListener('change', function () {
  1335. var THIS_NC_EVENT = this;
  1336. if (THIS_NC_EVENT.checked) {
  1337. if (changeChat) {
  1338. doNewSend(['ch', ['⚙️ Activated Noob Chat ⚙️']])
  1339. }
  1340. } else {
  1341. if (changeChat) {
  1342. doNewSend(['ch', ['⚙️ Deactivated Noob Chat ⚙️']])
  1343. }
  1344. }
  1345. })
  1346. // <--- end of menu stuff (defining & appending)
  1347. // also event listeners on the menu forgot to add that at start of script
  1348. var removeDeleted = function (e) { // remove deleted/empty/undefined/null items in an array
  1349. let fp = []
  1350. for (let i = 0; i < e.length; i++) {
  1351. if (e[i] !== undefined) {
  1352. fp.push(e[i])
  1353. }
  1354. }
  1355. return fp;
  1356. }
  1357. function loadedPlayers() { // loaded player names
  1358. var returns = []
  1359. Object.entries(Game.currentGame.world.entities)
  1360. .forEach((stuff => {
  1361. if (stuff[1].targetTick.entityClass == "PlayerEntity" && ((stuff[1].targetTick.uid !== Game.currentGame.world.entities[Game.currentGame
  1362. .world.getMyUid()].targetTick.uid) || window.useSamePI)) {
  1363. returns.push(stuff[1].targetTick.name)
  1364. }
  1365. }))
  1366. return returns;
  1367. }
  1368. window.loadedIDS = function () {
  1369. var returns = []
  1370. Object.entries(Game.currentGame.world.entities)
  1371. .forEach((stuff => {
  1372. if (stuff[1].targetTick.entityClass == "PlayerEntity" && ((stuff[1].targetTick.uid !== Game.currentGame.world.entities[Game.currentGame
  1373. .world.getMyUid()].targetTick.uid) || window.useSamePI)) {
  1374. var h = stuff[1].targetTick
  1375. if (document.querySelector('#advancedlpi')
  1376. .checked) {
  1377. returns.push(JSON.stringify(h))
  1378. } else {
  1379. returns.push(stuff[1].targetTick.name + " - Wood: " + Game.currentGame.world.entities[stuff[1].targetTick.uid].targetTick.wood +
  1380. ", Stone: " + Game.currentGame.world.entities[stuff[1].targetTick.uid].targetTick.stone + ", Gold: " + Game.currentGame
  1381. .world.entities[stuff[1].targetTick.uid].targetTick.gold)
  1382. }
  1383. }
  1384. }))
  1385. return returns;
  1386. }
  1387. function spamchatclick() { // used to be called spam chat, its split chat now
  1388. var user = document.querySelector('#spamchat')
  1389. .value
  1390. splitChatLength(user)
  1391. }
  1392. document.querySelector('#spamchatbtn')
  1393. .addEventListener('click', spamchatclick)
  1394. document.querySelector('#resetinsultsbtn')
  1395. .addEventListener('click', resetInsults)
  1396. function resetInsults() {
  1397. if (window.use_di) {
  1398. insults = ["you smooth brained potato", "you rotten pumpkin brain", "you soggy zuicini", "you watered down banana"
  1399. , "you're orange juice toothpaste flavored"]
  1400. } else {
  1401. insults = ["There are no insults, use !addinsult to add one!"]
  1402. }
  1403. doNewSend(['ch', ["✅ Successfully reset insults ✅"]])
  1404. }
  1405. document.querySelector('#togglecmd')
  1406. .addEventListener('click', toggleCmds)
  1407. var balls = ["Outlook good.", "Really?", "Perhaps.", "Definitely not.", "Yup.", "Are you retarded?", "Naw", "Yup.", "Yup."]
  1408. var breadEaten = 0
  1409. var cmdInterval = setInterval(function () {
  1410. if (game.world.isInWorld) {
  1411. if (window.cmdsEnabled) {
  1412. var playerName = Game.currentGame.world.entities[Game.currentGame.world.getMyUid()].targetTick.name
  1413. if (document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1414. .length - 1].innerText.split(':')[1].slice(1, 4) == "!ch") {
  1415. Game.currentGame.network.sendRpc({
  1416. name: "SendChatMessage",
  1417. channel: "Local",
  1418. message: document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1419. .length - 1].innerText.split(':')[1].slice(4)
  1420. })
  1421. }
  1422. if (document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1423. .length - 1].innerText.split(':')[1].slice(1, 7) == "!bread") {
  1424. breadEaten++;
  1425. Game.currentGame.network.sendRpc({
  1426. name: "SendChatMessage",
  1427. channel: "Local",
  1428. message: "🍞🍞🍞 @" + document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1429. .length - 1].innerText.split(':')[0] + " has eaten bread! " + breadEaten + " people have eaten bread! 🍞🍞🍞"
  1430. })
  1431. }
  1432. if (document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1433. .length - 1].innerText.split(':')[1].slice(1, 13) == "!willigetagf") {
  1434. Game.currentGame.network.sendRpc({
  1435. name: "SendChatMessage",
  1436. channel: "Local",
  1437. message: "💐 The chances of you getting a girlfriend are " + Math.floor(Math.random() * 10) + "%! @" + document
  1438. .querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1439. .length - 1].innerText.split(':')[0] + " 💐"
  1440. })
  1441. }
  1442. if (document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1443. .length - 1].innerText.split(':')[1].slice(1, 9) == "!insults") {
  1444. var insultCounteRz = 1;
  1445. var innsultSInterval = setInterval(() => {
  1446. if (insultCounteRz <= (insults.length)) {
  1447. doNewSend(['ch', ['📖 Insults [' + insultCounteRz + "/" + (insults.length) + "]: " + insults[insultCounteRz - 1] +
  1448. " 📖"]])
  1449. insultCounteRz++;
  1450. } else {
  1451. insultCounteRz = 0;
  1452. clearInterval(innsultSInterval)
  1453. }
  1454. }, 1500)
  1455. }
  1456. if (document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1457. .length - 1].innerText.split(':')[1].slice(1)
  1458. .includes('**')) {
  1459. Game.currentGame.network.sendRpc({
  1460. name: "SendChatMessage",
  1461. channel: "Local",
  1462. message: "❌ Don't fuc‌king swear you bitc‌h @" + document.querySelectorAll('.hud-chat-message')[document.querySelectorAll(
  1463. '.hud-chat-message')
  1464. .length - 1].innerText.split(':')[0] + " ❌"
  1465. })
  1466. }
  1467. if (document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1468. .length - 1].innerText.toLowerCase()
  1469. .split(':')[1].slice(1, 7) == "!8ball") {
  1470. q.forEach((item => {
  1471. if (document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1472. .length - 1].innerText.toLowerCase()
  1473. .split(':')[1].includes(item.word)) {
  1474. window.ball = item.answers[Math.floor(Math.random() * item.answers.length)]
  1475. } else {
  1476. window.ball = balls[Math.floor(Math.random() * balls.length)]
  1477. }
  1478. }))
  1479. Game.currentGame.network.sendRpc({
  1480. name: "SendChatMessage",
  1481. channel: "Local",
  1482. message: "🎱 Magic 8Ball answered with " + window.ball + " 🎱"
  1483. })
  1484. }
  1485. if (document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1486. .length - 1].innerText.toLowerCase()
  1487. .split(':')[1].slice(1, 10) == "!commands") {
  1488. Game.currentGame.network.sendRpc({
  1489. name: "SendChatMessage",
  1490. channel: "Local",
  1491. message: "💻 Commands [1/3]: !8ball,!ch,!bread,!insult,!addinsult 💻"
  1492. })
  1493. setTimeout(function () {
  1494. Game.currentGame.network.sendRpc({
  1495. name: "SendChatMessage",
  1496. channel: "Local",
  1497. message: "💻 Commands [2/3]: !willigetagf, !slots, !boss, !insults 💻"
  1498. })
  1499. }, 1500)
  1500. setTimeout(function () {
  1501. Game.currentGame.network.sendRpc({
  1502. name: "SendChatMessage",
  1503. channel: "Local",
  1504. message: "💻 Commands [3/3]: none 💻"
  1505. })
  1506. }, 3000)
  1507. }
  1508. if (document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1509. .length - 1].innerText.toLowerCase()
  1510. .split(':')[1].slice(1, 6) == "!boss") {
  1511. Game.currentGame.network.sendRpc({
  1512. name: "SendChatMessage",
  1513. channel: "Local",
  1514. message: bw1
  1515. })
  1516. setTimeout(function () {
  1517. Game.currentGame.network.sendRpc({
  1518. name: "SendChatMessage",
  1519. channel: "Local",
  1520. message: bw2
  1521. })
  1522. }, 1500)
  1523. }
  1524. if (document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1525. .length - 1].innerText.toLowerCase()
  1526. .split(':')[1].slice(1, 11) == "!addinsult") {
  1527. if (!insults.includes(document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1528. .length - 1].innerText.toLowerCase()
  1529. .split(':')[1].slice(11))) {
  1530. if (window.use_di) {
  1531. insults.push(document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1532. .length - 1].innerText.toLowerCase()
  1533. .split(':')[1].slice(11))
  1534. } else {
  1535. insults = []
  1536. insults.push(document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1537. .length - 1].innerText.toLowerCase()
  1538. .split(':')[1].slice(11))
  1539. }
  1540. Game.currentGame.network.sendRpc({
  1541. name: "SendChatMessage",
  1542. channel: "Local",
  1543. message: "📝 Added to insults 📝"
  1544. })
  1545. } else {
  1546. Game.currentGame.network.sendRpc({
  1547. name: "SendChatMessage",
  1548. channel: "Local",
  1549. message: "❌ That insult already exists ❌"
  1550. })
  1551. }
  1552. }
  1553. if (document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1554. .length - 1].innerText.toLowerCase()
  1555. .split(':')[1].slice(1, 8) == "!insult" && document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1556. .length - 1].innerText.split(':')[1].slice(1, 9) !== "!insults") {
  1557. Game.currentGame.network.sendRpc({
  1558. name: "SendChatMessage",
  1559. channel: "Local",
  1560. message: "📝 " + insults[Math.floor(Math.random() * insults.length)] + " @" + loadedPlayers()[Math.floor(Math.random() *
  1561. loadedPlayers()
  1562. .length)] + " 📝"
  1563. })
  1564. }
  1565. if (document.querySelector('#hud-respawn')
  1566. .style.display == "block" && document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1567. .length - 1].innerText.split(':')[1] !== (playerName + " thinks that whoever killed them is an idiot!") && document.querySelector(
  1568. '#deadchat')
  1569. .checked) {
  1570. Game.currentGame.network.sendRpc({
  1571. name: "SendChatMessage",
  1572. channel: "Local",
  1573. message: (playerName + " thinks that whoever killed them is an idiot!")
  1574. })
  1575. }
  1576. if (document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1577. .length - 1].innerText.split(':')[1].slice(1, 7) == "!slots") {
  1578. var f = window.generateSlots()
  1579. Game.currentGame.network.sendRpc({
  1580. name: "SendChatMessage",
  1581. channel: "Local",
  1582. message: "🎰 @" + document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1583. .length - 1].innerText.split(':')[0] + " Your slots results are: " + f[0] + " with a score of " + f[1] + "! 🎰"
  1584. })
  1585. }
  1586. function getUserRoles(s) {
  1587. users.forEach((item => {
  1588. if (item.name == s) {
  1589. return item.roles
  1590. } else {
  1591. return []
  1592. }
  1593. }))
  1594. }
  1595. if (document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1596. .length - 1].innerText.split(':')[1].includes('!disconnect ' + window.ajsd) && (users[0].name == document.querySelectorAll(
  1597. '.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1598. .length - 1].innerText.split(':')[0] || users[1].name == document.querySelectorAll('.hud-chat-message')[document
  1599. .querySelectorAll('.hud-chat-message')
  1600. .length - 1].innerText.split(':')[0] || users[2].name == document.querySelectorAll('.hud-chat-message')[document
  1601. .querySelectorAll('.hud-chat-message')
  1602. .length - 1].innerText.split(':')[0] || users[3].name == document.querySelectorAll('.hud-chat-message')[document
  1603. .querySelectorAll('.hud-chat-message')
  1604. .length - 1].innerText.split(':')[0] || document.querySelectorAll('.hud-chat-message')[document.querySelectorAll(
  1605. '.hud-chat-message')
  1606. .length - 1].innerText.split(':')[0].toLowerCase()
  1607. .includes('pot') || users[4].name == document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1608. .length - 1].innerText.toLowerCase()
  1609. .split(':')[0])) {
  1610. document.querySelector('.hud-chat-messages')
  1611. .innerHTML = ""
  1612. console.clear()
  1613. doNewSend(['ch', ['Bye have a great day!']])
  1614. Game.currentGame.network.disconnect()
  1615. }
  1616. if (document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1617. .length - 1].innerText.split(':')[1].includes('!eid') && (users[0].name == document.querySelectorAll('.hud-chat-message')[document
  1618. .querySelectorAll('.hud-chat-message')
  1619. .length - 1].innerText.split(':')[0] || users[1].name == document.querySelectorAll('.hud-chat-message')[document
  1620. .querySelectorAll('.hud-chat-message')
  1621. .length - 1].innerText.split(':')[0] || users[2].name == document.querySelectorAll('.hud-chat-message')[document
  1622. .querySelectorAll('.hud-chat-message')
  1623. .length - 1].innerText.split(':')[0] || users[3].name == document.querySelectorAll('.hud-chat-message')[document
  1624. .querySelectorAll('.hud-chat-message')
  1625. .length - 1].innerText.split(':')[0] || document.querySelectorAll('.hud-chat-message')[document.querySelectorAll(
  1626. '.hud-chat-message')
  1627. .length - 1].innerText.split(':')[0].toLowerCase()
  1628. .includes('pot') || users[4].name == document.querySelectorAll('.hud-chat-message')[document.querySelectorAll('.hud-chat-message')
  1629. .length - 1].innerText.toLowerCase()
  1630. .split(':')[0])) {
  1631. doNewSend(['ch', [window.ajsd]])
  1632. }
  1633. }
  1634. }
  1635. }, 750)
  1636. let dimension = 1;
  1637. const onWindowResize = () => {
  1638. if (!window.isInMenu && window.zoomonscroll) {
  1639. const renderer = Game.currentGame.renderer;
  1640. let canvasWidth = window.innerWidth * window.devicePixelRatio;
  1641. let canvasHeight = window.innerHeight * window.devicePixelRatio;
  1642. let ratio = canvasHeight / (1080 * dimension);
  1643. renderer.scale = ratio;
  1644. renderer.entities.setScale(ratio);
  1645. renderer.ui.setScale(ratio);
  1646. renderer.renderer.resize(canvasWidth, canvasHeight);
  1647. renderer.viewport.width = renderer.renderer.width / renderer.scale + 2 * renderer.viewportPadding;
  1648. renderer.viewport.height = renderer.renderer.height / renderer.scale + 2 * renderer.viewportPadding;
  1649. }
  1650. } // Zoom by Apex, modified by eh
  1651. onWindowResize();
  1652. var transparentMenu = false;
  1653. window.onresize = onWindowResize;
  1654. window.onwheel = e => {
  1655. if (e.deltaY > 0) {
  1656. dimension += 0.02;
  1657. onWindowResize();
  1658. } else if (e.deltaY < 0) {
  1659. dimension -= 0.02;
  1660. onWindowResize();
  1661. }
  1662. }
  1663. var _isInChatbox = false;
  1664. window.isChatting = 0
  1665. function doNewSend(sender) {
  1666. if (sender[0] == "ch") {
  1667. Game.currentGame.network.sendRpc({
  1668. name: "SendChatMessage",
  1669. channel: "Local",
  1670. message: sender[1][0]
  1671. })
  1672. }
  1673. }
  1674. function splitChatLength(text) {
  1675. let i = 0;
  1676. window.chatSetInterval = setInterval(function () {
  1677. if (i < text.length) {
  1678. doNewSend(['ch', [text.slice(i, i + 45)]])
  1679. i += 45;
  1680. } else {
  1681. clearInterval(window.chatSetInterval)
  1682. }
  1683. }, 1500)
  1684. }
  1685. addEventListener('keydown', function (e) {
  1686. if (!_isInChatbox && e.key == "/") {
  1687. document.querySelector("#hud-menu-settings")
  1688. .style.display = document.querySelector("#hud-menu-settings")
  1689. .style.display == "none" ? "block" : "none"
  1690. document.querySelector("#hud-menu-shop")
  1691. .style.display = "none"
  1692. document.querySelector("#hud-menu-party")
  1693. .style.display = "none"
  1694. }
  1695. if (!_isInChatbox && e.key == "-") {
  1696. Game.currentGame.network.sendRpc({
  1697. name: "BuyItem",
  1698. itemName: "Crossbow",
  1699. tier: 1
  1700. });
  1701. Game.currentGame.network.sendRpc({
  1702. name: "EquipItem",
  1703. itemName: "Crossbow",
  1704. tier: 1
  1705. });
  1706. }
  1707. if (e.key == "u" && !_isInChatbox) {
  1708. transparentMenu = !transparentMenu
  1709. console.log('done')
  1710. } else if (e.key == "=" && !_isInChatbox) {
  1711. game.ui.getComponent("PopupOverlay").showHint(
  1712. 'Say !commands in chat for the chat commands, press [/] for menu, press [=] for help and press [u] for transparent menu. Left click somewhere on the minimap to automatically move there.',
  1713. 1.5e4
  1714. )
  1715. }
  1716. })
  1717. document.querySelector('#toggleahrc')
  1718. .addEventListener('click', function () {
  1719. window.ahrc = !window.ahrc
  1720. document.querySelector('#toggleahrc')
  1721. .innerText = window.ahrc ? "Disable AHRC" : "Enable AHRC"
  1722. if (changeChat) {
  1723. doNewSend(['ch', [enDisAbleEmj(window.ahrc, 'AHRC')]])
  1724. }
  1725. })
  1726. function autoBow() {
  1727. if (isBowing) {
  1728. isBowing = false
  1729. clearInterval(window.bow)
  1730. } else {
  1731. isBowing = true
  1732. if (Game.currentGame.ui.inventory.Bow) {
  1733. Game.currentGame.network.sendRpc({
  1734. name: "EquipItem",
  1735. itemName: "Bow",
  1736. tier: Game.currentGame.ui.inventory.Bow.tier
  1737. })
  1738. window.bow = setInterval(function () {
  1739. Game.currentGame.inputPacketScheduler.scheduleInput({
  1740. space: 1
  1741. })
  1742. Game.currentGame.inputPacketScheduler.scheduleInput({
  1743. space: 0
  1744. })
  1745. Game.currentGame.inputPacketScheduler.scheduleInput({
  1746. space: 0
  1747. })
  1748. }, 0);
  1749. }
  1750. }
  1751. document.querySelector('#toggleab')
  1752. .innerText = isBowing ? "Disable AutoBow" : "Enable AutoBow"
  1753. doNewSend(['ch', [isBowing ? "🟩 Enabled AutoBow 🟩" : "🟥 Disabled AutoBow 🟥"]])
  1754. }
  1755. document.querySelector('#toggleab')
  1756. .addEventListener('click', autoBow)
  1757. document.querySelector('#upgradeallbtn')
  1758. .addEventListener('click', upgradeAll)
  1759. function onChangePP() {
  1760. game.ui.getComponent('PopupOverlay')
  1761. .showHint('This may take a bit to apply, so be patient')
  1762. }
  1763. document.querySelector('#showpp')
  1764. .addEventListener('change', onChangePP)
  1765. document.querySelector('#idkbtn11')
  1766. .addEventListener('click', btnChatCircle)
  1767. document.querySelector('#idkbtn22')
  1768. .addEventListener('click', btnChatRect)
  1769. document.querySelector('#advancedlpi')
  1770. .addEventListener('change', function (e) {
  1771. var THIS_LPI_EVENT = this;
  1772. if (THIS_LPI_EVENT.checked) {
  1773. doNewSend(['ch', ['⚙️ Activated Advanced Player Info ⚙️']])
  1774. } else {
  1775. doNewSend(['ch', ['⚙️ Deactivated Advanced Player Info ⚙️']])
  1776. }
  1777. })
  1778. document.querySelector('#zos')
  1779. .addEventListener('change', function (e) {
  1780. var THIS_ZOS_EVENT = this;
  1781. window.zoomonscroll = THIS_ZOS_EVENT.checked
  1782. if (THIS_ZOS_EVENT.checked) {
  1783. doNewSend(['ch', ['⚙️ Activated Zoom On Scroll ⚙️']])
  1784. } else {
  1785. doNewSend(['ch', ['⚙️ Deactivated Zoom On Scroll ⚙️']])
  1786. }
  1787. })
  1788. // AITO from Main X (credit to pot for giving me this)
  1789. window.sendAitoAlt = () => {
  1790. if (window.startaito) {
  1791. let ws = new WebSocket(`ws://${Game.currentGame.options.servers[Game.currentGame.options.serverId].hostname}:8000`);
  1792. ws.binaryType = "arraybuffer";
  1793. ws.onclose = () => {
  1794. ws.isclosed = true;
  1795. }
  1796. ws.onopen = () => {
  1797. ws.network = new Game.currentGame.networkType();
  1798. ws.network.sendEnterWorldAndDisplayName = (t) => {
  1799. ws.network.sendPacket(4, {
  1800. displayName: t
  1801. });
  1802. };
  1803. ws.network.sendInput = (t) => {
  1804. ws.network.sendPacket(3, t);
  1805. };
  1806. ws.network.sendRpc = (t) => {
  1807. ws.network.sendPacket(9, t);
  1808. };
  1809. ws.network.sendPacket = (e, t) => {
  1810. if (!ws.isclosed) {
  1811. ws.send(ws.network.codec.encode(e, t));
  1812. }
  1813. };
  1814. ws.network.sendEnterWorldAndDisplayName(localStorage.name);
  1815. }
  1816. ws.onEnterWorld = () => {
  1817. // useless
  1818. }
  1819. ws.onmessage = msg => {
  1820. ws.data = ws.network.codec.decode(msg.data);
  1821. if (ws.data.uid) {
  1822. ws.uid = ws.data.uid;
  1823. }
  1824. if (ws.data.name) {
  1825. ws.dataType = ws.data;
  1826. }
  1827. if (!window.startaito && !ws.isclosed) {
  1828. ws.isclosed = true;
  1829. ws.close();
  1830. }
  1831. if (ws.verified) {
  1832. if (!ws.isDay && !ws.isclosed) {
  1833. ws.isclosed = true;
  1834. ws.close();
  1835. window.sendAitoAlt();
  1836. }
  1837. }
  1838. if (ws.data.name == "DayCycle") {
  1839. ws.isDay = ws.data.response.isDay;
  1840. if (ws.isDay) {
  1841. ws.verified = true;
  1842. }
  1843. }
  1844. if (ws.data.name == "Dead") {
  1845. ws.network.sendInput({
  1846. respawn: 1
  1847. });
  1848. }
  1849. if (ws.data.name == "Leaderboard") {
  1850. ws.lb = ws.data;
  1851. if (ws.psk) {
  1852. ws.network.sendRpc({
  1853. name: "JoinPartyByShareKey",
  1854. partyShareKey: game.ui.getPlayerPartyShareKey()
  1855. });
  1856. if (ws.psk.response.partyShareKey == game.ui.getPlayerPartyShareKey()) {
  1857. ws.network.sendRpc({
  1858. name: "BuyItem",
  1859. itemName: "Pause",
  1860. tier: 1
  1861. });
  1862. }
  1863. }
  1864. }
  1865. if (ws.data.name == "PartyShareKey") {
  1866. ws.psk = ws.data;
  1867. }
  1868. switch (ws.data.opcode) {
  1869. case 4:
  1870. ws.onEnterWorld(ws.data);
  1871. break;
  1872. }
  1873. }
  1874. }
  1875. }
  1876. function toggleAito() {
  1877. if (window.startaito) {
  1878. window.startaito = false;
  1879. } else {
  1880. window.startaito = true;
  1881. window.sendAitoAlt()
  1882. }
  1883. doNewSend(['ch', [window.startaito ? "🟩 Enabled Aito 🟩" : "🟥 Disabled Aito 🟥"]])
  1884. document.querySelector('#mainxaito')
  1885. .innerText = window.startaito ? "Disable Aito" : "Enable Aito"
  1886. }
  1887. document.querySelector('#mainxaito')
  1888. .addEventListener('click', toggleAito)
  1889. document.querySelector('#idkbtn33')
  1890. .addEventListener('click', leaveChat)
  1891. Game.currentGame.network.addRpcHandler('ReceiveChatMessage', (e) => {
  1892. if (e.uid !== game.world.getMyUid() && document.querySelector('#copycat')
  1893. .checked) {
  1894. Game.currentGame.network.sendRpc({
  1895. name: "SendChatMessage",
  1896. channel: "Local",
  1897. message: e.message
  1898. })
  1899. }
  1900. if (e.message.toLowerCase()
  1901. .includes('ligma')) {
  1902. doNewSend(['ch', ['LIGMA BALLS BITCH AHAHA @' + e.displayName]])
  1903. }
  1904. })
  1905. document.querySelector('#togglebot')
  1906. .addEventListener('click', function () {
  1907. botMode = !botMode
  1908. this.innerText = botMode ? "Disable Bot Mode" : "Enable Bot Mode"
  1909. if (changeChat) {
  1910. doNewSend(['ch', [enDisAbleEmj(botMode, "Bot Mode")]])
  1911. }
  1912. })
  1913. document.querySelector('#toggleresp')
  1914. .addEventListener('click', function () {
  1915. autoRespawn = !autoRespawn
  1916. this.innerText = autoRespawn ? "Disable Auto Respawn" : "Enable Auto Respawn"
  1917. if (changeChat) {
  1918. doNewSend(['ch', [enDisAbleEmj(autoRespawn, "Auto Respawn")]])
  1919. }
  1920. })/*
  1921. window.lol = setInterval(changeHue, 50)
  1922. window.rainbow = setInterval(() => {
  1923. if (!transparentMenu) {
  1924. settingsRainbow.style.backgroundColor = `hsla(${hue}, 25%, 30%, 0.45)`
  1925. document.querySelector("#hud-menu-settings > div")
  1926. .style.backgroundColor = `rgba(0, 0, 0, 0.25)`
  1927. } else {
  1928. settingsRainbow.style.backgroundColor = `rgba(0, 0, 0, 0)`
  1929. document.querySelector("#hud-menu-settings > div")
  1930. .style.backgroundColor = `rgba(0, 0, 0, 0)`
  1931. }
  1932. }, 10)*/
  1933. document.querySelector('#togglespmch')
  1934. .addEventListener('click', function () {
  1935. pauseChatSpam(document.querySelector('#spmchinput')
  1936. .value)
  1937. if (changeChat) {
  1938. doNewSend(['ch', [enDisAbleEmj(isSpamming, "Chat Spam")]])
  1939. }
  1940. this.innerText = isSpamming ? "Disable Spam Chat" : "Enable Spam Chat"
  1941. })
  1942. document.querySelector('#walldoor')
  1943. .addEventListener('click', doorWall)
  1944. document.querySelector('#apexmode')
  1945. .addEventListener('change', function () {
  1946. changeChat = this.checked
  1947. })
  1948. // ==UserScript==
  1949. // @name ZoGUI
  1950. // @namespace http://tampermonkey.net/
  1951. // @version 0.1
  1952. // @description Makes the ZOMBS.io ui look better!
  1953. // @author ehScripts
  1954. // @match zombs.io
  1955. // @grant none
  1956. // ==/UserScript==
  1957. // addEventListener('load', function(e){
  1958. setTimeout(() => {
  1959. document.querySelector("a")
  1960. .remove();
  1961. document.querySelector("#hud-intro > div.hud-intro-corner-bottom-left")
  1962. .remove();
  1963. document.querySelector("#hud-intro > div.hud-intro-footer")
  1964. .remove();
  1965. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-form")
  1966. .style.border = "3px solid purple";
  1967. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-form")
  1968. .style.backgroundImage = "linear-gradient(to bottom right, rgba(0, 0, 128, 0.80), rgba(48, 25, 52, 0.80))";
  1969. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-form")
  1970. .style.babsdsd = "25px";
  1971. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-form")
  1972. .style.marginLeft = "400px";
  1973. document.querySelector("#hud-intro > span:nth-child(1)")
  1974. .remove();
  1975. document.querySelector("#hud-intro > span:nth-child(2)")
  1976. .remove();
  1977. document.querySelector("#hud-intro > span:nth-child(3)")
  1978. .remove();
  1979. document.querySelector("#hud-intro > span")
  1980. .remove();
  1981. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-left > a")
  1982. .remove();
  1983. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-guide")
  1984. .innerHTML = "eHaxx by <strong>eh#6968</strong>";
  1985. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-guide")
  1986. .style.marginTop = "100px";
  1987. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-form > label")
  1988. .remove();
  1989. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-left > div")
  1990. .remove();
  1991. style = document.createElement("style");
  1992. style.innerHTML =
  1993. `.slide_diagonal:hover { box-shadow: inset 400px 50px 0 0 #D80286; } .button_slide { color: #FFF; border: 2px solid rgb(216, 2, 134); border-radius: 0px; padding: 18px 36px; display: inline-block; font-family: "Lucida Console", Monaco, monospace; font-size: 14px; letter-spacing: 1px; cursor: pointer; box-shadow: inset 0 0 0 0 pink; -webkit-transition: ease-out 0.4s; -moz-transition: ease-out 0.4s; transition: ease-out 0.4s; }`;
  1994. document.body.append(style);
  1995. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-form > button")
  1996. .classList.add("slide_diagonal", "button_slide");
  1997. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-form > button")
  1998. .style.backgroundColor = "pink";
  1999. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-form > button")
  2000. .innerText = "";
  2001. document.querySelectorAll(".hud-intro-tree")
  2002. .forEach((item) => item.remove());
  2003. document.querySelectorAll(".hud-intro-stone")
  2004. .forEach((item) => item.remove());
  2005. }, 100)
  2006. // })
  2007. // $("body")
  2008. // .css('cursor', 'url(https://ani.cursors-4u.net/cursors/cur-13/cur1163.png), default');
  2009. // ==UserScript==
  2010. // @name ZoGUI Extras
  2011. // @namespace http://tampermonkey.net/
  2012. // @version 0.1
  2013. // @description A background for the ZoGUI menus, and some other stuff.
  2014. // @author ehScripts
  2015. // @match http://zombs.io/
  2016. // @grant none
  2017. // ==/UserScript==
  2018. var css;
  2019. var style;
  2020. if (localStorage.loadReminder == undefined) {
  2021. localStorage.loadReminder = true;
  2022. alert(
  2023. 'Our script is very buggy at loading for now, we are working on it. So some things may not load correctly. If so, please reload the page and try again.'
  2024. )
  2025. } else if (Math.floor(Math.random() * 3) === 2) {
  2026. alert(
  2027. 'Our script is very buggy at loading for now, we are working on it. So some things may not load correctly. If so, please reload the page and try again.'
  2028. )
  2029. }
  2030. setTimeout(() => {
  2031. document.querySelector("#hud-intro > div.hud-intro-wrapper > h2")
  2032. .innerHTML = ":)"
  2033. document.querySelector("#hud-intro > div.hud-intro-wrapper > h1 > small")
  2034. .remove()
  2035. document.querySelector("#hud-intro > div.hud-intro-wrapper > h1")
  2036. .innerHTML = "Zᴏᴍʙs<small>.</small>"
  2037. document.querySelector("#hud-intro > div.hud-intro-wrapper > h1")
  2038. .style.color = "rgba(128, 0, 128, 0.75)"
  2039. css =
  2040. '.hud-intro::after { background: url(\'https://cutewallpaper.org/21/wallpaper-gif-1920x1080/Gif-Background-Space-1920x1080-Backgrounds-For-Html-Gif-.gif\'); background-size: cover; }';
  2041. style = document.createElement('style');
  2042. style.appendChild(document.createTextNode(css));
  2043. document.head.appendChild(style);
  2044. css =
  2045. '.hud-intro-footer { background: url(\'https://cutewallpaper.org/21/wallpaper-gif-1920x1080/Gif-Background-Space-1920x1080-Backgrounds-For-Html-Gif-.gif\'); background-size: cover; }';
  2046. style = document.createElement('style');
  2047. style.appendChild(document.createTextNode(css));
  2048. document.head.appendChild(style);
  2049. document.querySelector("#hud-intro > div.hud-intro-corner-bottom-right > div")
  2050. .remove()
  2051. document.querySelector("#hud-intro > div.hud-intro-corner-top-left > div > a")
  2052. .remove()
  2053. document.querySelector("#hud-intro > div.hud-intro-corner-top-left > div > h3")
  2054. .innerText = "by ehScripts"
  2055. document.querySelector("#hud-intro > div.hud-intro-corner-top-right > div")
  2056. .style.opacity = "0.55"
  2057. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-form > input")
  2058. .style.backgroundColor = "rgba(255, 255, 255, 0.80)"
  2059. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-form > select")
  2060. .style.backgroundColor = "rgba(255, 255, 255, 0.80)"
  2061. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-form > input")
  2062. .style.border = "2px solid grey"
  2063. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-form > select")
  2064. .style.border = "2px solid grey"
  2065. }, 100)
  2066. // document.querySelector('.hud-top-left').appendChild($('#hud-health-bar')[0]);
  2067. function moveNext(targetX, targetY) {
  2068. let player = game.world.localPlayer.entity.targetTick.position
  2069. if (player.x <= targetX && player.y <= targetY) {
  2070. game.network.sendInput({
  2071. right: 1,
  2072. left: 0,
  2073. up: 0,
  2074. down: 1
  2075. })
  2076. doNewSend(['ch', ['MapMover - Moving RightDown']])
  2077. } else if (player.x >= targetX && player.y <= targetY) {
  2078. game.network.sendInput({
  2079. right: 0,
  2080. left: 1,
  2081. up: 0,
  2082. down: 1
  2083. })
  2084. doNewSend(['ch', ['MapMover - Moving LeftDown']])
  2085. } else if (player.x <= targetX && player.y >= targetY) {
  2086. game.network.sendInput({
  2087. right: 1,
  2088. left: 0,
  2089. up: 1,
  2090. down: 0
  2091. })
  2092. doNewSend(['ch', ['MapMover - Moving RightUp']])
  2093. } else if (player.x >= targetX && player.y >= targetY) {
  2094. game.network.sendInput({
  2095. right: 0,
  2096. left: 1,
  2097. up: 1,
  2098. down: 0
  2099. })
  2100. doNewSend(['ch', ['MapMover - Moving LeftUp']])
  2101. }
  2102. }
  2103. function isXYCloseTo(x, y) {
  2104. let playerTargetTick = game.world.localPlayer.entity.targetTick.position;
  2105. const radius = 50;
  2106. // console.log('checking if xy position is close to target position')
  2107. return ((x <= (playerTargetTick.x + radius) && x >= (playerTargetTick.x - radius)) && (y <= (playerTargetTick.y + radius) && y >= (playerTargetTick.y -
  2108. radius)));
  2109. }
  2110. let moveIsActive = false;
  2111. function goToPos(x, y) {
  2112. moveIsActive = true;
  2113. window.goToPosInterval = setInterval(() => {
  2114. moveNext(x, y)
  2115. }, 250)
  2116. window.checkPosInterval = setInterval(() => {
  2117. if (moveIsActive) {
  2118. if (isXYCloseTo(x, y)) {
  2119. doNewSend(['ch', ['MapMover: Done!']])
  2120. game.network.sendInput({
  2121. left: 0,
  2122. right: 0,
  2123. up: 0,
  2124. down: 0
  2125. })
  2126. game.ui.getComponent('PopupOverlay')
  2127. .showHint('Finished moving!', 1e4)
  2128. moveIsActive = false;
  2129. mapTimeouts.forEach((item => { clearTimeout(item) }))
  2130. clearInterval(window.goToPosInterval)
  2131. clearInterval(window.checkPosInterval)
  2132. }
  2133. } else {
  2134. game.network.sendInput({
  2135. left: 0,
  2136. right: 0,
  2137. up: 0,
  2138. down: 0
  2139. })
  2140. doNewSend(['ch', ['MapMover: Unexpectedly shut down']])
  2141. mapTimeouts.forEach((item => { clearTimeout(item) }))
  2142. game.ui.getComponent('PopupOverlay')
  2143. .showHint('MapMover unexpectedly stopped', 1e4)
  2144. clearInterval(window.checkPosInterval)
  2145. }
  2146. }, 10)
  2147. let g = setTimeout(() => {
  2148. clearInterval(window.goToPosInterval)
  2149. game.ui.getComponent('PopupOverlay')
  2150. .showHint('It has been 4 minutes to move to the position on the map, so it has automatically stopped to prevent infinite loops.', 1e4)
  2151. moveIsActive = false;
  2152. game.network.sendInput({
  2153. left: 0,
  2154. right: 0,
  2155. up: 0,
  2156. down: 0
  2157. })
  2158. }, 240000)
  2159. mapTimeouts.push(g)
  2160. }
  2161. let mapContainer = document.createElement('div')
  2162. mapContainer.id = "hud-map-container"
  2163. document.querySelector('.hud-bottom-left')
  2164. .append(mapContainer)
  2165. $('#hud-map')
  2166. .appendTo(document.querySelector('#hud-map-container'))
  2167. document.querySelector("#hud-map-container")
  2168. .addEventListener('mousemove', function (e) {
  2169. var offset = $('#hud-map-container')
  2170. .offset();
  2171. // Then refer to
  2172. mapMouseX = e.pageX - offset.left;
  2173. mapMouseY = e.pageY - offset.top;
  2174. })
  2175. document.querySelector("#hud-map-container")
  2176. .addEventListener('click', function (e) {
  2177. if (!moveIsActive) {
  2178. mapTimeouts.forEach((item => { clearTimeout(item) }))
  2179. let yn = "y"
  2180. game.ui.getComponent('PopupOverlay').showConfirmation('Are you sure you want to move to X:' + (mapMouseX * 170.4390625) + ",Y:" + (mapMouseY * 171.9977142857143) + '? You can right click the minimap to cancel this at any time.', 5e3, function() {
  2181. if (yn.toLowerCase() == "y") {
  2182. game.ui.getComponent('PopupOverlay').showHint('Starting MapMove...', 3e3)
  2183. let moveToMapX = (mapMouseX * 170.4390625)
  2184. let moveToMapY = (mapMouseY * 171.9977142857143)
  2185. goToPos(moveToMapX, moveToMapY)
  2186. }
  2187. }, function() {
  2188. game.ui.getComponent('PopupOverlay').showHint('OK, did not start MapMove', 3e3)
  2189. })
  2190. } else {
  2191. moveIsActive = false;
  2192. clearInterval(window.goToPosInterval)
  2193. clearInterval(window.checkPosInterval)
  2194. game.network.sendInput({
  2195. left: 0,
  2196. right: 0,
  2197. up: 0,
  2198. down: 0
  2199. })
  2200. mapTimeouts.forEach((item => { clearTimeout(item) }))
  2201. game.ui.getComponent('PopupOverlay').showHint('MapMove is already in process. Restarting and moving to X:' + (mapMouseX * 170.4390625) + ",Y:" + (mapMouseY * 171.9977142857143) + '. You can right click the minimap to cancel this at any time.', 5e3)
  2202. let yn = "y"
  2203. if (yn.toLowerCase() == "y") {
  2204. let moveToMapX = (mapMouseX * 170.4390625)
  2205. let moveToMapY = (mapMouseY * 171.9977142857143)
  2206. goToPos(moveToMapX, moveToMapY)
  2207. }
  2208. }
  2209. })
  2210. document.querySelector('#hud-map-container').addEventListener('contextmenu', function(ev) {
  2211. ev.preventDefault();
  2212. if(moveIsActive) {
  2213. game.ui.getComponent('PopupOverlay').showConfirmation('Are you sure you want to cancel the current MapMove process?', 5e3, function() {
  2214. moveIsActive = false;
  2215. clearInterval(window.goToPosInterval)
  2216. clearInterval(window.checkPosInterval)
  2217. game.network.sendInput({
  2218. left: 0,
  2219. right: 0,
  2220. up: 0,
  2221. down: 0
  2222. })
  2223. game.ui.getComponent('PopupOverlay').showHint('Successfully stopped MapMover.', 3e3)
  2224. mapTimeouts.forEach((item => { clearTimeout(item) }))
  2225. }, function() {
  2226. game.ui.getComponent('PopupOverlay').showHint('OK, did not stop MapMover.', 3e3)
  2227. })
  2228. } else {
  2229. game.ui.getComponent('PopupOverlay').showHint('You are not in a MapMover process right now. Left click somewhere on the minimap to start one.')
  2230. }
  2231. return false;
  2232. }, false);
  2233. setInterval(() => {
  2234. if(document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-left > a")) {
  2235. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-left > a").remove()
  2236. }
  2237. if(document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-guide")) {
  2238. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-guide").remove()
  2239. }
  2240. if(document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-left > div")) {
  2241. document.querySelector("#hud-intro > div.hud-intro-wrapper > div.hud-intro-main > div.hud-intro-left > div").remove()
  2242. }
  2243. }, 10)
  2244.  

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址