Vortex

-

  1. // ==UserScript==
  2. // @name Vortex
  3. // @version -
  4. // @description -
  5. // @match https://sploop.io/
  6. // @icon https://i.imgur.com/1REccXW.png
  7. // @run-at document-start
  8. // @grant none
  9. // @namespace https://greasyfork.org/users/1434229
  10. // ==/UserScript==
  11.  
  12. const resources = {
  13. wallpapers: "https://i.imgur.com/ybnsAVD.jpeg",
  14. settings: "https://i.imgur.com/FOahlaF.png",
  15. palette: "https://i.imgur.com/8wmJKgD.png",
  16.  
  17. flowerFirst: "https://i.imgur.com/FUJR2mI.png",
  18. flowerSecond: "https://i.imgur.com/nhGgidV.png",
  19. flowerThird: "https://i.imgur.com/Osm31mO.png",
  20.  
  21. stoneFirst: "",
  22. stoneSecond: "",
  23.  
  24. cookie: "https://i.imgur.com/23FWsc7.png"
  25. }
  26.  
  27. class HTML {
  28. static header (name) {
  29. return `<div class = "page-header">
  30. <h1> ${name} </h1>
  31. </div>`;
  32. }
  33. static checkbox (name, id, state) {
  34. return `<div class = "check-box-style">
  35. ${name}
  36. <input type = "checkbox" id = "${id}" style = "margin-bottom: 7.5px;" ${state}/>
  37. </div>`;
  38. }
  39. static button (name, id) {
  40. return `<button id = "${id}" class = "button-style" style = "color: white"> ${name} </button>`;
  41. }
  42. static setupButton (name, id) {
  43. return `<button id = "${id}" style = "display: flex; align-items: center; justify-content: space-between"> ${name} </button>`;
  44. }
  45. static newline () {
  46. return `<br>`;
  47. }
  48. static whiteline () {
  49. return `<hr>`;
  50. }
  51. static startHolderDiv(holderID, buttonID, buttonNAME, contentID) {
  52. return `<div class="add-options-holder" id="${holderID}" style="height: 35px;">
  53. <div class="static-options-holder">
  54. <div style="margin-left: 10px;" class="cool-text">${buttonNAME}</div>
  55. <button id="${buttonID}" class="option-button-holder">
  56. <img src="${resources.settings}" style="width: 25px; height: 25px; margin-top: 4.85px;" />
  57. </button>
  58. </div>
  59. <div id="${contentID}" class="content" style="max-height: 0; overflow: hidden; transition: max-height 0.15s ease-in-out; margin-top: -6px;">
  60. `;
  61. }
  62.  
  63. static closeDiv() {
  64. return `</div></div>`;
  65. }
  66. static color (id, name, color) {
  67. return `
  68. <div class="option-color" style = "font-size: 15px; color: gray;">
  69. ${name}
  70. <div style="display: flex; align-items: center; justify-content: space-between;">
  71. <input type="color" id="${id}" value="${color}" class="color-style"/>
  72. <img src = "${resources.palette}" style = "width: 25px; height: 25px"/>
  73. </div>
  74. </div>
  75. `
  76. }
  77. static bind (name, id, bind) {
  78. return `
  79. <div class="new-binds-section">
  80. ${name}
  81. <div style="display: flex; align-items: center; justify-content: space-between;">
  82. <input type="text" id="${id}" style = "width: 50px; text-align: center; border: none; border-radius: 8px; outline: none; height: 25px; background-color: rgba(0, 0, 0, 0.50); color: #fff;" value = "${bind}"/>
  83. </div>
  84. </div>`;
  85. }
  86. }
  87.  
  88. class get {
  89. static El (id) {
  90. return document.getElementById(id);
  91. }
  92. static Val (id) {
  93. return document.getElementById(id).value;
  94. }
  95. static crEl (style) {
  96. return document.createElement(style);
  97. }
  98. }
  99.  
  100. class menu {
  101. static style(name, id, leftOffset, topOffset, height) {
  102. name.id = id;
  103. name.className = "menu-items";
  104. name.style = `
  105. display: block;
  106. position: fixed;
  107. top: ${topOffset}px;
  108. background-color: #16171a;
  109. border: 3px solid #1f2024;
  110. color: white;
  111. border-radius: 8px;
  112. max-height: ${height}px;
  113. width: 200px;
  114. z-index: 999;
  115. transform-origin: center center;
  116. margin-left: calc(${leftOffset}vw - 115px);
  117. `;
  118. }
  119. }
  120.  
  121. const firstPage = get.crEl("div");
  122. menu.style(firstPage, "firstPage", "25", "10", "999");
  123.  
  124. const secondPage = get.crEl("div");
  125. menu.style(secondPage, "secondPage", "36", "10", "999");
  126.  
  127. const thirdPage = get.crEl("div");
  128. menu.style(thirdPage, "thirdPage", "47", "10", "999");
  129.  
  130. const fourthPage = get.crEl("div");
  131. menu.style(fourthPage, "fourthPage", "58", "10", "999");
  132.  
  133. const fifthPage = get.crEl("div");
  134. menu.style(fifthPage, "fifthPage", "69", "10", "999");
  135.  
  136.  
  137. const night = get.crEl("div");
  138. night.id = "night";
  139. night.style = "width: 100%; height: 100%; display: block; position: absolute; pointer-events: none; background-color: rgb(0 0 0 / 0%); opacity: 50%;";
  140.  
  141. const displays = get.crEl("div");
  142. displays.id = "displays";
  143. displays.style = `left: 10px; top: 10px; width: auto; max-height: 300px; display: block; position: absolute; pointer-events: none; background-color: rgb(0 0 0 / 0%); color: #fff;`;
  144.  
  145. const arrayList = get.crEl("div");
  146. arrayList.id = "arrayList";
  147. arrayList.style = `left: 10px; top: 120px; width: auto; max-height: 900px; display: block; position: absolute; pointer-events: none; background-color: rgb(0 0 0 / 0%); color: #fff; backdrop-filter: blur(0px); border-radius: 18px;`;
  148.  
  149. const cookie = get.crEl("div");
  150. cookie.id = "cookieSigma";
  151. cookie.src = resources.cookie;
  152.  
  153. window.addEventListener("DOMContentLoaded", () => {
  154.  
  155. firstPage.innerHTML = `
  156. ${HTML.header("Combat")}
  157. <div style="overflow-y: scroll; max-height: 700px;">
  158. ${HTML.newline()}
  159. ${HTML.startHolderDiv("auto-heal-holder", "auto-heal-button", "Auto heal", "auto-heal-content")}
  160. ${HTML.newline()}
  161. ${HTML.checkbox("Toggle", "auto-heal", "checked")}
  162. ${HTML.closeDiv()}
  163. ${HTML.newline()}
  164. ${HTML.startHolderDiv("auto-break-holder", "auto-break-button", "Auto break", "auto-break-content")}
  165. ${HTML.newline()}
  166. ${HTML.checkbox("Toggle", "auto-break", "checked")}
  167. ${HTML.newline()}
  168. ${HTML.checkbox("Equip demolist", "equip-demolist", "checked")}
  169. ${HTML.newline()}
  170. ${HTML.checkbox("Equip prev hat", "equip-demolist-prev-hat", "checked")}
  171. ${HTML.closeDiv()}
  172. ${HTML.newline()}
  173. ${HTML.startHolderDiv("auto-insta-holder", "auto-insta-button", "Auto insta", "auto-insta-content")}
  174. ${HTML.newline()}
  175. ${HTML.checkbox("Toggle", "auto-insta", "checked")}
  176. ${HTML.newline()}
  177. ${HTML.checkbox("Equip berserker", "equip-berserker", "checked")}
  178. ${HTML.newline()}
  179. ${HTML.checkbox("Equip prev hat", "equip-berserker-prev-hat", "")}
  180. ${HTML.closeDiv()}
  181. ${HTML.newline()}
  182. ${HTML.startHolderDiv("hats-holder", "hats-button", "Hats", "hats-content")}
  183. ${HTML.newline()}
  184. ${HTML.checkbox("Auto buy", "auto-buy", "checked")}
  185. ${HTML.newline()}
  186. ${HTML.checkbox("Auto hats", "auto-hats", "checked")}
  187. ${HTML.newline()}
  188. ${HTML.checkbox("Hat macros", "hat-macro", "checked")}
  189. ${HTML.closeDiv()}
  190. ${HTML.newline()}
  191. ${HTML.startHolderDiv("placement-holder", "placement-button", "Placement", "placement-content")}
  192. ${HTML.newline()}
  193. ${HTML.checkbox("Auto place", "auto-place", "")}
  194. ${HTML.newline()}
  195. ${HTML.checkbox("Fast place", "fast-place", "")}
  196. ${HTML.newline()}
  197. ${HTML.checkbox("Macros", "placement-macro", "checked")}
  198. ${HTML.closeDiv()}
  199. </div>
  200. ${HTML.newline()}
  201. `;
  202.  
  203. secondPage.innerHTML = `
  204. ${HTML.header("Utils")}
  205. <div style="overflow-y: scroll; max-height: 700px;">
  206. ${HTML.newline()}
  207. ${HTML.startHolderDiv("auto-respawn-holder", "auto-respawn-button", "Auto respawn", "auto-respawn-content")}
  208. ${HTML.newline()}
  209. ${HTML.checkbox("Toggle", "auto-respawn", "checked")}
  210. ${HTML.closeDiv()}
  211. ${HTML.newline()}
  212. ${HTML.startHolderDiv("anti-holder", "anti-button", "Anti trap", "anti-content")}
  213. ${HTML.newline()}
  214. ${HTML.checkbox("Toggle", "anti-trap", "checked")}
  215. ${HTML.closeDiv()}
  216. ${HTML.newline()}
  217. ${HTML.startHolderDiv("pick-holder", "pick-button", "Auto pick", "pick-content")}
  218. ${HTML.newline()}
  219. ${HTML.checkbox("Toggle", "auto-pick", "")}
  220. ${HTML.closeDiv()}
  221. ${HTML.newline()}
  222. ${HTML.startHolderDiv("mouse-holder", "mouse-button", "Mouse", "mouse-content")}
  223. ${HTML.newline()}
  224. ${HTML.checkbox("WClick", "w-click", "")}
  225. ${HTML.closeDiv()}
  226. ${HTML.newline()}
  227. ${HTML.startHolderDiv("pearl-holder", "pearl-button", "Quick pearl", "pearl-content")}
  228. ${HTML.newline()}
  229. ${HTML.checkbox("Toggle", "quick-pearl", "")}
  230. ${HTML.closeDiv()}
  231. </div>
  232. ${HTML.newline()}
  233. `;
  234.  
  235. thirdPage.innerHTML = `
  236. ${HTML.header("Visual")}
  237. <div style="overflow-y: scroll; max-height: 700px;">
  238. ${HTML.newline()}
  239. ${HTML.startHolderDiv("night-holder", "night-button", "Night", "night-content")}
  240. ${HTML.newline()}
  241. ${HTML.checkbox("Toggle", "night-mode", "")}
  242. ${HTML.newline()}
  243. ${HTML.color("night-color", "Night color", "#211b55")}
  244. ${HTML.closeDiv()}
  245. ${HTML.newline()}
  246. ${HTML.startHolderDiv("tracers-holder", "tracers-button", "Tracers", "tracers-content")}
  247. ${HTML.newline()}
  248. ${HTML.checkbox("Toggle", "tracers", "")}
  249. ${HTML.newline()}
  250. ${HTML.color("team-tracer-color", "Team color", "#8ECC51")}
  251. ${HTML.newline()}
  252. ${HTML.color("animal-tracer-color", "Animal color", "#5191CC")}
  253. ${HTML.newline()}
  254. ${HTML.color("enemy-tracer-color", "Enemy color", "#CC5151")}
  255. ${HTML.closeDiv()}
  256. ${HTML.newline()}
  257. ${HTML.startHolderDiv("markers-holder", "markers-button", "Markers", "markers-content")}
  258. ${HTML.newline()}
  259. ${HTML.checkbox("Toggle", "markers", "")}
  260. ${HTML.newline()}
  261. ${HTML.color("mine-marker-color", "Mine color", "#8ECC51")}
  262. ${HTML.newline()}
  263. ${HTML.color("team-marker-color", "Team color", "#5191CC")}
  264. ${HTML.newline()}
  265. ${HTML.color("enemy-marker-color", "Enemy color", "#CC5151")}
  266. ${HTML.closeDiv()}
  267. ${HTML.newline()}
  268. ${HTML.startHolderDiv("decorations-holder", "decorations-button", "Decorations", "decorations-content")}
  269. ${HTML.newline()}
  270. ${HTML.checkbox("Flowers (x)", "flowers", "")}
  271. ${HTML.newline()}
  272. ${HTML.checkbox("Stones (x)", "stones", "")}
  273. ${HTML.closeDiv()}
  274. ${HTML.newline()}
  275. ${HTML.startHolderDiv("auto-push-line-holder", "auto-push-line-button", "Push line", "auto-push-line-content")}
  276. ${HTML.newline()}
  277. ${HTML.checkbox("Toggle", "auto-push-line", "")}
  278. ${HTML.newline()}
  279. ${HTML.color("auto-push-line-color", "Push line color", "#00ff00")}
  280. ${HTML.closeDiv()}
  281. ${HTML.newline()}
  282. ${HTML.startHolderDiv("weapon-range-holder", "weapon-range-button", "Weapon range", "weapon-range-content")}
  283. ${HTML.newline()}
  284. ${HTML.checkbox("Toggle", "weapon-range", "")}
  285. ${HTML.newline()}
  286. ${HTML.color("weapon-range-color", "Color", "#00ff00")}
  287. ${HTML.newline()}
  288. ${HTML.checkbox("Fill", "weapon-range-fill", "")}
  289. ${HTML.newline()}
  290. ${HTML.checkbox("Shadow", "weapon-range-shadow", "")}
  291. ${HTML.closeDiv()}
  292. ${HTML.newline()}
  293. ${HTML.startHolderDiv("anim-text-holder", "anim-text-button", "Anim text", "anim-text-content")}
  294. ${HTML.newline()}
  295. ${HTML.checkbox("Hide heal text", "hide-heal-text", "")}
  296. ${HTML.newline()}
  297. ${HTML.checkbox("Hide dmg text", "hide-dmg-text", "")}
  298. ${HTML.closeDiv()}
  299. ${HTML.newline()}
  300. ${HTML.startHolderDiv("health-bar-holder", "health-bar-button", "Health bar", "health-bar-content")}
  301. ${HTML.newline()}
  302. ${HTML.color("team-mine-health-bar-color", "Team/Mine", "#a4cc4f")}
  303. ${HTML.newline()}
  304. ${HTML.color("enemy-animal-health-bar-color", "Enemy/Animal", "#cc5151")}
  305. ${HTML.closeDiv()}
  306. </div>
  307. ${HTML.newline()}
  308. `;
  309.  
  310. fourthPage.innerHTML = `
  311. ${HTML.header("Movement")}
  312. <div style="overflow-y: scroll; max-height: 700px;">
  313. ${HTML.newline()}
  314. ${HTML.startHolderDiv("auto-push-holder", "auto-push-button", "Auto push", "auto-push-content")}
  315. ${HTML.newline()}
  316. ${HTML.checkbox("Toggle", "auto-push", "")}
  317. ${HTML.closeDiv()}
  318. ${HTML.newline()}
  319. ${HTML.startHolderDiv("path-finder-holder", "path-finder-button", "Path finder", "path-finder-content")}
  320. ${HTML.newline()}
  321. ${HTML.checkbox("Toggle", "path-finder", "")}
  322. ${HTML.newline()}
  323. ${HTML.bind("Pos x", "pos-x", "0")}
  324. ${HTML.newline()}
  325. ${HTML.bind("Pos y", "pos-y", "0")}
  326. ${HTML.closeDiv()}
  327. </div>
  328. ${HTML.newline()}
  329. `;
  330.  
  331. fifthPage.innerHTML = `
  332. ${HTML.header("Display")}
  333. <div style="overflow-y: scroll; max-height: 700px;">
  334. ${HTML.newline()}
  335. ${HTML.startHolderDiv("display-holder", "display-button", "Display", "display-content")}
  336. ${HTML.newline()}
  337. ${HTML.checkbox("Ping display", "ping-display", "checked")}
  338. ${HTML.newline()}
  339. ${HTML.checkbox("Fps display", "fps-display", "checked")}
  340. ${HTML.newline()}
  341. ${HTML.checkbox("Time display", "time-display", "checked")}
  342. ${HTML.closeDiv()}
  343. ${HTML.newline()}
  344. ${HTML.startHolderDiv("blur-holder", "blur-button", "Blur", "blur-content")}
  345. ${HTML.newline()}
  346. ${HTML.checkbox("Clan menu", "clan-menu-blur", "")}
  347. ${HTML.newline()}
  348. ${HTML.checkbox("Shop menu", "shop-menu-blur", "")}
  349. ${HTML.closeDiv()}
  350. ${HTML.newline()}
  351. ${HTML.startHolderDiv("array-list-holder", "array-list-button", "Array List", "array-list-content")}
  352. ${HTML.newline()}
  353. ${HTML.checkbox("Toggle", "array-list-display", "")}
  354. ${HTML.newline()}
  355. ${HTML.checkbox("Blur", "array-list-blur", "")}
  356. ${HTML.closeDiv()}
  357. </div>
  358. ${HTML.newline()}
  359. `;
  360.  
  361. displays.innerHTML = `
  362. <div style = "display: flex; flex-direction: column;">
  363. <div id = "pingInner" class = "cool-text"> Ping: connecting </div>
  364. <div id = "fpsInner" class = "cool-text"> Fps: 0 </div>
  365. <div id = "timeInner" class = "cool-text"> Time: </div>
  366. </div>
  367. `;
  368.  
  369. document.body.appendChild(firstPage);
  370. document.body.appendChild(secondPage);
  371. document.body.appendChild(thirdPage);
  372. document.body.appendChild(fourthPage);
  373. document.body.appendChild(fifthPage);
  374. document.body.appendChild(night);
  375. document.body.appendChild(displays);
  376. document.body.appendChild(arrayList);
  377. document.body.appendChild(cookie);
  378. setInterval(() => {
  379. const features = [
  380. { id: "auto-heal", text: "Auto heal" },
  381. { id: "auto-break", text: "Auto break" },
  382. { id: "auto-insta", text: "Auto insta" },
  383. { id: "auto-hats", text: "Auto hats" },
  384. { id: "auto-buy", text: "Auto buy" },
  385. { id: "auto-place", text: "Auto place" },
  386. { id: "fast-place", text: "Fast place" },
  387. { id: "auto-respawn", text: "Auto respawn" },
  388. { id: "anti-trap", text: "Anti trap" },
  389. { id: "auto-pick", text: "Auto pick" },
  390. { id: "w-click", text: "WClick" },
  391. { id: "night-mode", text: "Night mode" },
  392. { id: "tracers", text: "Tracers" },
  393. { id: "markers", text: "Markers" },
  394. { id: "auto-push-line", text: "Push line" },
  395. { id: "weapon-range", text: "Weapon range" },
  396. { id: "hide-heal-text", text: "Hide heal text" },
  397. { id: "hide-dmg-text", text: "Hide dmg text" },
  398. { id: "auto-push", text: "Auto push" },
  399. { id: "path-finder", text: "Path finder" },
  400. { id: "ping-display", text: "Ping display" },
  401. { id: "fps-display", text: "Fps display" },
  402. { id: "time-display", text: "Time display" },
  403. { id: "clan-menu-blur", text: "Clan menu blur" },
  404. { id: "shop-menu-blur", text: "Shop menu blur" },
  405. { id: "array-list-display", text: "Array list display" },
  406. { id: "array-list-blur", text: "Array list blur" },
  407. { id: "hat-macro", text: "Hat macro" },
  408. { id: "placement-macro", text: "Placement macro" },
  409. { id: "quick-pearl", text: "Quick pearl" },
  410. ];
  411.  
  412. const checkedFeatures = features
  413. .filter(feature => get.El(feature.id).checked)
  414. .map(feature => `<div class="cool-text"> ${feature.text} </div>`);
  415.  
  416. if (get.El("array-list-display").checked) {
  417. get.El("arrayList").innerHTML = checkedFeatures.length > 0 ?
  418. `<div style="display: flex; flex-direction: column;"> ${checkedFeatures.join('')} </div>` :
  419. '';
  420. } else {
  421. get.El("arrayList").innerHTML = "";
  422. }
  423.  
  424. if (get.El("array-list-blur").checked) {
  425. get.El("arrayList").style.backdropFilter = "blur(5px)";
  426. } else {
  427. get.El("arrayList").style.backdropFilter = "blur(0px)";
  428. }
  429. }, 15);
  430.  
  431. const toggleContent = (contentId, holderId) => {
  432. const content = get.El(contentId);
  433. const holder = get.El(holderId);
  434. const isExpanded = content.style.maxHeight !== "0px" && content.style.maxHeight !== "";
  435. const targetHeight = isExpanded ? "35px" : `${content.scrollHeight + 37.5}px`;
  436.  
  437. content.style.maxHeight = isExpanded ? "0" : `${content.scrollHeight + 37.5}px`;
  438. holder.style.height = targetHeight;
  439. holder.style.transition = "height 0.15s ease-in-out";
  440. };
  441.  
  442. const toggleFunctions = [
  443. "auto-heal", "auto-break", "auto-insta", "hats", "placement", "auto-respawn",
  444. "night", "auto-push", "path-finder", "anti", "pick", "display", "tracers",
  445. "markers", "decorations", "auto-push-line", "weapon-range", "mouse", "blur",
  446. "anim-text", "health-bar", "array-list", "pearl",
  447. ];
  448.  
  449. toggleFunctions.forEach(id => {
  450. get.El(`${id}-button`).addEventListener("click", () => toggleContent(`${id}-content`, `${id}-holder`));
  451. });
  452.  
  453. setInterval(() => {
  454. if (get.El("night-mode").checked) {
  455. get.El("night").style.backgroundColor = get.Val("night-color");
  456. } else {
  457. get.El("night").style.backgroundColor = "rgba(0, 0, 0, 0)";
  458. }
  459. }, 0);
  460.  
  461. let styleItems = `
  462. ::-webkit-scrollbar {
  463. display: none;
  464. border-radius: 4px;
  465. outline: none;
  466. }
  467. @keyframes appear {
  468. 0% {
  469. transform: scale(0);
  470. opacity: 0;
  471. }
  472. 100% {
  473. transform: scale(1);
  474. opacity: 1;
  475. }
  476. }
  477.  
  478. @keyframes disappear {
  479. 0% {
  480. transform: scale(1);
  481. opacity: 1;
  482. }
  483. 100% {
  484. transform: scale(0);
  485. opacity: 0;
  486. }
  487. }
  488.  
  489. .menu-items {
  490. animation: appear 0.5s ease-in-out;
  491. opacity: 1;
  492. transform: scale(1);
  493. }
  494.  
  495. .menu-items.hidden {
  496. animation: disappear 0.5s ease-in-out forwards;
  497. }
  498. .new-binds-section {
  499. display: flex;
  500. justify-content: space-between;
  501. align-items: center;
  502. margin-top: -10px;
  503. font-family: "Montserrat", sans-serif;
  504. font-size: 15px;
  505. font-weight: 100;
  506. color: gray;
  507. margin-left: 10px;
  508. margin-right: 5px;
  509. }
  510. .option-color {
  511. display: flex;
  512. justify-content: space-between;
  513. align-items: center;
  514. margin-top: -10px;
  515. margin-left: 10px;
  516. margin-right: 6px;
  517. font-family: "Montserrat", sans-serif;
  518. font-size: 15px;
  519. font-weight: 100;
  520. color: gray;
  521. }
  522. .color-style {
  523. padding: 0 1px;
  524. margin: 0;
  525. height: 24px;
  526. cursor: url(img/ui/cursor-pointer.png) 6 0, pointer;
  527. background-color: rgba(0, 0, 0, 0);
  528. color: rgba(0, 0, 0, 0);
  529. border: none;
  530. outline: none;
  531. margin-right: -40px;
  532. opacity: 0.1%;
  533. }
  534. .option-button-holder {
  535. border: none;
  536. outline: none;
  537. background-color: rgba(0, 0, 0, 0);
  538. }
  539. .add-options-holder {
  540. border-radius: 8px;
  541. margin-left: 5px;
  542. margin-right: 5px;
  543. height: 35px;
  544. background-color: #21242b;
  545. text-align: left;
  546. color: gray;
  547. font-family: "Montserrat", sans-serif;
  548. font-size: 15px;
  549. font-weight: 100;
  550. }
  551. .static-options-holder {
  552. border-radius: 8px;
  553. align-items: center;
  554. justify-content: space-between;
  555. display: flex;
  556. margin-right: 5px;
  557. margin-top: -10px;
  558. height: 35px;
  559. background-color: #21242b;
  560. text-align: left;
  561. color: gray;
  562. font-family: "Montserrat", sans-serif;
  563. font-size: 15px;
  564. font-weight: 100;
  565. }
  566. .cool-text {
  567. font-family: "Montserrat", sans-serif;
  568. font-size: 15px;
  569. font-weight: 100;
  570. }
  571. .page-header {
  572. text-align: center;
  573. margin-top: 10px;
  574. font-family: Montserrat, sans-serif;
  575. }
  576. .page-header h1 {
  577. font-family: "Montserrat", sans-serif;
  578. font-size: 18px;
  579. font-weight: 100;
  580. }
  581. #homepage {
  582. background-image: url(${resources.wallpapers}) !important;
  583. background-repeat: no-repeat;
  584. background-position: center;
  585. background-size: cover;
  586. }
  587. .check-box-style {
  588. margin-top: -13px;
  589. align-items: center;
  590. justify-content: space-between;
  591. display: flex;
  592. font-family: "Montserrat", sans-serif;
  593. font-size: 15px;
  594. font-weight: 100;
  595. padding-left: 10px;
  596. padding-right: 5px;
  597. }
  598. .background-img-play, #small-waiting, #logo, #main-login-button, #main-sign-up-button, #nav, #cross-promo, #bottom-wrap, #google_play, #game-left-content-main, #game-bottom-content, #game-right-content-main, #right-content, #left-content, #settings {
  599. display: none !important;
  600. }
  601. #game-content {
  602. justify-content: center;
  603. }
  604. #main-content {
  605. width: auto;
  606. }
  607. input:checked[type="checkbox"] {
  608. background: #3f454d;
  609. transition: background 0.3s ease-in-out;
  610. }
  611. input[type="checkbox" i] {
  612. background-color: initial;
  613. cursor: default;
  614. appearance: auto;
  615. box-sizing: border-box;
  616. margin: 3px 3px 3px 4px;
  617. padding: initial;
  618. border: initial;
  619. }
  620. input:checked[type="checkbox"]::after {
  621. left: 55%;
  622. }
  623. input[type="checkbox"]::after {
  624. position: absolute;
  625. content: "";
  626. width: 15px;
  627. height: 15px;
  628. top: -2.15px;;
  629. left: 0;
  630. background: #fff;
  631. border-radius: 50%;
  632. box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  633. transition: 0.4s;
  634. }
  635. input[type="checkbox"] {
  636. position: relative;
  637. appearance: none;
  638. width: 30px;
  639. height: 10px;
  640. background: #3f454d;
  641. border-radius: 8px;
  642. box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  643. cursor: url(img/ui/cursor-pointer.png) 6 0, pointer;
  644. top: 4px;
  645. transition: 0.4s;
  646. }
  647. `;
  648. const styleItemsUpd = get.crEl("style");
  649. styleItemsUpd.type = "text/css";
  650. styleItemsUpd.innerText = styleItems;
  651. document.head.appendChild(styleItemsUpd);
  652. });
  653.  
  654.  
  655. document.addEventListener('DOMContentLoaded', function() {
  656. var meta = document.createElement('meta');
  657. meta.name = 'viewport';
  658. meta.content = 'width=device-width, initial-scale=1.0, user-scalable=no';
  659. document.getElementsByTagName('head')[0].appendChild(meta);
  660. document.addEventListener('keydown', function(event) {
  661. if ((event.ctrlKey || event.metaKey) && (event.key === '+' || event.key === '-' || event.key === '=')) {
  662. event.preventDefault();
  663. }
  664. });
  665. document.addEventListener('wheel', function(event) {
  666. if (event.ctrlKey || event.metaKey) {
  667. event.preventDefault();
  668. }
  669. }, { passive: false });
  670. document.addEventListener('touchstart', function(event) {
  671. if (event.touches.length > 1) {
  672. event.preventDefault();
  673. }
  674. }, { passive: false });
  675. document.addEventListener('gesturestart', function(event) {
  676. event.preventDefault();
  677. });
  678. document.addEventListener('gesturechange', function(event) {
  679. event.preventDefault();
  680. });
  681. document.addEventListener('gestureend', function(event) {
  682. event.preventDefault();
  683. });
  684. get.El("game-canvas").onclick = () => {
  685. if (get.El("w-click").checked) {
  686. sendPacket(packets.hit, 255 & mouseAngle, mouseAngle >> 8 & 255);
  687. sendPacket(packets.stopAttack);
  688. sendPacket(packets.hit, 255 & mouseAngle, mouseAngle >> 8 & 255);
  689. sendPacket(packets.stopAttack);
  690. }
  691. }
  692.  
  693. });
  694.  
  695.  
  696. let frames = 0,
  697. lastTime,
  698. lastUpdate = 0,
  699. frameCount = 0;
  700. window.updateFPSCounter = (currentTime) => {
  701. const elapsedSeconds = (currentTime - (lastTime || (lastTime = currentTime))) / 1000;
  702. frameCount++;
  703. if (elapsedSeconds >= 1) {
  704. if (get.El('fps-display').checked) {
  705. get.El("fpsInner").innerHTML = `Fps: ${Math.round(frameCount / elapsedSeconds)}`;
  706. } else {
  707. get.El("fpsInner").innerHTML = '';
  708. }
  709. frameCount = 0;
  710. lastTime = currentTime;
  711. };
  712. };
  713.  
  714. setInterval(() => {
  715. if (get.El("time-display").checked) {
  716. get.El("timeInner").innerHTML = `Time: ${new Date().toLocaleTimeString()}`;
  717. } else {
  718. get.El("timeInner").innerHTML = '';
  719. }
  720. if (get.El("shop-menu-blur").checked) {
  721. get.El('hat-menu').style.backdropFilter = "blur(5px)";
  722. } else {
  723. get.El('hat-menu').style.backdropFilter = "blur(0px)";
  724. }
  725. if (get.El("clan-menu-blur").checked) {
  726. get.El('clan-menu').style.backdropFilter = "blur(5px)";
  727. } else {
  728. get.El('clan-menu').style.backdropFilter = "blur(0px)";
  729. }
  730. }, 1000);
  731.  
  732. const binds = {
  733. trap: "KeyF",
  734. spike: "KeyV",
  735. wall: "Digit4",
  736. mill: "KeyN",
  737. food: "KeyQ",
  738. platform: "...",
  739. turret: "...",
  740.  
  741. bushHat: "...",
  742. berserkerHat: "KeyB",
  743. jungleGear: "...",
  744. crystalGear: "KeyC",
  745. spikeGear: "...",
  746. immunityGear: "KeyG",
  747. boostHat: "KeyM",
  748. appleHat: "...",
  749. scubaGear: "...",
  750. hood: "KeyK",
  751. demolist: "KeyZ",
  752.  
  753. pearl: "KeyT",
  754. }
  755.  
  756. const hats = {
  757. bushHat: 1,
  758. berserkerHat: 2,
  759. jungleGear: 3,
  760. crystalGear: 4,
  761. spikeGear: 5,
  762. immunityGear: 6,
  763. boostHat: 7,
  764. appleHat: 8,
  765. scubaGear: 9,
  766. hood: 10,
  767. demolist: 11
  768. }
  769.  
  770. const packets = {
  771. item: 0,
  772. move: 1,
  773. itemByID: 2,
  774. hat: 5,
  775. chat: 7,
  776. place: 8,
  777. joinGame: 11,
  778. angle: 13,
  779. upgrade: 14,
  780. stopMove: 15,
  781. clanAcc: 17,
  782. stopAttack: 18,
  783. hit: 19,
  784. joinClan: 21,
  785. clan: 22,
  786. EAttack: 23,
  787. clanLeave: 24
  788. }
  789.  
  790. const serverPackets = {
  791. pingServer: 0,
  792. updateLeaderBoard: 3,
  793. age_barWmats: 8,
  794. chooseItem: 14,
  795. pingUpdate: 15,
  796. updateClan: 16,
  797. clanRequest: 17,
  798. death: 19,
  799. getKill: 22,
  800. createClan: 24,
  801. clanRemove: 27,
  802. killText: 28,
  803. attackAnimation: 29,
  804. updateEntities: 20,
  805. playerSpawn: 32,
  806. getMyID: 33,
  807. spawn: 35,
  808. itemCount: 36
  809. }
  810.  
  811. let hue = 0;
  812.  
  813. let replaceInterval = setInterval(() => {
  814. if (CanvasRenderingContext2D.prototype.roundRect) {
  815. CanvasRenderingContext2D.prototype.roundRect = ((oldFunc) => function() { if (this.fillStyle == "") this.fillStyle = `hsl(${hue}, 100%, 50%)`; return oldFunc.call(this, ...arguments); })(CanvasRenderingContext2D.prototype.roundRect);
  816. clearInterval(replaceInterval);
  817. }}, 10);
  818.  
  819. const changeHue = () => {
  820. hue += Math.random() * 3;
  821. }
  822.  
  823. setInterval(changeHue, 10);
  824.  
  825.  
  826. let kh = [1, 12, 9, 19, 20, 15, 8, 17, 16];
  827.  
  828. let traps = [];
  829. let teammates = [];
  830.  
  831. let Entity = new Array();
  832. let myWS,
  833. weaponInHands = 0,
  834. ping = 100,
  835. PI = 3.141592653589793,
  836. PI2 = 6.283185307179586,
  837. mouseAngle,
  838. mouseX,
  839. mouseY,
  840. inRiver = false,
  841. buyed = false,
  842. myPlayer = { id: null, clown: false, inRiver: false },
  843. hatReloaded = true;
  844.  
  845. window.getWS = (websocket) => {
  846. myWS = websocket;
  847. websocket.onclose = () => {
  848. myWS = undefined;
  849. buyed = false;
  850. };
  851. };
  852.  
  853.  
  854. const autoRespawnElement = () => {
  855. return myWS.send(JSON.stringify([10, localStorage.nickname, localStorage.skin, "", localStorage.accessory, localStorage.accMail, localStorage.accToken, localStorage.back]));
  856. }
  857.  
  858. const toRad = (angle) => {
  859. while (angle < 0) {
  860. angle += 360;
  861. };
  862. while (angle >= 360) {
  863. angle -= 360;
  864. };
  865. return (angle * Math.PI) / 180;
  866. };
  867. const toDegree = (angle) => {
  868. return ((angle * 180) / Math.PI);
  869. };
  870. const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
  871. const formatAge = age => Math.floor(Math.log(1 + Math.max(0, age)) ** 2.4 / 13);
  872. let formatEnemy = {
  873. x: 0,
  874. y: 0,
  875. }
  876. window.receiveMsg = async ({ data }) => {
  877. const decoded = typeof data === "string" ? JSON.parse(data) : new Uint8Array(data);
  878. switch (decoded[0]) {
  879. case serverPackets.attackAnimation:
  880. for (let i = 1; i < decoded.length; i += 5) {
  881. const type = decoded[i]
  882. , id = decoded[i + 1] | decoded[i + 2] << 8
  883. , weapon = decoded[i + 3];
  884. let isObject = decoded[i + 4];
  885. }
  886. break;
  887. case serverPackets.playerSpawn:
  888. break
  889. case serverPackets.chooseItem:
  890. if (get.El("auto-pick").checked) kh.forEach(id => sendPacket(packets.upgrade, decoded[1].find(id2 => id === id2)));
  891. break;
  892. case serverPackets.getMyID:
  893. myPlayer.id = decoded[1];
  894. break;
  895. case serverPackets.pingUpdate:
  896. ping = decoded[1];
  897. get.El('ping-display').checked ? get.El("pingInner").innerHTML = "Ping: "+ ping + "" : get.El("pingInner").innerHTML = "";
  898. break;
  899. case serverPackets.spawn:
  900. if (!buyed && get.El("auto-buy").checked) {
  901. for (let i = 0; i < 12; i++) sendPacket(packets.hat, i);
  902. buyed = true;
  903. };
  904. break;
  905. case serverPackets.death:
  906. if (get.El("auto-respawn").checked) autoRespawnElement();
  907. break;
  908. case serverPackets.getKill:
  909. break
  910. case serverPackets.updateClan: {
  911. const array_with_ID = [...decoded.slice(2, decoded.length)];
  912. array_with_ID.splice(array_with_ID.indexOf(myPlayer.id), 1);
  913. teammates = array_with_ID;
  914. return;
  915. }
  916. case serverPackets.createClan: {
  917. const array_with_ID = [...decoded.slice(3, decoded.length)];
  918. array_with_ID.splice(array_with_ID.indexOf(myPlayer.id), 1);
  919. teammates = array_with_ID;
  920. break;
  921. }
  922. case serverPackets.clanRemove:
  923. teammates = [];
  924. break;
  925. case serverPackets.updateEntities: {
  926. for (let i = 1; i < decoded.length; i += 19) {
  927. const newEnemy = {
  928. type: decoded[i],
  929. id: decoded[i + 1],
  930. hat: decoded[i + 11],
  931. teamID: decoded[i + 12],
  932. x: decoded[i + 4] | decoded[i + 5] << 8,
  933. y: decoded[i + 6] | decoded[i + 7] << 8,
  934. index: decoded[i + 2] | decoded[i + 3] << 8,
  935. health: Math.ceil(decoded[i + 13] / 2.55),
  936. angle: decoded[i + 9] * 0.02454369260617026 - PI,
  937. broken: decoded[i + 8]
  938. }
  939. newEnemy.id === myPlayer.id && Object.assign(myPlayer, newEnemy);
  940. window.myPlayer = newEnemy;
  941.  
  942. if (newEnemy.broken & 2) {
  943. if (myPlayer.inTrap && myPlayer.inTrap.index === newEnemy.index) {
  944. myPlayer.inTrap = false;
  945. clearInterval(hatInterval);
  946. hatInterval = setInterval(() => {
  947. if (hatReloaded) {
  948. clearInterval(hatInterval);
  949. equipHat(myPlayer.prevHat);
  950. };
  951. }, 10)
  952. };
  953.  
  954. traps = traps.filter(trap => trap.index !== newEnemy.index);
  955.  
  956. } else {
  957. if (newEnemy.type === 6) {
  958. traps.push(newEnemy);
  959.  
  960. } else if (get.El("auto-break").checked && newEnemy.id === myPlayer.id && newEnemy.broken !== 16) {
  961. const trap = traps.find(trap => Math.hypot(myPlayer.x - trap.x, myPlayer.y - trap.y) <= 52 && trap.id !== myPlayer.id && !teammates.includes(trap.id));
  962.  
  963. if (trap && myPlayer.inTrap && trap.index !== myPlayer.inTrap.index) {
  964. myPlayer.inTrap = trap;
  965. };
  966.  
  967. if (!myPlayer.inTrap && trap) {
  968. myPlayer.inTrap = trap;
  969. const angle = Math.atan2(trap.y - myPlayer.y, trap.x - myPlayer.x);
  970. const prevWeapon = window.stats[Sploop.itemsID][weaponInHands];
  971. sendPacket(packets.item, 1)
  972. hit(angle);
  973. sendPacket(packets.itemByID, prevWeapon);
  974. sendPacket(packets.stopAttack);
  975. if (get.El("anti-trap").checked) {
  976. singlePlace(7, toRad(toDegree(angle) - 97));
  977. await sleep(90);
  978. singlePlace(7, toRad(toDegree(angle) + 97));
  979. await sleep(90);
  980. singlePlace(7, toRad(toDegree(angle) + 180));
  981. }
  982. };
  983.  
  984. if (myPlayer.inTrap && trap) {
  985. const angle = Math.atan2(trap.y - myPlayer.y, trap.x - myPlayer.x);
  986. if (get.El("equip-demolist").checked) equipHat(hats.demolist);
  987. const prevWeapon = window.stats[Sploop.itemsID][weaponInHands];
  988. sendPacket(packets.item, 1);
  989. hit(angle);
  990. sendPacket(packets.itemByID, prevWeapon);
  991. sendPacket(packets.stopAttack);
  992. };
  993.  
  994. if (myPlayer.inTrap && !traps.find(trap => Math.hypot(myPlayer.x - trap.x, myPlayer.y - trap.y) <= 52)) {
  995. myPlayer.inTrap = false;
  996. clearInterval(hatInterval);
  997. hatInterval = setInterval(() => {
  998. if (hatReloaded) {
  999. clearInterval(hatInterval);
  1000. if (get.El("equip-demolist-prev-hat").checked) equipHat(myPlayer.prevHat);
  1001. };
  1002. }, 10);
  1003. };
  1004. }
  1005. }
  1006. window.inTrap = myPlayer.inTrap;
  1007. }
  1008.  
  1009. if (get.El("auto-hats").checked) {
  1010. if (myPlayer.y <= 9000 && myPlayer.y >= 8000 && !myPlayer.inRiver) {
  1011. myPlayer.inRiver = true;
  1012. if (hatReloaded) {
  1013. equipHat(hats.scubaGear);
  1014. } else {
  1015. clearInterval(hatInterval);
  1016. hatInterval = setInterval(() => {
  1017. if (hatReloaded) {
  1018. clearInterval(hatInterval);
  1019. equipHat(hats.scubaGear);
  1020. };
  1021. }, 10)
  1022. };
  1023. };
  1024. if ((myPlayer.y >= 9000 || myPlayer.y <= 8000) && myPlayer.inRiver) {
  1025. myPlayer.inRiver = false;
  1026. if (hatReloaded) {
  1027. equipHat(myPlayer.prevHat);
  1028. } else {
  1029. clearInterval(hatInterval);
  1030. hatInterval = setInterval(() => {
  1031. if (hatReloaded) {
  1032. clearInterval(hatInterval);
  1033. equipHat(myPlayer.prevHat);
  1034. };
  1035. }, 10)
  1036. };
  1037. };
  1038. } else {
  1039. myPlayer.inRiver = false;
  1040. };
  1041. if (myPlayer.broken === 128 && !myPlayer.clowned && get.El("auto-hats").checked) {
  1042. myPlayer.clowned = true;
  1043. equipHat(hats.jungleGear);
  1044. setTimeout(() => {
  1045. myPlayer.clowned = false;
  1046. equipHat(myPlayer.prevHat);
  1047. }, 3000)
  1048. };
  1049. if (!myPlayer.clowned && !myPlayer.inRiver && get.El("auto-hats").checked) {
  1050. if (Math.hypot(formatEnemy.x - myPlayer.x2, formatEnemy.y - myPlayer.y2)) {
  1051. // if (myPlayer.hat != hats.crystalGear) equipHat(hats.crystalGear);
  1052. }
  1053. }
  1054. if (myPlayer.health < 100 && get.El("auto-heal").checked) {
  1055. setTimeout(() => {
  1056. placeFood();
  1057. }, window.pingTime > 100 ? 35 : 45);
  1058. };
  1059.  
  1060. break;
  1061. }
  1062. }
  1063. }
  1064.  
  1065. const encoder = new TextEncoder();
  1066. const sendMsg = (text) => {
  1067. return sendPacket(packets.chat, ...encoder.encode(text));
  1068. };
  1069. const hit = (angle) => {
  1070. const transformedAngle = 65535 * (angle + Math.PI) / (2 * Math.PI);
  1071. sendPacket(packets.hit, 255 & transformedAngle, transformedAngle >> 8 & 255);
  1072. };
  1073.  
  1074. setInterval(() => {
  1075. if (healingEffect) {
  1076. crc.drawImage(get.El("cookieSigma").src, myPlayer.x, myPlayer.y, 100, 100)
  1077. }
  1078. }, 0);
  1079.  
  1080. let placingObject = 0;
  1081. let doingInsta = false;
  1082. let autoPushing = false, pushingCounts = 0;
  1083. window.getEntityData = (entity, ctx, isTeammate) => {
  1084. const isMe = entity[Sploop.id] === myPlayer.id;
  1085. const entityX = entity[Sploop.x], entityY = entity[Sploop.y], entityAngle = entity[Sploop.angle];
  1086. if (isMe) myPlayer.currentItem = window.weapons[entity[Sploop.currentWeapon]];
  1087. if (get.El("weapon-range").checked && entity.type == 0) {
  1088. const {range: weaponRange, [Sploop.weaponName]: weaponName } = window.weapons[entity[Sploop.currentWeapon]];
  1089. crc.save();
  1090. crc.beginPath();
  1091. crc.fillStyle = get.El("weapon-range-fill").checked ? get.Val("weapon-range-color") : "rgba(0, 0, 0, 0)";
  1092. crc.strokeStyle = get.Val("weapon-range-color");
  1093. crc.shadowColor = get.El("weapon-range-shadow").checked ? get.Val("weapon-range-color") : "rgba(0, 0, 0, 0)";
  1094. crc.shadowBlur = 15;
  1095. crc.globalAlpha = 0.3;
  1096. crc.lineWidth = 3;
  1097. if (["XBow", "Bow", "Stone Musket", "Pearl"].includes(weaponName)) {
  1098. const [weaponX, weaponY] = [weaponRange * Math.cos(entityAngle), weaponRange * Math.sin(entityAngle)];
  1099. crc.moveTo(entityX, entityY);
  1100. crc.lineTo(weaponX + entityX, weaponY + entityY);
  1101. } else {
  1102. crc.arc(entityX, entityY, weaponRange, entityAngle - 1.5, entityAngle + 1.5);
  1103. }
  1104. crc.fill();
  1105. crc.stroke();
  1106. crc.closePath();
  1107. crc.restore();
  1108. }
  1109.  
  1110. const tracerAngle = (Math.atan2(myPlayer.y2 - entity[Sploop.y], myPlayer.x2 - entity[Sploop.x]) + Math.PI) % (2 * Math.PI);
  1111. const tracerDistance = Math.max(Math.hypot(entity[Sploop.y] - myPlayer.y2, entity[Sploop.x] - myPlayer.x2) / 2, 30);
  1112. const tracerx = myPlayer.x2 + tracerDistance * Math.cos(tracerAngle);
  1113. const tracery = myPlayer.y2 + tracerDistance * Math.sin(tracerAngle);
  1114. let tracerColor;
  1115. if (get.El("tracers").checked) {
  1116. if (myPlayer.id != entity[Sploop.id]) {
  1117. if (entity.type != 0) {
  1118. tracerColor = get.Val("animal-tracer-color");
  1119. } else if (entity.type == 0 && !teammates.includes(entity[Sploop.id])) {
  1120. tracerColor = get.Val("enemy-tracer-color");
  1121. } else {
  1122. tracerColor = get.Val("team-tracer-color");
  1123. }
  1124. } else {
  1125. tracerColor = "rgba(0, 0, 0, 0)";
  1126. }
  1127. } else {
  1128. tracerColor = "rgba(0, 0, 0, 0)";
  1129. }
  1130. crc.save();
  1131. crc.beginPath();
  1132. crc.translate(tracerx, tracery);
  1133. crc.rotate(Math.PI / 4);
  1134. crc.rotate(tracerAngle);
  1135. crc.globalAlpha = 1;
  1136. crc.lineCap = "round";
  1137. crc.fillStyle = tracerColor;
  1138. crc.moveTo(-10, -10);
  1139. crc.bezierCurveTo(-10, -10, 15, -15, 10, 10)
  1140. crc.lineTo(25, -25)
  1141. crc.fill();
  1142. crc.closePath();
  1143. crc.restore();
  1144.  
  1145. if (get.El("path-finder").checked) {
  1146. let distanceToPath = Math.hypot(get.Val("pos-x") - myPlayer.x2, get.Val("pos-y") - myPlayer.y2);
  1147. let angleToPath = Math.atan2(get.Val("pos-y") - myPlayer.y2, get.Val("pos-x") - myPlayer.x2);
  1148. const pathAngle = 65535 * (angleToPath + Math.PI) / (2 * Math.PI);
  1149. if (distanceToPath < 50) {
  1150. sendPacket(packets.stopMove);
  1151. } else {
  1152. sendPacket(packets.move, 255 & pathAngle, pathAngle >> 8 & 255);
  1153. }
  1154. crc.save();
  1155. crc.beginPath();
  1156. crc.lineWidth = 5;
  1157. crc.lineCap = "round";
  1158. crc.strokeStyle = "#ff0000";
  1159. crc.moveTo(myPlayer.x, myPlayer.y);
  1160. crc.lineTo(get.Val("pos-x"), get.Val("pos-y"));
  1161. crc.stroke();
  1162. crc.closePath();
  1163. crc.restore();
  1164. }
  1165.  
  1166. if (isMe) {
  1167. myPlayer.x2 = entityX;
  1168. myPlayer.y2 = entityY;
  1169. myPlayer.angle2 = entityAngle;
  1170. myPlayer.currentWeapon = entity[Sploop.currentWeapon];
  1171. } else if (!isMe && entity.type === 0 && !teammates.includes(entity[Sploop.id])) {
  1172. formatEnemy.x = entity[Sploop.x];
  1173. formatEnemy.y = entity[Sploop.y];
  1174. const distance = Math.hypot(entityX - myPlayer.x2, entityY - myPlayer.y2);
  1175. const angle = Math.atan2(entityY - myPlayer.y2, entityX - myPlayer.x2);
  1176. const angleToMe = Math.atan2(myPlayer.y - entity[Sploop.y], myPlayer.x - entity[Sploop.x]);
  1177.  
  1178. if (get.El("path-finder").checked) {
  1179.  
  1180. } else {
  1181. if (get.El("auto-push").checked && distance <= 170) {
  1182. const enemyTrapped = myTraps.find(c => myPlayer.id == c[Sploop.id] && Math.hypot(c[Sploop.y] - entity[Sploop.y], c[Sploop.x] - entity[Sploop.x]) <= 50);
  1183. if (enemyTrapped && Math.hypot(enemyTrapped[Sploop.y] - myPlayer.y, enemyTrapped[Sploop.x] - myPlayer.x) <= 250) {
  1184. const nearestSpike = mySpikes.find(c => myPlayer.id == c[Sploop.id] && Math.hypot(c[Sploop.y] - enemyTrapped[Sploop.y], c[Sploop.x] - enemyTrapped[Sploop.x]) <= 140);
  1185. if (nearestSpike) {
  1186. pushingCounts++;
  1187. autoPushing = true;
  1188. nearestSpike.x = nearestSpike[Sploop.x];
  1189. nearestSpike.y = nearestSpike[Sploop.y];
  1190. const angleToEnemy = Math.atan2(entity[Sploop.y] - nearestSpike.y, entity[Sploop.x] - nearestSpike.x)
  1191. let distance = Math.hypot(nearestSpike.x - entity[Sploop.x], nearestSpike.y - entity[Sploop.y]) + 45;
  1192. const pushPos = {
  1193. x: nearestSpike.x + (distance * Math.cos(angleToEnemy)),
  1194. y: nearestSpike.y + (distance * Math.sin(angleToEnemy))
  1195. };
  1196. const pushingCount = Math.hypot(myPlayer.x - pushPos.x, myPlayer.y - pushPos.y);
  1197. let pushingAngle;
  1198. if (pushingCount > 15) {
  1199. pushingAngle = Math.atan2(pushPos.y - myPlayer.y, pushPos.x - myPlayer.x);
  1200. } else {
  1201. pushingAngle = Math.atan2(entity[Sploop.y] - myPlayer.y, entity[Sploop.x] - myPlayer.x);
  1202. };
  1203. if (get.El("auto-push-line").checked) {
  1204. crc.save();
  1205. crc.beginPath();
  1206. crc.lineWidth = 5;
  1207. crc.lineCap = "round";
  1208. crc.strokeStyle = get.Val("auto-push-line-color");
  1209. crc.moveTo(myPlayer.x, myPlayer.y);
  1210. crc.bezierCurveTo(entity[Sploop.x], entity[Sploop.y], pushPos.x, pushPos.y, nearestSpike.x, nearestSpike.y);
  1211. crc.fillStyle = get.Val("auto-push-line-color");
  1212. crc.globalAlpha = 0.5;
  1213. crc.arc(nearestSpike.x, nearestSpike.y, 8, 0, Math.PI * 2);
  1214. crc.fill();
  1215. crc.stroke();
  1216. crc.closePath();
  1217. crc.restore();
  1218. }
  1219. const pushAngle = 65535 * (pushingAngle + Math.PI) / (2 * Math.PI);
  1220. if (distance < 40) {
  1221. sendPacket(packets.stopMove);
  1222. } else {
  1223. if (pushingCounts > 6) {
  1224. sendPacket(packets.move, 255 & pushAngle, pushAngle >> 8 & 255);
  1225. pushingCounts = 0;
  1226. }
  1227. }
  1228. };
  1229. };
  1230. }
  1231. if (doingInsta == false && get.El("auto-insta").checked && ![hats.crystalGear, hats.immunityGear].includes(entity[Sploop.hat]) && distance <= 135) {
  1232. const instaKillAngle = Math.atan2(entity[Sploop.y] - myPlayer.y2, entity[Sploop.x] - myPlayer.x2);
  1233. if (weaponReloading == false && hatReloaded) {
  1234. doingInsta = true;
  1235. singlePlace(4, instaKillAngle);
  1236. const hitAngle = 65535 * (instaKillAngle + PI) / PI2;
  1237. if (get.El("equip-berserker").checked) equipHat(hats.berserkerHat);
  1238. sendPacket(packets.item, 0);
  1239. sendPacket(packets.hit, 255 & hitAngle, hitAngle >> 8 & 255);
  1240. setTimeout(() => {
  1241. sendPacket(packets.stopAttack);
  1242. sendPacket(packets.item, weaponInHands);
  1243. setTimeout(() => {
  1244. doingInsta = false;
  1245. clearInterval(hatInterval);
  1246. hatInterval = setInterval(() => {
  1247. if (hatReloaded) {
  1248. clearInterval(hatInterval);
  1249. if (get.El("equip-berserker-prev-hat").checked) equipHat(myPlayer.prevHat);
  1250. };
  1251. }, 10);
  1252. }, 1300);
  1253. }, 55);
  1254. }
  1255. }
  1256. if (distance <= 130) {
  1257. const enemyTrapped = myTraps.find(c => Math.hypot(c[Sploop.y] - entity[Sploop.y], c[Sploop.x] - entity[Sploop.x]) <= 70);
  1258. if (enemyTrapped) {
  1259. const x = enemyTrapped[Sploop.x] - myPlayer.x;
  1260. const y = enemyTrapped[Sploop.y] - myPlayer.y;
  1261. placingObject++;
  1262. if (placingObject == 15) {
  1263. singlePlace(4, Math.atan2(y, x) + 1.3);
  1264. singlePlace(4, Math.atan2(y, x) - 1.3);
  1265. placingObject = 0;
  1266. } else if (placingObject == 7.5) {
  1267. singlePlace(4, Math.atan2(y, x) + 2.6);
  1268. singlePlace(4, Math.atan2(y, x) - 2.6);
  1269. placingObject = 0;
  1270. }
  1271. } else {
  1272. placingObject++;
  1273. if (placingObject == 15) {
  1274. singlePlace(7, angle);
  1275. placingObject = 0;
  1276. }
  1277. }
  1278. }
  1279. }
  1280. };
  1281. };
  1282.  
  1283. window.render = (ctx, shit) => {
  1284. };
  1285.  
  1286. let mySpikes = [];
  1287. let myTraps = [];
  1288. window.drawMarkers = (target, id, ctx, step) => {
  1289. const objectID = target[Sploop.id]
  1290. const isSpike = [2, 7, 17].includes(target.type);
  1291.  
  1292. if (isSpike) {
  1293. let isMySpike = myPlayer.id == objectID;
  1294. if (isMySpike && !mySpikes.find(c => c[Sploop.id2] == target[Sploop.id2])) {
  1295. mySpikes.push(target);
  1296. }
  1297. }
  1298.  
  1299. if (myTraps && target.type == 6) {
  1300. let isMyTrap = myPlayer.id == objectID;
  1301. if (isMyTrap && !myTraps.find(c => c[Sploop.id2] == target[Sploop.id2])) {
  1302. myTraps.push(target);
  1303. }
  1304. };
  1305.  
  1306. let color, strokeColor;
  1307. if (get.El("markers").checked) {
  1308. if (teammates.includes(target[Sploop.id])) {
  1309. color = get.Val("team-marker-color");
  1310. strokeColor = "#303030";
  1311. } else if (objectID === myPlayer.id) {
  1312. color = get.Val("mine-marker-color");
  1313. strokeColor = strokeColor = "#303030";
  1314. } else {
  1315. color = get.Val("enemy-marker-color");
  1316. strokeColor = strokeColor = "#303030";
  1317. }
  1318. } else {
  1319. color = "rgba(0, 0, 0, 0)";
  1320. strokeColor = "rgba(0, 0, 0, 0)";
  1321. }
  1322.  
  1323. if (![21, 30, 40, 31, 32, 33, 34, 35, 38, 39, 1, 3, 4, 5, 9].includes(target.type)) {
  1324. ctx.save();
  1325. ctx.beginPath();
  1326. ctx.strokeStyle = strokeColor;
  1327. ctx.lineWidth = 10;
  1328. ctx.arc(0, 0, 5, 0, 2 * Math.PI);
  1329. ctx.stroke();
  1330. ctx.fillStyle = color;
  1331. ctx.arc(0, 0, 5, 0, 2 * Math.PI);
  1332. ctx.fill();
  1333. ctx.closePath();
  1334. ctx.restore();
  1335. }
  1336. };
  1337.  
  1338. let weaponReloading = false;
  1339. window.attackAnimation = (type, id, weapon, isObject, entity) => {
  1340. try {
  1341. const entityID = entity[Sploop.id];
  1342. entityID == myPlayer.id && (weaponReloading = true);
  1343. setTimeout(function () {
  1344. entityID == myPlayer.id && (weaponReloading = false);
  1345. }, window.weapons[window.stats[Sploop.itemsID][weaponInHands]].reload)
  1346. } catch (err) { }
  1347. };
  1348.  
  1349. const checkChanges = (obj1, obj2) => {
  1350. const keys1 = Object.keys(obj1);
  1351. const keys2 = Object.keys(obj2);
  1352. return keys2.some(key => !keys1.includes(key)) || keys1.some(key => !keys2.includes(key));
  1353. };
  1354.  
  1355. const changeSettings = (key, value) => {
  1356. let newSettings = JSON.parse(localStorage.settings);
  1357. newSettings[key] = value;
  1358. localStorage.setItem("settings", JSON.stringify(newSettings));
  1359. };
  1360.  
  1361. const sendPacket = (packetID, ...values) => {
  1362. return myWS.send(new Uint8Array([packetID, ...values]));
  1363. }
  1364.  
  1365. let mouseAngle2;
  1366. window.addEventListener("mousemove", ({ pageX, pageY }) => {
  1367. mouseX = pageX;
  1368. mouseY = pageY;
  1369. mouseAngle = 65535 * (Math.atan2(mouseY - innerHeight / 2, mouseX - innerWidth / 2) + PI) / PI2;
  1370. mouseAngle2 = Math.atan2(mouseY - innerHeight / 2, mouseX - innerWidth / 2);
  1371. });
  1372.  
  1373. let hatInterval;
  1374. const equipHat = (id) => {
  1375. if (hatReloaded) {
  1376. hatReloaded = false;
  1377. setTimeout(() => {
  1378. hatReloaded = true;
  1379. }, 1300);
  1380. if (myPlayer.hat !== id) {
  1381. myPlayer.prevHat = myPlayer.inRiver && myPlayer.hat === hats.scubaGear ? id : myPlayer.hat;
  1382. sendPacket(packets.hat, id);
  1383. };
  1384. };
  1385. };
  1386.  
  1387. let _isKeyDown = false, _intervalId;
  1388. const checkChat = () => !get.El("chat-wrapper").style.display || get.El("chat-wrapper").style.display === "none";
  1389. let repeater = (key, action) => ({
  1390. start(keycode) {
  1391. if (keycode === key && !_isKeyDown) {
  1392. _isKeyDown = true;
  1393. _intervalId = setInterval(() => {
  1394. action();
  1395. !_isKeyDown && (clearInterval(_intervalId), _intervalId = undefined);
  1396. }, 25);
  1397. }
  1398. },
  1399. stop(keycode) {
  1400. if (keycode === key) {
  1401. _isKeyDown = false;
  1402. };
  1403. }
  1404. });
  1405.  
  1406. const changeAngle = (angle, isTransformed = false) => {
  1407. if (isTransformed) {
  1408. sendPacket(packets.angle, 255 & angle, angle >> 8 & 255);
  1409. return;
  1410. } else {
  1411. const angle2 = 65535 * (angle + Math.PI) / (2 * Math.PI);
  1412. sendPacket(packets.angle, 255 & angle2, angle2 >> 8 & 255);
  1413. }
  1414. };
  1415.  
  1416. let crc;
  1417.  
  1418. const prevRect = CanvasRenderingContext2D.prototype.clearRect;
  1419. CanvasRenderingContext2D.prototype.clearRect = function (x, y, width, height) {
  1420. if (this.canvas.id === "game-canvas") {
  1421. crc = this.canvas.getContext("2d");
  1422. }
  1423. return prevRect.apply(this, arguments);
  1424. }
  1425.  
  1426. const { fillRect } = CanvasRenderingContext2D.prototype;
  1427. CanvasRenderingContext2D.prototype.fillRect = function (x, y, width, height) {
  1428. return fillRect.apply(this, arguments);
  1429. }
  1430.  
  1431. const place = (itemID) => {
  1432. if (get.El("fast-place").checked) {
  1433. sendPacket(packets.item, weaponInHands);
  1434. sendPacket(packets.item, itemID);
  1435. sendPacket(packets.hit, 255 & mouseAngle, mouseAngle >> 8 & 255);
  1436. sendPacket(packets.stopAttack);
  1437. sendPacket(packets.item, weaponInHands);
  1438. sendPacket(packets.item, weaponInHands);
  1439. sendPacket(packets.item, itemID);
  1440. sendPacket(packets.hit, 255 & mouseAngle, mouseAngle >> 8 & 255);
  1441. sendPacket(packets.stopAttack);
  1442. sendPacket(packets.item, weaponInHands);
  1443. } else {
  1444. sendPacket(packets.item, weaponInHands);
  1445. sendPacket(packets.item, itemID);
  1446. sendPacket(packets.hit, 255 & mouseAngle, mouseAngle >> 8 & 255);
  1447. sendPacket(packets.stopAttack);
  1448. sendPacket(packets.item, weaponInHands);
  1449. }
  1450. };
  1451.  
  1452. const singlePlace = (itemID, preAngle) => {
  1453. const back = mouseAngle;
  1454. const angle = 65535 * (preAngle + Math.PI) / (2 * Math.PI);
  1455. sendPacket(packets.item, weaponInHands);
  1456. sendPacket(packets.item, itemID);
  1457. sendPacket(packets.hit, 255 & angle, angle >> 8 & 255);
  1458. changeAngle(back, true);
  1459. sendPacket(packets.stopAttack);
  1460. sendPacket(packets.item, weaponInHands);
  1461. };
  1462.  
  1463. let healingEffect = false;
  1464. const placeFood = () => {
  1465. healingEffect = true;
  1466. sendPacket(packets.item, weaponInHands);
  1467. sendPacket(packets.item, 2);
  1468. const healAngle = 65535 * (myPlayer.angle + PI) / PI2;
  1469. sendPacket(packets.hit, 255 & healAngle, healAngle >> 8 & 255);
  1470. sendPacket(packets.stopAttack);
  1471. sendPacket(packets.item, weaponInHands);
  1472. setTimeout(() => {
  1473. healingEffect = false;
  1474. }, 1500)
  1475. };
  1476.  
  1477. const placeByKey = (key, itemID) => repeater(binds[key], () => place(itemID), itemID);
  1478. const placement = {
  1479. trap: placeByKey("trap", 7),
  1480. spike: placeByKey("spike", 4),
  1481. wall: placeByKey("wall", 3),
  1482. mill: placeByKey("mill", 5),
  1483. QHold: placeByKey("QHeal", 2),
  1484. platform: placeByKey("platform", 8),
  1485. turret: placeByKey("turret", 10)
  1486. };
  1487.  
  1488. const quickPearl = () => {
  1489. sendPacket(packets.item, 1);
  1490. sendPacket(packets.hit, 255 & mouseAngle, mouseAngle >> 8 & 255);
  1491. sendPacket(packets.item, weaponInHands);
  1492. setTimeout(() => {
  1493. sendPacket(packets.stopAttack);
  1494. }, 55);
  1495. }
  1496.  
  1497. const key = {
  1498. W: false,
  1499. A: false,
  1500. S: false,
  1501. D: false,
  1502. }
  1503.  
  1504.  
  1505.  
  1506. document.addEventListener("keydown", event => {
  1507. if (event.repeat || !checkChat()) return;
  1508. const pressedKey = event.code;
  1509. if (get.El("placement-macro").checked) {
  1510. if (Object.values(binds).includes(pressedKey)) Object.values(placement).forEach(action => action.start(pressedKey));
  1511. }
  1512.  
  1513. switch (pressedKey) {
  1514. case "Digit1": weaponInHands = 0; break;
  1515. case "Digit2": weaponInHands = 1; break;
  1516. case "KeyW": (key.W = true, "changeColor"); break;
  1517. case "KeyA": (key.A = true, "changeColor"); break;
  1518. case "KeyS": (key.S = true, "changeColor"); break;
  1519. case "KeyD": (key.D = true, "changeColor"); break;
  1520. case binds.pearl: if (get.El("quick-pearl").checked) quickPearl(); break;
  1521. };
  1522.  
  1523. for (const [key, value] of Object.entries(binds)) (pressedKey === value && hats[key] && get.El("hat-macro").checked) ? equipHat(hats[key]) : '';
  1524.  
  1525. });
  1526.  
  1527. document.addEventListener("keyup", event => {
  1528. if (!checkChat()) return;
  1529. const pressedKey = event.code;
  1530. if (Object.values(binds).includes(pressedKey)) Object.values(placement).forEach(action => action.stop(pressedKey));
  1531. switch (pressedKey) {
  1532. case "KeyW": (key.W = false, "changeColorBack"); break;
  1533. case "KeyA": (key.A = false, "changeColorBack"); break;
  1534. case "KeyS": (key.S = false, "changeColorBack"); break;
  1535. case "KeyD": (key.D = false, "changeColorBack"); break;
  1536. }
  1537. });
  1538.  
  1539. const TYPEOF = value => Object.prototype.toString.call(value).slice(8, -1).toLowerCase();
  1540. const NumberSystem = [
  1541. { radix: 2, prefix: "0b0*" },
  1542. { radix: 8, prefix: "0+" },
  1543. { radix: 10, prefix: "" },
  1544. { radix: 16, prefix: "0x0*" }
  1545. ];
  1546. class Regex {
  1547. constructor(code, unicode) {
  1548. this.code = this.COPY_CODE = code;
  1549. this.unicode = unicode || false;
  1550. this.hooks = {};
  1551. }
  1552.  
  1553. static parseValue = value => {
  1554. try { return Function(`return (${value})`)(); }
  1555. catch (err) { return null; }
  1556. };
  1557.  
  1558. isRegexp = value => TYPEOF(value) === "regexp";
  1559.  
  1560. generateNumberSystem = int => `(?:${NumberSystem.map(({ prefix, radix }) => prefix + int.toString(radix)).join("|")})`;
  1561.  
  1562. parseVariables = regex => regex.replace(/\{VAR\}/g, "(?:let|var|const)")
  1563. .replace(/\{QUOTE\}/g, "['\"`]")
  1564. .replace(/ARGS\{(\d+)\}/g, (_, count) => (Array(Number(count)).fill("\\w+")).join("\\s*,\\s*"))
  1565. .replace(/NUMBER\{(\d+)\}/g, (_, int) => this.generateNumberSystem(Number(int)));
  1566.  
  1567. format = (name, inputRegex, flags) => {
  1568. const regex = Array.isArray(inputRegex) ? inputRegex.map(exp => this.isRegexp(exp) ? exp.source : exp).join("\\s*") : this.isRegexp(inputRegex) ? inputRegex.source : "";
  1569. let parsedRegex = this.parseVariables(regex);
  1570.  
  1571. if (this.unicode) {
  1572. parsedRegex = parsedRegex.replace(/\\w/g, "(?:[^\\x00-\\x7F-]|\\$|\\w)");
  1573. }
  1574.  
  1575. const expression = new RegExp(parsedRegex.replace(/\{INSERT\}/, ""), flags);
  1576. return parsedRegex.includes("{INSERT}") ? new RegExp(parsedRegex, flags) : expression;
  1577. };
  1578.  
  1579. template = (type, name, regex, substr) => {
  1580. const expression = new RegExp(`(${this.format(name, regex).source})`);
  1581. const match = this.code.match(expression) || [];
  1582. this.code = this.code.replace(expression, type === 0 ? "$1" + substr : substr + "$1");
  1583. return match;
  1584. };
  1585.  
  1586. match = (name, regex, flags, debug = false) => {
  1587. const expression = this.format(name, regex, flags);
  1588. const match = this.code.match(expression) || [];
  1589. this.hooks[name] = { expression, match };
  1590. return match;
  1591. };
  1592.  
  1593. matchAll = (name, regex, debug = false) => {
  1594. const expression = this.format(name, regex, "g");
  1595. const matches = [...this.code.matchAll(expression)];
  1596. this.hooks[name] = { expression, match: matches };
  1597. return matches;
  1598. };
  1599.  
  1600. replace = (name, regex, substr, flags) => {
  1601. const expression = this.format(name, regex, flags);
  1602. this.code = this.code.replace(expression, substr);
  1603. return this.code.match(expression) || [];
  1604. };
  1605.  
  1606. replaceAll = (name, regex, substr, flags) => {
  1607. const expression = this.format(name, regex, "g");
  1608. this.code = this.code.replaceAll(expression, substr);
  1609. return this.code.match(expression) || [];
  1610. };
  1611.  
  1612. append = (name, regex, substr) => this.template(0, name, regex, substr);
  1613.  
  1614. prepend = (name, regex, substr) => this.template(1, name, regex, substr);
  1615.  
  1616. insert = (name, regex, substr) => {
  1617. const { source } = this.format(name, regex);
  1618. if (!source.includes("{INSERT}")) throw new Error("Your regexp must contain {INSERT} keyword");
  1619. const findExpression = new RegExp(source.replace(/^(.*)\{INSERT\}(.*)$/, "($1)($2)"));
  1620. this.code = this.code.replace(findExpression, `$1${substr}$2`);
  1621. return this.code.match(findExpression);
  1622. };
  1623. };
  1624. let smoothCamVal = 45;
  1625. let Sploop;
  1626. const applyHooks = code => {
  1627. const Hook = new Regex(code, true);
  1628. window.COPY_CODE = (Hook.COPY_CODE.match(/^(\(function \w+\(\w+\)\{.+)\(.+?\);$/) || [])[1];
  1629. Hook.append("EXTERNAL fix", /\(function (\w+)\(\w+\)\{/, "let $2 = eval(`(() => ${COPY_CODE})()`);delete window.COPY_CODE;console.log(1);");
  1630. const myData = Hook.match('myPlayer', /=(\w.get\(\w{2}\));\w&&\w\(\)/)[1];
  1631. const X = Hook.match('playerX', /\{this\.(\w{2})=\w\|\|0/)[1];
  1632. const Y = Hook.match('playerY', /,this\.(\w{2})=\w\|\|0\}/)[1];
  1633. const ID = Hook.match('ID', /&&\w{2}===\w\.(\w{2})\){/)[1];
  1634. const ID2 = Hook.match('ID2', /-1!==\w+\.(\w+)&&/)[1];
  1635. const currentWeapon = Hook.match("crntWeapon", /,\w.(\w{2})===/)[1];
  1636. const angle = Hook.match("angle", /;\w.(\w{2})=\w\(\)/)[1];
  1637. const weaponName = Hook.match("wpnName", /(\w{2}):"XX/)[1];
  1638. const health = Hook.match("health", /(\w{2})<<8;/)[1];
  1639. const weaponDamage = Hook.match("wpnDamage", /(\w{2}):32,reload:300/)[1];
  1640. const teamID = Hook.match('test', /,\w=\w.(\w{2})\|.+?\<\<8/)[1];
  1641. const radius = Hook.match("radius", /(\w{2}):220/)[1];
  1642. const [, currentItem, hat] = Hook.match("hat", /\(\w+\.(\w+)\|\w+\.(\w+)<<NUMBER{8}\)/);
  1643. const inWhichObject = Hook.match("iwo", /110\).+?,1===\w.(\w{2})&&!\w{2}/)[1];
  1644. const weaponID = Hook.match('el', /(\w{2}):0,\w{2}:22,reload:150/)[1];
  1645. const itemsID = Hook.match("IDs", />1\){.{3}(\w{2})/)[1];
  1646. const objQuantity = Hook.match("Quantity", /\),this.(\w{2})=\w\):/)[1];
  1647. Sploop = {
  1648. myPlayer: {
  1649. myData: myData,
  1650. x: `${myData}.${X}`,
  1651. y: `${myData}.${Y}`,
  1652. id: `${myData}.${ID}`,
  1653. teamID: `${myData}.${teamID}`,
  1654. angle: `${myData}.${angle}`
  1655. },
  1656. x: X,
  1657. y: Y,
  1658. id: ID,
  1659. id2: ID2,
  1660. hat: hat,
  1661. type: 'type',
  1662. angle: angle,
  1663. health: health,
  1664. radius: radius,
  1665. teamID: teamID,
  1666. itemsID: itemsID,
  1667. weaponID: weaponID,
  1668. weaponName: weaponName,
  1669. objQuantity: objQuantity,
  1670. weaponDamage: weaponDamage,
  1671. currentWeapon: currentWeapon,
  1672. inWhichObject: inWhichObject
  1673. };
  1674. Hook.replace("animTextTime", /this.(\w{2})=400/, `this.$1=400`);
  1675. Hook.replace("smoothCam", /\w{4}.\w{3}\(.[0-9]{2}\*/, `Math.min(.00${smoothCamVal}*`);
  1676. Hook.replace("blockMouse", /\|\|(\w+\(\w+\(\)\)\))/, `||!window.inTrap && $1;`);
  1677. Hook.append("renderer", /1}function \w+\((\w),(\w)\){/, `window.render($2, $3);`);
  1678. Hook.append("updateFPS", /const (\w)=\+new Date,.+?3;/, `window.updateFPSCounter($2);`);
  1679. Hook.replace("renderItems", /(\(\w+\.\w+\+\w+,\w+\.\w+\+\w+\).+?\w+\(\).+?\w+\.\w+\.\w+\)([,;]))/, `$1window.drawMarkers(...arguments)$2`);
  1680. const args = Hook.match("drawEntityInfo", /-NUMBER{50},.+?function \w+\((ARGS{3})\)\{/)[1];
  1681. Hook.append('drawEntityInfo', /=.5;/, `try {window.getEntityData(${args});} catch(err) {};`)
  1682. Hook.append("getMsg", /0;fu.{10}(\w).{2}/, `window.receiveMsg($2);`);
  1683. Hook.append("getWS", /(\w{2})=new \w{2}\("".{31}/, `,window.getWS($2)`);
  1684. // Hook.replace('showIDs', /((\w).\w{2};const \w=\w.\w{2}\|\|\(\w.\w{2}=\w\(\).\w{2}\()(\w).(\w{2})/, `$1 "{" + $2.${Sploop.id} + "} " + $3.$4 `);
  1685. const weaponList = Hook.match("weaponList", /\?Math\.PI\/2.+?(\w\(\))/)[1];
  1686. Hook.replace("defaultData", /(\W\w+>NUMBER{1}\W.+?(\w+)\.(\w+).+?)function/, `$1window.stats=$2;window.weapons = ${weaponList};window.sprites = tt();function`);
  1687. Hook.append('attackReload', /\+=NUMBER{5}.+?(\w+)=.+?(\w+)=.+?(\w+)=.+?(\w+)=.+?(\w+)=.+?;/, `window.attackAnimation($2, $3, $4, $5, $6);`)
  1688.  
  1689. return Hook.code;
  1690. };
  1691.  
  1692. window.eval = new Proxy(window.eval, {
  1693. apply(target, _this, args) {
  1694. const code = args[0];
  1695. if (code.length > 100000) {
  1696. args[0] = applyHooks(code);
  1697. window.eval = target;
  1698. }
  1699. return target.apply(_this, args);
  1700. }
  1701. });
  1702.  
  1703. window.addEventListener("DOMContentLoaded", () => {
  1704. document.addEventListener("keydown", (event) => {
  1705. if (event.code === "ShiftRight") {
  1706. const menuItems = document.querySelectorAll(".menu-items");
  1707. menuItems.forEach((item) => {
  1708. item.classList.toggle("hidden");
  1709. });
  1710. }
  1711. });
  1712.  
  1713. let { fillText, fillRect } = CanvasRenderingContext2D.prototype;
  1714.  
  1715. CanvasRenderingContext2D.prototype.fillText = function(x, y, width, height) {
  1716. if (get.El("homepage").style.display == "none") {
  1717. if (this.fillStyle != "#8ecc51") {
  1718. if ((this.strokeStyle === "#000" || this.strokeStyle === "#000000") && this.font === "45px \"Baloo Paaji\"" && get.El("hide-dmg-text").checked) {
  1719. return
  1720. }
  1721. } else {
  1722. if ((this.strokeStyle === "#000" || this.strokeStyle === "#000000") && this.font === "45px \"Baloo Paaji\"" && get.El("hide-heal-text").checked) {
  1723. return
  1724. }
  1725. }
  1726. }
  1727. return fillText.apply(this, arguments)
  1728. }
  1729.  
  1730. CanvasRenderingContext2D.prototype.fillRect = function(x, y, width, height) {
  1731. if (get.El("homepage").style.display == "none") {
  1732. if (this.fillStyle == "#a4cc4f") {
  1733. this.fillStyle = get.Val("team-mine-health-bar-color");
  1734. } else if (this.fillStyle == "#cc5151") {
  1735. this.fillStyle = get.Val("enemy-animal-health-bar-color");
  1736. }
  1737. }
  1738. return fillRect.apply(this, arguments)
  1739. }
  1740. });