& Majesty

!majesty

  1. // ==UserScript==
  2. // @name & Majesty
  3. // @namespace http://tampermonkey.net/
  4. // @version 2.0
  5. // @description !majesty
  6. // @icon https://cdn.discordapp.com/emojis/853002908924510240.gif?v=1
  7. // @author .
  8. // @match http://zombs.io/
  9. // @match http://tc-mod-xyz.glitch.me/
  10. // @grant Ryan Wolf
  11. // ==/UserScript==
  12.  
  13. document.querySelector(".hud-chat-messages").style.width ="900px";
  14. let CAMenucss = `
  15. .hud-CAMenu-grid3::-webkit-scrollbar-track {
  16. box-shadow: inset 0 0 5px white;
  17. border-radius: 10px;
  18. border: white solid 1px;
  19. background-color: rgba(0,0,0,0.8);
  20. }
  21. .hud-CAMenu-grid3::-webkit-scrollbar {
  22. background-color: black;
  23. border-radius: 10px;
  24. width: 10px;
  25. }
  26.  
  27. .hud-CAMenu-grid3::-webkit-scrollbar-thumb {
  28. background: rgba(217, 217, 217, 1);
  29. border-radius: 10px;
  30. width: 3px;}
  31.  
  32. .hud-CAMenu-grid3::-webkit-scrollbar-thumb:hover {
  33. background: rgba(177, 177, 177, 1);
  34. border-radius: 10px;
  35. }
  36. .hud-menu-CAMenu {
  37. /*scroll bar*/
  38. /**/
  39. display: none;
  40. position: fixed;
  41. top: 45%;
  42. left: 35%;
  43. width: 1000px;
  44. height: 670px;
  45. margin: -270px 0 0 -300px;
  46. padding: 20px;
  47. background: rgba(0, 0, 0, 0.6);
  48. color: #eee;
  49. border-radius: 4px;
  50. z-index: 15;
  51. }
  52.  
  53. .hud-menu-CAMenu .hud-CAMenu-grid3 {
  54. display: block;
  55. height: 360px;
  56. padding: 10px;
  57. margin-top: 18px;
  58. background: rgba(0, 0, 0, 0.3);
  59. overflow: auto;
  60. }
  61.  
  62. .hud-spell-icons .hud-spell-icon[data-type="CAMenu"]::before {
  63. background-image: url("https://cdn.discordapp.com/emojis/853004676889968720.png?v=1");
  64. }
  65.  
  66. .hud-spell-icon[data-type="CAMenu"]:hover{
  67. }
  68.  
  69. /* BTN */
  70.  
  71. .CAbtn:hover {
  72. cursor: pointer;
  73. }
  74. .CAbtn1 {
  75. background-color: rgba(0, 0, 0, 0);
  76. border: 2px solid white;
  77. color: white;
  78. height:40px;
  79. margin: 5px;
  80. border-radius: 10px;
  81. padding: 7px;
  82. width: 243px;
  83. }
  84. .CAbtn1:hover{
  85. opacity: 0.6;
  86. cursor: pointor;
  87. }
  88. .CAbtn1-activated {
  89. background-color: rgba(255, 255, 255, 0.5);
  90. border: 2px solid white;
  91. color: white;
  92. height:40px;
  93. margin: 5px;
  94. border-radius: 10px;
  95. padding: 7px;
  96. width: 243px;
  97. }
  98. .CAbtn1-activated:hover{
  99. opacity: 0.6;
  100. cursor: pointor
  101. }
  102.  
  103. .CAbtnR {
  104. background-color: #FF5964;
  105. border: 2px solid white;
  106. color: white;
  107. height:40px;
  108. margin: 5px;
  109. border-radius: 10px;
  110. padding: 7px;
  111. width: 243px;
  112. }
  113. .CAbtnR:hover{
  114. opacity: 0.6;
  115. cursor: pointor;
  116. }
  117.  
  118. .CAbtnY {
  119. background-color: #FFE74C;
  120. border: 2px solid white;
  121. color: white;
  122. height:40px;
  123. margin: 5px;
  124. border-radius: 10px;
  125. padding: 7px;
  126. width: 243px;
  127. }
  128. .CAbtnY:hover{
  129. opacity: 0.6;
  130. cursor: pointor;
  131. }
  132.  
  133. .CAbtnG {
  134. background-color: #6BF178;
  135. border: 2px solid white;
  136. color: white;
  137. height:40px;
  138. margin: 5px;
  139. border-radius: 10px;
  140. padding: 7px;
  141. width: 243px;
  142. }
  143. .CAbtnG:hover{
  144. opacity: 0.6;
  145. cursor: pointor;
  146. }
  147.  
  148. .CAbtnB {
  149. background-color: #35A7FF;
  150. border: 2px solid white;
  151. color: white;
  152. height:40px;
  153. margin: 5px;
  154. border-radius: 10px;
  155. padding: 7px;
  156. width: 243px;
  157. }
  158. .CAbtnB:hover{
  159. opacity: 0.6;
  160. cursor: pointor;
  161. }
  162.  
  163.  
  164. .hud-CAMenuClose-icon{
  165. position: relative;
  166. transform: scale(2);
  167. bottom: 460px;
  168. float: right;
  169. z-index:100;
  170.  
  171. opacity: 0.2;
  172. }
  173.  
  174. .hud-CAMenuClose-icon:hover{
  175. opacity: 0.5;
  176. cursor: pointer;
  177. }
  178.  
  179. .hud-CAMenuTitle{
  180. position: relative;
  181. bottom: 480px;
  182. font-size: 30px;
  183. color: white;
  184. text-align: center;
  185. left:10px;
  186. font-weight: bold;
  187. font-family: "Hammersmith One", sans-serif;
  188. }
  189.  
  190. /*emm*/
  191.  
  192. .box {
  193. display: block;
  194. width: 100%;
  195. height: 50px;
  196. line-height: 34px;
  197. padding: 8px 14px;
  198. margin: 0 0 10px;
  199. background: #eee;
  200. border: 0;
  201. font-size: 14px;
  202. box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  203. border-radius: 4px;
  204. }
  205. .codeIn, .joinOut {
  206. height: 50px;
  207. }
  208.  
  209. .hud-menu-zipp3 h3 {
  210. display: block;
  211. margin: 0;
  212. line-height: 20px;
  213. }
  214.  
  215.  
  216. .hud-menu-zipp3 .hud-the-tab {
  217. position: relative;
  218. height: 40px;
  219. line-height: 40px;
  220. margin: 20px;
  221. border: 0px solid rgb(0, 0, 0, 0);
  222. }
  223. .hud-menu-zipp3 .hud-the-tab {
  224. display: block;
  225. float: left;
  226. padding: 0 14px;
  227. margin: 0 1px 0 0;
  228. font-size: 14px;
  229. background: rgba(0, 0, 0, 0.4);
  230. color: rgba(255, 255, 255, 0.4);
  231. transition: all 0.15s ease-in-out;
  232. }
  233. .hud-menu-zipp3 .hud-the-tab:hover {
  234. background: rgba(0, 0, 0, 0.2);
  235. color: #eee;
  236. cursor: pointer;
  237. }
  238. `;
  239.  
  240. let styles = document.createElement("style");
  241. styles.appendChild(document.createTextNode(CAMenucss));
  242. document.head.appendChild(styles);
  243. styles.type = "text/css";
  244.  
  245. // Büyüler
  246. let spell = document.createElement("div");
  247. spell.classList.add("hud-spell-icon");
  248. spell.setAttribute("data-type", "CAMenu");
  249. spell.classList.add("hud-CAMenu-icon");
  250. document.getElementsByClassName("hud-spell-icons")[0].appendChild(spell);
  251.  
  252. // Hareket
  253. document.getElementsByClassName("hud-CAMenu-icon")[0].addEventListener("mouseover", onMenuicon);
  254. document.getElementsByClassName("hud-CAMenu-icon")[0].addEventListener("mouseout", offMenuicon);
  255.  
  256. function onMenuicon() {
  257. var caMenuTooltip = document.createElement('div');
  258. caMenuTooltip.classList.add("hud-tooltip");
  259. caMenuTooltip.classList.add("hud-tooltip-right");
  260. caMenuTooltip.classList.add("CaTooltip");
  261. caMenuTooltip.style = "left: 76px; top: 325px; font-size:15px;font-weight:bold; font-family:Hammersmith One;";
  262. caMenuTooltip.innerHTML = "Majesty";
  263. document.body.appendChild(caMenuTooltip);
  264. }
  265.  
  266. function offMenuicon() {
  267. document.getElementsByClassName("CaTooltip")[0].remove();
  268. }
  269. // Menü Alt Yapı
  270. let modHTML = `
  271. <div class="hud-menu-CAMenu">
  272. <br />
  273. <style>
  274. .mt{
  275. width: 15%;
  276. background-color:rgba(0, 0, 0, 0);
  277. border: 2px solid #fff;
  278. border-radius: 5px;
  279. margin: 5px;
  280. color: white;
  281. }
  282.  
  283. .SI{
  284. width: 15%;
  285. background-color:rgba(0, 0, 0, 0);
  286. border: 2px solid #fff;
  287. border-radius: 5px;
  288. margin: 5px;
  289. color: white;
  290. padding: 1px;
  291. }
  292.  
  293. .SI:hover
  294. {
  295. opacity: 0.6;
  296. cursor: pointer;
  297. }
  298. .mt:hover{
  299. opacity: 0.6;
  300. cursor: pointer;
  301. }
  302. </style>
  303. <div style="text-align:center">
  304. <button class="SE mt">Detaylı Kaldır</button>
  305. <button class="AB mt">Otomatik Kurucu</button>
  306. <button class="PA mt">Giriş & Çıkış</button>
  307. <button class="BS mt">Otomatik Yazıcı</button>
  308. <button class="SI MY">Detaylı Yükselt</button>
  309. <button class="MN mt">Pençetay</button>
  310. <div class="hud-CAMenu-grid3">
  311. </div>
  312. <p class="hud-CAMenuClose-icon">&#x2715</p>
  313. <p class="hud-CAMenuTitle"></P>
  314. </div>
  315. `;
  316. document.body.insertAdjacentHTML("afterbegin", modHTML);
  317. let CaMenu = document.getElementsByClassName("hud-menu-CAMenu")[0];
  318.  
  319. let grabLb = document.createElement("BUTTON");
  320. grabLb.className = "btn btn-blue";
  321. grabLb.id = "grabLb";
  322. grabLb.style = "width: 100%; height: 25px; margin-top: 3%;";
  323. grabLb.innerHTML = "Liderler Panosu";
  324. grabLb.className = "btn btn-blue";
  325. grabLb.id = "grabLb";
  326. grabLb.style = "width: 100%; height: 25px; margin-top: 3%;";
  327. grabLb.innerHTML = "Liderler Panosu";
  328.  
  329. // Tıklama
  330. // Ikon Tıklama
  331. document.getElementsByClassName("hud-CAMenu-icon")[0].addEventListener("click", function() {
  332. if (CaMenu.style.display == "none" || CaMenu.style.display == "") {
  333. document.getElementById("hud-menu-shop").style.display = "none";
  334. document.getElementById("hud-menu-party").style.display = "none";
  335. document.getElementById("hud-menu-settings").style.display = "none";
  336. CaMenu.style.display = "block";
  337. } else {
  338. CaMenu.style.display = "none";
  339. };
  340. });
  341. // Ikon Silme
  342. document.getElementsByClassName("hud-CAMenuClose-icon")[0].addEventListener("click", function() {
  343. if (CaMenu.style.display == "none" || CaMenu.style.display == "") {
  344. document.getElementById("hud-menu-shop").style.display = "none";
  345. document.getElementById("hud-menu-party").style.display = "none";
  346. document.getElementById("hud-menu-settings").style.display = "none";
  347. CaMenu.style.display = "block";
  348. } else {
  349. CaMenu.style.display = "none";
  350. };
  351. });
  352.  
  353. let _menu = document.getElementsByClassName("hud-menu-icon");
  354. let _spell = document.getElementsByClassName("hud-spell-icon");
  355. let allIcon = [
  356. _menu[0], _menu[1], _menu[2], _spell[0], _spell[1]
  357. ];
  358.  
  359. // Düşman
  360. allIcon.forEach(function(elem) {
  361. elem.addEventListener("click", function() {
  362. if (CaMenu.style.display == "block") {
  363. CaMenu.style.display = "none";
  364. };
  365. });
  366. });
  367.  
  368. document.getElementsByClassName("SE")[0].addEventListener("click", function() {
  369. displayAllToNone();
  370. document.getElementsByClassName("SE")[0].innerText = "</>";
  371. document.getElementsByClassName("etc.Class")[0].innerText = "Detaylı Kaldır";
  372. for (let i = 0; i < 50; i++) {
  373. if (document.getElementsByClassName(i + "i")[0]) {
  374. document.getElementsByClassName(i + "i")[0].style.display = "";
  375. }
  376. }
  377. })
  378.  
  379. document.getElementsByClassName("AB")[0].addEventListener("click", function() {
  380. displayAllToNone();
  381. document.getElementsByClassName("AB")[0].innerText = "</>";
  382. document.getElementsByClassName("etc.Class")[0].innerText = "Otomatik Kurucu";
  383. for (let i = 0; i < 50; i++) {
  384. if (document.getElementsByClassName(i + "i7")[0]) {
  385. document.getElementsByClassName(i + "i7")[0].style.display = "";
  386. }
  387. }
  388. })
  389.  
  390. document.getElementsByClassName("PA")[0].addEventListener("click", function() {
  391. displayAllToNone();
  392. document.getElementsByClassName("PA")[0].innerText = "</>";
  393. document.getElementsByClassName("etc.Class")[0].innerText = "Giriş & Çıkış";
  394. for (let i = 0; i < 50; i++) {
  395. if (document.getElementsByClassName(i + "i3")[0]) {
  396. document.getElementsByClassName(i + "i3")[0].style.display = "";
  397. }
  398. }
  399. })
  400. document.getElementsByClassName("BS")[0].addEventListener("click", function() {
  401. displayAllToNone();
  402. document.getElementsByClassName("BS")[0].innerText = "</>";
  403. document.getElementsByClassName("etc.Class")[0].innerText = "Otomatik Yazıcı";
  404. for (let i = 0; i < 50; i++) {
  405. if (document.getElementsByClassName(i + "i4")[0]) {
  406. document.getElementsByClassName(i + "i4")[0].style.display = "";
  407. }
  408. }
  409. })
  410.  
  411.  
  412.  
  413.  
  414. document.getElementsByClassName("SI")[0].addEventListener("click", function() {
  415. displayAllToNone();
  416. document.getElementsByClassName("SI")[0].innerText = "</>";
  417. document.getElementsByClassName("etc.Class")[0].innerText = "Detaylı Yükselt";
  418. for (let i = 0; i < 50; i++) {
  419. if (document.getElementsByClassName(i + "i5")[0]) {
  420. document.getElementsByClassName(i + "i5")[0].style.display = "";
  421. }
  422. }
  423. })
  424.  
  425. document.getElementsByClassName("MN")[0].addEventListener("click", function() {
  426. displayAllToNone();
  427. document.getElementsByClassName("MN")[0].innerText = "</>";
  428. document.getElementsByClassName("etc.Class")[0].innerText = "Pençetay";
  429. for (let i = 0; i < 50; i++) {
  430. if (document.getElementsByClassName(i + "i6")[0]) {
  431. document.getElementsByClassName(i + "i6")[0].style.display = "";
  432. }
  433. }
  434. })
  435.  
  436. function displayAllToNone() {
  437. document.getElementsByClassName("SE")[0].innerText = "Detaylı Kaldır";
  438. document.getElementsByClassName("AB")[0].innerText = "Otomatik Kurucu";
  439. document.getElementsByClassName("BS")[0].innerText = "Otomatik Yazıcı";
  440. document.getElementsByClassName("PA")[0].innerText = "Giriş & Çıkış";
  441. document.getElementsByClassName("SI")[0].innerText = "Detaylı Yükselt";
  442. document.getElementsByClassName("MN")[0].innerText = "Pençetay";
  443. for (let i = 0; i < 50; i++) {
  444. if (document.getElementsByClassName(i + "i")[0]) {
  445. document.getElementsByClassName(i + "i")[0].style.display = "none";
  446. }
  447. }
  448. for (let i = 0; i < 50; i++) {
  449. if (document.getElementsByClassName(i + "i7")[0]) {
  450. document.getElementsByClassName(i + "i7")[0].style.display = "none";
  451. }
  452. }
  453. for (let i = 0; i < 50; i++) {
  454. if (document.getElementsByClassName(i + "i3")[0]) {
  455. document.getElementsByClassName(i + "i3")[0].style.display = "none";
  456. }
  457. }
  458. for (let i = 0; i < 50; i++) {
  459. if (document.getElementsByClassName(i + "i4")[0]) {
  460. document.getElementsByClassName(i + "i4")[0].style.display = "none";
  461. }
  462. }
  463. for (let i = 0; i < 50; i++) {
  464. if (document.getElementsByClassName(i + "i5")[0]) {
  465. document.getElementsByClassName(i + "i5")[0].style.display = "none";
  466. }
  467. }
  468. for (let i = 0; i < 50; i++) {
  469. if (document.getElementsByClassName(i + "i6")[0]) {
  470. document.getElementsByClassName(i + "i6")[0].style.display = "none";
  471. }
  472. }
  473. }
  474. document.getElementsByClassName("hud-CAMenu-grid3")[0].innerHTML = `
  475. <div style="text-align:center">
  476. <!----------------------------başlangıç--------------------------->
  477. <div class="etc.Class">
  478. <hr />
  479. <h3>• Kurt & Java Majesty</h3>
  480. </div>
  481. <hr />
  482.  
  483. <!----------------------------detaylı kaldırma--------------------------->
  484.  
  485. <button class="CAbtn1 1i"id = "SellAll">Her Şeyi Kaldır</button>
  486. <button class="CAbtn1 2i"id = "SellWalls">Duvarları Kaldır</button>
  487. <button class="CAbtn1 3i"id = "SellDoors">Kapıları Kaldır</button>
  488. <button class="CAbtn1 4i"id = "SellSlowtraps">Tuzakları Kaldır</button>
  489. <button class="CAbtn1 5i"id = "SellArrows">Okçuları Kaldır</button>
  490. <button class="CAbtn1 6i"id = "SellCanons">Topçuları Kaldır</button>
  491. <button class="CAbtn1 7i"id = "SellMelees"ttiricileri Kaldır</button>
  492. <button class="CAbtn1 8i"id = "SellBombs">Bombaları Kaldır</button>
  493. <button class="CAbtn1 9i"id = "SellMages">Büyücüleri Kaldır</button>
  494. <button class="CAbtn1 10i"id = "SellGoldmines">Altın Toplayıcıları Kaldır</button>
  495. <button class="CAbtn1 11i"id = "SellHarvesters">Kazıcıları Kaldır</button>
  496. <hr class="12i">
  497.  
  498. <!----------------------------otomatik kurucu--------------------------->
  499.  
  500. <button class="CAbtn1 1i7"id ="auto3x3">3x3 Duvar Etkinleştir</button>
  501. <button class="CAbtn1 27i7"id ="autoHarvesterTrap">Kapan Tuzağı Etkinleştir</button>
  502. <hr class="3i7">
  503.  
  504. <!----------------------------sohbet--------------------------->
  505.  
  506. <input type="text" id="spamtext" name="spamtext" required maxlength="60" size="40" placeholder="Yazılıcak Şey"class="1i4" style="background-color:rgba(0,0,0,0);padding: 5px; border-radius:5px;color:rgba(255,255,255,0.7); border:2px solid white;">
  507. <button class="CAbtn1 2i4"id="spambtn" style="width: 200px;">Otomatik Yazıcı Etkinleştir</button>
  508. <button class="CAbtn1 3i4"id="clearchatbtn">Sohbet Sil</button>
  509.  
  510. <!--------------------------------parti------------------------------>
  511. <label for="zombs.ioPartyKey" class="1i3">Parti Kodu</label>
  512. <input type="text" id="partycodeinput" name="zombs.ioPartyKey" required maxlength="20" size="22" class="2i3" placeholder = "Anaktar"style="background-color:rgba(0,0,0,0);padding: 5px; border-radius:5px;color:rgba(255,255,255,0.7); border:2px solid white;">
  513. <input type="text" id="partycodeinput" name="zombs.ioPartyKey" required maxlength="20" size="22" class="7i3" placeholder = "Yedek Anaktar"style="background-color:rgba(0,0,0,0);padding: 5px; border-radius:5px;color:rgba(255,255,255,0.7); border:2px solid white;">
  514. <button class="CAbtn1 3i3"id="joinparty" style="width: 200px">Partiye Otomatik Katılmayı Etkinleştir</button>
  515. <br class="4i3">
  516. <button class="CAbtn1 5i3"id="leaveparty">Partiden Çık</button>
  517. <button class="CAbtn1 6i3"id="opt">Sekme Aç</button>
  518. <hr class="8i3">
  519. <!----------------------------detaylı yükseltme--------------------------->
  520. <hr class="4i4">
  521. <button class="CAbtn1 5i5"id = "UpgradeAll">Her Şeyi Yükselt</button>
  522. <button class="CAbtn1 6i5"id = "UpgradeWalls">Duvarları Yükselt</button>
  523. <button class="CAbtn1 7i5"id = "UpgradeDoors">Kapıları Yükselt</button>
  524. <button class="CAbtn1 8i5"id = "UpgradeSlowtraps">Tuzakları Yükselt</button>
  525. <button class="CAbtn1 9i5"id = "UpgradeArrows">Okçuları Yükselt</button>
  526. <button class="CAbtn1 10i5"id = "UpgradeCanons">Topçuları Yükselt</button>
  527. <button class="CAbtn1 11i5"id = "UpgradeMelees"ttiricileri Yükselt</button>
  528. <button class="CAbtn1 12i5"id = "UpgradeBombs">Bombaları Yükselt</button>
  529. <button class="CAbtn1 13i5"id = "UpgradeMages">Büyücüleri Yükselt</button>
  530. <button class="CAbtn1 14i5"id = "UpgradeGoldmines">Altın Toplayıcıları Yükselt</button>
  531. <button class="CAbtn1 15i5"id = "UpgradeHarvesters">Kazıcıları Yükselt</button>
  532. <hr class="16i5">
  533.  
  534. <!----------------------------pençetay--------------------------->
  535. <button class="CAbtn1 1i6"id="AHRC">Otomatik Kazıcı Etkinleştir</button>
  536. <button class="CAbtn1-activated 2i6"id="daynight">Karanlık Mod Etkinleştir</button>
  537. <button class="CAbtn1-activated 3i6"id="SellPet">Hayvanları Kaldır</button>
  538. <button class="CAbtn1-activated 4i6"id="Game.currentGame.network.disconnect()">Bağlantıyı kes</button>
  539. <hr class="5i6">
  540. </div>
  541. `;
  542. displayAllToNone();
  543. // Menü Sonu
  544. // Değişkenler
  545. var auto3x3 = false;
  546. var CAshouldBuild3x3Walls = false;
  547. var CAshouldBuild5x5Walls = false;
  548. var CAshouldBuild7x7Walls = false;
  549. var AHRC = false;
  550. var nightdark = true;
  551. var JoinParty = false;
  552. var spamchat = false;
  553. var joinedserver = false;
  554. var v_autoharvestertrap = false;
  555. var mapmousex;
  556. var mapmousey;
  557. var mapmovetox;
  558. var mapmovetoy;
  559.  
  560. // Klon
  561. var button7 = document.getElementById("opt");
  562. button7.addEventListener("click", partytab);
  563.  
  564. function partytab() {
  565. var url = document.getElementsByClassName('hud-party-share')[0].value;
  566. window.open(url);
  567. }
  568.  
  569. function CAchat(msg) {
  570. Game.currentGame.network.sendRpc({
  571. name: "SendChatMessage",
  572. channel: "Local",
  573. message: msg
  574. })
  575. }
  576.  
  577. function placeWall(x, y) {
  578. game.network.sendRpc({
  579. name: 'MakeBuilding',
  580. x: x,
  581. y: y,
  582. type: "Wall",
  583. yaw: 0
  584. });
  585. }
  586.  
  587. function placeHarvester(x, y) {
  588. game.network.sendRpc({
  589. name: 'MakeBuilding',
  590. x: x,
  591. y: y,
  592. type: "Harvester",
  593. yaw: 0
  594. });
  595. }
  596.  
  597. function CAThree(gridPos) {
  598. placeWall(gridPos.x, gridPos.y);
  599. placeWall(gridPos.x + 48, gridPos.y);
  600. placeWall(gridPos.x, gridPos.y + 48);
  601. placeWall(gridPos.x - 48, gridPos.y);
  602. placeWall(gridPos.x, gridPos.y - 48);
  603. placeWall(gridPos.x - 48, gridPos.y + 48);
  604. placeWall(gridPos.x + 48, gridPos.y - 48);
  605. placeWall(gridPos.x + 48, gridPos.y + 48);
  606. placeWall(gridPos.x - 48, gridPos.y - 48);
  607. }
  608.  
  609. function CAFive(gridPos) {
  610. // 1
  611. placeWall(gridPos.x - 48 - 48, gridPos.y + 48 + 48);
  612. placeWall(gridPos.x - 48, gridPos.y + 48 + 48);
  613. placeWall(gridPos.x, gridPos.y + 48 + 48);
  614. placeWall(gridPos.x + 48, gridPos.y + 48 + 48);
  615. placeWall(gridPos.x + 48 + 48, gridPos.y + 48 + 48);
  616. // 2
  617. placeWall(gridPos.x - 48 - 48, gridPos.y + 48);
  618. placeWall(gridPos.x - 48, gridPos.y + 48);
  619. placeWall(gridPos.x, gridPos.y + 48);
  620. placeWall(gridPos.x + 48, gridPos.y + 48);
  621. placeWall(gridPos.x + 48 + 48, gridPos.y + 48);
  622. // 3
  623. placeWall(gridPos.x - 48 - 48, gridPos.y);
  624. placeWall(gridPos.x - 48, gridPos.y);
  625. placeWall(gridPos.x, gridPos.y);
  626. placeWall(gridPos.x + 48, gridPos.y);
  627. placeWall(gridPos.x + 48 + 48, gridPos.y);
  628. // 4
  629. placeWall(gridPos.x - 48 - 48, gridPos.y - 48);
  630. placeWall(gridPos.x - 48, gridPos.y - 48);
  631. placeWall(gridPos.x, gridPos.y - 48);
  632. placeWall(gridPos.x + 48, gridPos.y - 48);
  633. placeWall(gridPos.x + 48 + 48, gridPos.y - 48);
  634. // 5
  635. placeWall(gridPos.x - 48 - 48, gridPos.y - 48 - 48);
  636. placeWall(gridPos.x - 48, gridPos.y - 48 - 48);
  637. placeWall(gridPos.x, gridPos.y - 48 - 48);
  638. placeWall(gridPos.x + 48, gridPos.y - 48 - 48);
  639. placeWall(gridPos.x + 48 + 48, gridPos.y - 48 - 48);
  640. }
  641.  
  642. function CASeven(gridPos) {
  643. // 1
  644. placeWall(gridPos.x - 48 - 48 - 48, gridPos.y + 48 + 48 + 48)
  645. placeWall(gridPos.x - 48 - 48, gridPos.y + 48 + 48 + 48);
  646. placeWall(gridPos.x - 48, gridPos.y + 48 + 48 + 48);
  647. placeWall(gridPos.x, gridPos.y + 48 + 48 + 48);
  648. placeWall(gridPos.x + 48, gridPos.y + 48 + 48 + 48);
  649. placeWall(gridPos.x + 48 + 48, gridPos.y + 48 + 48 + 48);
  650. placeWall(gridPos.x + 48 + 48 + 48, gridPos.y + 48 + 48 + 48);
  651. // 2
  652. placeWall(gridPos.x - 48 - 48 - 48, gridPos.y + 48 + 48);
  653. placeWall(gridPos.x - 48 - 48, gridPos.y + 48 + 48);
  654. placeWall(gridPos.x - 48, gridPos.y + 48 + 48);
  655. placeWall(gridPos.x, gridPos.y + 48 + 48);
  656. placeWall(gridPos.x + 48, gridPos.y + 48 + 48);
  657. placeWall(gridPos.x + 48 + 48, gridPos.y + 48 + 48);
  658. placeWall(gridPos.x + 48 + 48 + 48, gridPos.y + 48 + 48);
  659. // 3
  660. placeWall(gridPos.x - 48 - 48 - 48, gridPos.y + 48);
  661. placeWall(gridPos.x - 48 - 48, gridPos.y + 48);
  662. placeWall(gridPos.x - 48, gridPos.y + 48);
  663. placeWall(gridPos.x, gridPos.y);
  664. placeWall(gridPos.x + 48, gridPos.y + 48);
  665. placeWall(gridPos.x + 48 + 48, gridPos.y + 48);
  666. placeWall(gridPos.x + 48 + 48 + 48, gridPos.y + 48);
  667. // 4
  668. placeWall(gridPos.x - 48 - 48 - 48, gridPos.y);
  669. placeWall(gridPos.x - 48 - 48, gridPos.y);
  670. placeWall(gridPos.x - 48, gridPos.y);
  671. placeWall(gridPos.x, gridPos.y);
  672. placeWall(gridPos.x + 48, gridPos.y);
  673. placeWall(gridPos.x + 48 + 48, gridPos.y);
  674. placeWall(gridPos.x + 48 + 48 + 48, gridPos.y);
  675. // 5
  676. placeWall(gridPos.x - 48 - 48 - 48, gridPos.y - 48);
  677. placeWall(gridPos.x - 48 - 48, gridPos.y - 48);
  678. placeWall(gridPos.x - 48, gridPos.y - 48);
  679. placeWall(gridPos.x, gridPos.y - 48);
  680. placeWall(gridPos.x + 48, gridPos.y - 48);
  681. placeWall(gridPos.x + 48 + 48, gridPos.y - 48);
  682. placeWall(gridPos.x + 48 + 48 + 48, gridPos.y - 48);
  683. // 6
  684. placeWall(gridPos.x - 48 - 48 - 48, gridPos.y - 48 - 48);
  685. placeWall(gridPos.x - 48 - 48, gridPos.y - 48 - 48);
  686. placeWall(gridPos.x - 48, gridPos.y - 48 - 48);
  687. placeWall(gridPos.x, gridPos.y - 48 - 48);
  688. placeWall(gridPos.x + 48, gridPos.y - 48 - 48);
  689. placeWall(gridPos.x + 48 + 48, gridPos.y - 48 - 48);
  690. placeWall(gridPos.x + 48 + 48 + 48, gridPos.y - 48 - 48);
  691. // 7
  692. placeWall(gridPos.x - 48 - 48 - 48, gridPos.y - 48 - 48 - 48);
  693. placeWall(gridPos.x - 48 - 48, gridPos.y - 48 - 48 - 48);
  694. placeWall(gridPos.x - 48, gridPos.y - 48 - 48 - 48);
  695. placeWall(gridPos.x, gridPos.y - 48 - 48 - 48);
  696. placeWall(gridPos.x + 48, gridPos.y - 48 - 48 - 48);
  697. placeWall(gridPos.x + 48 + 48, gridPos.y - 48 - 48 - 48);
  698. placeWall(gridPos.x + 48 + 48 + 48, gridPos.y - 48 - 48 - 48);
  699. // Bilmiyorum Neden x4, y5 (5 katman 4) Çalışmıyor, Bu Yüzden Tekrar 3x3 Yapıyorum
  700. CAThree(gridPos);
  701. }
  702. /*---------------------------------------------------başlangıç--------------------------------------------------------*/
  703. function joinserver()
  704. {
  705. joinedserver = true;
  706. }
  707.  
  708. // Otomatik Kazıcı Tuzağı
  709. function autoharvestertrap()
  710. {
  711. v_autoharvestertrap = !v_autoharvestertrap;
  712. document.getElementById("autoHarvesterTrap").innerHTML = v_autoharvestertrap ? "Otomatik Kapan Tuzağını Devre Dışı Bırak" : "Otomatik Kapan Tuzağını Etkinleştir";
  713. document.getElementById("autoHarvesterTrap").classList.replace(v_autoharvestertrap ? "CAbtn1" : "CAbtn1-activated", v_autoharvestertrap ? "CAbtn1-activated" : "CAbtn1");
  714. if (v_autoharvestertrap) {
  715.  
  716. game.ui.getComponent('PopupOverlay').showHint("[Kapan] Etkinleştirildi, İnsanları Tuzağa Düşürmek İstiyorsanız, Tüm Biçerdöverleri Sattığınızdan Emin Olun!", 1e4);
  717. CAchat("Otomatik Kapan Tuzağı Açıldı 👙");
  718. } else {
  719. CAchat("Otomatik Kapan Tuzağı Kapatıldı 👙");
  720. }
  721. }
  722.  
  723. document.addEventListener('mousedown', e => {
  724. let CAmousePs = {
  725. x: e.clientX,
  726. y: e.clientY
  727. };
  728. if (game.inputManager.mouseDown && game.ui.components.PlacementOverlay.buildingId == "Harvester") {
  729. var CAbuildingSchema = game.ui.getBuildingSchema();
  730. var CAschemaData = CAbuildingSchema.Wall;
  731. var CAmousePosition = game.ui.getMousePosition();
  732. var CAworld = game.world;
  733. var CAworldPos = game.renderer.screenToWorld(CAmousePs.x, CAmousePs.y);
  734. var CAcellIndexes = CAworld.entityGrid.getCellIndexes(CAworldPos.x, CAworldPos.y, {
  735. width: CAschemaData.gridWidth,
  736. height: CAschemaData.gridHeight
  737. });
  738. var CAcellSize = CAworld.entityGrid.getCellSize();
  739. var CAcellAverages = {
  740. x: 0,
  741. y: 0
  742. };
  743. for (var i in CAcellIndexes) {
  744. if (!CAcellIndexes[i]) {
  745. return false;
  746. }
  747. var CAcellPos = CAworld.entityGrid.getCellCoords(CAcellIndexes[i]);
  748. var isOccupied = game.ui.components.PlacementOverlay.checkIsOccupied(CAcellIndexes[i], CAcellPos);
  749. CAcellAverages.x += CAcellPos.x;
  750. CAcellAverages.y += CAcellPos.y;
  751. }
  752. CAcellAverages.x = CAcellAverages.x / CAcellIndexes.length;
  753. CAcellAverages.y = CAcellAverages.y / CAcellIndexes.length;
  754. var gridPos = {
  755. x: CAcellAverages.x * CAcellSize + CAcellSize / 2,
  756. y: CAcellAverages.y * CAcellSize + CAcellSize / 2
  757. };
  758. console.log("place harvester1");
  759. if (v_autoharvestertrap) {
  760. console.log("place harvester");
  761. placeHarvester(gridPos.x - 144, gridPos.y + 48);
  762. placeHarvester(gridPos.x - 144, gridPos.y - 48);
  763. //
  764. placeHarvester(gridPos.x - 48, gridPos.y + 144);
  765. placeHarvester(gridPos.x - 48, gridPos.y - 144);
  766. //
  767. placeHarvester(gridPos.x + 48, gridPos.y + 144);
  768. placeHarvester(gridPos.x + 48, gridPos.y - 144);
  769. //
  770. placeHarvester(gridPos.x + 144, gridPos.y - 48);
  771. placeHarvester(gridPos.x + 144, gridPos.y - 48);
  772. }
  773. }
  774. })
  775.  
  776.  
  777. // 3x3 Duvar
  778.  
  779. function F_auto3x3() {
  780. auto3x3 = !auto3x3;
  781. document.getElementById("auto3x3").innerHTML = auto3x3 ? "3x3 Duvar Devre Dışı Bırak" : "3x3 Duvar Etkinleştir";
  782. document.getElementById("auto3x3").classList.replace(auto3x3 ? "CAbtn1" : "CAbtn1-activated", auto3x3 ? "CAbtn1-activated" : "CAbtn1");
  783. if (auto3x3) {
  784.  
  785. game.ui.getComponent('PopupOverlay').showHint("", 1e4);
  786. CAchat("3x3 Dîwar Vekirî 👨‍⚖️");
  787. } else {
  788. CAchat("3x3 Dîwar Girtî 👨‍⚖️");
  789. }
  790. }
  791. document.addEventListener('mousemove', e => {
  792. let mousePs = {
  793. x: e.clientX,
  794. y: e.clientY
  795. };
  796. if (game.inputManager.mouseDown && game.ui.components.PlacementOverlay.buildingId == "Wall") {
  797. var buildingSchema = game.ui.getBuildingSchema();
  798. var schemaData = buildingSchema.Wall;
  799. var mousePosition = game.ui.getMousePosition();
  800. var world = game.world;
  801. var worldPos = game.renderer.screenToWorld(mousePs.x, mousePs.y);
  802. var cellIndexes = world.entityGrid.getCellIndexes(worldPos.x, worldPos.y, {
  803. width: schemaData.gridWidth,
  804. height: schemaData.gridHeight
  805. });
  806. var cellSize = world.entityGrid.getCellSize();
  807. var cellAverages = {
  808. x: 0,
  809. y: 0
  810. };
  811. for (var i in cellIndexes) {
  812. if (!cellIndexes[i]) {
  813. return false;
  814. }
  815. var cellPos = world.entityGrid.getCellCoords(cellIndexes[i]);
  816. var isOccupied = game.ui.components.PlacementOverlay.checkIsOccupied(cellIndexes[i], cellPos);
  817. cellAverages.x += cellPos.x;
  818. cellAverages.y += cellPos.y;
  819. }
  820. cellAverages.x = cellAverages.x / cellIndexes.length;
  821. cellAverages.y = cellAverages.y / cellIndexes.length;
  822. var gridPos = {
  823. x: cellAverages.x * cellSize + cellSize / 2,
  824. y: cellAverages.y * cellSize + cellSize / 2
  825. };
  826. if (auto3x3) {
  827. CAThree(gridPos);
  828. }
  829.  
  830. }
  831. })
  832.  
  833. addEventListener('keydown', function(e) {
  834. if (e.key == "z") {
  835. CAshouldBuild3x3Walls = true;
  836. CAshouldBuild5x5Walls = false;
  837. CAshouldBuild7x7Walls = false;
  838. } else if (e.key == "x") {
  839. CAshouldBuild5x5Walls = true;
  840. CAshouldBuild3x3Walls = false;
  841. CAshouldBuild7x7Walls = false;
  842. } else if (e.key == "c") {
  843. CAshouldBuild7x7Walls = true;
  844. CAshouldBuild3x3Walls = false;
  845. CAshouldBuild5x5Walls = false;
  846. }
  847. })
  848.  
  849. addEventListener('keyup', function(e) {
  850. if (e.key == "z") {
  851. CAshouldBuild3x3Walls = false;
  852. } else if (e.key == "x") {
  853. CAshouldBuild5x5Walls = false;
  854. } else if (e.key == "c") {
  855. CAshouldBuild7x7Walls = false;
  856. }
  857. })
  858.  
  859. document.addEventListener('mousedown', e => {
  860. let CAmousePs = {
  861. x: e.clientX,
  862. y: e.clientY
  863. };
  864. if (game.inputManager.mouseDown && game.ui.components.PlacementOverlay.buildingId == "Wall") {
  865. var CAbuildingSchema = game.ui.getBuildingSchema();
  866. var CAschemaData = CAbuildingSchema.Wall;
  867. var CAmousePosition = game.ui.getMousePosition();
  868. var CAworld = game.world;
  869. var CAworldPos = game.renderer.screenToWorld(CAmousePs.x, CAmousePs.y);
  870. var CAcellIndexes = CAworld.entityGrid.getCellIndexes(CAworldPos.x, CAworldPos.y, {
  871. width: CAschemaData.gridWidth,
  872. height: CAschemaData.gridHeight
  873. });
  874. var CAcellSize = CAworld.entityGrid.getCellSize();
  875. var CAcellAverages = {
  876. x: 0,
  877. y: 0
  878. };
  879. for (var i in CAcellIndexes) {
  880. if (!CAcellIndexes[i]) {
  881. return false;
  882. }
  883. var CAcellPos = CAworld.entityGrid.getCellCoords(CAcellIndexes[i]);
  884. var isOccupied = game.ui.components.PlacementOverlay.checkIsOccupied(CAcellIndexes[i], CAcellPos);
  885. CAcellAverages.x += CAcellPos.x;
  886. CAcellAverages.y += CAcellPos.y;
  887. }
  888. CAcellAverages.x = CAcellAverages.x / CAcellIndexes.length;
  889. CAcellAverages.y = CAcellAverages.y / CAcellIndexes.length;
  890. var gridPos = {
  891. x: CAcellAverages.x * CAcellSize + CAcellSize / 2,
  892. y: CAcellAverages.y * CAcellSize + CAcellSize / 2
  893. };
  894. if (CAshouldBuild3x3Walls && !auto3x3) {
  895. CAThree(gridPos);
  896. } else if (CAshouldBuild5x5Walls && !auto3x3) {
  897. CAFive(gridPos);
  898. } else if (CAshouldBuild7x7Walls && !auto3x3) {
  899. CASeven(gridPos);
  900. }
  901. }
  902. })
  903.  
  904. document.addEventListener('mousemove', e => {
  905. let CAmousePs = {
  906. x: e.clientX,
  907. y: e.clientY
  908. };
  909. if (game.inputManager.mouseDown && game.ui.components.PlacementOverlay.buildingId == "Wall") {
  910. var CAbuildingSchema = game.ui.getBuildingSchema();
  911. var CAschemaData = CAbuildingSchema.Wall;
  912. var CAmousePosition = game.ui.getMousePosition();
  913. var CAworld = game.world;
  914. var CAworldPos = game.renderer.screenToWorld(CAmousePs.x, CAmousePs.y);
  915. var CAcellIndexes = CAworld.entityGrid.getCellIndexes(CAworldPos.x, CAworldPos.y, {
  916. width: CAschemaData.gridWidth,
  917. height: CAschemaData.gridHeight
  918. });
  919. var CAcellSize = CAworld.entityGrid.getCellSize();
  920. var CAcellAverages = {
  921. x: 0,
  922. y: 0
  923. };
  924. for (var i in CAcellIndexes) {
  925. if (!CAcellIndexes[i]) {
  926. return false;
  927. }
  928. var CAcellPos = CAworld.entityGrid.getCellCoords(CAcellIndexes[i]);
  929. var isOccupied = game.ui.components.PlacementOverlay.checkIsOccupied(CAcellIndexes[i], CAcellPos);
  930. CAcellAverages.x += CAcellPos.x;
  931. CAcellAverages.y += CAcellPos.y;
  932. }
  933. CAcellAverages.x = CAcellAverages.x / CAcellIndexes.length;
  934. CAcellAverages.y = CAcellAverages.y / CAcellIndexes.length;
  935. var gridPos = {
  936. x: CAcellAverages.x * CAcellSize + CAcellSize / 2,
  937. y: CAcellAverages.y * CAcellSize + CAcellSize / 2
  938. };
  939. if (CAshouldBuild3x3Walls && !auto3x3) {
  940. CAThree(gridPos);
  941. } else if (CAshouldBuild5x5Walls && !auto3x3) {
  942. CAFive(gridPos);
  943. } else if (CAshouldBuild7x7Walls && !auto3x3) {
  944. CASeven(gridPos);
  945. }
  946. }
  947. })
  948. // Silme Bölümü
  949. function SellAll() {
  950. game.ui.getComponent('PopupOverlay').showConfirmation('Varsayılan hakaretleri değiştirmek istediğinizden emin misiniz? Bu, tüm özel hakaretleri sıfırlayacaktır', 1e4, function(){
  951.  
  952. var entities = Game.currentGame.world.entities;
  953. for (var uid in entities) {
  954. if (!entities.hasOwnProperty(uid)) continue;
  955. var obj = entities[uid];
  956. if (obj.fromTick.model !== "GoldStash") {
  957. Game.currentGame.network.sendRpc({
  958. name: "DeleteBuilding",
  959. uid: obj.fromTick.uid
  960. });
  961. }
  962. }
  963. CAchat("Her tişt Rakirin 👨‍⚖️ ");
  964.  
  965. }, function(){
  966. game.ui.getComponent('PopupOverlay').showHint('Fine...', 1e4)
  967. })
  968. }
  969.  
  970. function SellWalls() {
  971. var entities = Game.currentGame.world.entities;
  972. for (var uid in entities) {
  973. if (!entities.hasOwnProperty(uid)) continue;
  974. var obj = entities[uid];
  975. if (obj.fromTick.model == "Wall") {
  976. Game.currentGame.network.sendRpc({
  977. name: "DeleteBuilding",
  978. uid: obj.fromTick.uid
  979. })
  980. }
  981. }
  982. CAchat('Dîwar Rakirin 👨‍⚖️');
  983. }
  984.  
  985. function SellDoors() {
  986. var entities = Game.currentGame.world.entities;
  987. for (var uid in entities) {
  988. if (!entities.hasOwnProperty(uid)) continue;
  989. var obj = entities[uid];
  990. if (obj.fromTick.model == "Door") {
  991. Game.currentGame.network.sendRpc({
  992. name: "DeleteBuilding",
  993. uid: obj.fromTick.uid
  994. })
  995. }
  996. }
  997. CAchat('Derî Hat Rakirin 👨‍⚖️');
  998. }
  999.  
  1000. function SellSlowtraps() {
  1001. var entities = Game.currentGame.world.entities;
  1002. for (var uid in entities) {
  1003. if (!entities.hasOwnProperty(uid)) continue;
  1004. var obj = entities[uid];
  1005. if (obj.fromTick.model == "SlowTrap") {
  1006. Game.currentGame.network.sendRpc({
  1007. name: "DeleteBuilding",
  1008. uid: obj.fromTick.uid
  1009. })
  1010. }
  1011. }
  1012. CAchat('Xefik Rakirin 👨‍⚖️');
  1013. }
  1014.  
  1015. function SellArrows() {
  1016. var entities = Game.currentGame.world.entities;
  1017. for (var uid in entities) {
  1018. if (!entities.hasOwnProperty(uid)) continue;
  1019. var obj = entities[uid];
  1020. if (obj.fromTick.model == "ArrowTower") {
  1021. Game.currentGame.network.sendRpc({
  1022. name: "DeleteBuilding",
  1023. uid: obj.fromTick.uid
  1024. })
  1025. }
  1026. }
  1027. CAchat('Arşîvan *okçular* Rakirin 👨‍⚖️');
  1028. }
  1029.  
  1030. function SellCanons() {
  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 == "CannonTower") {
  1036. Game.currentGame.network.sendRpc({
  1037. name: "DeleteBuilding",
  1038. uid: obj.fromTick.uid
  1039. })
  1040. }
  1041. }
  1042. CAchat('Topxane rakirin 👨‍⚖️');
  1043. }
  1044.  
  1045. function SellMelees() {
  1046. var entities = Game.currentGame.world.entities;
  1047. for (var uid in entities) {
  1048. if (!entities.hasOwnProperty(uid)) continue;
  1049. var obj = entities[uid];
  1050. if (obj.fromTick.model == "MeleeTower") {
  1051. Game.currentGame.network.sendRpc({
  1052. name: "DeleteBuilding",
  1053. uid: obj.fromTick.uid
  1054. })
  1055. }
  1056. }
  1057. CAchat('Thrusters Rakirin 👨‍⚖️');
  1058. }
  1059.  
  1060. function SellBombs() {
  1061. var entities = Game.currentGame.world.entities;
  1062. for (var uid in entities) {
  1063. if (!entities.hasOwnProperty(uid)) continue;
  1064. var obj = entities[uid];
  1065. if (obj.fromTick.model == "BombTower") {
  1066. Game.currentGame.network.sendRpc({
  1067. name: "DeleteBuilding",
  1068. uid: obj.fromTick.uid
  1069. })
  1070. }
  1071. }
  1072. CAchat('Bombe rakirin 👨‍⚖️');
  1073. }
  1074.  
  1075. function SellMages() {
  1076. var entities = Game.currentGame.world.entities;
  1077. for (var uid in entities) {
  1078. if (!entities.hasOwnProperty(uid)) continue;
  1079. var obj = entities[uid];
  1080. if (obj.fromTick.model == "MageTower") {
  1081. Game.currentGame.network.sendRpc({
  1082. name: "DeleteBuilding",
  1083. uid: obj.fromTick.uid
  1084. })
  1085. }
  1086. }
  1087. CAchat('Sorcerers Rakirin 👨‍⚖️');
  1088. }
  1089.  
  1090. function SellGoldmines() {
  1091. var entities = Game.currentGame.world.entities;
  1092. for (var uid in entities) {
  1093. if (!entities.hasOwnProperty(uid)) continue;
  1094. var obj = entities[uid];
  1095. if (obj.fromTick.model == "GoldMine") {
  1096. Game.currentGame.network.sendRpc({
  1097. name: "DeleteBuilding",
  1098. uid: obj.fromTick.uid
  1099. })
  1100. }
  1101. }
  1102. CAchat('Jeneratorên Zêr Hatin Rakirin 👨‍⚖️');
  1103. }
  1104.  
  1105. function SellHarvesters() {
  1106. var entities = Game.currentGame.world.entities;
  1107. for (var uid in entities) {
  1108. if (!entities.hasOwnProperty(uid)) continue;
  1109. var obj = entities[uid];
  1110. if (obj.fromTick.model == "Harvester") {
  1111. Game.currentGame.network.sendRpc({
  1112. name: "DeleteBuilding",
  1113. uid: obj.fromTick.uid
  1114. })
  1115. }
  1116. }
  1117. CAchat('Kaynak Toplayıcılar Kaldırıldı 👙');
  1118. }
  1119.  
  1120. function UpgradeAll() {
  1121. var entities = Game.currentGame.world.entities;
  1122. for (var uid in entities) {
  1123. if (!entities.hasOwnProperty(uid)) continue;
  1124. var obj = entities[uid];
  1125. if (obj.fromTick.model == "GoldStash") {
  1126. Game.currentGame.network.sendRpc({
  1127. name: "UpgradeBuilding",
  1128. uid: obj.fromTick.uid
  1129. })
  1130. }
  1131. }
  1132. CAchat('Ana Merkez Yükseltildi 👙');
  1133. }
  1134.  
  1135. function UpgradeWalls() {
  1136. var entities = Game.currentGame.world.entities;
  1137. for (var uid in entities) {
  1138. if (!entities.hasOwnProperty(uid)) continue;
  1139. var obj = entities[uid];
  1140. if (obj.fromTick.model == "Wall") {
  1141. Game.currentGame.network.sendRpc({
  1142. name: "UpgradeBuilding",
  1143. uid: obj.fromTick.uid
  1144. })
  1145. }
  1146. }
  1147. CAchat('dîwar bilind bûn 👨‍⚖️');
  1148. }
  1149.  
  1150. function UpgradeDoors() {
  1151. var entities = Game.currentGame.world.entities;
  1152. for (var uid in entities) {
  1153. if (!entities.hasOwnProperty(uid)) continue;
  1154. var obj = entities[uid];
  1155. if (obj.fromTick.model == "Door") {
  1156. Game.currentGame.network.sendRpc({
  1157. name: "UpgradeBuilding",
  1158. uid: obj.fromTick.uid
  1159. })
  1160. }
  1161. }
  1162. CAchat('Doors Upgraded 👨‍⚖️');
  1163. }
  1164.  
  1165. function UpgradeSlowtraps() {
  1166. var entities = Game.currentGame.world.entities;
  1167. for (var uid in entities) {
  1168. if (!entities.hasOwnProperty(uid)) continue;
  1169. var obj = entities[uid];
  1170. if (obj.fromTick.model == "SlowTrap") {
  1171. Game.currentGame.network.sendRpc({
  1172. name: "UpgradeBuilding",
  1173. uid: obj.fromTick.uid
  1174. })
  1175. }
  1176. }
  1177. CAchat('Xefik Upgraded 👨‍⚖️');
  1178. }
  1179.  
  1180. function UpgradeArrows() {
  1181. var entities = Game.currentGame.world.entities;
  1182. for (var uid in entities) {
  1183. if (!entities.hasOwnProperty(uid)) continue;
  1184. var obj = entities[uid];
  1185. if (obj.fromTick.model == "ArrowTower") {
  1186. Game.currentGame.network.sendRpc({
  1187. name: "UpgradeBuilding",
  1188. uid: obj.fromTick.uid
  1189. })
  1190. }
  1191. }
  1192. CAchat('Archers Upgraded 👨‍⚖️');
  1193. }
  1194.  
  1195. function UpgradeCanons() {
  1196. var entities = Game.currentGame.world.entities;
  1197. for (var uid in entities) {
  1198. if (!entities.hasOwnProperty(uid)) continue;
  1199. var obj = entities[uid];
  1200. if (obj.fromTick.model == "CannonTower") {
  1201. Game.currentGame.network.sendRpc({
  1202. name: "UpgradeBuilding",
  1203. uid: obj.fromTick.uid
  1204. })
  1205. }
  1206. }
  1207. CAchat('Topxane Nûjen kirin 👨‍⚖️');
  1208. }
  1209.  
  1210. function UpgradeMelees() {
  1211. var entities = Game.currentGame.world.entities;
  1212. for (var uid in entities) {
  1213. if (!entities.hasOwnProperty(uid)) continue;
  1214. var obj = entities[uid];
  1215. if (obj.fromTick.model == "MeleeTower") {
  1216. Game.currentGame.network.sendRpc({
  1217. name: "UpgradeBuilding",
  1218. uid: obj.fromTick.uid
  1219. })
  1220. }
  1221. }
  1222. CAchat('Thrusters Upgraded 👨‍⚖️');
  1223. }
  1224.  
  1225. function UpgradeBombs() {
  1226. var entities = Game.currentGame.world.entities;
  1227. for (var uid in entities) {
  1228. if (!entities.hasOwnProperty(uid)) continue;
  1229. var obj = entities[uid];
  1230. if (obj.fromTick.model == "BombTower") {
  1231. Game.currentGame.network.sendRpc({
  1232. name: "UpgradeBuilding",
  1233. uid: obj.fromTick.uid
  1234. })
  1235. }
  1236. }
  1237. CAchat('Bombebaran nûve kirin 👨‍⚖️');
  1238. }
  1239.  
  1240. function UpgradeMages() {
  1241. var entities = Game.currentGame.world.entities;
  1242. for (var uid in entities) {
  1243. if (!entities.hasOwnProperty(uid)) continue;
  1244. var obj = entities[uid];
  1245. if (obj.fromTick.model == "MagicTower") {
  1246. Game.currentGame.network.sendRpc({
  1247. name: "UpgradeBuilding",
  1248. uid: obj.fromTick.uid
  1249. })
  1250. }
  1251. }
  1252. CAchat('Mages Upgraded 👨‍⚖️');
  1253. }
  1254.  
  1255. function UpgradeGoldmines() {
  1256. var entities = Game.currentGame.world.entities;
  1257. for (var uid in entities) {
  1258. if (!entities.hasOwnProperty(uid)) continue;
  1259. var obj = entities[uid];
  1260. if (obj.fromTick.model == "GoldMine") {
  1261. Game.currentGame.network.sendRpc({
  1262. name: "UpgradeBuilding",
  1263. uid: obj.fromTick.uid
  1264. })
  1265. }
  1266. }
  1267. CAchat('Berhevkarên Zêr Nûjen Bûn 👨‍⚖️');
  1268. }
  1269.  
  1270. function UpgradeHarvesters() {
  1271. var entities = Game.currentGame.world.entities;
  1272. for (var uid in entities) {
  1273. if (!entities.hasOwnProperty(uid)) continue;
  1274. var obj = entities[uid];
  1275. if (obj.fromTick.model == "Harvester") {
  1276. Game.currentGame.network.sendRpc({
  1277. name: "UpgradeBuilding",
  1278. uid: obj.fromTick.uid
  1279. })
  1280. }
  1281. }
  1282. CAchat('Excavators Upgraded 👨‍⚖️');
  1283. }
  1284.  
  1285. function SellPet() {
  1286. var entities = Game.currentGame.world.entities;
  1287. for (var uid in entities) {
  1288. if (!entities.hasOwnProperty(uid)) continue;
  1289. var obj = entities[uid];
  1290. if (entities[uid].fromTick.model == "PetCARL" || entities[uid].fromTick.model == "PetMiner") {
  1291. Game.currentGame.network.sendRpc({
  1292. name: "UpgradeBuilding",
  1293. uid: obj.fromTick.uid
  1294. })
  1295. }
  1296. }
  1297. CAchat('Hayvanlar Kaldırıldı 👨‍⚖️');
  1298. }
  1299.  
  1300.  
  1301. function F_AHRC() {
  1302. AHRC = !AHRC;
  1303. document.getElementById("AHRC").innerHTML = AHRC ? "Otomatik Kazıcı Devre Dışı Bırak" : "Otomatik Kazıcı Etkinleştir";
  1304. document.getElementById("AHRC").classList.replace(AHRC ? "CAbtn1" : "CAbtn1-activated", AHRC ? "CAbtn1-activated" : "CAbtn1");
  1305. if (AHRC) {
  1306. CAchat('Excavator Otomatîk Vekirî 👨‍⚖️');
  1307. } else {
  1308. CAchat('Excavator Otomatîk Girtî ye 👨‍⚖️');
  1309. }
  1310. }
  1311. // Kalkan
  1312. function FixShield() {
  1313. if (Game.currentGame.ui.playerTick.zombieShieldHealth < 85000) {
  1314. Game.currentGame.network.sendRpc({
  1315. name: "EquipItem",
  1316. itemName: "ZombieShield",
  1317. tier: Game.currentGame.ui.inventory.ZombieShield.tier
  1318. });
  1319. }
  1320. }
  1321. Game.currentGame.network.addRpcHandler("DayCycle", FixShield);
  1322. // Parti den Ayrıl
  1323. function leaveparty() {
  1324. Game.currentGame.network.sendRpc({
  1325. name: "LeaveParty"
  1326. })
  1327. }
  1328. // Partiye Katıl
  1329. function joinparty() {
  1330. JoinParty = !JoinParty;
  1331. document.getElementById("joinparty").innerHTML = JoinParty ? "Partiye Otomatik Katılmayı Devre Dışı Bırak" : "Partiye Otomatik Katılmayı Etkinleştir";
  1332. document.getElementById("joinparty").classList.replace(JoinParty ? "CAbtn1" : "CAbtn1-activated", JoinParty ? "CAbtn1-activated" : "CAbtn1");
  1333. }
  1334. // Gün Işığı
  1335. function daynight() {
  1336. nightdark = !nightdark;
  1337. document.getElementById("daynight").innerHTML = nightdark ? "Karanlık Mod Etkinleştir" : "Karanlık Mod Devre Dışı Bırak";
  1338. document.getElementById("daynight").classList.replace(nightdark ? "CAbtn1" : "CAbtn1-activated", nightdark ? "CAbtn1-activated" : "CAbtn1");
  1339. if (nightdark) {
  1340. document.getElementsByClassName("hud-day-night-overlay")[0].style.display = "block";
  1341. CAchat("Tarî Girtî ye 👨‍⚖️");
  1342.  
  1343. } else {
  1344. document.getElementsByClassName("hud-day-night-overlay")[0].style.display = "none";
  1345. CAchat("Tarî Vekirî 👨‍⚖️");
  1346. }
  1347. }
  1348.  
  1349. function F_spamchat()
  1350. {
  1351. spamchat = !spamchat;
  1352. document.getElementById("spambtn").innerHTML = spamchat ? "Otomatik Yazıcıyı Devre Dışı Bırak" : "Otomatik Yazıcıyı Etkinleştir";
  1353. document.getElementById("spambtn").classList.replace(spamchat ? "CAbtn1" : "CAbtn1-activated", spamchat ? "CAbtn1-activated" : "CAbtn1");
  1354. if(spamchat)
  1355. {
  1356. CAchat("Destpêkirina Çapkerê Otomatîk 👨‍⚖️");
  1357. }
  1358. else
  1359. {
  1360. setTimeout(() => { CAchat("Çapkerê Oto qediya 👨‍⚖️"); }, 900);
  1361. }
  1362. }
  1363.  
  1364. function clearchat()
  1365. {
  1366. document.querySelector('.hud-chat-messages')
  1367. .innerHTML = ""
  1368. }
  1369. // Yapım
  1370. function mapmove(e)
  1371. {
  1372. mapmousex = e.pageX - 3;
  1373. mapmousey = e.pageY - (document.getElementsByTagName('body')[0].clientHeight - 36 - 140);
  1374. mapmovetox = Math.round(mapmousex / document.querySelector("#hud-mapcontainer").clientWidth * 23973);
  1375. mapmovetoy = Math.round(mapmousey / document.querySelector("#hud-mapcontainer").clientHeight * 23973);
  1376.  
  1377. game.ui.getComponent('PopupOverlay').showConfirmation(`Taşınmak istediğinden emin misin X: ${mapmovetox}?, Y: ${mapmovetoy}`, 1e4, function(){
  1378.  
  1379. CAchat("yes");
  1380. }, function(){
  1381. CAchat("no");
  1382. });
  1383.  
  1384. }
  1385. // Toplayıcı
  1386. setInterval(function() {
  1387.  
  1388. if (AHRC) {
  1389. var entities = Game.currentGame.world.entities
  1390. for (let uid in entities) {
  1391. if (!entities.hasOwnProperty(uid)) continue;
  1392. let obj = entities[uid];
  1393. Game.currentGame.network.sendRpc({
  1394. name: "CollectHarvester",
  1395. uid: obj.fromTick.uid
  1396. });
  1397. if (obj.fromTick.model == "Harvester" && obj.fromTick.tier == 1) {
  1398. Game.currentGame.network.sendRpc({
  1399. name: "AddDepositToHarvester",
  1400. uid: obj.fromTick.uid,
  1401. deposit: 0.07
  1402. });
  1403. }
  1404. if (obj.fromTick.model == "Harvester" && obj.fromTick.tier == 2) {
  1405. Game.currentGame.network.sendRpc({
  1406. name: "AddDepositToHarvester",
  1407. uid: obj.fromTick.uid,
  1408. deposit: 0.11
  1409. });
  1410. }
  1411. if (obj.fromTick.model == "Harvester" && obj.fromTick.tier == 3) {
  1412. Game.currentGame.network.sendRpc({
  1413. name: "AddDepositToHarvester",
  1414. uid: obj.fromTick.uid,
  1415. deposit: 0.17
  1416. });
  1417. }
  1418. if (obj.fromTick.model == "Harvester" && obj.fromTick.tier == 4) {
  1419. Game.currentGame.network.sendRpc({
  1420. name: "AddDepositToHarvester",
  1421. uid: obj.fromTick.uid,
  1422. deposit: 0.22
  1423. });
  1424. }
  1425. if (obj.fromTick.model == "Harvester" && obj.fromTick.tier == 5) {
  1426. Game.currentGame.network.sendRpc({
  1427. name: "AddDepositToHarvester",
  1428. uid: obj.fromTick.uid,
  1429. deposit: 0.25
  1430. });
  1431. }
  1432. if (obj.fromTick.model == "Harvester" && obj.fromTick.tier == 6) {
  1433. Game.currentGame.network.sendRpc({
  1434. name: "AddDepositToHarvester",
  1435. uid: obj.fromTick.uid,
  1436. deposit: 0.28
  1437. });
  1438. }
  1439. if (obj.fromTick.model == "Harvester" && obj.fromTick.tier == 7) {
  1440. Game.currentGame.network.sendRpc({
  1441. name: "AddDepositToHarvester",
  1442. uid: obj.fromTick.uid,
  1443. deposit: 0.42
  1444. });
  1445. }
  1446. if (obj.fromTick.model == "Harvester" && obj.fromTick.tier == 8) {
  1447. Game.currentGame.network.sendRpc({
  1448. name: "AddDepositToHarvester",
  1449. uid: obj.fromTick.uid,
  1450. deposit: 0.65
  1451. });
  1452. }
  1453. }
  1454. }
  1455. // Klana Katıl
  1456. if (JoinParty) {
  1457. Game.currentGame.network.sendRpc({
  1458. name: "JoinPartyByShareKey",
  1459. partyShareKey: document.querySelector('#partycodeinput').value
  1460. });
  1461. }
  1462.  
  1463.  
  1464.  
  1465. // Sohbet Spam
  1466. if(spamchat)
  1467. {
  1468. CAchat(document.querySelector('#spamtext').value);
  1469. }
  1470. }, 100);
  1471.  
  1472. // Etkinlikler
  1473. document.querySelector('#auto3x3')
  1474. .addEventListener('click', F_auto3x3);
  1475. document.querySelector('#SellAll')
  1476. .addEventListener('click', SellAll);
  1477. document.querySelector('#SellWalls')
  1478. .addEventListener('click', SellWalls);
  1479. document.querySelector('#SellDoors')
  1480. .addEventListener('click', SellDoors);
  1481. document.querySelector('#SellSlowtraps')
  1482. .addEventListener('click', SellSlowtraps);
  1483. document.querySelector('#SellArrows')
  1484. .addEventListener('click', SellArrows);
  1485. document.querySelector('#SellCanons')
  1486. .addEventListener('click', SellCanons);
  1487. document.querySelector('#SellMelees')
  1488. .addEventListener('click', SellMelees);
  1489. document.querySelector('#SellBombs')
  1490. .addEventListener('click', SellBombs);
  1491. document.querySelector('#SellMages')
  1492. .addEventListener('click', SellMages);
  1493. document.querySelector('#SellGoldmines')
  1494. .addEventListener('click', SellGoldmines);
  1495. document.querySelector('#SellHarvesters')
  1496. .addEventListener('click', SellHarvesters);
  1497. document.querySelector('#UpgradeAll')
  1498. .addEventListener('click', UpgradeAll);
  1499. document.querySelector('#UpgradeWalls')
  1500. .addEventListener('click', UpgradeWalls);
  1501. document.querySelector('#UpgradeDoors')
  1502. .addEventListener('click', UpgradeDoors);
  1503. document.querySelector('#UpgradeSlowtraps')
  1504. .addEventListener('click', UpgradeSlowtraps);
  1505. document.querySelector('#UpgradeArrows')
  1506. .addEventListener('click', UpgradeArrows);
  1507. document.querySelector('#UpgradeCanons')
  1508. .addEventListener('click', UpgradeCanons);
  1509. document.querySelector('#UpgradeMelees')
  1510. .addEventListener('click', UpgradeMelees);
  1511. document.querySelector('#UpgradeBombs')
  1512. .addEventListener('click', UpgradeBombs);
  1513. document.querySelector('#UpgradeMages')
  1514. .addEventListener('click', UpgradeMages);
  1515. document.querySelector('#UpgradeGoldmines')
  1516. .addEventListener('click', UpgradeGoldmines);
  1517. document.querySelector('#UpgradeHarvesters')
  1518. .addEventListener('click', UpgradeHarvesters);
  1519. document.querySelector('#AHRC')
  1520. .addEventListener('click', F_AHRC);
  1521. document.querySelector('#leaveparty')
  1522. .addEventListener('click', leaveparty);
  1523. document.querySelector('#joinparty')
  1524. .addEventListener('click', joinparty);
  1525. document.querySelector('#daynight')
  1526. .addEventListener('click', daynight);
  1527. document.querySelector('#spambtn')
  1528. .addEventListener('click', F_spamchat);
  1529. document.querySelector('#clearchatbtn')
  1530. .addEventListener('click', clearchat);
  1531. document.querySelector('.hud-intro-play')
  1532. .addEventListener('click', joinserver);
  1533. document.querySelector('#autoHarvesterTrap')
  1534. .addEventListener('click', autoharvestertrap);
  1535. document.querySelector('#SellPet')
  1536. .addEventListener('click', SellPet);
  1537. // Harita
  1538. document.querySelector('#hud-mapcontainer')
  1539. .addEventListener('click', function(e){mapmove(e)});

QingJ © 2025

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