advanced SPLOOp.io script LOL

script for lazy ass nigs it has autoplace auto push and things like that

目前为 2025-02-12 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name advanced SPLOOp.io script LOL
  3. // @version 1.12
  4. // @description script for lazy ass nigs it has autoplace auto push and things like that
  5. // @namespace Auto-push auto instakill auto place
  6. // @author renato and i COPYED the whole script LMAO
  7. // @match https://sploop.io/
  8. // @license MIT
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=sploop.io
  10. // @run-at document-start
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. const getElem = (id) => {
  15. return document.getElementById(id);
  16. }
  17.  
  18. const getValue = (id) => {
  19. return document.getElementById(id).value;
  20. }
  21.  
  22. const localResources = {
  23. arrow: "https://i.imgur.com/jFZXJlt.png",
  24. }
  25.  
  26. const HTML = {
  27. menuname: function (name, version) {
  28. return `
  29. <div style="display: flex">
  30. <span class="menu-header">
  31. <h1> ${name} </h1>
  32. </span>
  33. <span class="version-header">
  34. <h1> ${version} </h1>
  35. </span>
  36. </div>
  37. `
  38. },
  39. newline: function (amount) {
  40. let result = '';
  41. for (let i = 0; i < amount; i += 1) {
  42. result += '<br>';
  43. }
  44. return result;
  45. },
  46. title: function (name, id, id2) {
  47. return `
  48. <div class="option-title">
  49. <div class="holder-title">${name}</div>
  50. <button id="${id}" class="title-button">
  51. <img src=${localResources.arrow} id="${id2}" style="width: 25px; height: 25px; transform: rotate(0deg); transition: transform 0.3s ease-in-out;"/>
  52. </button>
  53. </div>`;
  54. },
  55. color: function (id, name, color, id2, state) {
  56. return `
  57. <div class="option-color">
  58. <h1>${name}</h1>
  59. <div style="display: flex; align-items: center; justify-content: space-between;">
  60. <input type="color" id="${id}" value="${color}" class="color-style" style="margin-right: 5px;" />
  61. <input type="checkbox" id="${id2}" style = "margin-bottom: 12.5px;" ${state} />
  62. </div>
  63. </div>
  64. `
  65. },
  66. noarrowtitle: function (name) {
  67. return `
  68. <div class="option-title">
  69. <div class="holder-title">${name}</div>
  70. </div>`;
  71. },
  72. checkbox: function (name, id, state) {
  73. return `
  74. <div class="new-checkbox-section">
  75. <h1> ${name} </h1> <input type="checkbox" id="${id}" style = "margin-bottom: 12.5px;" ${state}/>
  76. </div>`;
  77. },
  78. text: function (name, id, value, id2, state) {
  79. return `
  80. <div class="option-text-text">
  81. <h1> ${name} </h1>
  82. <div style="display: flex; align-items: center; justify-content: space-between;">
  83. <input type="text" id="${id}" class="chats-input" style="width: 225px" value="${value}"/>
  84. <input type="checkbox" id="${id2}" style = "margin-bottom: 12.5px;" ${state} />
  85. </div>
  86. </div>
  87. `
  88. },
  89. }
  90.  
  91. const menu = document.createElement("div");
  92. menu.id = "menu";
  93. menu.style = ' position: absolute; padding: 5px; border-radius: 4px; color: #000; background-color: #2B2B2C; top: 0; left: 0; bottom: 0; right: 0; margin: auto; width: 625px; height: 325px; display: block; ';
  94.  
  95. const display = document.createElement("div");
  96. display.id = "display";
  97. display.style = ' position: absolute; top: 20px; left: 20px; color: #fff; display: block; font-size: 16.5px; font-family: Cursive; ';
  98.  
  99. const watermarkD = document.createElement("div");
  100. watermarkD.id = "watermarkD";
  101. watermarkD.style = ' position: absolute; display: none; top: 20px; left: 45%; border-radius: 12px; width: 180px; height: 50px; font-size: 18px; font-family: "Montserrat", sans-serif; font-weight: 900; background-color: rgba(0, 0, 0, 0); color: #fff; border: 5px solid black; align-items: center; text-align: center; padding: 10px; ';
  102.  
  103. window.addEventListener("DOMContentLoaded", () => {
  104.  
  105. display.innerHTML = `
  106. <div id = "pinginner"> </div> <br>
  107. <div id = "fpsinner"> </div>
  108. `;
  109.  
  110. document.body.appendChild(display);
  111.  
  112. watermarkD.innerHTML = `RXT v1`
  113. document.body.appendChild(watermarkD);
  114.  
  115.  
  116.  
  117. menu.innerHTML = `
  118. <div class="tabs">
  119. <ul>
  120. ${HTML.menuname("RXT ", " version 1")} ${HTML.newline(1)}
  121. <div class="option-text"><li><a id="#tab1">Combat</a></li></div>
  122. <div class="option-text"><li><a id="#tab2">Misc</a></li></div>
  123. <div class="option-text"><li><a id="#tab3">Visual</a></li></div>
  124. <div class="option-text"><li><a id="#tab4">Chats</a></li></div>
  125. </ul>
  126. </div>
  127. <div class="menu-content">
  128.  
  129. <div id="tab1" class="tab-content active">
  130. <div style = "overflow-y: scroll; height: 305px;">
  131. <div class="add-holder">
  132. ${HTML.title("Heal", "heal-arrow", "heal-arrow-rotation")}
  133. <div id="heal-content" style="display: none;">
  134. ${HTML.checkbox("Auto heal", "autoheal", "checked")}
  135. </div> </div> ${HTML.newline(1)}
  136. <div class="add-holder">
  137. ${HTML.title("Placing", "placing-arrow", "placing-arrow-rotation")}
  138. <div id="placing-content" style="display: none;">
  139. ${HTML.checkbox("Auto place", "autoplace", "checked")}
  140. ${HTML.checkbox("Placing macro", "placingmacro", "checked")}
  141. </div> </div> ${HTML.newline(1)}
  142. <div class="add-holder">
  143. ${HTML.title("Movement", "movement-arrow", "movement-arrow-rotation")}
  144. <div id="movement-content" style="display: none;">
  145. ${HTML.checkbox("Auto push", "autopush", "")}
  146. ${HTML.checkbox("Path finder", "pathfinder", "")}
  147. ${HTML.checkbox("Scaffold", "scaffold", "")}
  148. </div> </div> ${HTML.newline(1)}
  149. <div class="add-holder">
  150. ${HTML.title("Hats", "hats-arrow", "hats-arrow-rotation")}
  151. <div id="hats-content" style="display: none;">
  152. ${HTML.checkbox("Auto jungle", "autojungle", "checked")}
  153. ${HTML.checkbox("Auto scuba", "autoscuba", "checked")}
  154. ${HTML.checkbox("Auto demolist", "autodemolist", "")}
  155. ${HTML.checkbox("Auto prev hat", "autoprevhat", "")}
  156. ${HTML.checkbox("Hats macro", "hatsmacro", "checked")}
  157. </div> </div> ${HTML.newline(1)}
  158. <div class="add-holder">
  159. ${HTML.title("Other", "other-arrow", "other-arrow-rotation")}
  160. <div id="other-content" style="display: none;">
  161. ${HTML.checkbox("Auto insta", "autoinsta", "checked")}
  162. ${HTML.checkbox("Auto break trap", "autobreak", "checked")}
  163. </div> </div>
  164. </div>
  165. </div>
  166.  
  167. <div id="tab2" class="tab-content">
  168. <div style = "overflow-y: scroll; height: 305px;">
  169. <div class="add-holder">
  170. ${HTML.noarrowtitle("Select")}
  171. ${HTML.checkbox("Auto pick", "autopick", "")}
  172. </div> ${HTML.newline(1)}
  173. <div class="add-holder">
  174. ${HTML.noarrowtitle("Display")}
  175. ${HTML.checkbox("Show ping", "showping", "")}
  176. ${HTML.checkbox("Show fps", "showfps", "")}
  177. </div>
  178. </div>
  179. </div>
  180.  
  181. <div id="tab3" class="tab-content">
  182. <div style = "overflow-y: scroll; height: 305px;">
  183. <div class="add-holder">
  184. ${HTML.title("Tracers", "tracers-arrow", "tracers-arrow-rotation")}
  185. <div id="tracers-content" style="display: none;">
  186. ${HTML.color("animal-tracer-color", "Animal color", "#518CCC", "animal-tracers", "checked")}
  187. ${HTML.color("team-tracer-color", "Teammates color", "#8ECC51", "team-tracers", "checked")}
  188. ${HTML.color("enemy-tracer-color", "Enemies color", "#CC5151", "enemy-tracers", "checked")}
  189. ${HTML.checkbox("Use lines", "use-lines", "")}
  190. ${HTML.checkbox("Use rainbow", "use-rainbow", "")} ${HTML.newline(1)}
  191. ${HTML.color("autopush-tracer-color", "Auto push line", "#6b78c1", "autopushline", "state")}
  192. </div> </div> ${HTML.newline(1)}
  193. <div class="add-holder">
  194. ${HTML.title("Markers", "markers-arrow", "markers-arrow-rotation")}
  195. <div id="markers-content" style="display: none;">
  196. ${HTML.color("team-marker-color", "Teammates color", "#518CCC", "team-markers", "checked")}
  197. ${HTML.color("mine-marker-color", "Mine color", "#8ECC51", "mine-markers", "checked")}
  198. ${HTML.color("enemy-marker-color", "Enemies color", "#CC5151", "enemy-markers", "checked")}
  199. </div> </div> ${HTML.newline(1)}
  200. <div class="add-holder">
  201. ${HTML.title("Watermark", "watermark-arrow", "watermark-arrow-rotation")}
  202. <div id="watermark-content" style="display: none;">
  203. ${HTML.color("fill-mark-color", "Fill color", "#CC5151", "fill-color", "checked")}
  204. ${HTML.color("stroke-mark-color", "Stroke color", "#FF0000", "stroke-color", "checked")}
  205. ${HTML.checkbox("Use rainbow", "use-rainbow-mark", "")}
  206. ${HTML.checkbox("Watermark", "watermark-display", "")}
  207. </div> </div>
  208. </div>
  209. </div>
  210.  
  211. <div id="tab4" class="tab-content">
  212. <div style = "overflow-y: scroll; height: 305px;">
  213. <div class="add-holder">
  214. ${HTML.title("Chats", "chats-arrow", "chats-arrow-rotation")}
  215. <div id="chats-content" style="display: none;">
  216. ${HTML.text("Kill chat", "kill-chat", "gg you're no match", "killchat", "checked")}
  217. ${HTML.text("Auto break chat", "auto-break-chat", "", "autobreakchat", "")}
  218. ${HTML.text("Auto push chat", "auto-push-chat", "", "autopushchat", "checked")}
  219. </div> </div>
  220. </div>
  221. </div>
  222.  
  223. </div>
  224. `;
  225.  
  226. document.body.appendChild(menu);
  227.  
  228. setInterval(() => {
  229. if (getElem("watermark-display").checked) {
  230. getElem("watermarkD").style.display = "block";
  231. } else {
  232. getElem("watermarkD").style.display = "none";
  233. }
  234. getElem("watermarkD").style.backgroundColor = (getElem("use-rainbow-mark").checked ? `hsl(${hue}, 100%, 50%)` : (getElem("fill-color").checked ? getValue("fill-mark-color") : 'rgba(0, 0, 0, 0)'));
  235. getElem("watermarkD").style.borderColor = (getElem("use-rainbow-mark").checked ? `hsl(${hue}, 100%, 80%)` : (getElem("stroke-color").checked ? getValue("stroke-mark-color") : 'rgba(0, 0, 0, 0)'));
  236. }, 0);
  237.  
  238. document.addEventListener("keydown", (e) => {
  239. if (e.keyCode == 27) {
  240. if (getElem("menu").style.display == "none") {
  241. getElem("menu").style.display = "block"
  242. } else {
  243. getElem("menu").style.display = "none"
  244. }
  245. }
  246. });
  247.  
  248. let classesAndStyles = `
  249. ::-webkit-scrollbar {
  250. display: none;
  251. border-radius: 4px;
  252. outline: none;
  253. }
  254. .option-title, .title-button:hover {
  255. cursor: url(img/ui/cursor-pointer.png) 6 0, pointer;
  256. }
  257.  
  258. .option-color, .option-text-text {
  259. display: flex;
  260. justify-content: space-between;
  261. align-items: center;
  262. margin-top: 10px;
  263. }
  264.  
  265. .chats-input {
  266. padding: 5px;
  267. border: none;
  268. outline: none;
  269. text-align: center;
  270. border-radius: 4px;
  271. background-color: #3f3f4b;
  272. color: #fff;
  273. }
  274.  
  275. .title-button {
  276. color: #6b78c1;
  277. border: none;
  278. outline: none;
  279. border-radius: 4px;
  280. width: 100%;
  281. height: 22.5px;
  282. background-color: rgba(0,0,0,0);
  283. text-align: right;
  284. }
  285.  
  286. .holder-title {
  287. color: #646fab;
  288. font-size: 22.5px;
  289. }
  290.  
  291. .option-title {
  292. display: flex;
  293. justify-content: space-between;
  294. align-items: center;
  295. }
  296.  
  297. .menu-header h1 {
  298. font-size: 20px;
  299. color: #fff;
  300. }
  301.  
  302. .version-header h1 {
  303. color: #646fab;
  304. font-size: 20px;
  305. margin-left: 5px;
  306. }
  307.  
  308. .new-checkbox-section {
  309. display: flex;
  310. justify-content: space-between;
  311. align-items: center;
  312. margin-top: 10px;
  313. }
  314.  
  315. .color-style {
  316. outline: none;
  317. border: none;
  318. padding: 0 1px;
  319. margin: 0;
  320. height: 24px;
  321. background-color: #515a88;
  322. border-radius: 5px;
  323. cursor: pointer
  324. }
  325.  
  326. .tab-content h1 {
  327. color: #515a88;
  328. font-size: 20px;
  329. }
  330.  
  331. .tabs {
  332. position: absolute;
  333. border-radius: 4px;
  334. float: left;
  335. width: 150px;
  336. height: 315px;
  337. background-color: #2F2F31;
  338. padding: 10px;
  339. margin-right: 5px;
  340. }
  341.  
  342. .tabs ul {
  343. list-style: none;
  344. margin: 0;
  345. padding: 0;
  346. }
  347.  
  348. .tabs li {
  349. width: 100%;
  350. margin-bottom: 10px;
  351. padding: 10px;
  352. background-color: #36363d;
  353. border-radius: 4px;
  354. transition: background-color 0.3s ease-in-out;
  355. }
  356.  
  357. .tabs a {
  358. text-decoration: none;
  359. color: #fff;
  360. padding: 5px 10px;
  361. transition: color 0.3s ease-in-out;
  362. }
  363.  
  364. .tabs li:hover a {
  365. color: #646fab;
  366. cursor: url(img/ui/cursor-pointer.png) 6 0, pointer;
  367. }
  368.  
  369. .tabs li:hover {
  370. background-color: #28282f;
  371. color: #646fab;
  372. cursor: url(img/ui/cursor-pointer.png) 6 0, pointer;
  373. }
  374.  
  375. .tabs a:hover {
  376. color: #646fab;
  377. cursor: url(img/ui/cursor-pointer.png) 6 0, pointer;
  378. }
  379.  
  380. .menu-content {
  381. border-radius: 4px;
  382. float: right;
  383. width: calc(100% - 150px - 5px);
  384. padding: 5px;
  385. background-color: #2F2F31;
  386. }
  387.  
  388. .tab-content {
  389. display: none;
  390. }
  391.  
  392. .tab-content.active {
  393. display: block;
  394. }
  395.  
  396. .add-holder {
  397. width: 100%;
  398. padding: 5px;
  399. color: #fff;
  400. border-radius: 4px;
  401. background-color: #36363d;
  402. }
  403.  
  404. input:checked[type="checkbox"] {
  405. background: #6b78c1;
  406. }
  407.  
  408. input[type="checkbox" i] {
  409. background-color: initial;
  410. cursor: default;
  411. appearance: auto;
  412. box-sizing: border-box;
  413. margin: 3px 3px 3px 4px;
  414. padding: initial;
  415. border: initial;
  416. }
  417.  
  418. input:checked[type="checkbox"]::after {
  419. left: 55%;
  420. }
  421.  
  422. input[type="checkbox"]::after {
  423. position: absolute;
  424. content: "";
  425. width: 15px;
  426. height: 15px;
  427. top: 0;
  428. left: 0;
  429. background: #fff;
  430. border-radius: 50%;
  431. box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  432. transition: 0.4s;
  433. }
  434.  
  435. input[type="checkbox"] {
  436. position: relative;
  437. appearance: none;
  438. width: 30px;
  439. height: 15px;
  440. background: #3f454d;
  441. border-radius: 8px;
  442. box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  443. cursor: url(img/ui/cursor-pointer.png) 6 0, pointer;
  444. top: 4px;
  445. transition: 0.4s;
  446. }
  447.  
  448. #cross-promo,
  449. #bottom-wrap,
  450. #google_play,
  451. #game-left-content-main,
  452. #game-bottom-content,
  453. #game-right-content-main,
  454. #right-content,
  455. #left-content,
  456. #settings {
  457. display: none !important;
  458. }
  459. #main-content {
  460. background: rgb(54 54 61 / 20%)
  461. }
  462. #homepage {
  463. background: rgb(65 65 165 / 65%);
  464. }
  465. .nav-button-active {
  466. color: #6b78c1;
  467. }
  468. .nav-button-text:hover {
  469. color: #57619a;
  470. }
  471. .dark-blue-button,
  472. .blue-button,
  473. .green-button {
  474. background-color: #6b78c1;
  475. box-shadow: inset 0 -5px 0 #57619a;
  476. }
  477. .green-button:hover,
  478. .dark-blue-button:hover,
  479. .blue-button:hover,
  480. #play:hover {
  481. background-color: #7c8bdd;
  482. box-shadow: inset 0 -5px 0 #6974b6;
  483. }
  484. .login-button-active,
  485. .dark-blue-button-3-active {
  486. background-color: #7c8bdd;
  487. box-shadow: inset 0 5px 0 #6974b6;
  488. }
  489. #server-select {
  490. background-color: #6b78c1;
  491. box-shadow: inset 0 -5px 0 #57619a;
  492. }
  493. #server-select:hover {
  494. background-color: #7c8bdd;
  495. box-shadow: inset 0 -5px 0 #6974b6;
  496. }
  497. .background-img-play {
  498. filter: blur(2.5px);
  499. background: none;
  500. display: none !important;
  501. }
  502. #play {
  503. background-color: #6b78c1;
  504. box-shadow: inset 0 -9px 0 #57619a;
  505. }
  506. #play-text {
  507. text-align: center;
  508. position: absolute;
  509. top: 11px;
  510. left: 0;
  511. items-align: center;
  512. bottom: 0;
  513. right: 0;
  514. margin: auto;
  515. }
  516.  
  517. #logo {
  518. height: 150px;
  519. }
  520. `;
  521. const menuStylesUpdate = document.createElement("style");
  522. menuStylesUpdate.type = "text/css";
  523. menuStylesUpdate.innerText = classesAndStyles;
  524. document.head.appendChild(menuStylesUpdate);
  525.  
  526. getElem('ranking-middle-main').style.height = '380px';
  527. getElem('ranking-ranks-container').style.height = '295px';
  528. getElem('ranking2-middle-main').style.height = '380px';
  529. getElem('ranking-rank-container').style.height = '295px';
  530. getElem('profile-left-main').style.width = '650px';
  531. getElem('change-username').style.width = '200px';
  532. document.querySelector('#game-content').style.justifyContent = 'center';
  533. document.querySelector('#main-content').style.width = 'auto';
  534.  
  535. let isArrowRotated = [false, false, false, false, false, false, false, false, false];
  536.  
  537. const toggleContent = (index) => {
  538. const contentEl = getElem(`${["heal", "placing", "hats", "tracers", "markers", "other", "movement", "chats", "watermark"][index]}-content`);
  539. const arrowEl = getElem(`${["heal", "placing", "hats", "tracers", "markers", "other", "movement", "chats", "watermark"][index]}-arrow-rotation`);
  540.  
  541. if (contentEl.style.display === "none") {
  542. contentEl.style.display = "block";
  543. contentEl.style.height = "0";
  544. contentEl.style.overflow = "hidden";
  545. contentEl.style.transition = "height 0.3s ease-in-out";
  546. setTimeout(() => {
  547. contentEl.style.height = contentEl.scrollHeight + "px";
  548. }, 10);
  549. } else {
  550. contentEl.style.height = contentEl.scrollHeight + "px";
  551. contentEl.style.transition = "height 0.3s ease-in-out";
  552. setTimeout(() => {
  553. contentEl.style.height = "0";
  554. setTimeout(() => {
  555. contentEl.style.display = "none";
  556. }, 300);
  557. }, 10);
  558. }
  559.  
  560. arrowEl.style.transform = isArrowRotated[index] ? 'rotate(0deg)' : 'rotate(90deg)';
  561. isArrowRotated[index] = !isArrowRotated[index];
  562. };
  563.  
  564. getElem("heal-arrow").onclick = () => toggleContent(0);
  565. getElem("placing-arrow").onclick = () => toggleContent(1);
  566. getElem("hats-arrow").onclick = () => toggleContent(2);
  567. getElem("tracers-arrow").onclick = () => toggleContent(3);
  568. getElem("markers-arrow").onclick = () => toggleContent(4);
  569. getElem("other-arrow").onclick = () => toggleContent(5);
  570. getElem("movement-arrow").onclick = () => toggleContent(6);
  571. getElem("chats-arrow").onclick = () => toggleContent(7);
  572. getElem("watermark-arrow").onclick = () => toggleContent(8);
  573.  
  574. const tabs = document.querySelectorAll('.tabs li');
  575. const tabContents = document.querySelectorAll('.tab-content');
  576.  
  577. tabs.forEach((tab, index) => {
  578. tab.addEventListener('click', () => {
  579. tabContents.forEach((content) => {
  580. content.classList.remove('active');
  581. });
  582. tabContents[index].classList.add('active');
  583. });
  584. });
  585.  
  586. setInterval(() => {
  587. defaultToggles.autoBreak = getElem("autobreak").checked ? true : false;
  588. defaultToggles.autoHeal = getElem("autoheal").checked ? true : false;
  589. defaultToggles.autoPlace = getElem("autoplace").checked ? true : false;
  590. defaultToggles.autoPush = getElem("autopush").checked ? true : false;
  591. defaultToggles.autoJungle = getElem("autojungle").checked ? true : false;
  592. defaultToggles.autoScuba = getElem("autoscuba").checked ? true : false;
  593. defaultToggles.autoDemolist = getElem("autodemolist").checked ? true : false;
  594. defaultToggles.autoPrevHat = getElem("autoprevhat").checked ? true : false;
  595. defaultToggles.autoPick = getElem("autopick").checked ? true : false;
  596. defaultToggles.autoInsta = getElem("autoinsta").checked ? true : false;
  597. defaultToggles.teamTracers = getElem("team-tracers").checked ? true : false;
  598. defaultToggles.animalTracers = getElem("animal-tracers").checked ? true : false;
  599. defaultToggles.enemyTracers = getElem("enemy-tracers").checked ? true : false;
  600. defaultToggles.useRainbow = getElem("use-rainbow").checked ? true : false;
  601. defaultToggles.useLines = getElem("use-lines").checked ? true : false;
  602. defaultToggles.killChat = getElem("killchat").checked ? true : false;
  603. defaultToggles.killChatValue = getValue("kill-chat");
  604. defaultToggles.autoPushChat = getElem("autopushchat").checked ? true : false;
  605. defaultToggles.autoPushChatValue = getValue("auto-push-chat");
  606. defaultToggles.autoBreakChat = getElem("autobreakchat").checked ? true : true;
  607. defaultToggles.autoBreakChatValue = getValue("auto-break-chat");
  608. defaultToggles.teamMarkers = getElem("team-markers").checked ? true : false;
  609. defaultToggles.enemyMarkers = getElem("enemy-markers").checked ? true : false;
  610. defaultToggles.mineMarkers = getElem("mine-markers").checked ? true : false;
  611. defaultToggles.autoPushLine = getElem("autopushline").checked ? true : false;
  612. defaultToggles.placingMacro = getElem("placingmacro").checked ? true : false;
  613. defaultToggles.hatsMacro = getElem("hatsmacro").checked ? true : false;
  614. defaultToggles.showPing = getElem("showping").checked ? true : false;
  615. defaultToggles.showFps = getElem("showfps").checked ? true : false;
  616. defaultToggles.scaffold = getElem("scaffold").checked ? true : false;
  617. }, []);
  618. });
  619.  
  620. let frames = 0,
  621. lastTime,
  622. lastUpdate = 0,
  623. frameCount = 0;
  624. window.updateFPSCounter = (currentTime) => {
  625. const elapsedSeconds = (currentTime - (lastTime || (lastTime = currentTime))) / 1000;
  626. frameCount++;
  627.  
  628. // Define colors for the gradient (lightest to darkest purples)
  629. const purpleColors = [
  630. "#d8a9ff", // Lightest purple
  631. "#bb80ff", // Light purple
  632. "#9f55ff", // Medium light purple
  633. "#8a2aff", // Medium purple
  634. "#7c00cc", // Darker purple
  635. "#6200b3", // Dark purple
  636. "#48007a", // Very dark purple
  637. "#2e0044" // Deepest purple
  638. ];
  639.  
  640. if (elapsedSeconds >= 1) {
  641. if (defaultToggles.showFps) {
  642. // Create the purple gradient string from lightest to darkest
  643. const gradient = `linear-gradient(to right, ${purpleColors.join(', ')})`;
  644.  
  645. // Apply the gradient to the text
  646. getElem("fpsinner").innerHTML = `Fps: ${Math.round(frameCount / elapsedSeconds)}`;
  647. getElem("fpsinner").style.background = gradient;
  648. getElem("fpsinner").style.webkitBackgroundClip = 'text'; // Required for Webkit browsers
  649. getElem("fpsinner").style.backgroundClip = 'text'; // Required for other browsers
  650. getElem("fpsinner").style.color = 'transparent'; // Make the text color transparent so the gradient shows
  651.  
  652. // Apply a dark glowing effect to the text
  653. getElem("fpsinner").style.textShadow = "0 0 10px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 0, 0, 0.7)";
  654. } else {
  655. getElem("fpsinner").innerHTML = '';
  656. }
  657. frameCount = 0;
  658. lastTime = currentTime;
  659. };
  660. }
  661. let alive = {}
  662. const defaultToggles = {
  663. autoBreak: true,
  664. autoHeal: true,
  665. autoPlace: true,
  666. autoPush: true,
  667. autoJungle: true,
  668. autoScuba: true,
  669. autoDemolist: true,
  670. autoPrevHat: false,
  671. autoInsta: false,
  672. autoPick: true,
  673. showPing: true,
  674. showFps: true,
  675. teamTracers: false,
  676. enemyTracers: false,
  677. animalTracers: false,
  678. useRainbow: false,
  679. useLines: false,
  680. killChatValue: "",
  681. killChat: false,
  682. autoBreakChatValue: "",
  683. autoBreakChat: false,
  684. autoPushChatValue: "",
  685. autoPushChat: false,
  686. teamMarkers: false,
  687. enemyMarkers: false,
  688. mineMarkers: false,
  689. autoPushLine: false,
  690. placingMacro: false,
  691. hatsMacro: true,
  692. scaffold: false,
  693. }
  694.  
  695. const binds = {
  696. trap: "KeyF",
  697. spike: "KeyV",
  698. wall: "Digit4",
  699. mill: "Digit6",
  700. food: "KeyQ",
  701. platform: "...",
  702. turret: "...",
  703.  
  704. bushHat: "...",
  705. berserkerHat: "KeyB",
  706. jungleGear: "...",
  707. crystalGear: "KeyY",
  708. spikeGear: "KeyH",
  709. immunityGear: "KeyI",
  710. boostHat: "KeyN",
  711. appleHat: "...",
  712. scubaGear: "...",
  713. hood: "KeyT",
  714. demolist: "KeyC",
  715. }
  716.  
  717. let color
  718. , colors = {
  719. stroke: "#303030",
  720. nobody: "rgba(0, 0, 0, 0)",
  721. nobodystroke: "rgba(0, 0, 0, 0)",
  722. }
  723.  
  724. const hats = {
  725. bushHat: 1,
  726. berserkerHat: 2,
  727. jungleGear: 3,
  728. crystalGear: 4,
  729. spikeGear: 5,
  730. immunityGear: 6,
  731. boostHat: 7,
  732. appleHat: 8,
  733. scubaGear: 9,
  734. hood: 10,
  735. demolist: 11
  736. }
  737.  
  738. const packets = {
  739. item: 0,
  740. move: 1,
  741. itemByID: 2,
  742. hat: 5,
  743. chat: 7,
  744. place: 8,
  745. joinGame: 11,
  746. angle: 13,
  747. upgrade: 14,
  748. stopMove: 15,
  749. clanAcc: 17,
  750. stopAttack: 18,
  751. hit: 19,
  752. joinClan: 21,
  753. clan: 22,
  754. EAttack: 23,
  755. clanLeave: 24
  756. }
  757.  
  758. const serverPackets = {
  759. pingServer: 0,
  760. updateLeaderBoard: 3,
  761. age_barWmats: 8,
  762. chooseItem: 14,
  763. pingUpdate: 15,
  764. updateClan: 16,
  765. clanRequest: 17,
  766. death: 19,
  767. getKill: 22,
  768. createClan: 24,
  769. clanRemove: 27,
  770. killText: 28,
  771. attackAnimation: 29,
  772. updateEntities: 20,
  773. playerSpawn: 32,
  774. getMyID: 33,
  775. spawn: 35,
  776. itemCount: 36,
  777. }
  778.  
  779.  
  780.  
  781. // Save the original fillRect function
  782. const originalFillRect = CanvasRenderingContext2D.prototype.fillRect;
  783.  
  784. // Define colors for the gradient (lightest to darkest purples)
  785. const purpleColors = [
  786. "#d8a9ff", // Lightest purple
  787. "#bb80ff", // Light purple
  788. "#9f55ff", // Medium light purple
  789. "#8a2aff", // Medium purple
  790. "#7c00cc", // Darker purple
  791. "#6200b3", // Dark purple
  792. "#48007a", // Very dark purple
  793. "#2e0044" // Deepest purple
  794. ];
  795.  
  796. // Override fillRect
  797. CanvasRenderingContext2D.prototype.fillRect = function (x, y, width, height) {
  798. // Check if fillStyle is the specific color
  799. if (this.fillStyle === "#a4cc4f") {
  800. // Create a gradient from lightest to darkest purple for the health bar
  801. const gradient = this.createLinearGradient(x, y, x + width, y + height);
  802.  
  803. // Add each color stop for the purple gradient (starting from lightest to darkest)
  804. gradient.addColorStop(0, purpleColors[0]); // Lightest purple
  805. gradient.addColorStop(0.14, purpleColors[1]); // Lighter purple
  806. gradient.addColorStop(0.28, purpleColors[2]); // Medium light purple
  807. gradient.addColorStop(0.42, purpleColors[3]); // Medium purple
  808. gradient.addColorStop(0.57, purpleColors[4]); // Darker purple
  809. gradient.addColorStop(0.71, purpleColors[5]); // Dark purple
  810. gradient.addColorStop(0.85, purpleColors[6]); // Very dark purple
  811. gradient.addColorStop(1, purpleColors[7]); // Deepest purple
  812.  
  813. // Set the fillStyle to the gradient for the health bar
  814. this.fillStyle = gradient;
  815.  
  816. // Call the original fillRect function (to draw the health bar)
  817. originalFillRect.call(this, x, y, width, height);
  818.  
  819. // Calculate the health percentage
  820. const healthPercentage = Math.floor((myPlayer.health / myPlayer.maxHealth) * 100);
  821.  
  822. // Apply futuristic, aesthetic styling to the health text
  823. this.font = "18px 'Orbitron', sans-serif"; // Smaller font size for a more subtle effect
  824. this.textAlign = "center"; // Center the text horizontally
  825. this.textBaseline = "middle"; // Center the text vertically
  826.  
  827. // Create a gradient for the text with the same colors as the health bar
  828. const textGradient = this.createLinearGradient(x, y, x + width, y + height);
  829. textGradient.addColorStop(0, purpleColors[0]); // Lightest purple
  830. textGradient.addColorStop(0.14, purpleColors[1]); // Lighter purple
  831. textGradient.addColorStop(0.28, purpleColors[2]); // Medium light purple
  832. textGradient.addColorStop(0.42, purpleColors[3]); // Medium purple
  833. textGradient.addColorStop(0.57, purpleColors[4]); // Darker purple
  834. textGradient.addColorStop(0.71, purpleColors[5]); // Dark purple
  835. textGradient.addColorStop(0.85, purpleColors[6]); // Very dark purple
  836. textGradient.addColorStop(1, purpleColors[7]); // Deepest purple
  837.  
  838. // Set the fillStyle to the text gradient
  839. this.fillStyle = textGradient;
  840.  
  841. // Draw the text "HP: X%" (replace X with the calculated health percentage)
  842. this.shadowColor = "rgba(255, 255, 255, 0.7)"; // Light white glow
  843. this.shadowBlur = 10; // Blur the shadow for glow effect
  844. this.shadowOffsetX = 0;
  845. this.shadowOffsetY = 0;
  846.  
  847. // Draw the health percentage text 20px below the health bar
  848. this.fillText("health: " + myPlayer.health + "%", x + width / 2, y + height + 20);
  849. } else {
  850. // If fillStyle is not the specific color, call the original fillRect function
  851. originalFillRect.call(this, x, y, width, height);
  852. }
  853. };
  854.  
  855.  
  856.  
  857. let kh = [1, 12, 9, 19, 20, 15, 8, 17, 16];
  858.  
  859. let traps = [];
  860. let teammates = [];
  861. let drawpinginner = "game is loading";
  862.  
  863. let doingInsta = false;
  864. let Entity = new Array();
  865. let drawSyncHit = false;
  866. let genderPing = NaN;
  867. let autoPushing = false;
  868. let myWS,
  869. weaponInHands = 0,
  870. ping = 100,
  871. PI = 3.141592653589793,
  872. PI2 = 6.283185307179586,
  873. mouseAngle,
  874. mouseX,
  875. mouseY,
  876. inRiver = false,
  877. buyed = false,
  878. myPlayer = { id: null, clown: false, inRiver: false },
  879. hatReloaded = true;
  880. let drawHitSyncCircle = false;
  881. window.getWS = (websocket) => {
  882. myWS = websocket;
  883. websocket.onclose = () => {
  884. myWS = undefined;
  885. buyed = false;
  886. };
  887. };
  888.  
  889. const toRad = (angle) => {
  890. while (angle < 0) {
  891. angle += 360;
  892. };
  893. while (angle >= 360) {
  894. angle -= 360;
  895. };
  896. return (angle * Math.PI) / 180;
  897. };
  898. const toDegree = (angle) => {
  899. return ((angle * 180) / Math.PI);
  900. };
  901. const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
  902. const formatAge = age => Math.floor(Math.log(1 + Math.max(0, age)) ** 2.4 / 13);
  903.  
  904. window.receiveMsg = async ({ data }) => {
  905. const decoded = typeof data === "string" ? JSON.parse(data) : new Uint8Array(data);
  906. switch (decoded[0]) {
  907. case serverPackets.attackAnimation:
  908. for (let i = 1; i < decoded.length; i += 5) {
  909. const type = decoded[i]
  910. , id = decoded[i + 1] | decoded[i + 2] << 8
  911. , weapon = decoded[i + 3];
  912. let isObject = decoded[i + 4];
  913. }
  914. break;
  915. case serverPackets.playerSpawn:
  916. break
  917. case serverPackets.chooseItem:
  918. if (defaultToggles.autoPick) kh.forEach(id => sendPacket(packets.upgrade, decoded[1].find(id2 => id === id2)));
  919. break;
  920. case serverPackets.getMyID:
  921. myPlayer.id = decoded[1];
  922. break;
  923. case serverPackets.pingUpdate:
  924. ping = decoded[1];
  925. if (defaultToggles.showPing) {
  926. // Create a gradient from lightest to darkest purple for the "Ping" text
  927. var purpleColors = [
  928. "#d8a9ff", // Lightest purple
  929. "#bb80ff", // Light purple
  930. "#9f55ff", // Medium light purple
  931. "#8a2aff", // Medium purple
  932. "#7c00cc", // Darker purple
  933. "#6200b3", // Dark purple
  934. "#48007a", // Very dark purple
  935. "#2e0044" // Deepest purple
  936. ];
  937.  
  938. // Join the colors into a CSS gradient string
  939. var gradient = 'linear-gradient(to right, ' + purpleColors.join(', ') + ')';
  940.  
  941. // Set the inner HTML for the ping value
  942. getElem("pinginner").innerHTML = "Ping: " + ping + "ms";
  943.  
  944. // Apply the gradient to the background and clip it to text
  945. getElem("pinginner").style.background = gradient;
  946. getElem("pinginner").style.webkitBackgroundClip = 'text'; // For Chrome/Safari
  947. getElem("pinginner").style.backgroundClip = 'text'; // For Firefox/Other browsers
  948. getElem("pinginner").style.color = 'transparent'; // Make the text color transparent
  949.  
  950. // Apply the dark glowing text effect
  951. getElem("pinginner").style.textShadow = "0 0 10px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 0, 0, 0.7)";
  952. } else {
  953. getElem("pinginner").innerHTML = "";
  954. }
  955.  
  956. break;
  957. case serverPackets.spawn:
  958. alive = true
  959. if (!buyed) {
  960. for (let i = 0; i < 12; i++) sendPacket(packets.hat, i);
  961. buyed = true;
  962. };
  963. break;
  964. case serverPackets.death:
  965. alive = false
  966. break;
  967. case serverPackets.getKill:
  968. if (defaultToggles.killChat) {
  969. let kills = decoded[1][0];
  970. let killChatValue = defaultToggles.killChatValue;
  971. let updatedValue = killChatValue.replace('{kills}', kills);
  972. sendMsg(updatedValue);
  973. }
  974. break
  975. case serverPackets.updateClan: {
  976. const array_with_ID = [...decoded.slice(2, decoded.length)];
  977. array_with_ID.splice(array_with_ID.indexOf(myPlayer.id), 1);
  978. teammates = array_with_ID;
  979. return;
  980. }
  981. case serverPackets.createClan: {
  982. const array_with_ID = [...decoded.slice(3, decoded.length)];
  983. array_with_ID.splice(array_with_ID.indexOf(myPlayer.id), 1);
  984. teammates = array_with_ID;
  985. break;
  986. }
  987. case serverPackets.clanRemove:
  988. teammates = [];
  989. break;
  990. case serverPackets.updateEntities: {
  991. for (let i = 1; i < decoded.length; i += 19) {
  992. const newEnemy = {
  993. type: decoded[i],
  994. id: decoded[i + 1],
  995. hat: decoded[i + 11],
  996. teamID: decoded[i + 12],
  997. x: decoded[i + 4] | decoded[i + 5] << 8,
  998. y: decoded[i + 6] | decoded[i + 7] << 8,
  999. index: decoded[i + 2] | decoded[i + 3] << 8,
  1000. health: Math.ceil(decoded[i + 13] / 2.55),
  1001. angle: decoded[i + 9] * 0.02454369260617026 - PI,
  1002. broken: decoded[i + 8]
  1003. }
  1004. newEnemy.id === myPlayer.id && Object.assign(myPlayer, newEnemy);
  1005. window.myPlayer = newEnemy;
  1006. if (newEnemy.broken & 2) {
  1007. if (myPlayer.inTrap && myPlayer.inTrap.index === newEnemy.index) {
  1008. myPlayer.inTrap = false;
  1009. clearInterval(hatInterval);
  1010. hatInterval = setInterval(() => {
  1011. if (hatReloaded) {
  1012. clearInterval(hatInterval);
  1013. equipHat(hats.crystalGear);//puaal
  1014. };
  1015. }, 10)
  1016. };
  1017. traps = traps.filter(trap => trap.index !== newEnemy.index);
  1018. } else {
  1019. if (newEnemy.type === 6) {
  1020. traps.push(newEnemy);
  1021. } else if (defaultToggles.autoBreak && newEnemy.id === myPlayer.id && newEnemy.broken !== 16) {
  1022. const trap = traps.find(trap => Math.hypot(myPlayer.x - trap.x, myPlayer.y - trap.y) <= 70 && trap.id !== myPlayer.id && !teammates.includes(trap.id));
  1023. if (trap && myPlayer.inTrap && trap.index !== myPlayer.inTrap.index) {
  1024. myPlayer.inTrap = trap;
  1025. };
  1026. if (!myPlayer.inTrap && trap) {
  1027. myPlayer.inTrap = trap;
  1028. const angle = Math.atan2(trap.y - myPlayer.y, trap.x - myPlayer.x);
  1029. const prevWeapon = window.stats[Sploop.itemsID][weaponInHands];
  1030. sendPacket(packets.item, 1)
  1031. hit(angle);
  1032. sendPacket(packets.itemByID, prevWeapon);
  1033. sendPacket(packets.stopAttack);
  1034. const item = 7;
  1035. singlePlace(item, toRad(toDegree(angle) - 97));
  1036. await sleep(90);
  1037. singlePlace(item, toRad(toDegree(angle) + 97));
  1038. await sleep(90);
  1039. singlePlace(item, toRad(toDegree(angle) + 180));
  1040. };
  1041. if (myPlayer.inTrap && trap) {
  1042. const angle = Math.atan2(trap.y - myPlayer.y, trap.x - myPlayer.x);
  1043. if (defaultToggles.autoDemolist) {
  1044. equipHat(hats.demolist);
  1045. }
  1046. const prevWeapon = window.stats[Sploop.itemsID][weaponInHands];
  1047. singlePlace(7, newEnemy);
  1048. sendPacket(packets.item, 1);
  1049. hit(angle);
  1050. sendPacket(packets.itemByID, prevWeapon);
  1051. sendPacket(packets.stopAttack);
  1052. };
  1053. if (myPlayer.inTrap && !traps.find(trap => Math.hypot(myPlayer.x - trap.x, myPlayer.y - trap.y) <= 52)) {
  1054. singlePlace(4, newEnemy);
  1055. myPlayer.inTrap = false;
  1056. clearInterval(hatInterval);
  1057. hatInterval = setInterval(() => {
  1058. if (hatReloaded) {
  1059. clearInterval(hatInterval);
  1060. if (defaultToggles.autoPrevHat) {
  1061. equipHat(hats.crystalGear);
  1062. }
  1063. };
  1064. }, 10)
  1065. };
  1066. }
  1067. }
  1068. window.inTrap = myPlayer.inTrap;
  1069. }
  1070.  
  1071. if (myPlayer.y <= 9000 && myPlayer.y >= 8000) {
  1072. if (defaultToggles.scaffold) {
  1073. const angle = Math.atan2(myPlayer.y - myPlayer.y2, myPlayer.x - myPlayer.x2);
  1074. place(8, angle);
  1075. }
  1076. }
  1077.  
  1078. if (defaultToggles.autoScuba) {
  1079. if (myPlayer.y <= 9000 && myPlayer.y >= 8000 && !myPlayer.inRiver) {
  1080. myPlayer.inRiver = true;
  1081. if (hatReloaded) {
  1082. equipHat(hats.scubaGear);
  1083. } else {
  1084. clearInterval(hatInterval);
  1085. hatInterval = setInterval(() => {
  1086. if (hatReloaded) {
  1087. clearInterval(hatInterval);
  1088. equipHat(hats.scubaGear);
  1089. };
  1090. }, 10)
  1091. };
  1092. };
  1093. if ((myPlayer.y >= 9000 || myPlayer.y <= 8000) && myPlayer.inRiver) {
  1094. myPlayer.inRiver = false;
  1095. if (hatReloaded) {
  1096. equipHat(hats.boostHat);
  1097. } else {
  1098. clearInterval(hatInterval);
  1099. hatInterval = setInterval(() => {
  1100. if (hatReloaded) {
  1101. clearInterval(hatInterval);
  1102. equipHat(hats.boostHat);
  1103. };
  1104. }, 10)
  1105. };
  1106. };
  1107. } else {
  1108. myPlayer.inRiver = false;
  1109. };
  1110.  
  1111. if (myPlayer.broken === 128 && !myPlayer.clowned && defaultToggles.autoJungle) {
  1112. myPlayer.clowned = true;
  1113. equipHat(hats.jungleGear);
  1114. setTimeout(() => {
  1115. myPlayer.clowned = false;
  1116. equipHat(hats.crystalGear);
  1117. }, 3000)
  1118. };
  1119.  
  1120. let damageCount = 0; // Counter for damage hits between 9 and 14
  1121. let healingSlow = false; // Flag to indicate if healing should be slowed down
  1122. let slowHealingTimer = 0; // Timer for resetting slow healing after 1000ms
  1123. let lastDamage = 0; // Store last damage value
  1124. let doubleHealDisabled = false; // Flag to indicate if double heal is disabled
  1125. let doubleHealFor35Active = false; // Flag for double heal at 35 HP
  1126. let noDelayActive = false; // Flag to track if no-delay healing is active for 62-65 HP range
  1127. let noDelayTimer = null; // Timer to manage the no-delay window for healing
  1128.  
  1129. // Function to detect damage in the range of 9 to 14
  1130. function handleDamage(damage) {
  1131. // Check if the damage is between 9 and 14
  1132. if (damage >= 10 && damage <= 14) {
  1133. damageCount++;
  1134. }
  1135.  
  1136. // If damageCount exceeds 4, slow down healing
  1137. if (damageCount > 4 && !healingSlow) {
  1138. healingSlow = true; // Set flag to slow healing
  1139. slowHealingTimer = Date.now() + 1000; // Set timer for 1000ms to reset healing
  1140. }
  1141.  
  1142. // Special check for 65 exact damage to trigger double heal
  1143. if (damage === 65 && !doubleHealDisabled) {
  1144. healPlayer(true); // Trigger double heal
  1145. doubleHealDisabled = true; // Disable special heal
  1146. setTimeout(() => {
  1147. doubleHealDisabled = false; // Re-enable special heal after 3000ms
  1148. }, 3000);
  1149. }
  1150. }
  1151.  
  1152. let specialHealActive = false; // Flag to track if special healing is active
  1153.  
  1154. // Function to handle healing logic
  1155. function healPlayer(isDoubleHeal = false) {
  1156. let delay;
  1157.  
  1158. // Check if health is exactly 35 and the special heal is not disabled
  1159. if (myPlayer.health === 35 && !doubleHealFor35Active) {
  1160. doubleHealFor35Active = true; // Activate double heal for 35 HP
  1161. healPlayer(true); // Trigger double heal immediately with no delay
  1162.  
  1163. // Disable double heal for 2000ms
  1164. setTimeout(() => {
  1165. doubleHealFor35Active = false; // Re-enable double heal for 35 HP after 2000ms
  1166. }, 2000);
  1167.  
  1168. return; // Prevent further healing logic from executing
  1169. }
  1170.  
  1171. // Special heal for under 40 health
  1172. if (myPlayer.health < 40 && !specialHealActive) {
  1173. specialHealActive = true; // Activate special healing
  1174.  
  1175. // Initialize the delay counter for each tick
  1176. let healTickDelay = 10; // Start with 15ms delay
  1177. let healTickCount = 0; // Track the number of healing ticks
  1178.  
  1179. // Function to apply the special healing gradually
  1180. let healInterval = setInterval(() => {
  1181. // Heal with the current delay
  1182. placeFood(); // Heal the player
  1183.  
  1184. // Increase the delay after each heal
  1185. healTickCount++;
  1186. healTickDelay += 5; // Increase by 10ms per heal tick
  1187.  
  1188. // If delay exceeds a certain limit (e.g., 100ms), stop the special healing
  1189. if (healTickDelay >= 100 || healTickCount > 10) {
  1190. clearInterval(healInterval); // Stop healing when the delay gets too high
  1191. specialHealActive = false; // Deactivate special healing
  1192. }
  1193. }, healTickDelay); // Apply healing at the current delay
  1194.  
  1195. return; // Prevent further healing logic from executing
  1196. }
  1197.  
  1198. // If we are in the 62-65 range, and no-delay healing is active, check if myPlayer.hat !== 4
  1199. if (myPlayer.health >= 62 && myPlayer.health <= 65 && !noDelayActive && myPlayer.hat !== 4) {
  1200. noDelayActive = true; // Activate no delay healing
  1201. healPlayer(true); // Trigger double heal immediately with no delay
  1202.  
  1203. // Set a timer to disable the no-delay healing for 1 second
  1204. setTimeout(() => {
  1205. noDelayActive = false; // Disable no-delay healing after 1 second
  1206. }, 1000);
  1207.  
  1208. // Set a timer to re-enable no-delay healing every 2 seconds (changed from 3 seconds to 2 seconds)
  1209. setTimeout(() => {
  1210. noDelayActive = true; // Re-enable no-delay healing after 2 seconds
  1211. }, 1000);
  1212.  
  1213. return; // Prevent further healing logic from executing
  1214. }
  1215.  
  1216. // If healing should be slowed down due to constant damage
  1217. if (healingSlow) {
  1218. delay = 250; // Slow healing with 170ms delay
  1219. } else {
  1220. // Determine the delay based on health ranges
  1221. if (myPlayer.health >= 62 && myPlayer.health <= 65 && noDelayActive) {
  1222. delay = -1; // Heal immediately with no delay if in the range 62-65 and no-delay active
  1223. } else if (myPlayer.health >= 22 && myPlayer.health <= 34) {
  1224. delay = 40; // Heal with 40ms delay
  1225. } else {
  1226. delay = window.pingTime > 100 ? 55 : 80; // Default healing delay based on pingTime
  1227. }
  1228. }
  1229.  
  1230. // If it's been more than 1000ms since we started slow healing, reset the healing speed
  1231. if (healingSlow && Date.now() > slowHealingTimer) {
  1232. healingSlow = false; // Reset the slow healing flag
  1233. damageCount = 0; // Reset the damage counter
  1234. }
  1235.  
  1236. // If this is a double heal, trigger twice with no delay
  1237. if (isDoubleHeal) {
  1238. // Heal the player twice with no delay
  1239. setTimeout(() => {
  1240. placeFood(); // Heal the player
  1241. }, 0); // Heal immediately
  1242.  
  1243. setTimeout(() => {
  1244. placeFood(); // Heal again
  1245. }, 0); // Heal immediately again
  1246. } else {
  1247. // Heal the player with normal delay
  1248. setTimeout(() => {
  1249. placeFood(); // Heal the player
  1250. }, delay);
  1251. }
  1252. }
  1253.  
  1254. // Logic to trigger the healing process and track damage (this would be triggered where damage is detected in your game loop)
  1255. if (myPlayer.health < 100 && defaultToggles.autoHeal) {
  1256. let delay;
  1257.  
  1258. // Determine the delay based on health ranges
  1259. if (myPlayer.health < 40 && !specialHealActive) {
  1260. delay = 15; // Start the special heal with 15ms delay when health is below 40
  1261. } else if (myPlayer.health >= 62 && myPlayer.health <= 65 && !noDelayActive && myPlayer.hat === 4) {
  1262. delay = 25; // Heal with 35ms delay when no-delay is off and hat is 4
  1263. } else if (myPlayer.health >= 62 && myPlayer.health <= 65 && noDelayActive) {
  1264. delay = -1; // Heal immediately with no delay when in the range 62-65 and no-delay is active
  1265. } else if (myPlayer.health >= 22 && myPlayer.health <= 34) {
  1266. delay = 25; // Heal with 40ms delay
  1267. } else {
  1268. delay = window.pingTime > 100 ? 55 : 80; // Default healing delay based on pingTime
  1269. }
  1270.  
  1271. setTimeout(() => {
  1272. healPlayer(); // Trigger the healing function
  1273. }, delay);
  1274. }
  1275.  
  1276. break;
  1277. }
  1278. }
  1279. }
  1280.  
  1281. const encoder = new TextEncoder();
  1282. const sendMsg = (text) => {
  1283. return sendPacket(packets.chat, ...encoder.encode(text));
  1284. };
  1285. const hit = (angle) => {
  1286. const transformedAngle = 65535 * (angle + Math.PI) / (2 * Math.PI);
  1287. sendPacket(packets.hit, 255 & transformedAngle, transformedAngle >> 8 & 255);
  1288. };
  1289.  
  1290. let placingObject = 0;
  1291. let pushingCounts = 0;
  1292. let pushingChatCount = 0;
  1293.  
  1294. window.getEntityData = (entity, ctx, isTeammate) => {
  1295. const isMe = entity[Sploop.id] === myPlayer.id;
  1296. const entityX = entity[Sploop.x], entityY = entity[Sploop.y], entityAngle = entity[Sploop.angle];
  1297.  
  1298. if (isMe) myPlayer.currentItem = window.weapons[entity[Sploop.currentWeapon]];
  1299.  
  1300. const tracerAngle = (Math.atan2(myPlayer.y2 - entity[Sploop.y], myPlayer.x2 - entity[Sploop.x]) + Math.PI) % (2 * Math.PI);
  1301. const tracerDistance = Math.max(Math.hypot(entity[Sploop.y] - myPlayer.y2, entity[Sploop.x] - myPlayer.x2) / 2, 30);
  1302. const tracerx = myPlayer.x2 + tracerDistance * Math.cos(tracerAngle);
  1303. const tracery = myPlayer.y2 + tracerDistance * Math.sin(tracerAngle);
  1304. let tracerColor;
  1305. if (myPlayer.id != entity[Sploop.id]) {
  1306. if (defaultToggles.useRainbow) {
  1307. if (defaultToggles.teamTracers || defaultToggles.enemyTracers || defaultToggles.animalTracers) {
  1308. tracerColor = `hsl(${hue}, 100%, 50%)`;
  1309. }
  1310. } else {
  1311. if (entity.type != 0) {
  1312. (defaultToggles.animalTracers) ? tracerColor = getValue("animal-tracer-color") : tracerColor = "rgba(0, 0, 0, 0)"
  1313. } else if (entity.type == 0 && !teammates.includes(entity[Sploop.id])) {
  1314. (defaultToggles.enemyTracers) ? tracerColor = getValue("enemy-tracer-color") : tracerColor = "rgba(0, 0, 0, 0)"
  1315. } else {
  1316. (defaultToggles.teamTracers) ? tracerColor = getValue("team-tracer-color") : tracerColor = "rgba(0, 0, 0, 0)"
  1317. }
  1318. }
  1319. } else {
  1320. tracerColor = "rgba(0, 0, 0, 0)";
  1321. }
  1322. if (defaultToggles.useLines) {
  1323. canvas.local.save();
  1324. canvas.local.beginPath();
  1325. canvas.local.globalAlpha = 1;
  1326. canvas.local.lineCap = "round"
  1327. canvas.local.strokeStyle = tracerColor;
  1328. canvas.local.lineWidth = 5;
  1329. canvas.local.moveTo(myPlayer.x2, myPlayer.y2);
  1330. canvas.local.lineTo(entity[Sploop.x], entity[Sploop.y])
  1331. canvas.local.stroke();
  1332. canvas.local.closePath();
  1333. canvas.local.restore();
  1334. } else {
  1335. canvas.local.save();
  1336. canvas.local.beginPath();
  1337. canvas.local.translate(tracerx, tracery);
  1338. canvas.local.rotate(Math.PI / 4);
  1339. canvas.local.rotate(tracerAngle);
  1340. canvas.local.globalAlpha = 1;
  1341. canvas.local.fillStyle = tracerColor;
  1342. canvas.local.moveTo(-12, -12);
  1343. canvas.local.lineTo(12, 12);
  1344. canvas.local.lineTo(25, -25);
  1345. canvas.local.fill();
  1346. canvas.local.closePath();
  1347. canvas.local.restore();
  1348. }
  1349.  
  1350. if (isMe) {
  1351. myPlayer.x2 = entityX;
  1352. myPlayer.y2 = entityY;
  1353. myPlayer.angle2 = entityAngle;
  1354. myPlayer.currentWeapon = entity[Sploop.currentWeapon];
  1355. } else if (!isMe && entity.type === 0 && !teammates.includes(entity[Sploop.id])) {
  1356. const distance = Math.hypot(entityX - myPlayer.x2, entityY - myPlayer.y2);
  1357. const angle = Math.atan2(entityY - myPlayer.y2, entityX - myPlayer.x2); // Angle to enemy (not used for placement)
  1358.  
  1359. let lastPlacedObject = -1; // Track the last object placed to prevent repeated packets
  1360.  
  1361. if (defaultToggles.autoPlace && distance <= 150) {
  1362. const enemyTrapped = myTraps.find(c => Math.hypot(c[Sploop.y] - entity[Sploop.y], c[Sploop.x] - entity[Sploop.x]) <= 65);
  1363. if (enemyTrapped) {
  1364. const x = enemyTrapped[Sploop.x] - myPlayer.x;
  1365. const y = enemyTrapped[Sploop.y] - myPlayer.y;
  1366. placingObject++;
  1367.  
  1368. // Adjust for ping and decide how many objects to place
  1369. let delayTime = 0;
  1370. if (ping > 70) {
  1371. // If ping is over 100, double place (call singlePlace twice)
  1372. if (placingObject == 15 && lastPlacedObject !== placingObject) {
  1373. setTimeout(() => { singlePlace(4, Math.atan2(y, x) + 1.3); }, 20);
  1374. setTimeout(() => { singlePlace(4, Math.atan2(y, x) - 1.3); }, 40); // Double place
  1375. setTimeout(() => { singlePlace(4, Math.atan2(y, x) + 1.3); }, 80);
  1376. setTimeout(() => { singlePlace(4, Math.atan2(y, x) - 1.3); }, 100); // Double place
  1377. lastPlacedObject = placingObject; // Mark the last object placed
  1378. placingObject = 0;
  1379. delayTime = 15; // Speed up placement for high ping
  1380. } else if (placingObject == 7.5 && lastPlacedObject !== placingObject) {
  1381. setTimeout(() => { singlePlace(4, Math.atan2(y, x) + 2.6); }, 20);
  1382. setTimeout(() => { singlePlace(4, Math.atan2(y, x) - 2.6); }, 40); // Double place
  1383. setTimeout(() => {
  1384. setTimeout(() => { singlePlace(4, Math.atan2(y, x) - 33.3); }, 20);
  1385. }, 25);
  1386. setTimeout(() => { singlePlace(4, Math.atan2(y, x) + 2.6); }, 80);
  1387. setTimeout(() => { singlePlace(4, Math.atan2(y, x) - 2.6); }, 100); // Double place
  1388. lastPlacedObject = placingObject; // Mark the last object placed
  1389. placingObject = 0;
  1390. delayTime = 15; // Speed up placement for high ping
  1391. }
  1392. } else {
  1393. // If ping is under 100, place a single object
  1394. if (placingObject == 15 && lastPlacedObject !== placingObject) {
  1395. setTimeout(() => { singlePlace(4, Math.atan2(y, x) + 10.95593); }, 20);
  1396. lastPlacedObject = placingObject; // Mark the last object placed
  1397. placingObject = 0;
  1398. } else if (placingObject == 7.5 && lastPlacedObject !== placingObject) {
  1399. setTimeout(() => { singlePlace(4, Math.atan2(y, x) + 2.6); }, 20);
  1400. setTimeout(() => { singlePlace(4, Math.atan2(y, x) - 2.6); }, 40); // Double place
  1401. setTimeout(() => {
  1402. setTimeout(() => { singlePlace(4, Math.atan2(y, x) + 1.3); }, 20);
  1403. setTimeout(() => { singlePlace(4, Math.atan2(y, x) - 1.3); }, 40); // Double place
  1404. }, 25);
  1405. lastPlacedObject = placingObject; // Mark the last object placed
  1406. placingObject = 0;
  1407. delayTime = 15; // Speed up placement for high ping
  1408. }
  1409. }
  1410.  
  1411. // Apply delay only when ping is over 100
  1412. if (delayTime > 60) {
  1413. setTimeout(() => {}, delayTime); // Adjust delay between actions for high ping
  1414. }
  1415.  
  1416. } else {
  1417. placingObject++;
  1418. let delayTime = 0;
  1419. if (ping > 100) {
  1420. // If ping is over 100, double place (call singlePlace twice)
  1421. if (placingObject == 15 && lastPlacedObject !== placingObject) {
  1422. singlePlace(7, angle); // Double place
  1423. lastPlacedObject = placingObject; // Mark the last object placed
  1424. placingObject = 0;
  1425. delayTime = 20; // Speed up placement for high ping
  1426. }
  1427. } else {
  1428. // If ping is under 100, place a single object
  1429. if (placingObject == 15 && lastPlacedObject !== placingObject) {
  1430. setTimeout(()=>{
  1431. singlePlace(7, angle);
  1432. },25);
  1433. lastPlacedObject = placingObject; // Mark the last object placed
  1434. placingObject = 0;
  1435. }
  1436. }
  1437.  
  1438. // Apply delay only when ping is over 100
  1439. if (delayTime > 60) {
  1440. setTimeout(() => {}, delayTime); // Adjust delay between actions for high ping
  1441. }
  1442. }
  1443. }
  1444.  
  1445.  
  1446. const dsd = myTraps.find(c => myPlayer.id == c[Sploop.id] && Math.hypot(c[Sploop.y] - entity[Sploop.y], c[Sploop.x] - entity[Sploop.x]) <= 70);
  1447. if (doingInsta == false &&![hats.crystalGear, hats.immunityGear].includes(entity[Sploop.hat]) && distance <= 135 && !dsd) {
  1448. const instaKillAngle = Math.atan2(entity[Sploop.y] - myPlayer.y2, entity[Sploop.x] - myPlayer.x2);
  1449. if (weaponReloading == false && hatReloaded) {
  1450. doingInsta = true;
  1451. singlePlace(4, instaKillAngle);
  1452. const hitAngle = 65535 * (instaKillAngle + PI) / PI2;
  1453. equipHat(hats.berserkerHat);
  1454. setTimeout(()=>{
  1455. sendPacket(packets.item, 0);
  1456. sendPacket(packets.hit, 255 & hitAngle, hitAngle >> 8 & 255);
  1457. },1);
  1458. setTimeout(() => {
  1459. sendPacket(packets.stopAttack);
  1460. sendPacket(packets.item, weaponInHands);
  1461. setTimeout(() => {
  1462. doingInsta = false;
  1463. clearInterval(hatInterval);
  1464. hatInterval = setInterval(() => {
  1465. if (hatReloaded) {
  1466. clearInterval(hatInterval);
  1467. equipHat(hats.crystalGear);
  1468. };
  1469. }, 1);
  1470. }, 1600);
  1471. }, 1);
  1472. }
  1473. }
  1474. if (defaultToggles.autoPush && distance <= 170) {
  1475. const enemyTrapped = myTraps.find(c => myPlayer.id == c[Sploop.id] && Math.hypot(c[Sploop.y] - entity[Sploop.y], c[Sploop.x] - entity[Sploop.x]) <= 75);
  1476. if (enemyTrapped && Math.hypot(enemyTrapped[Sploop.y] - myPlayer.y, enemyTrapped[Sploop.x] - myPlayer.x) <= 250) {
  1477. // Ensure the spike belongs to your player
  1478. const nearestSpike = mySpikes.find(c => c[Sploop.id] == myPlayer.id && Math.hypot(c[Sploop.y] - enemyTrapped[Sploop.y], c[Sploop.x] - enemyTrapped[Sploop.x]) <= 140);
  1479. if (nearestSpike) {
  1480. pushingCounts++;
  1481. autoPushing = true;
  1482. nearestSpike.x = nearestSpike[Sploop.x];
  1483. nearestSpike.y = nearestSpike[Sploop.y];
  1484. const angleToEnemy = Math.atan2(entity[Sploop.y] - nearestSpike.y, entity[Sploop.x] - nearestSpike.x)
  1485. let distance = Math.hypot(nearestSpike.x - entity[Sploop.x], nearestSpike.y - entity[Sploop.y]) + 45;
  1486. const pushPos = {
  1487. x: nearestSpike.x + (distance * Math.cos(angleToEnemy)),
  1488. y: nearestSpike.y + (distance * Math.sin(angleToEnemy))
  1489. };
  1490. const pushingCount = Math.hypot(myPlayer.x - pushPos.x, myPlayer.y - pushPos.y);
  1491. let pushingAngle;
  1492. if (pushingCount > 15) {
  1493. pushingAngle = Math.atan2(pushPos.y - myPlayer.y, pushPos.x - myPlayer.x);
  1494. } else {
  1495. pushingAngle = Math.atan2(entity[Sploop.y] - myPlayer.y, entity[Sploop.x] - myPlayer.x);
  1496. }
  1497. const pushAngle = 65535 * (pushingAngle + Math.PI) / (2 * Math.PI);
  1498.  
  1499. if(entity[Sploop.health] < 99 && distance <= 200){
  1500. const instaKillAngle = Math.atan2(entity[Sploop.y] - myPlayer.y2, entity[Sploop.x] - myPlayer.x2);
  1501. const hitAngle = 65535 * (instaKillAngle + PI) / PI2;
  1502. equipHat(hats.berserkerHat);
  1503. sendPacket(packets.item, 0);
  1504.  
  1505. // Adjust the delay based on ping
  1506. let delayTime = 25;
  1507. if (ping > 100) {
  1508. delayTime = 25; // Halve the delay if ping is over 100
  1509. }
  1510.  
  1511. setTimeout(()=>{
  1512. sendPacket(packets.hit, 255 & hitAngle, hitAngle >> 8 & 255);
  1513. }, delayTime);
  1514.  
  1515. setTimeout(()=>{
  1516. sendPacket(packets.stopAttack);
  1517. }, delayTime);
  1518.  
  1519. setTimeout(()=>{
  1520. equipHat(hats.crystalGear);
  1521. }, 1600);
  1522. }
  1523. // Draw purple stroke and fill
  1524. ctx.save();
  1525. ctx.beginPath();
  1526. ctx.lineWidth = 5;
  1527. ctx.lineCap = "round";
  1528. ctx.strokeStyle = "#800080"; // Purple stroke color
  1529. ctx.fillStyle = "#800080"; // Purple fill color
  1530. ctx.moveTo(myPlayer.x, myPlayer.y);
  1531. ctx.bezierCurveTo(entity[Sploop.x], entity[Sploop.y], pushPos.x, pushPos.y, nearestSpike.x, nearestSpike.y);
  1532. ctx.globalAlpha = 0.5;
  1533. ctx.arc(nearestSpike.x, nearestSpike.y, 8, 0, Math.PI * 2);
  1534. ctx.fill(); // Fill the circle
  1535. ctx.stroke(); // Stroke the path
  1536. ctx.closePath();
  1537. ctx.restore();
  1538.  
  1539. if (distance < 35) {
  1540. sendPacket(packets.stopMove);
  1541. } else {
  1542. if (pushingCounts > 6) {
  1543. sendPacket(packets.move, 255 & pushAngle, pushAngle >> 8 & 255);
  1544. pushingCounts = 0;
  1545. }
  1546. }
  1547. }
  1548. }
  1549. }}}
  1550. window.render = (ctx, shit) => {
  1551. };
  1552.  
  1553. let mySpikes = [];
  1554. let myTraps = [];
  1555. let myScaffs = [];
  1556. window.drawMarkers = (target, id, ctx, step) => {
  1557. const objectID = target[Sploop.id]
  1558. const isSpike = [2, 7, 17].includes(target.type);
  1559.  
  1560. if (isSpike) {
  1561. let isMySpike = myPlayer.id == objectID;
  1562. if (isMySpike && !mySpikes.find(c => c[Sploop.id2] == target[Sploop.id2])) {
  1563. mySpikes.push(target);
  1564. }
  1565. }
  1566.  
  1567. if (myTraps && target.type == 6) {
  1568. let isMyTrap = myPlayer.id == objectID;
  1569. if (isMyTrap && !myTraps.find(c => c[Sploop.id2] == target[Sploop.id2])) {
  1570. myTraps.push(target);
  1571. }
  1572. };
  1573.  
  1574. if (myScaffs && target.type == 9) {
  1575. let isMyScaff = myPlayer.id == objectID;
  1576. if (isMyScaff && !myScaffs.find(c => c[Sploop.id2] == target[Sploop.id2])) {
  1577. myScaffs.push(target);
  1578. }
  1579. };
  1580.  
  1581. let color, strokeColor;
  1582. if (teammates.includes(target[Sploop.id])) {
  1583. if (defaultToggles.teamMarkers) {
  1584. color = getValue("team-marker-color");
  1585. strokeColor = colors.stroke;
  1586. } else {
  1587. color = colors.nobody;
  1588. strokeColor = colors.nobodystroke;
  1589. }
  1590. } else if (objectID === myPlayer.id) {
  1591. if (defaultToggles.mineMarkers) {
  1592. color = getValue("mine-marker-color");
  1593. strokeColor = colors.stroke;
  1594. } else {
  1595. color = colors.nobody;
  1596. strokeColor = colors.nobodystroke;
  1597. }
  1598. } else {
  1599. if (defaultToggles.enemyMarkers) {
  1600. color = getValue("enemy-marker-color");
  1601. strokeColor = colors.stroke;
  1602. } else {
  1603. color = colors.nobody;
  1604. strokeColor = colors.nobodystroke;
  1605. }
  1606. }
  1607.  
  1608. if (![21, 30, 40, 31, 32, 33, 34, 35, 38, 39, 1, 3, 4, 5, 9].includes(target.type)) {
  1609. ctx.save();
  1610. ctx.beginPath();
  1611. ctx.strokeStyle = strokeColor;
  1612. ctx.lineWidth = 10;
  1613. ctx.arc(0, 0, 5, 0, 2 * Math.PI);
  1614. ctx.stroke();
  1615. ctx.fillStyle = color;
  1616. ctx.arc(0, 0, 5, 0, 2 * Math.PI);
  1617. ctx.fill();
  1618. ctx.closePath();
  1619. ctx.restore();
  1620. }
  1621.  
  1622. };
  1623.  
  1624. let weaponReloading = false;
  1625. window.attackAnimation = (type, id, weapon, isObject, entity) => {
  1626. try {
  1627. const entityID = entity[Sploop.id];
  1628. entityID == myPlayer.id && (weaponReloading = true);
  1629. setTimeout(function () {
  1630. entityID == myPlayer.id && (weaponReloading = false);
  1631. }, window.weapons[window.stats[Sploop.itemsID][weaponInHands]].reload)
  1632. } catch (err) { }
  1633. };
  1634.  
  1635. const checkChanges = (obj1, obj2) => {
  1636. const keys1 = Object.keys(obj1);
  1637. const keys2 = Object.keys(obj2);
  1638. return keys2.some(key => !keys1.includes(key)) || keys1.some(key => !keys2.includes(key));
  1639. };
  1640.  
  1641. const changeSettings = (key, value) => {
  1642. let newSettings = JSON.parse(localStorage.settings);
  1643. newSettings[key] = value;
  1644. localStorage.setItem("settings", JSON.stringify(newSettings));
  1645. };
  1646.  
  1647. const sendPacket = (packetID, ...values) => {
  1648. return myWS.send(new Uint8Array([packetID, ...values]));
  1649. }
  1650.  
  1651. let mouseAngle2;
  1652. window.addEventListener("mousemove", ({ pageX, pageY }) => {
  1653. mouseX = pageX;
  1654. mouseY = pageY;
  1655. mouseAngle = 65535 * (Math.atan2(mouseY - innerHeight / 2, mouseX - innerWidth / 2) + PI) / PI2;
  1656. mouseAngle2 = Math.atan2(mouseY - innerHeight / 2, mouseX - innerWidth / 2);
  1657. });
  1658.  
  1659. let hatInterval;
  1660. const equipHat = (id) => {
  1661. if (hatReloaded) {
  1662. hatReloaded = false;
  1663. setTimeout(() => {
  1664. hatReloaded = true;
  1665. }, 1300);
  1666. if (myPlayer.hat !== id) {
  1667. myPlayer.prevHat = myPlayer.inRiver && myPlayer.hat === hats.scubaGear ? id : myPlayer.hat;
  1668. sendPacket(packets.hat, id);
  1669. };
  1670. };
  1671. };
  1672.  
  1673. let _isKeyDown = false, _intervalId;
  1674.  
  1675. const checkChat = () => !getElem("chat-wrapper").style.display || getElem("chat-wrapper").style.display === "none";
  1676.  
  1677. let repeater = (key, action) => ({
  1678. start(keycode) {
  1679. if (keycode === key && !_isKeyDown) {
  1680. _isKeyDown = true;
  1681. placingItem = true;
  1682. _intervalId = setInterval(() => {
  1683. action();
  1684. !_isKeyDown && (clearInterval(_intervalId), _intervalId = undefined);
  1685. }, 25);
  1686. }
  1687. },
  1688. stop(keycode) {
  1689. if (keycode === key) {
  1690. _isKeyDown = false;
  1691. placingItem = false;
  1692. };
  1693. }
  1694. });
  1695.  
  1696. const changeAngle = (angle, isTransformed = false) => {
  1697. if (isTransformed) {
  1698. sendPacket(packets.angle, 255 & angle, angle >> 8 & 255);
  1699. return;
  1700. } else {
  1701. const angle2 = 65535 * (angle + Math.PI) / (2 * Math.PI);
  1702. sendPacket(packets.angle, 255 & angle2, angle2 >> 8 & 255);
  1703. }
  1704. };
  1705.  
  1706. let placingItem = false;
  1707. const canvas = {
  1708. local: undefined,
  1709. }
  1710.  
  1711. window.addEventListener("DOMContentLoaded", event => {
  1712. canvas.local = getElem("game-canvas").getContext("2d");
  1713. });
  1714.  
  1715. const prevRect = CanvasRenderingContext2D.prototype.clearRect;
  1716. CanvasRenderingContext2D.prototype.clearRect = function (x, y, width, height) {
  1717. if (this.canvas.id === "game-canvas") {
  1718. canvas.local = this.canvas.getContext("2d");
  1719. }
  1720. return prevRect.apply(this, arguments);
  1721. }
  1722.  
  1723. const { fillRect } = CanvasRenderingContext2D.prototype;
  1724. CanvasRenderingContext2D.prototype.fillRect = function (x, y, width, height) {
  1725. if (placingItem && this.fillStyle === "#a4cc4f") {
  1726. //drawPredict('place');
  1727. };
  1728. return fillRect.apply(this, arguments);
  1729. }
  1730.  
  1731. const place = (itemID) => {
  1732. sendPacket(packets.item, weaponInHands);
  1733. sendPacket(packets.item, itemID);
  1734. sendPacket(packets.hit, 255 & mouseAngle, mouseAngle >> 8 & 255);
  1735. sendPacket(packets.stopAttack);
  1736. sendPacket(packets.item, weaponInHands);
  1737. };
  1738.  
  1739. const singlePlace = (itemID, preAngle) => {
  1740. const back = mouseAngle;
  1741. const angle = 65535 * (preAngle + Math.PI) / (2 * Math.PI);
  1742. sendPacket(packets.item, weaponInHands);
  1743. sendPacket(packets.item, itemID);
  1744. sendPacket(packets.hit, 255 & angle, angle >> 8 & 255);
  1745. changeAngle(back, true);
  1746. sendPacket(packets.stopAttack);
  1747. sendPacket(packets.item, weaponInHands);
  1748. };
  1749.  
  1750. const placeFood = () => {
  1751. sendPacket(packets.item, weaponInHands);
  1752. sendPacket(packets.item, 2);
  1753. const healAngle = 65535 * (myPlayer.angle + PI) / PI2;
  1754. sendPacket(packets.hit, 255 & healAngle, healAngle >> 8 & 255);
  1755. sendPacket(packets.stopAttack);
  1756. sendPacket(packets.item, weaponInHands);
  1757. };
  1758.  
  1759. const placeByKey = (key, itemID) => repeater(binds[key], () => place(itemID), itemID);
  1760. const placement = {
  1761. trap: placeByKey("trap", 7),
  1762. spike: placeByKey("spike", 4),
  1763. wall: placeByKey("wall", 3),
  1764. mill: placeByKey("mill", 5),
  1765. QHold: placeByKey("QHeal", 2),
  1766. platform: placeByKey("platform", 8),
  1767. turret: placeByKey("turret", 10)
  1768. };
  1769.  
  1770. let copyMove = 0;
  1771. document.addEventListener("keydown", event => {
  1772. if (event.repeat || !checkChat()) return;
  1773. const pressedKey = event.code;
  1774. if (defaultToggles.placingMacro) {
  1775. if (Object.values(binds).includes(pressedKey)) Object.values(placement).forEach(action => action.start(pressedKey));
  1776. }
  1777. if (["KeyW", "KeyA", "KeyS", "KeyD"].includes(pressedKey)) {
  1778. if (pressedKey === "KeyW") copyMove |= 1;
  1779. if (pressedKey === "KeyA") copyMove |= 4;
  1780. if (pressedKey === "KeyS") copyMove |= 2;
  1781. if (pressedKey === "KeyD") copyMove |= 8;
  1782. }
  1783.  
  1784. switch (pressedKey) {
  1785. case "Digit1": weaponInHands = 0; break;
  1786. case "Digit2": weaponInHands = 1; break;
  1787. case binds.bushHat: if (defaultToggles.hatsMacro) equipHat(hats.bushHat); break;
  1788. case binds.berserkerHat: if (defaultToggles.hatsMacro) equipHat(hats.berserkerHat); break;
  1789. case binds.jungleGear: if (defaultToggles.hatsMacro) equipHat(hats.jungleGear); break;
  1790. case binds.crystalGear: if (defaultToggles.hatsMacro) equipHat(hats.crystalGear); break;
  1791. case binds.spikeGear: if (defaultToggles.hatsMacro) equipHat(hats.spikeGear); break;
  1792. case binds.immunityGear: if (defaultToggles.hatsMacro) equipHat(hats.immunityGear); break;
  1793. case binds.boostHat: if (defaultToggles.hatsMacro) equipHat(hats.boostHat); break;
  1794. case binds.appleHat: if (defaultToggles.hatsMacro) equipHat(hats.appleHat); break;
  1795. case binds.scubaGear: if (defaultToggles.hatsMacro) equipHat(hats.scubaGear); break;
  1796. case binds.hood: if (defaultToggles.hatsMacro) equipHat(hats.hood); break;
  1797. case binds.demolist: if (defaultToggles.hatsMacro) equipHat(hats.demolist); break;
  1798. };
  1799. });
  1800.  
  1801. document.addEventListener("keyup", event => {
  1802. if (!checkChat()) return;
  1803. const pressedKey = event.code;
  1804. if (["KeyW", "KeyA", "KeyS", "KeyD"].includes(pressedKey)) {
  1805. if (pressedKey === "KeyW") copyMove &= -2;
  1806. if (pressedKey === "KeyA") copyMove &= -5;
  1807. if (pressedKey === "KeyS") copyMove &= -3;
  1808. if (pressedKey === "KeyD") copyMove &= -9;
  1809. };
  1810. if (Object.values(binds).includes(pressedKey)) Object.values(placement).forEach(action => action.stop(pressedKey));
  1811. });
  1812.  
  1813. let objectsCounts = {
  1814. limit: 0,
  1815. count: 0,
  1816. }
  1817.  
  1818. const hasCount = (type) => {
  1819. return objectsCounts.count < objectsCounts.limit;
  1820. }
  1821.  
  1822. const maxObjCount = [0, 0, 0, 100, 30, 8, 2, 12, 32, 1, 2];
  1823. window.drawItemBar = (ctx, imageData, index) => {
  1824. const limit = maxObjCount[window.weapons[window.stats[Sploop.itemsID][index]][Sploop.weaponID2]];
  1825. const crntCount = window.stats[Sploop.objCount][window.weapons[window.stats[Sploop.itemsID][index]][Sploop.weaponID2]];
  1826. objectsCounts.limit = limit;
  1827. objectsCounts.count = crntCount;
  1828. if (limit == 0) return;
  1829. const text = `${crntCount}/${limit}`;
  1830. ctx.save();
  1831. ctx.font = "900 20px Montserrat";
  1832. ctx.fillStyle = "#fff";
  1833. ctx.fillText(text, imageData[Sploop.x] + imageData.width - ctx.measureText(text).width - 10, imageData[Sploop.y] + 25);
  1834. ctx.strokeStyle = "#000";
  1835. ctx.strokeText(text, imageData[Sploop.x] + imageData.width - ctx.measureText(text).width - 10, imageData[Sploop.y] + 25);
  1836. ctx.restore();
  1837. };
  1838.  
  1839. const TYPEOF = value => Object.prototype.toString.call(value).slice(8, -1).toLowerCase();
  1840. const NumberSystem = [
  1841. { radix: 2, prefix: "0b0*" },
  1842. { radix: 8, prefix: "0+" },
  1843. { radix: 10, prefix: "" },
  1844. { radix: 16, prefix: "0x0*" }
  1845. ];
  1846. class Regex {
  1847. constructor(code, unicode) {
  1848. this.code = this.COPY_CODE = code;
  1849. this.unicode = unicode || false;
  1850. this.hooks = {};
  1851. }
  1852.  
  1853. static parseValue = value => {
  1854. try { return Function(`return (${value})`)(); }
  1855. catch (err) { return null; }
  1856. };
  1857.  
  1858. isRegexp = value => TYPEOF(value) === "regexp";
  1859.  
  1860. generateNumberSystem = int => `(?:${NumberSystem.map(({ prefix, radix }) => prefix + int.toString(radix)).join("|")})`;
  1861.  
  1862. parseVariables = regex => regex.replace(/\{VAR\}/g, "(?:let|var|const)")
  1863. .replace(/\{QUOTE\}/g, "['\"`]")
  1864. .replace(/ARGS\{(\d+)\}/g, (_, count) => (Array(Number(count)).fill("\\w+")).join("\\s*,\\s*"))
  1865. .replace(/NUMBER\{(\d+)\}/g, (_, int) => this.generateNumberSystem(Number(int)));
  1866.  
  1867. format = (name, inputRegex, flags) => {
  1868. const regex = Array.isArray(inputRegex) ? inputRegex.map(exp => this.isRegexp(exp) ? exp.source : exp).join("\\s*") : this.isRegexp(inputRegex) ? inputRegex.source : "";
  1869. let parsedRegex = this.parseVariables(regex);
  1870.  
  1871. if (this.unicode) {
  1872. parsedRegex = parsedRegex.replace(/\\w/g, "(?:[^\\x00-\\x7F-]|\\$|\\w)");
  1873. }
  1874.  
  1875. const expression = new RegExp(parsedRegex.replace(/\{INSERT\}/, ""), flags);
  1876. return parsedRegex.includes("{INSERT}") ? new RegExp(parsedRegex, flags) : expression;
  1877. };
  1878.  
  1879. template = (type, name, regex, substr) => {
  1880. const expression = new RegExp(`(${this.format(name, regex).source})`);
  1881. const match = this.code.match(expression) || [];
  1882. this.code = this.code.replace(expression, type === 0 ? "$1" + substr : substr + "$1");
  1883. return match;
  1884. };
  1885.  
  1886. match = (name, regex, flags, debug = false) => {
  1887. const expression = this.format(name, regex, flags);
  1888. const match = this.code.match(expression) || [];
  1889. this.hooks[name] = { expression, match };
  1890. return match;
  1891. };
  1892.  
  1893. matchAll = (name, regex, debug = false) => {
  1894. const expression = this.format(name, regex, "g");
  1895. const matches = [...this.code.matchAll(expression)];
  1896. this.hooks[name] = { expression, match: matches };
  1897. return matches;
  1898. };
  1899.  
  1900. replace = (name, regex, substr, flags) => {
  1901. const expression = this.format(name, regex, flags);
  1902. this.code = this.code.replace(expression, substr);
  1903. return this.code.match(expression) || [];
  1904. };
  1905.  
  1906. replaceAll = (name, regex, substr, flags) => {
  1907. const expression = this.format(name, regex, "g");
  1908. this.code = this.code.replaceAll(expression, substr);
  1909. return this.code.match(expression) || [];
  1910. };
  1911.  
  1912. append = (name, regex, substr) => this.template(0, name, regex, substr);
  1913.  
  1914. prepend = (name, regex, substr) => this.template(1, name, regex, substr);
  1915.  
  1916. insert = (name, regex, substr) => {
  1917. const { source } = this.format(name, regex);
  1918. if (!source.includes("{INSERT}")) throw new Error("Your regexp must contain {INSERT} keyword");
  1919. const findExpression = new RegExp(source.replace(/^(.*)\{INSERT\}(.*)$/, "($1)($2)"));
  1920. this.code = this.code.replace(findExpression, `$1${substr}$2`);
  1921. return this.code.match(findExpression);
  1922. };
  1923. };
  1924.  
  1925. let Sploop;
  1926. const applyHooks = code => {
  1927. const Hook = new Regex(code, true);
  1928. window.COPY_CODE = (Hook.COPY_CODE.match(/^(\(function \w+\(\w+\)\{.+)\(.+?\);$/) || [])[1];
  1929. Hook.append("EXTERNAL fix", /\(function (\w+)\(\w+\)\{/, "let $2 = eval(`(() => ${COPY_CODE})()`);delete window.COPY_CODE;console.log(1);");
  1930. const myData = Hook.match('myPlayer', /=(\w.get\(\w{2}\));\w&&\w\(\)/)[1];
  1931. const X = Hook.match('playerX', /\{this\.(\w{2})=\w\|\|0/)[1];
  1932. const Y = Hook.match('playerY', /,this\.(\w{2})=\w\|\|0\}/)[1];
  1933. const ID = Hook.match('ID', /&&\w{2}===\w\.(\w{2})\){/)[1];
  1934. const ID2 = Hook.match('ID2', /-1!==\w+\.(\w+)&&/)[1];
  1935. const currentWeapon = Hook.match("crntWeapon", /,\w.(\w{2})===/)[1];
  1936. const angle = Hook.match("angle", /;\w.(\w{2})=\w\(\)/)[1];
  1937. const weaponName = Hook.match("wpnName", /(\w{2}):"XX/)[1];
  1938. const health = Hook.match("health", /(\w{2})<<8;/)[1];
  1939. const weaponDamage = Hook.match("wpnDamage", /(\w{2}):32,reload:300/)[1];
  1940. const teamID = Hook.match('test', /,\w=\w.(\w{2})\|.+?\<\<8/)[1];
  1941. const radius = Hook.match("radius", /(\w{2}):220/)[1];
  1942. const [, currentItem, hat] = Hook.match("hat", /\(\w+\.(\w+)\|\w+\.(\w+)<<NUMBER{8}\)/);
  1943. const inWhichObject = Hook.match("iwo", /110\).+?,1===\w.(\w{2})&&!\w{2}/)[1];
  1944. const weaponID = Hook.match('el', /(\w{2}):0,\w{2}:22,reload:150/)[1];
  1945. const itemsID = Hook.match("IDs", />1\){.{3}(\w{2})/)[1];
  1946. const weaponID2 = Hook.matchAll('el', /,(\w+):9,\w+:2/)[1][1];
  1947. const objCount = Hook.match("objCount", /\),this.(\w{2})=\w\):/)[1];
  1948. const size = Hook.match("size", /\.(\w{2})\+50/)[1];
  1949. const objQuantity = Hook.match("Quantity", /\),this.(\w{2})=\w\):/)[1];
  1950. const itemBar = Hook.match("defaultData", /(\W\w+>NUMBER{1}\W.+?(\w+)\.(\w+).+?)function/)[3];
  1951. Sploop = {
  1952. myPlayer: {
  1953. myData: myData,
  1954. x: `${myData}.${X}`,
  1955. y: `${myData}.${Y}`,
  1956. id: `${myData}.${ID}`,
  1957. teamID: `${myData}.${teamID}`,
  1958. angle: `${myData}.${angle}`
  1959. },
  1960. x: X,
  1961. y: Y,
  1962. id: ID,
  1963. id2: ID2,
  1964. hat: hat,
  1965. type: 'type',
  1966. angle: angle,
  1967. health: health,
  1968. radius: radius,
  1969. teamID: teamID,
  1970. itemsID: itemsID,
  1971. temBar: itemBar,
  1972. objCount: objCount,
  1973. weaponID: weaponID,
  1974. weaponID2: weaponID2,
  1975. weaponName: weaponName,
  1976. objQuantity: objQuantity,
  1977. weaponDamage: weaponDamage,
  1978. currentWeapon: currentWeapon,
  1979. inWhichObject: inWhichObject
  1980. };
  1981. Hook.append("itemCounter", /AGE 0.+?\[(\w+)\][,;](\w+)\.\w+\((\w+)\)([,;])/, `window.drawItemBar($4,$3,$2)$5`);
  1982. Hook.replace("blockMouse", /\|\|(\w+\(\w+\(\)\)\))/, `||!window.inTrap && $1;`);
  1983. Hook.append("renderer", /1}function \w+\((\w),(\w)\){/, `window.render($2, $3);`);
  1984. Hook.replace("grid", /1,(\w{2})=!0/, `1, $1=window.grid`);
  1985. Hook.replace("grid", /,\w{2}(&&\w+\(\w,)/, `,window.grid$1`);
  1986. Hook.append("updateFPS", /const (\w)=\+new Date,.+?3;/, `window.updateFPSCounter($2);`);
  1987. Hook.replace("renderItems", /(\(\w+\.\w+\+\w+,\w+\.\w+\+\w+\).+?\w+\(\).+?\w+\.\w+\.\w+\)([,;]))/, `$1window.drawMarkers(...arguments)$2`);
  1988. const args = Hook.match("drawEntityInfo", /-NUMBER{50},.+?function \w+\((ARGS{3})\)\{/)[1];
  1989. Hook.append('drawEntityInfo', /=.5;/, `try {window.getEntityData(${args});} catch(err) {};`)
  1990. Hook.append("getMsg", /0;fu.{10}(\w).{2}/, `window.receiveMsg($2);`);
  1991. Hook.append("getWS", /(\w{2})=new \w{2}\("".{31}/, `,window.getWS($2)`);
  1992. const weaponList = Hook.match("weaponList", /\?Math\.PI\/2.+?(\w\(\))/)[1];
  1993. Hook.replace("defaultData", /(\W\w+>NUMBER{1}\W.+?(\w+)\.(\w+).+?)function/, `$1window.stats=$2;window.weapons = ${weaponList};window.sprites = tt();function`);
  1994. Hook.append('attackReload', /\+=NUMBER{5}.+?(\w+)=.+?(\w+)=.+?(\w+)=.+?(\w+)=.+?(\w+)=.+?;/, `window.attackAnimation($2, $3, $4, $5, $6);`)
  1995. return Hook.code;
  1996. };
  1997.  
  1998. window.eval = new Proxy(window.eval, {
  1999. apply(target, _this, args) {
  2000. const code = args[0];
  2001. if (code.length > 100000) {
  2002. args[0] = applyHooks(code);
  2003. window.eval = target;
  2004. }
  2005. return target.apply(_this, args);
  2006. }
  2007. });