Zombs.io Script

Cool. Check greasyfork description.

  1. // ==UserScript==
  2. // @name Zombs.io Script
  3. // @namespace -
  4. // @version v1
  5. // @description Cool. Check greasyfork description.
  6. // @author Nudo#3310
  7. // @match *://zombs.io/*
  8. // @require http://code.jquery.com/jquery-3.3.1.min.js
  9. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.js
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. //­
  14.  
  15. let cvs = document.querySelector('canvas')
  16. /*
  17. let elm = document.getElementsByTagName('*')
  18. for(let i = 0; i < elm.length; ++i) {
  19. elm[i].oncontextmenu = null
  20. }
  21. */
  22. let openMenu = `
  23. <div class="hud-spell-icon" data-type="SettingsHack"></div>
  24. <div class="hack-info-holder">
  25. <div class="hack-inner">
  26. <div>
  27. <h4>Settings</h4>
  28. <h5>Hack</h5>
  29. </div>
  30. <div>
  31. <p>Here you can enable hacks ;3</p>
  32. </div>
  33. <div>
  34. <p style="color: #8ecc51">Click</p>
  35. </div>
  36. </div>
  37. </div>
  38. <style>
  39. .hack-inner h4 {
  40. display: block;
  41. margin: 0;
  42. color: #d0d0d0;
  43. }
  44. .hack-inner p {
  45. margin: 10px 0 0;
  46. color: #eeeeee;
  47. white-space: nowrap;
  48. font-size: 14px;
  49. }
  50. .hack-inner h5 {
  51. display: block;
  52. margin: 0;
  53. color: rgba(255, 255, 255, 0.6);
  54. }
  55. .hack-inner {
  56. display: flex;
  57. flex-direction: column;
  58. background: rgba(0, 0, 0, 0.4);
  59. padding: 10px;
  60. border-radius: 4px;
  61. }
  62. .hack-inner::after {
  63. content: ' ';
  64. display: block;
  65. position: absolute;
  66. top: 50%;
  67. right: 100%;
  68. margin-top: -6px;
  69. border-top: 6px solid transparent;
  70. border-bottom: 6px solid transparent;
  71. border-right: 6px solid rgba(0, 0, 0, 0.4);
  72. }
  73. .hack-info-holder {
  74. display: none;
  75. position: absolute;
  76. left: 76px;
  77. top: -25px;
  78. }
  79. .hud-spell-icons .hud-spell-icon[data-type=SettingsHack]::before {
  80. background-image: url(https://media.discordapp.net/attachments/776127909651808276/945227208602046524/settings-ico.png);
  81. }
  82. </style>
  83. `
  84. $("#hud-spell-icons").prepend(openMenu)
  85. $('[data-type="SettingsHack"]').hover(() => {
  86. $('.hack-info-holder').css("display", "block")
  87. }, () => {
  88. $('.hack-info-holder').css("display", "none")
  89. })
  90.  
  91. let menu = `
  92. <div class="menu-holder">
  93. <div class="menu-wrapper">
  94. <div class="menu-title">
  95. <h3>Settings</h3>
  96. <a class="menu-close" id="closeSettings"></a>
  97. </div>
  98. <div class="menu-navbar">
  99. <div class="nav-btns">
  100. <div id="mainBtn" style="background: rgba(0, 0, 0, 0.4); color: rgba(255, 255, 255, 0.4)">Main</div>
  101. <div id="miscBtn">Misc</div>
  102. <div id="sellBtn">Sell</div>
  103. <div id="botsBtn">Bots</div>
  104. <div id="upgradesBtn">Upgrades</div>
  105. <div id="autobaseBtn">AutoBase</div>
  106. </div>
  107. </div>
  108. <div class="menu-content" id="main" style="display: block;"></div>
  109. <div class="menu-content" id="misc"></div>
  110. <div class="menu-content" id="bots"></div>
  111. <div class="menu-content" id="sell"></div>
  112. <div class="menu-content" id="upgrades"></div>
  113. <div class="menu-content" id="autobase" style="width: 530px"></div>
  114. <div class="menu-footer">
  115. <span>Made by Nudo#3310</span>
  116. </div>
  117. </div>
  118. </div>
  119. <style>
  120. .toggler-mark {
  121. display: none;
  122. width: 6px;
  123. height: 12px;
  124. border: solid #777;
  125. border-width: 0 3px 3px 0;
  126. transform: rotate(45deg);
  127. border-radius: 2px;
  128. margin-left: 4.2px;
  129. }
  130. .toggler-checkbox {
  131. margin-right: 10px;
  132. margin-top: 2px;
  133. background: rgba(0, 0, 0, .4);
  134. width: 15px;
  135. border-radius: 2px;
  136. height: 15px;
  137. }
  138. .toggler-action {
  139. color: rgba(255, 255, 255, 0.4);
  140. font-size: 14px;
  141. }
  142. .toggler-active {
  143. display: block;
  144. }
  145. .toggler-display {
  146. margin-top: 5px;
  147. padding: 10px;
  148. background: #444;
  149. border-radius: 4px;
  150. height: 35px;
  151. display: flex;
  152. cursor: pointer;
  153. align-items: center;
  154. justify-content: space-between;
  155. }
  156. .toggler-info {
  157. display: flex;
  158. flex-direction: column;
  159. }
  160. .toggler-info #toggler-name {
  161. font-weight: 1000;
  162. color: #eee;
  163. font-size: 16px;
  164. }
  165. .toggler-info #toggler-desc {
  166. color: rgba(255, 255, 255, 0.4);
  167. font-size: 14px;
  168. }
  169. .toggler-container {
  170. width: -webkit-fill-available;
  171. padding: 10px;
  172. margin: 2px;
  173. background: rgba(255, 255, 255, 0.1);
  174. border-radius: 3px;
  175. color: #eee;
  176. display: flex;
  177. justify-content: space-between;
  178.  
  179. }
  180. .toggler-display {
  181. transition: all 0.15s ease-in-out;
  182. }
  183. .toggler-display:hover {
  184. background-color: #555;
  185. color: #fff;
  186. }
  187. /*
  188. .menu-navbar #autobaseBtn::after {
  189. content: 'BETA';
  190. display: inline-block;
  191. vertical-align: middle;
  192. height: 16px;
  193. line-height: 16px;
  194. margin: 0 0 0 6px;
  195. padding: 0 4px;
  196. font-size: 10px;
  197. background: #c9523c;
  198. color: #eee;
  199. text-shadow: 0 1px 3px rgb(0 0 0 / 20%);
  200. border-radius: 2px;
  201. }
  202. */
  203. .menu-content {
  204. display: none;
  205. flex-direction: column;
  206. height: 300px;
  207. padding: 10px;
  208. background: rgba(0, 0, 0, 0.2);
  209. overflow-y: auto;
  210. border-radius: 0 3px 3px 3px;
  211. }
  212. .menu-footer {
  213. position: relative;
  214. bottom: -5px;
  215. }
  216. .menu-footer span {
  217. font-weight: 1000;
  218. font-size: 18px;
  219. color: #d0d0d0;
  220. }
  221.  
  222. .menu-navbar {
  223. width: 100%;
  224. }
  225. .nav-btns {
  226. display: flex;
  227. }
  228. .nav-btns div {
  229. cursor: pointer;
  230. display: flex;
  231. padding: 0 14px;
  232. margin: 0 1px 0 0;
  233. font-size: 14px;
  234. background: rgba(0, 0, 0, 0.4);
  235. color: rgba(255, 255, 255, 0.4);
  236. transition: all 0.15s ease-in-out;
  237. justify-content: center;
  238. align-items: center;
  239. width: 75px;
  240. height: 35px;
  241. }
  242. .nav-btns div:first-child {
  243. border-radius: 3px 0 0;
  244. }
  245. .nav-btns div:last-child {
  246. border-radius: 0 3px 0 0;
  247. }
  248. /*.nav-btns div:active, .nav-btns div:hover {
  249. background: rgba(0, 0, 0, 0.2);
  250. color: #eee;
  251. }*/
  252. .menu-title {
  253. width: 100%;
  254. height: auto;
  255. display: flex;
  256. justify-content: space-between;
  257. }
  258. .menu-wrapper h3 {
  259. display: block;
  260. margin: 0;
  261. line-height: 20px;
  262. }
  263. .menu-close::after {
  264. transform: rotate( 320deg);
  265. }
  266. .menu-close {
  267. cursor: pointer;
  268. width: 30px;
  269. height: 30px;
  270. opacity: 0.2;
  271. transition: all 0.15s ease-in-out;
  272. }
  273. .menu-close::before {
  274. transform: rotate(45deg);
  275. }
  276. .menu-close::before, .menu-close::after {
  277. content: ' ';
  278. position: absolute;
  279. height: 30px;
  280. width: 2px;
  281. background: #eee;
  282. }
  283. .menu-close:hover, .menu-close:active {
  284. opacity: 0.4;
  285. }
  286. .menu-wrapper {
  287. width: 600px;
  288. height: 420px;
  289. padding: 20px;
  290. background: rgba(0, 0, 0, 0.6);
  291. color: #eee;
  292. border-radius: 4px;
  293. z-index: 15;
  294. }
  295. .menu-holder {
  296. display: none;
  297. position: absolute;
  298. width: 100%;
  299. top: 0;
  300. height: 100%;
  301. align-items: center;
  302. justify-content: center;
  303. }
  304. </style>
  305. `
  306.  
  307. $("#hud").append(menu)
  308.  
  309. $('[data-type="SettingsHack"]').click(() => {
  310. cvs.style.filter = "blur(8px)"
  311. $(".menu-holder").css(`display`, `flex`)
  312. })
  313.  
  314. $("#closeSettings").click(() => {
  315. cvs.style.filter = "none"
  316. $(".menu-holder").css(`display`, `none`)
  317. })
  318.  
  319. $(document).mouseup((e) => {
  320. if ($(".menu-holder").has(e.target).length === 0){
  321. $(".menu-holder").hide()
  322. cvs.style.filter = "none"
  323. }
  324. })
  325.  
  326. let btns = ["mainBtn", "miscBtn", "autobaseBtn", "sellBtn", "upgradesBtn", "botsBtn"]
  327.  
  328. $(`#${btns[0]}`).css({"background": "rgba(0, 0, 0, 0.2)", "color": "#eee"})
  329.  
  330. function activeButton(e) {
  331. for (let i = 0; i < btns.length; i++) {
  332. if (e.target.id == btns[i]) $(`#${btns[i]}`).css({"background": "rgba(0, 0, 0, 0.2)", "color": "#eee"})
  333. else $(`#${btns[i]}`).css({"background": "rgba(0, 0, 0, 0.4)", "color": "rgba(255, 255, 255, 0.4)"})
  334. }
  335. }
  336.  
  337. $("#mainBtn").click((e) => {
  338. activeButton(e)
  339. $("#main").css("display", "flex")
  340. $("#misc").css("display", "none")
  341. $("#upgrades").css("display", "none")
  342. $("#sell").css("display", "none")
  343. $("#autobase").css("display", "none")
  344. $("#bots").css("display", "none")
  345. })
  346.  
  347. $("#miscBtn").click((e) => {
  348. activeButton(e)
  349. $("#misc").css("display", "flex")
  350. $("#main").css("display", "none")
  351. $("#upgrades").css("display", "none")
  352. $("#sell").css("display", "none")
  353. $("#autobase").css("display", "none")
  354. $("#bots").css("display", "none")
  355. })
  356.  
  357. $("#autobaseBtn").click((e) => {
  358. activeButton(e)
  359. $("#autobase").css("display", "flex")
  360. $("#main").css("display", "none")
  361. $("#misc").css("display", "none")
  362. $("#upgrades").css("display", "none")
  363. $("#sell").css("display", "none")
  364. $("#bots").css("display", "none")
  365. })
  366.  
  367. $("#sellBtn").click((e) => {
  368. activeButton(e)
  369. $("#sell").css("display", "flex")
  370. $("#main").css("display", "none")
  371. $("#misc").css("display", "none")
  372. $("#autobase").css("display", "none")
  373. $("#upgrades").css("display", "none")
  374. $("#bots").css("display", "none")
  375. })
  376.  
  377. $("#upgradesBtn").click((e) => {
  378. activeButton(e)
  379. $("#upgrades").css("display", "flex")
  380. $("#main").css("display", "none")
  381. $("#misc").css("display", "none")
  382. $("#autobase").css("display", "none")
  383. $("#sell").css("display", "none")
  384. $("#bots").css("display", "none")
  385. })
  386. $("#botsBtn").click((e) => {
  387. activeButton(e)
  388. $("#bots").css("display", "flex")
  389. $("#upgrades").css("display", "none")
  390. $("#main").css("display", "none")
  391. $("#misc").css("display", "none")
  392. $("#autobase").css("display", "none")
  393. $("#sell").css("display", "none")
  394. })
  395.  
  396. let packets = {
  397. 0: "PACKET_ENTITY_UPDATE",
  398. 1: "PACKET_PLAYER_COUNTER_UPDATE",
  399. 2: "PACKET_SET_WORLD_DIMENSIONS",
  400. 3: "PACKET_INPUT",
  401. 4: "PACKET_ENTER_WORLD",
  402. 7: "PACKET_PING",
  403. 9: "PACKET_RPC",
  404. PACKET_ENTER_WORLD: 4,
  405. PACKET_ENTITY_UPDATE: 0,
  406. PACKET_INPUT: 3,
  407. PACKET_PING: 7,
  408. PACKET_PLAYER_COUNTER_UPDATE: 1,
  409. PACKET_RPC: 9,
  410. PACKET_SET_WORLD_DIMENSIONS: 2
  411. }
  412.  
  413. let ar = [null, Infinity];
  414.  
  415. class Handler {
  416. constructor() {
  417. this.msg = null
  418. this.uid = null
  419. this.players = {}
  420. this.buildings = {}
  421. this.entities = {}
  422. this.myPlayer = null
  423. this.myPet = null
  424. this.alive = false
  425. this.visibleModel = null
  426. this.myStash = null
  427. this.uaDate = Date.now()
  428. this.myPartyKey = null
  429. this.bossWaves = [9, 17, 25, 33, 41, 49, 57, 65, 73, 81, 89, 97, 105, 121]
  430. this.proc = {
  431. health: {
  432. player: 100,
  433. pet: 100
  434. }
  435. }
  436. }
  437. updateUid() {
  438. if (this.msg.uid) {
  439. this.uid = this.msg.uid
  440. this.players = {}
  441. this.buildings = {}
  442. this.entities = {}
  443. window.msg = 0
  444. }
  445. }
  446. buyItem(e) {
  447. Game.currentGame.network.sendRpc({
  448. "name": "BuyItem",
  449. "itemName": e,
  450. "tier": 1
  451. })
  452. }
  453. equipItem(e) {
  454. Game.currentGame.network.sendRpc({
  455. "name": "EquipItem",
  456. "itemName": e,
  457. "tier": 1
  458. })
  459. }
  460. useItem(e) {
  461. this.buyItem(e)
  462. this.equipItem(e)
  463. }
  464. entitiesAction(model, action) {
  465. this.entities = Game.currentGame.world.entities
  466. for (let ind in this.entities) {
  467. if (!this.entities.hasOwnProperty(ind)) continue
  468. let obj = this.entities[ind]
  469. action(obj, model)
  470. }
  471. }
  472. updateMyStash() {
  473. this.entitiesAction("GoldStash", (e, m) => {
  474. if (e.fromTick.model == m) {
  475. this.myStash = e
  476. }
  477. })
  478. }
  479. upgradeAll() {
  480. this.entitiesAction("GoldStash", (e, m) => {
  481. if (e.fromTick.model != m) {
  482. Game.currentGame.network.sendRpc({
  483. name: "UpgradeBuilding",
  484. uid: e.fromTick.uid
  485. })
  486. }
  487. })
  488. }
  489. /*revivePets() {
  490. for(let idn in game.world.entities) {
  491. if(game.world.entities[idn].fromTick.model == "PetCARL" || game.world.entities[idn].fromTick.model == "PetMiner") {
  492. Game.currentGame.network.sendRpc({
  493. name: "purchaseItem",
  494. itemName: "PetRevive",
  495. uid: game.world.entities[idn].fromTick.uid
  496. });
  497. }
  498. }
  499. }*/
  500. sellPets() {
  501. for(let idn in game.world.entities) {
  502. if(game.world.entities[idn].fromTick.model == "PetCARL" || game.world.entities[idn].fromTick.model == "PetMiner") {
  503. Game.currentGame.network.sendRpc({
  504. name: "DeleteBuilding",
  505. uid: game.world.entities[idn].fromTick.uid
  506. });
  507. }
  508. }
  509. }
  510. delAction(model) {
  511. this.entities = Game.currentGame.world.entities
  512. for (let ind in this.entities) {
  513. if (!this.entities.hasOwnProperty(ind)) continue;
  514. if (this.entities[ind].fromTick.model == model) {
  515. Game.currentGame.network.sendRpc({
  516. name: "DeleteBuilding",
  517. uid: this.entities[ind].fromTick.uid
  518. });
  519. }
  520. }
  521. }
  522. sellBuilding(model, {verify, content}) {
  523. if (verify) {
  524. Game.currentGame.ui.getComponent("PopupOverlay").showConfirmation(content, 1e4, () => {
  525. this.delAction(model)
  526. })
  527. } else {
  528. this.delAction(model)
  529. }
  530. }
  531. sellAll() {
  532. Game.currentGame.ui.getComponent("PopupOverlay").showConfirmation("Are you sure?", 1e4, () => {
  533. this.entities = Game.currentGame.world.entities
  534. for (let ind in this.entities) {
  535. if (!this.entities.hasOwnProperty(ind)) continue;
  536. if (this.entities[ind].fromTick.model != "GoldStash") {
  537. Game.currentGame.network.sendRpc({
  538. name: "DeleteBuilding",
  539. uid: this.entities[ind].fromTick.uid
  540. });
  541. }
  542. }
  543. })
  544. }
  545. ahrc() {
  546. let depTier = [0.07, 0.11, 0.17, 0.22, 0.25, 0.28, 0.42, 0.65]
  547. this.entitiesAction("Harvester", (e) => {
  548. if (e.fromTick.deposit > 0) {
  549. Game.currentGame.network.sendRpc({
  550. name: "CollectHarvester",
  551. uid: e.fromTick.uid
  552. });
  553. }
  554. for (let i = 0; i < depTier.length; i++) {
  555. let tc = i + 1
  556. if (e.fromTick.tier == tc) {
  557. if (e.fromTick.deposit <= 0) {
  558. Game.currentGame.network.sendRpc({
  559. name: "AddDepositToHarvester",
  560. uid: e.fromTick.uid,
  561. deposit: depTier[i]
  562. });
  563. }
  564. }
  565. }
  566. })
  567. }
  568. heal(type) {
  569. switch (type) {
  570. case "proc":
  571. if (this.myPlayer) {
  572. this.proc.health.player = (this.myPlayer.health / this.myPlayer.maxHealth) * 100
  573. if (this.myPet) {
  574. this.proc.health.pet = (this.myPet.health / this.myPet.maxHealth) * 100
  575. }
  576. }
  577. window.proc = this.proc
  578. break
  579. case "player":
  580. if (this.myPlayer) {
  581. if (this.proc.health.player <= 35) {
  582. this.useItem("HealthPotion")
  583. }
  584. }
  585. break
  586. case "pet":
  587. if (this.myPet) {
  588. if (this.proc.health.pet <= 35) {
  589. this.useItem("PetHealthPotion")
  590. }
  591. }
  592. break
  593. }
  594. }
  595. waveInfo() {
  596. if ($("#hud-day-night-overlay").css("opacity") < 0.5) {
  597. if (!scoreLog.n || Date.now() - scoreLog.n >= 1000) {
  598. if ($("#hud-day-night-overlay").css("opacity") < 0.5) {
  599. scoreLog.night = true
  600. scoreLog.day = false
  601. }
  602. scoreLog.n = Date.now()
  603. }
  604. }
  605. if ($("#hud-day-night-overlay").css("opacity") > 0.5) {
  606. if (!scoreLog.d || Date.now() - scoreLog.d >= 1000) {
  607. if ($("#hud-day-night-overlay").css("opacity") > 0.5) {
  608. scoreLog.night = false
  609. scoreLog.day = true
  610. }
  611. scoreLog.d = Date.now()
  612. }
  613. }
  614. if (scoreLog.timer.enabled) {
  615. if (!scoreLog.timer.dateS || Date.now() - scoreLog.timer.dateS >= 1000) {
  616. scoreLog.timer.sec -= 1
  617. scoreLog.timer.dateS = Date.now()
  618. }
  619. $("#wave-timer").text(scoreLog.timer.sec + "s")
  620. document.getElementById("waveBarInner").style.width = 100 * (scoreLog.timer.sec / scoreLog.timer.max) + "%"
  621. }
  622. }
  623. autoRespawn() {
  624. if (document.querySelector('.hud-respawn').style.display == "none") return
  625. game.inputPacketScheduler.scheduleInput({
  626. respawn: 1
  627. })
  628. document.querySelector('.hud-respawn').style.display = "none"
  629. }
  630. clickImitation(e) {
  631. switch (e) {
  632. case "space":
  633. game.network.sendInput({space: 0})
  634. game.network.sendInput({space: 1})
  635. break
  636. case "up":
  637. Game.currentGame.network.sendInput({
  638. up: 1
  639. })
  640. break
  641. case "down":
  642. Game.currentGame.network.sendInput({
  643. down: 1
  644. })
  645. break
  646. case "left":
  647. Game.currentGame.network.sendInput({
  648. left: 1
  649. })
  650. break
  651. case "right":
  652. Game.currentGame.network.sendInput({
  653. right: 1
  654. })
  655. break
  656. }
  657. }
  658. putBuilding(x, y, model, yaw = 180) {
  659. Game.currentGame.network.sendRpc({
  660. name: "MakeBuilding",
  661. x: x,
  662. y: y,
  663. type: model,
  664. yaw: yaw
  665. })
  666. }
  667. findNearPlayer(ourUID, ourX, ourY) {
  668. ar[0] = null;
  669. ar[1] = Infinity;
  670. for(let key in Game.currentGame.world.entities) {
  671. const entity = Game.currentGame.world.entities[key];
  672. if(!entity || entity.targetTick.uid == ourUID || !entity.targetTick || entity.entityClass !== "PlayerEntity" || game.world.localPlayer.entity.targetTick.partyId == entity.targetTick.partyId) continue;
  673. const position = entity.targetTick.position;
  674. const dist = (ourX - position.x) ** 2 + (ourY - position.y) ** 2;
  675. if(dist < ar[1]){
  676. ar[1] = dist;
  677. ar[0] = entity;
  678. }
  679. }
  680. return ar;
  681. }
  682. setMouseMoved(e) {
  683. game.network.sendInput({
  684. mouseMoved: e
  685. })
  686. }
  687. lookYaw({x1, x2}, {y1, y2}) {
  688. return game.inputPacketCreator.screenToYaw((-x1 + x2) * 100, (-y1 + y2) * 100)
  689. }
  690. autoAim() {
  691. if (this.players.uid) {
  692. const [target, distSqrd] = this.findNearPlayer(
  693. game.world.localPlayer.entity.targetTick.uid,
  694. game.world.localPlayer.entity.targetTick.position.x,
  695. game.world.localPlayer.entity.targetTick.position.y);
  696. if (target) {
  697. this.setMouseMoved(this.lookYaw({
  698. x1: game.world.localPlayer.entity.targetTick.position.x,
  699. x2: target.targetTick.position.x
  700. }, {
  701. y1: game.world.localPlayer.entity.targetTick.position.y,
  702. y2: target.targetTick.position.y
  703. }))
  704. console.log(target.targetTick)
  705. document.querySelector(".player-info-holder").innerHTML += `
  706. <div class="box">
  707. <div id="name" style="color: #cc5151">Aim at: ${target.targetTick.name}</div>
  708. </div>`
  709. }
  710. }
  711. }
  712. buySpear() {
  713. let getTierText = $("[data-item='Spear'] > .hud-shop-item-tier").text()
  714. let getTier = getTierText.split(" ")[1]
  715. if (getTier == 1 && this.myPlayer.gold > 1400) {
  716. this.useItem("Spear")
  717. }
  718. }
  719. update() {
  720. if (tgl.autorespawn) this.autoRespawn()
  721. this.waveInfo()
  722. this.updateUid()
  723. this.alive = game.world.inWorld
  724. if (this.msg.entities) {
  725. if (window.msg == 0) {
  726. game.world.replicator.onEntityUpdate(this.msg);
  727. }
  728. if (this.msg.entities[this.uid].name) {
  729. this.myPlayer = this.msg.entities[this.uid];
  730. }
  731. for (let ind in this.myPlayer) {
  732. if (this.myPlayer[ind] !== this.msg.entities[this.uid][ind] && this.msg.entities[this.uid][ind] !== undefined) {
  733. this.myPlayer[ind] = this.msg.entities[this.uid][ind];
  734. }
  735. }
  736. if (this.myPlayer.petUid) {
  737. if (this.msg.entities[this.myPlayer.petUid]) {
  738. if (this.msg.entities[this.myPlayer.petUid].model) {
  739. this.myPet = this.msg.entities[this.myPlayer.petUid];
  740. }
  741. }
  742. for (let ind in this.myPet) {
  743. if (this.msg.entities[this.myPlayer.petUid]) {
  744. if (this.myPet[ind] !== this.msg.entities[this.myPlayer.petUid][ind] && this.msg.entities[this.myPlayer.petUid][ind] !== undefined) {
  745. this.myPet[ind] = this.msg.entities[this.myPlayer.petUid][ind]
  746. }
  747. }
  748. }
  749. }
  750. }
  751. if (this.alive) {
  752. //this.revivePets()
  753. updatePlayerInfo()
  754. this.updateMyStash()
  755. this.myPartyKey = Game.currentGame.ui.getPlayerPartyShareKey()
  756. this.heal("proc")
  757. if (tgl.autoaim) {
  758. this.autoAim()
  759. }
  760. if (tgl.autobuyspear) {
  761. this.buySpear()
  762. }
  763. if (lockYaw.active) {
  764. this.setMouseMoved(lockYaw.yaw)
  765. }
  766. if (tgl.autospacebar) {
  767. this.clickImitation("space")
  768. }
  769. if (tgl.autoheal) {
  770. this.heal("player")
  771. }
  772. if (tgl.petheal) {
  773. this.heal("pet")
  774. }
  775. if (tgl.ahrc) {
  776. this.ahrc()
  777. }
  778. if (tgl.upgradesall) {
  779. // Anti lag night
  780. if (scoreLog.night) {
  781. if (!this.uaDate || Date.now() - this.uaDate >= 1000) {
  782. this.upgradeAll()
  783. this.uaDate = Date.now()
  784. }
  785. } else {
  786. this.upgradeAll()
  787. }
  788. }
  789. if (tgl.bsbase) {
  790. BSBase()
  791. }
  792. }
  793. }
  794. }
  795.  
  796. let handler = new Handler()
  797. game.network.addPacketHandler = (e, cb) => {
  798. game.network.emitter.on(packets[e], cb)
  799. }
  800.  
  801. game.network.emitter.removeListener('PACKET_ENTITY_UPDATE', game.network.emitter._events.PACKET_ENTITY_UPDATE)
  802.  
  803. game.network.addPacketHandler(0, e => {
  804. handler.msg = e
  805. handler.update()
  806. })
  807.  
  808. for (let i = 0; i < 10; i++) {
  809. game.network.addPacketHandler(i, function(e) {
  810. handler.msg = e
  811. handler.update()
  812. })
  813. }
  814.  
  815.  
  816. window.sendBot = () => {
  817. console.log("Send bot")
  818. // connect(game.options.servers[game.options.serverId].hostname, "8000")
  819. }
  820.  
  821.  
  822. let playerInfo = `
  823. <div class="player-info-holder">
  824. </div>
  825. <style>
  826. .box {
  827. font-weight: 1000;
  828. color: white;
  829. display: flex;
  830. foxt-size: 14px;
  831. }
  832. .box #name {
  833. color: #a79aef;
  834. text-shadow: 0px 0px 5px blue, 0px 0px 5px blue;
  835. }
  836. .player-info-holder {
  837. pointer-events: none;
  838. position: absolute;
  839. display: flex;
  840. flex-direction: column;
  841. top: 290px;
  842. left: 76px;
  843. }
  844. </style>
  845. `
  846.  
  847. $("#hud").append(playerInfo)
  848.  
  849. function addPlayer(name, res, party) {
  850. document.querySelector(".player-info-holder").innerHTML += `
  851. <div class="box">
  852. <div id="name" style="color: ${handler.myPlayer.partyId == party ? "#8ecc51" : "#a79aef"}">${name}&nbsp</div>
  853. <div id="res">[${res}]</div>
  854. </div>
  855. `
  856. }
  857.  
  858. function updatePlayerInfo() {
  859. document.querySelector(".player-info-holder").innerHTML = ""
  860. Object.entries(Game.currentGame.world.entities).forEach((stuff => {
  861. if (stuff[1].targetTick.entityClass == "PlayerEntity" && ((stuff[1].targetTick.uid !== Game.currentGame.world.entities[Game.currentGame.world.getMyUid()].targetTick.uid) || window.useSamePI)) {
  862. let rr = Game.currentGame.world.entities[stuff[1].targetTick.uid].targetTick
  863. handler.players = rr
  864. let hp = (rr.health / rr.maxHealth) * 100
  865. let res = `Gold: ${rr.gold},
  866. Wood: ${rr.wood},
  867. Stone: ${rr.stone},
  868. Hp: ${~~(hp)}%`
  869. addPlayer(stuff[1].targetTick.name, res, rr.partyId)
  870. }
  871. }))
  872. }
  873.  
  874. let dimension = 1;
  875.  
  876. const onWindowResize = () => {
  877. const renderer = Game.currentGame.renderer;
  878. let canvasWidth = window.innerWidth * window.devicePixelRatio;
  879. let canvasHeight = window.innerHeight * window.devicePixelRatio;
  880. let ratio = Math.max(canvasWidth / (1920 * dimension), canvasHeight / (1080 * dimension));
  881. renderer.scale = ratio;
  882. renderer.entities.setScale(ratio);
  883. renderer.ui.setScale(ratio);
  884. renderer.renderer.resize(canvasWidth, canvasHeight);
  885. renderer.viewport.width = renderer.renderer.width / renderer.scale + 2 * renderer.viewportPadding;
  886. renderer.viewport.height = renderer.renderer.height / renderer.scale + 2 * renderer.viewportPadding;
  887. }
  888.  
  889. onWindowResize()
  890.  
  891. window.addEventListener("resize", () => {
  892. onWindowResize()
  893. })
  894.  
  895. window.dpr = (e) => {
  896. window.devicePixelRatio = e
  897. onWindowResize()
  898. }
  899.  
  900. function disableEvent() {
  901. let els = [".menu-holder", "#hud-menu-party", "#hud-menu-shop", "#hud-menu-settings"]
  902. for (let i = 0; i < els.length; i++) {
  903. if ($(els[i]).css("display") != "none") {
  904. return true
  905. }
  906. return false
  907. }
  908. }
  909.  
  910. window.addEventListener("wheel", function(e, t = 1.003) {
  911. if (disableEvent() || !tgl.wheelzoom || $("#hud-chat").hasClass("is-focused")) return
  912. if (e.deltaY > 0) {
  913. for(let i = 0; i < 50; i++) {
  914. setTimeout(() => {
  915. dimension = dimension * t
  916. onWindowResize()
  917. }, i * 5)
  918. };
  919. } else if(e.deltaY <= 1){
  920. for(let i = 0; i < 50; i++) {
  921. setTimeout(() => {
  922. dimension = dimension / t
  923. onWindowResize()
  924. }, i * 5)
  925. };
  926. }
  927. });
  928.  
  929. let lockYaw = {
  930. active: false,
  931. yaw: 0
  932. }
  933.  
  934. let clearChat = {
  935. cmd: "!clear",
  936. active: false
  937. }
  938.  
  939. function checkChat() {
  940. if ($(".hud-chat-input").val() == clearChat.cmd) {
  941. clearChat.active = true
  942. }
  943. }
  944.  
  945. document.addEventListener("keydown", e => {
  946. if (e.code == "Enter") {
  947. checkChat()
  948. if (clearChat.active) {
  949. document.querySelector(".hud-chat-messages").innerHTML = ""
  950. clearChat.active = false
  951. setTimeout(() => {
  952. document.querySelector(".hud-chat-messages").innerHTML = ""
  953. }, 500)
  954. }
  955. }
  956. if (e.code == "KeyX") {
  957. lockYaw.active = !lockYaw.active
  958. if (lockYaw.active) {
  959. lockYaw.yaw = game.world.localPlayer.entity.targetTick.yaw
  960. } else {
  961. lockYaw.yaw = null
  962. }
  963. }
  964. })
  965.  
  966. let dni = `
  967. <div class="dni-holder">
  968. <div id="lastscore">Score for last night: 0</div>
  969. <div class="waveBar">
  970. <div class="timer-holder">
  971. <span id="wave-timer">0s</span>
  972. </div>
  973. <div id="waveBarInner"></div>
  974. </div>
  975. </div>
  976. <style>
  977. .timer-holder {
  978. position: absolute;
  979. width: 200px;
  980. height: 30px;
  981. display: flex;
  982. margin-left: -3px;
  983. margin-top: -3px;
  984. justify-content: center;
  985. align-items: center;
  986. }
  987. .timer-holder span {
  988. font-size: 20px;
  989. font-weight: 1000;
  990. color: #2d2d2d;
  991. }
  992. #waveBarInner {
  993. width: 0%;
  994. height: 100%;
  995. background: rgba(255, 255, 255, 0.4);
  996. border-radius: 6px;
  997. }
  998. .waveBar {
  999. margin: 5px;
  1000. padding: 3px;
  1001. width: 200px;
  1002. height: 30px;
  1003. background: rgb(0 0 0 / 20%);
  1004. border-radius: 6px;
  1005. }
  1006. #lastscore {
  1007. font-weight: 1000;
  1008. font-size: 25px;
  1009. color: #d0d0d0;
  1010. }
  1011. .dni-holder {
  1012. position: absolute;
  1013. top: 0;
  1014. left: 0;
  1015. width: 100%;
  1016. display: flex;
  1017. justify-content: center;
  1018. align-items: center;
  1019. flex-direction: column;
  1020. }
  1021. </style>
  1022. `
  1023.  
  1024. $("#hud").append(dni)
  1025.  
  1026. let scoreLog = {
  1027. night: false,
  1028. day: false,
  1029. d: Date.now(),
  1030. n: Date.now(),
  1031. new: null,
  1032. old: null,
  1033. last: null,
  1034. date: Date.now(),
  1035. timer: {
  1036. sec: 0,
  1037. dateS: Date.now(),
  1038. enabled: false,
  1039. max: 59
  1040. }
  1041. }
  1042.  
  1043. Game.currentGame.network.addRpcHandler("DayCycle", () => {
  1044. if (scoreLog.night) {
  1045. scoreLog.timer.sec = scoreLog.timer.max
  1046. document.getElementById("waveBarInner").style.width = "100%"
  1047. scoreLog.timer.enabled = true
  1048. scoreLog.old = Game.currentGame.ui.playerTick.score
  1049. $("#lastscore").text(`Score for last night: ...`)
  1050. }
  1051. if (scoreLog.day) {
  1052. document.getElementById("waveBarInner").style.background = "rgba(255, 255, 255, 0.4)"
  1053. $("#wave-timer").text("0s")
  1054. document.getElementById("waveBarInner").style.width = "0%"
  1055. scoreLog.timer.enabled = false
  1056. scoreLog.new = Game.currentGame.ui.playerTick.score
  1057. scoreLog.last = (scoreLog.new - scoreLog.old)
  1058. $("#lastscore").text(`Score for last night: ${scoreLog.last}`)
  1059. }
  1060. })
  1061.  
  1062.  
  1063. let checkbMAIN = [{
  1064. name: "AutoPlayerHeal",
  1065. desc: "Auto uses heal potion",
  1066. id: "autoheal",
  1067. action: "Enabled",
  1068. active: true,
  1069. button: false
  1070. },{
  1071. name: "AutoPetHeal",
  1072. desc: "Auto uses pet heal potion",
  1073. id: "petheal",
  1074. action: "Enabled",
  1075. active: true,
  1076. button: false
  1077. },{
  1078. name: "AHRC",
  1079. desc: "Auto collect resources from harvester",
  1080. id: "ahrc",
  1081. action: "Disabled",
  1082. active: false,
  1083. button: false
  1084. },{
  1085. name: "AutoSpear",
  1086. desc: "Auto buy spear [tier: 1]",
  1087. id: "autobuyspear",
  1088. action: "Disabled",
  1089. active: false,
  1090. button: false
  1091. },{
  1092. name: "AutoSpaceBar",
  1093. desc: "Automatically clicks on the space bar",
  1094. id: "autospacebar",
  1095. action: "Disabled",
  1096. active: false,
  1097. button: false
  1098. },{
  1099. name: "AutoAim",
  1100. desc: "you will look at the enemy, but you will not turn around",
  1101. id: "autoaim",
  1102. action: "Disabled",
  1103. active: false,
  1104. button: false
  1105. }]
  1106. let checkbMISC = [{
  1107. name: "WheelZoom",
  1108. desc: "Changes the visible part of the game",
  1109. id: "wheelzoom",
  1110. action: "Enabled",
  1111. active: true,
  1112. button: false
  1113. },{
  1114. name: "LeaveFromClan",
  1115. desc: "You will leave the clan you are in",
  1116. id: "leaveclan",
  1117. action: "Leave",
  1118. button: true
  1119. },{
  1120. name: "AutoRespawn",
  1121. desc: "Respawn you after death",
  1122. id: "autorespawn",
  1123. action: "Enabled",
  1124. active: true,
  1125. button: false
  1126. }]
  1127. let checkbSELL = [{
  1128. name: "SellPets",
  1129. desc: "Remove your pet",
  1130. id: "sellpets",
  1131. action: "Sell",
  1132. button: true
  1133. },{
  1134. name: "All",
  1135. desc: "Sell everything",
  1136. id: "sellall",
  1137. action: "Sell",
  1138. button: true
  1139. },{
  1140. name: "Walls",
  1141. desc: "Sell walls",
  1142. id: "sellwalls",
  1143. action: "Sell",
  1144. button: true
  1145. },{
  1146. name: "Doors",
  1147. desc: "Sell doors",
  1148. id: "selldoors",
  1149. action: "Sell",
  1150. button: true
  1151. },{
  1152. name: "Traps",
  1153. desc: "Sell traps",
  1154. id: "selltraps",
  1155. action: "Sell",
  1156. button: true
  1157. },{
  1158. name: "ArrowTowers",
  1159. desc: "Sell arrow towers",
  1160. id: "sellarrows",
  1161. action: "Sell",
  1162. button: true
  1163. },{
  1164. name: "CannonTowers",
  1165. desc: "Sell cannon towers",
  1166. id: "sellcannons",
  1167. action: "Sell",
  1168. button: true
  1169. },{
  1170. name: "MeleeTowers",
  1171. desc: "Sell melee towers",
  1172. id: "sellmelees",
  1173. action: "Sell",
  1174. button: true
  1175. },{
  1176. name: "BombTowers",
  1177. desc: "Sell bomb towers",
  1178. id: "sellbombs",
  1179. action: "Sell",
  1180. button: true
  1181. },{
  1182. name: "MageTowers",
  1183. desc: "Sell mage towers",
  1184. id: "sellmages",
  1185. action: "Sell",
  1186. button: true
  1187. },{
  1188. name: "GoldMines",
  1189. desc: "Sell gold mines",
  1190. id: "sellgoldmines",
  1191. action: "Sell",
  1192. button: true
  1193. },{
  1194. name: "Harvesters",
  1195. desc: "Sell harvesters",
  1196. id: "sellharvesters",
  1197. action: "Sell",
  1198. button: true
  1199. },{
  1200. name: "GoldStash",
  1201. desc: "Sell gold stash",
  1202. id: "sellgoldstash",
  1203. action: "Sell",
  1204. button: true
  1205. }]
  1206. let checkbBOTS = [{
  1207. name: "SendBot",
  1208. desc: "Send one bot",
  1209. id: "sendbot",
  1210. action: "Send",
  1211. button: true
  1212. }]
  1213. let checkbUPGRADES = [{
  1214. name: "UpgradesAll",
  1215. desc: "Improves all buildings",
  1216. id: "upgradesall",
  1217. action: "Disabled",
  1218. active: false,
  1219. button: false
  1220. }]
  1221. let checkbAUTOBASE = [{
  1222. name: "BSBase",
  1223. desc: "[BryanSmithBase] Hack will create a base for you by itself",
  1224. id: "bsbase",
  1225. action: "Disabled",
  1226. active: false,
  1227. button: false
  1228. }]
  1229.  
  1230. let tgl = {
  1231. autoheal: true,
  1232. petheal: true,
  1233. ahrc: false,
  1234. wheelzoom: true,
  1235. upgradesall: false,
  1236. autorespawn: true,
  1237. autospacebar: false,
  1238. autoaim: false,
  1239. bsbase: false,
  1240. autobuyspear: false
  1241. }
  1242.  
  1243. function addTogglerHTML(loc, button, name, desc, id, action, active) {
  1244. if (!button) {
  1245. document.getElementById(loc).innerHTML += `
  1246. <div class="toggler-container">
  1247. <div class="toggler-info">
  1248. <div id="toggler-name">${name}</div>
  1249. <div id="toggler-desc">${desc}</div>
  1250. </div>
  1251. <div class="toggler-display" id="${id}">
  1252. <span class="toggler-checkbox"><span class="toggler-mark ${active ? "toggler-active" : ""}" id="${id}-checkbox"></span></span>
  1253. <span class="toggler-action" id="${id}-action">${action}</span>
  1254. </div>
  1255. </div>
  1256. `
  1257. } else {
  1258. document.getElementById(loc).innerHTML += `
  1259. <div class="toggler-container">
  1260. <div class="toggler-info">
  1261. <div id="toggler-name">${name}</div>
  1262. <div id="toggler-desc">${desc}</div>
  1263. </div>
  1264. <div class="toggler-display" id="${id}">
  1265. <span class="toggler-action">${action}</span>
  1266. </div>
  1267. </div>
  1268. `
  1269. }
  1270. }
  1271.  
  1272. function checkboxGenerator() {
  1273. for (let i = 0; i < checkbMAIN.length; i++) {
  1274. if (checkbMAIN[i].name) addTogglerHTML("main", checkbMAIN[i].button, checkbMAIN[i].name, checkbMAIN[i].desc, checkbMAIN[i].id, checkbMAIN[i].action || null, checkbMAIN[i].active || null)
  1275. }
  1276. for (let i = 0; i < checkbMISC.length; i++) {
  1277. if (checkbMISC[i].name) addTogglerHTML("misc", checkbMISC[i].button, checkbMISC[i].name, checkbMISC[i].desc, checkbMISC[i].id, checkbMISC[i].action || null, checkbMISC[i].active || null)
  1278. }
  1279. for (let i = 0; i < checkbSELL.length; i++) {
  1280. if (checkbSELL[i].name) addTogglerHTML("sell", checkbSELL[i].button, checkbSELL[i].name, checkbSELL[i].desc, checkbSELL[i].id, checkbSELL[i].action || null, checkbSELL[i].active || null)
  1281. }
  1282. for (let i = 0; i < checkbBOTS.length; i++) {
  1283. if (checkbBOTS[i].name) addTogglerHTML("bots", checkbBOTS[i].button, checkbBOTS[i].name, checkbBOTS[i].desc, checkbBOTS[i].id, checkbBOTS[i].action, checkbBOTS[i].active)
  1284. }
  1285. for (let i = 0; i < checkbUPGRADES.length; i++) {
  1286. if (checkbUPGRADES[i].name) addTogglerHTML("upgrades", checkbUPGRADES[i].button, checkbUPGRADES[i].name, checkbUPGRADES[i].desc, checkbUPGRADES[i].id, checkbUPGRADES[i].action || null, checkbUPGRADES[i].active || null)
  1287. }
  1288. for (let i = 0; i < checkbAUTOBASE.length; i++) {
  1289. if (checkbAUTOBASE[i].name) addTogglerHTML("autobase", checkbAUTOBASE[i].button, checkbAUTOBASE[i].name, checkbAUTOBASE[i].desc, checkbAUTOBASE[i].id, checkbAUTOBASE[i].action || null, checkbAUTOBASE[i].active || null)
  1290. }
  1291. }
  1292.  
  1293. checkboxGenerator()
  1294.  
  1295. function updateCheckBox(n, e) {
  1296. if (e) {
  1297. $(`#${n}-action`).text("Enabled")
  1298. $(`#${n}-checkbox`).addClass("toggler-active")
  1299. } else {
  1300. $(`#${n}-action`).text("Disabled")
  1301. $(`#${n}-checkbox`).removeClass("toggler-active")
  1302. }
  1303. }
  1304.  
  1305. $("#autoheal").click(() => (tgl.autoheal = !tgl.autoheal, updateCheckBox("autoheal", tgl.autoheal)))
  1306. $("#petheal").click(() => (tgl.petheal = !tgl.petheal, updateCheckBox("petheal", tgl.petheal)))
  1307. $("#ahrc").click(() => (tgl.ahrc = !tgl.ahrc, updateCheckBox("ahrc", tgl.ahrc)))
  1308. $("#wheelzoom").click(() => (tgl.wheelzoom = !tgl.wheelzoom, updateCheckBox("wheelzoom", tgl.wheelzoom)))
  1309. $("#leaveclan").click(() => Game.currentGame.network.sendRpc({name: "LeaveParty"}))
  1310. $("#upgradesall").click(() => (tgl.upgradesall = !tgl.upgradesall, updateCheckBox("upgradesall", tgl.upgradesall)))
  1311. $("#sendbot").click(() => window.sendBot())
  1312. $("#autorespawn").click(() => (tgl.autorespawn = !tgl.autorespawn, updateCheckBox("autorespawn", tgl.autorespawn)))
  1313. $("#autospacebar").click(() => (tgl.autospacebar = !tgl.autospacebar, updateCheckBox("autospacebar", tgl.autospacebar)))
  1314. $("#autoaim").click(() => (tgl.autoaim = !tgl.autoaim, updateCheckBox("autoaim", tgl.autoaim)))
  1315. $("#sellpets").click(() => handler.sellPets())
  1316. $("#bsbase").click(() => (tgl.bsbase = !tgl.bsbase, updateCheckBox("bsbase", tgl.bsbase)))
  1317. $("#autobuyspear").click(() => (tgl.autobuyspear = !tgl.autobuyspear, updateCheckBox("autobuyspear", tgl.autobuyspear)))
  1318.  
  1319. $("#sellall").click(() => handler.sellAll())
  1320. $("#sellwalls").click(() => handler.sellBuilding("Wall", {verify: false, content: ""}))
  1321. $("#selldoors").click(() => handler.sellBuilding("Door", {verify: false, content: ""}))
  1322. $("#selltraps").click(() => handler.sellBuilding("SlowTrap", {verify: false, content: ""}))
  1323. $("#sellarrows").click(() => handler.sellBuilding("ArrowTower", {verify: false, content: ""}))
  1324. $("#sellcannons").click(() => handler.sellBuilding("ConnonTower", {verify: false, content: ""}))
  1325. $("#sellmelees").click(() => handler.sellBuilding("MeleeTower", {verify: false, content: ""}))
  1326. $("#sellbombs").click(() => handler.sellBuilding("BombTower", {verify: false, content: ""}))
  1327. $("#sellmages").click(() => handler.sellBuilding("MageTower", {verify: false, content: ""}))
  1328. $("#sellgoldmines").click(() => handler.sellBuilding("GoldMine", {verify: false, content: ""}))
  1329. $("#sellharvesters").click(() => handler.sellBuilding("Harvester", {verify: false, content: ""}))
  1330. $("#sellgoldstash").click(() => handler.sellBuilding("GoldStash", {verify: true, content: "Are you sure?"}))
  1331.  
  1332. function OWBase() {
  1333. if (!handler.myStash.targetTick) return
  1334. let stash = handler.myStash.targetTick
  1335. let stashPosition = {
  1336. x: stash.position.x,
  1337. y: stash.position.y
  1338. }
  1339. }
  1340.  
  1341. function BSBase() {
  1342. if (!handler.myStash.targetTick) return
  1343. let stash = handler.myStash.targetTick
  1344. let stashPosition = {
  1345. x: stash.position.x,
  1346. y: stash.position.y
  1347. }
  1348. handler.putBuilding(stashPosition.x + 0, stashPosition.y + 0, 'GoldStash', 0);
  1349. handler.putBuilding(stashPosition.x + -192, stashPosition.y + -48, 'GoldMine', 0);
  1350. handler.putBuilding(stashPosition.x + -192, stashPosition.y + 48, 'GoldMine', 0);
  1351. handler.putBuilding(stashPosition.x + -48, stashPosition.y + -192, 'GoldMine', 0);
  1352. handler.putBuilding(stashPosition.x + 48, stashPosition.y + -192, 'GoldMine', 0);
  1353. handler.putBuilding(stashPosition.x + 192, stashPosition.y + -48, 'GoldMine', 0);
  1354. handler.putBuilding(stashPosition.x + 192, stashPosition.y + 48, 'GoldMine', 0);
  1355. handler.putBuilding(stashPosition.x + -48, stashPosition.y + 192, 'GoldMine', 0);
  1356. handler.putBuilding(stashPosition.x + 48, stashPosition.y + 192, 'GoldMine', 0);
  1357. handler.putBuilding(stashPosition.x + -144, stashPosition.y + 288, 'ArrowTower', 0);
  1358. handler.putBuilding(stashPosition.x + -48, stashPosition.y + 288, 'ArrowTower', 0);
  1359. handler.putBuilding(stashPosition.x + 48, stashPosition.y + 288, 'ArrowTower', 0);
  1360. handler.putBuilding(stashPosition.x + 144, stashPosition.y + 288, 'ArrowTower', 0);
  1361. handler.putBuilding(stashPosition.x + -288, stashPosition.y + -48, 'ArrowTower', 0);
  1362. handler.putBuilding(stashPosition.x + -288, stashPosition.y + 48, 'ArrowTower', 0);
  1363. handler.putBuilding(stashPosition.x + -288, stashPosition.y + 144, 'ArrowTower', 0);
  1364. handler.putBuilding(stashPosition.x + -48, stashPosition.y + -288, 'ArrowTower', 0);
  1365. handler.putBuilding(stashPosition.x + 48, stashPosition.y + -288, 'ArrowTower', 0);
  1366. handler.putBuilding(stashPosition.x + 288, stashPosition.y + -144, 'ArrowTower', 0);
  1367. handler.putBuilding(stashPosition.x + 288, stashPosition.y + -48, 'ArrowTower', 0);
  1368. handler.putBuilding(stashPosition.x + 288, stashPosition.y + 48, 'ArrowTower', 0);
  1369. handler.putBuilding(stashPosition.x + 288, stashPosition.y + 144, 'ArrowTower', 0);
  1370. handler.putBuilding(stashPosition.x + 384, stashPosition.y + 144, 'ArrowTower', 0);
  1371. handler.putBuilding(stashPosition.x + 480, stashPosition.y + 144, 'ArrowTower', 0);
  1372. handler.putBuilding(stashPosition.x + 336, stashPosition.y + 240, 'ArrowTower', 0);
  1373. handler.putBuilding(stashPosition.x + 432, stashPosition.y + 240, 'ArrowTower', 0);
  1374. handler.putBuilding(stashPosition.x + 384, stashPosition.y + 336, 'ArrowTower', 0);
  1375. handler.putBuilding(stashPosition.x + 144, stashPosition.y + 384, 'ArrowTower', 0);
  1376. handler.putBuilding(stashPosition.x + 144, stashPosition.y + 480, 'ArrowTower', 0);
  1377. handler.putBuilding(stashPosition.x + 48, stashPosition.y + 576, 'ArrowTower', 0);
  1378. handler.putBuilding(stashPosition.x + 240, stashPosition.y + 432, 'ArrowTower', 0);
  1379. handler.putBuilding(stashPosition.x + -288, stashPosition.y + -144, 'CannonTower', 0);
  1380. handler.putBuilding(stashPosition.x + -384, stashPosition.y + -144, 'CannonTower', 0);
  1381. handler.putBuilding(stashPosition.x + -480, stashPosition.y + -144, 'CannonTower', 0);
  1382. handler.putBuilding(stashPosition.x + -432, stashPosition.y + -240, 'CannonTower', 0);
  1383. handler.putBuilding(stashPosition.x + -336, stashPosition.y + -240, 'CannonTower', 0);
  1384. handler.putBuilding(stashPosition.x + -336, stashPosition.y + 240, 'CannonTower', 0);
  1385. handler.putBuilding(stashPosition.x + -144, stashPosition.y + 384, 'CannonTower', 0);
  1386. handler.putBuilding(stashPosition.x + -240, stashPosition.y + 432, 'CannonTower', 0);
  1387. handler.putBuilding(stashPosition.x + -144, stashPosition.y + -288, 'CannonTower', 0);
  1388. handler.putBuilding(stashPosition.x + -144, stashPosition.y + -384, 'CannonTower', 0);
  1389. handler.putBuilding(stashPosition.x + -144, stashPosition.y + -480, 'CannonTower', 0);
  1390. handler.putBuilding(stashPosition.x + -240, stashPosition.y + -432, 'CannonTower', 0);
  1391. handler.putBuilding(stashPosition.x + -336, stashPosition.y + -384, 'CannonTower', 0);
  1392. handler.putBuilding(stashPosition.x + 144, stashPosition.y + -288, 'CannonTower', 0);
  1393. handler.putBuilding(stashPosition.x + 144, stashPosition.y + -384, 'CannonTower', 0);
  1394. handler.putBuilding(stashPosition.x + 144, stashPosition.y + -480, 'CannonTower', 0);
  1395. handler.putBuilding(stashPosition.x + 240, stashPosition.y + -432, 'CannonTower', 0);
  1396. handler.putBuilding(stashPosition.x + 336, stashPosition.y + -384, 'CannonTower', 0);
  1397. handler.putBuilding(stashPosition.x + 336, stashPosition.y + -240, 'CannonTower', 0);
  1398. handler.putBuilding(stashPosition.x + 432, stashPosition.y + -240, 'CannonTower', 0);
  1399. handler.putBuilding(stashPosition.x + 528, stashPosition.y + -240, 'CannonTower', 0);
  1400. handler.putBuilding(stashPosition.x + 480, stashPosition.y + -144, 'CannonTower', 0);
  1401. handler.putBuilding(stashPosition.x + 576, stashPosition.y + -144, 'CannonTower', 0);
  1402. handler.putBuilding(stashPosition.x + 384, stashPosition.y + -144, 'BombTower', 0);
  1403. handler.putBuilding(stashPosition.x + 384, stashPosition.y + -48, 'BombTower', 0);
  1404. handler.putBuilding(stashPosition.x + 384, stashPosition.y + 48, 'BombTower', 0);
  1405. handler.putBuilding(stashPosition.x + 480, stashPosition.y + -48, 'BombTower', 0);
  1406. handler.putBuilding(stashPosition.x + 480, stashPosition.y + 48, 'BombTower', 0);
  1407. handler.putBuilding(stashPosition.x + 576, stashPosition.y + -48, 'BombTower', 0);
  1408. handler.putBuilding(stashPosition.x + 576, stashPosition.y + 48, 'BombTower', 0);
  1409. handler.putBuilding(stashPosition.x + 528, stashPosition.y + 240, 'MagicTower', 0);
  1410. handler.putBuilding(stashPosition.x + 480, stashPosition.y + 336, 'MagicTower', 0);
  1411. handler.putBuilding(stashPosition.x + 240, stashPosition.y + 528, 'MagicTower', 0);
  1412. handler.putBuilding(stashPosition.x + 144, stashPosition.y + 576, 'MagicTower', 0);
  1413. handler.putBuilding(stashPosition.x + 48, stashPosition.y + 384, 'BombTower', 0);
  1414. handler.putBuilding(stashPosition.x + -48, stashPosition.y + 384, 'BombTower', 0);
  1415. handler.putBuilding(stashPosition.x + 48, stashPosition.y + 480, 'BombTower', 0);
  1416. handler.putBuilding(stashPosition.x + -48, stashPosition.y + 480, 'BombTower', 0);
  1417. handler.putBuilding(stashPosition.x + -48, stashPosition.y + 576, 'BombTower', 0);
  1418. handler.putBuilding(stashPosition.x + -144, stashPosition.y + 480, 'BombTower', 0);
  1419. handler.putBuilding(stashPosition.x + -144, stashPosition.y + 576, 'MagicTower', 0);
  1420. handler.putBuilding(stashPosition.x + -240, stashPosition.y + 528, 'MagicTower', 0);
  1421. handler.putBuilding(stashPosition.x + -336, stashPosition.y + 480, 'MagicTower', 0);
  1422. handler.putBuilding(stashPosition.x + -384, stashPosition.y + -48, 'BombTower', 0);
  1423. handler.putBuilding(stashPosition.x + -384, stashPosition.y + 48, 'BombTower', 0);
  1424. handler.putBuilding(stashPosition.x + -384, stashPosition.y + 144, 'BombTower', 0);
  1425. handler.putBuilding(stashPosition.x + -480, stashPosition.y + -48, 'BombTower', 0);
  1426. handler.putBuilding(stashPosition.x + -480, stashPosition.y + 48, 'BombTower', 0);
  1427. handler.putBuilding(stashPosition.x + -480, stashPosition.y + 144, 'BombTower', 0);
  1428. handler.putBuilding(stashPosition.x + -432, stashPosition.y + 240, 'CannonTower', 0);
  1429. handler.putBuilding(stashPosition.x + -384, stashPosition.y + 336, 'MagicTower', 0);
  1430. handler.putBuilding(stashPosition.x + 336, stashPosition.y + 480, 'MagicTower', 0);
  1431. handler.putBuilding(stashPosition.x + -480, stashPosition.y + 336, 'MagicTower', 0);
  1432. handler.putBuilding(stashPosition.x + -528, stashPosition.y + 240, 'MagicTower', 0);
  1433. handler.putBuilding(stashPosition.x + 480, stashPosition.y + -336, 'MagicTower', 0);
  1434. handler.putBuilding(stashPosition.x + -48, stashPosition.y + -480, 'BombTower', 0);
  1435. handler.putBuilding(stashPosition.x + -48, stashPosition.y + -384, 'BombTower', 0);
  1436. handler.putBuilding(stashPosition.x + 48, stashPosition.y + -384, 'BombTower', 0);
  1437. handler.putBuilding(stashPosition.x + 48, stashPosition.y + -480, 'BombTower', 0);
  1438. handler.putBuilding(stashPosition.x + 48, stashPosition.y + -576, 'BombTower', 0);
  1439. handler.putBuilding(stashPosition.x + 144, stashPosition.y + -576, 'MagicTower', 0);
  1440. handler.putBuilding(stashPosition.x + 240, stashPosition.y + -528, 'MagicTower', 0);
  1441. handler.putBuilding(stashPosition.x + 336, stashPosition.y + -480, 'MagicTower', 0);
  1442. handler.putBuilding(stashPosition.x + -48, stashPosition.y + -576, 'MagicTower', 0);
  1443. handler.putBuilding(stashPosition.x + -144, stashPosition.y + -576, 'MagicTower', 0);
  1444. handler.putBuilding(stashPosition.x + -240, stashPosition.y + -528, 'MagicTower', 0);
  1445. handler.putBuilding(stashPosition.x + -336, stashPosition.y + -480, 'MagicTower', 0);
  1446. handler.putBuilding(stashPosition.x + -576, stashPosition.y + 48, 'ArrowTower', 0);
  1447. handler.putBuilding(stashPosition.x + -576, stashPosition.y + 144, 'MagicTower', 0);
  1448. handler.putBuilding(stashPosition.x + -576, stashPosition.y + -48, 'MagicTower', 0);
  1449. handler.putBuilding(stashPosition.x + -576, stashPosition.y + -144, 'MagicTower', 0);
  1450. handler.putBuilding(stashPosition.x + -528, stashPosition.y + -240, 'MagicTower', 0);
  1451. handler.putBuilding(stashPosition.x + -480, stashPosition.y + -336, 'MagicTower', 0);
  1452. handler.putBuilding(stashPosition.x + -144, stashPosition.y + -192, 'Harvester', 0);
  1453. handler.putBuilding(stashPosition.x + 144, stashPosition.y + -192, 'Harvester', 0);
  1454. handler.putBuilding(stashPosition.x + 144, stashPosition.y + 192, 'Harvester', 0);
  1455. handler.putBuilding(stashPosition.x + -144, stashPosition.y + 192, 'Harvester', 0);
  1456. handler.putBuilding(stashPosition.x + -648, stashPosition.y + -168, 'Wall', 0);
  1457. handler.putBuilding(stashPosition.x + -648, stashPosition.y + -120, 'Wall', 0);
  1458. handler.putBuilding(stashPosition.x + -648, stashPosition.y + -72, 'Wall', 0);
  1459. handler.putBuilding(stashPosition.x + -648, stashPosition.y + -24, 'Wall', 0);
  1460. handler.putBuilding(stashPosition.x + -648, stashPosition.y + 24, 'Wall', 0);
  1461. handler.putBuilding(stashPosition.x + -648, stashPosition.y + 72, 'Wall', 0);
  1462. handler.putBuilding(stashPosition.x + -648, stashPosition.y + 120, 'Wall', 0);
  1463. handler.putBuilding(stashPosition.x + -648, stashPosition.y + 168, 'Wall', 0);
  1464. handler.putBuilding(stashPosition.x + -696, stashPosition.y + -120, 'Wall', 0);
  1465. handler.putBuilding(stashPosition.x + -696, stashPosition.y + -72, 'Wall', 0);
  1466. handler.putBuilding(stashPosition.x + -696, stashPosition.y + -24, 'Wall', 0);
  1467. handler.putBuilding(stashPosition.x + -696, stashPosition.y + 24, 'Wall', 0);
  1468. handler.putBuilding(stashPosition.x + -696, stashPosition.y + 72, 'Wall', 0);
  1469. handler.putBuilding(stashPosition.x + -696, stashPosition.y + 120, 'Wall', 0);
  1470. handler.putBuilding(stashPosition.x + 600, stashPosition.y + 120, 'Door', 0);
  1471. handler.putBuilding(stashPosition.x + 552, stashPosition.y + 120, 'Door', 0);
  1472. handler.putBuilding(stashPosition.x + 552, stashPosition.y + 168, 'Door', 0);
  1473. handler.putBuilding(stashPosition.x + 600, stashPosition.y + 168, 'Door', 0);
  1474. handler.putBuilding(stashPosition.x + 648, stashPosition.y + -168, 'Wall', 0);
  1475. handler.putBuilding(stashPosition.x + 648, stashPosition.y + -120, 'Wall', 0);
  1476. handler.putBuilding(stashPosition.x + 648, stashPosition.y + -72, 'Wall', 0);
  1477. handler.putBuilding(stashPosition.x + 648, stashPosition.y + -24, 'Wall', 0);
  1478. handler.putBuilding(stashPosition.x + 648, stashPosition.y + 24, 'Wall', 0);
  1479. handler.putBuilding(stashPosition.x + 648, stashPosition.y + 72, 'Wall', 0);
  1480. handler.putBuilding(stashPosition.x + 648, stashPosition.y + 120, 'Wall', 0);
  1481. handler.putBuilding(stashPosition.x + 648, stashPosition.y + 168, 'Wall', 0);
  1482. handler.putBuilding(stashPosition.x + 696, stashPosition.y + -120, 'Wall', 0);
  1483. handler.putBuilding(stashPosition.x + 696, stashPosition.y + -72, 'Wall', 0);
  1484. handler.putBuilding(stashPosition.x + 696, stashPosition.y + -24, 'Wall', 0);
  1485. handler.putBuilding(stashPosition.x + 696, stashPosition.y + 24, 'Wall', 0);
  1486. handler.putBuilding(stashPosition.x + 696, stashPosition.y + 72, 'Wall', 0);
  1487. handler.putBuilding(stashPosition.x + 696, stashPosition.y + 120, 'Wall', 0);
  1488. handler.putBuilding(stashPosition.x + -168, stashPosition.y + -648, 'Wall', 0);
  1489. handler.putBuilding(stashPosition.x + -120, stashPosition.y + -648, 'Wall', 0);
  1490. handler.putBuilding(stashPosition.x + -72, stashPosition.y + -648, 'Wall', 0);
  1491. handler.putBuilding(stashPosition.x + -24, stashPosition.y + -648, 'Wall', 0);
  1492. handler.putBuilding(stashPosition.x + 24, stashPosition.y + -648, 'Wall', 0);
  1493. handler.putBuilding(stashPosition.x + 72, stashPosition.y + -648, 'Wall', 0);
  1494. handler.putBuilding(stashPosition.x + 120, stashPosition.y + -648, 'Wall', 0);
  1495. handler.putBuilding(stashPosition.x + 168, stashPosition.y + -648, 'Wall', 0);
  1496. handler.putBuilding(stashPosition.x + -120, stashPosition.y + -696, 'Wall', 0);
  1497. handler.putBuilding(stashPosition.x + -72, stashPosition.y + -696, 'Wall', 0);
  1498. handler.putBuilding(stashPosition.x + -24, stashPosition.y + -696, 'Wall', 0);
  1499. handler.putBuilding(stashPosition.x + 24, stashPosition.y + -696, 'Wall', 0);
  1500. handler.putBuilding(stashPosition.x + 72, stashPosition.y + -696, 'Wall', 0);
  1501. handler.putBuilding(stashPosition.x + 120, stashPosition.y + -696, 'Wall', 0);
  1502. handler.putBuilding(stashPosition.x + -168, stashPosition.y + 648, 'Wall', 0);
  1503. handler.putBuilding(stashPosition.x + -120, stashPosition.y + 648, 'Wall', 0);
  1504. handler.putBuilding(stashPosition.x + -72, stashPosition.y + 648, 'Wall', 0);
  1505. handler.putBuilding(stashPosition.x + -24, stashPosition.y + 648, 'Wall', 0);
  1506. handler.putBuilding(stashPosition.x + 24, stashPosition.y + 648, 'Wall', 0);
  1507. handler.putBuilding(stashPosition.x + 72, stashPosition.y + 648, 'Wall', 0);
  1508. handler.putBuilding(stashPosition.x + 120, stashPosition.y + 648, 'Wall', 0);
  1509. handler.putBuilding(stashPosition.x + 168, stashPosition.y + 648, 'Wall', 0);
  1510. handler.putBuilding(stashPosition.x + -120, stashPosition.y + 696, 'Wall', 0);
  1511. handler.putBuilding(stashPosition.x + -72, stashPosition.y + 696, 'Wall', 0);
  1512. handler.putBuilding(stashPosition.x + -24, stashPosition.y + 696, 'Wall', 0);
  1513. handler.putBuilding(stashPosition.x + 24, stashPosition.y + 696, 'Wall', 0);
  1514. handler.putBuilding(stashPosition.x + 72, stashPosition.y + 696, 'Wall', 0);
  1515. handler.putBuilding(stashPosition.x + 120, stashPosition.y + 696, 'Wall', 0);
  1516. handler.putBuilding(stashPosition.x + 216, stashPosition.y + 312, 'Door', 0);
  1517. handler.putBuilding(stashPosition.x + 216, stashPosition.y + 360, 'Door', 0);
  1518. handler.putBuilding(stashPosition.x + 264, stashPosition.y + 360, 'Door', 0);
  1519. handler.putBuilding(stashPosition.x + 216, stashPosition.y + -120, 'Door', 0);
  1520. handler.putBuilding(stashPosition.x + -216, stashPosition.y + -120, 'Door', 0);
  1521. handler.putBuilding(stashPosition.x + -216, stashPosition.y + 120, 'Door', 0);
  1522. handler.putBuilding(stashPosition.x + 216, stashPosition.y + 120, 'Door', 0);
  1523. handler.putBuilding(stashPosition.x + 216, stashPosition.y + -312, 'Door', 0);
  1524. handler.putBuilding(stashPosition.x + 216, stashPosition.y + -360, 'Door', 0);
  1525. handler.putBuilding(stashPosition.x + 264, stashPosition.y + -360, 'Door', 0);
  1526. handler.putBuilding(stashPosition.x + -216, stashPosition.y + -360, 'Door', 0);
  1527. handler.putBuilding(stashPosition.x + -216, stashPosition.y + -312, 'Door', 0);
  1528. handler.putBuilding(stashPosition.x + -264, stashPosition.y + -360, 'Door', 0);
  1529. handler.putBuilding(stashPosition.x + -216, stashPosition.y + 312, 'Door', 0);
  1530. handler.putBuilding(stashPosition.x + -216, stashPosition.y + 360, 'Door', 0);
  1531. handler.putBuilding(stashPosition.x + -264, stashPosition.y + 360, 'Door', 0);
  1532. }
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.