Advertisement
Guest User

Untitled

a guest
Aug 27th, 2019
2,206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 72.50 KB | None | 0 0
  1. // ==UserScript==
  2. // @name BHARATHI Mod: MooMoo.io Hack fast and better. Auto heal, Hat change, etc...
  3. // @namespace -
  4. // @version 1.3
  5. // @description MooMoo.io Hack made by BHARATHI Tutorials now works for every MooMoo.io and Hat change fixed.
  6. // @author BHARATHI Tutorials
  7. // @match *://moomoo.io/*
  8. // @match http://dev.moomoo.io/*
  9. // @match *sandbox.moomoo.io/*
  10. // @match *expermental.moomoo.io/*
  11. // @grant none
  12. // @require https://greasyfork.org/scripts/368273-msgpack/code/msgpack.js?version=598723
  13. // @require http://code.jquery.com/jquery-3.3.1.min.js
  14. // @require https://code.jquery.com/ui/1.12.0/jquery-ui.min.js
  15. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.js
  16.  
  17. // @downloadURL none
  18. // ==/UserScript==
  19.  
  20. //Neat cursor: credit to BHARATHI Tutorials
  21. $("#gameCanvas").css('cursor', 'url(http://cur.cursors-4u.net/user/use-1/use153.cur), default');
  22. $("#consentBlock").css({display: "none"});
  23. var autoHealSpeed = 150; //Bigger number = SLOWER autoheal; fastest is 0.
  24. var DEFAULT_HAT = 7;
  25. var DEFAULT_WINGS = 18;
  26. var instaKillKey = 114;
  27. var spikeKey = 118;
  28. var trapKey = 102;
  29. var removeMonkeyTail = true;
  30. var askMeAgain = true; //set this to false if the user doesnt want to be asked about hat switching again
  31.  
  32. var allTraps = [];
  33. var CORESTATE = {
  34. inwater: {active: false},
  35. nearenemy: {active: false},
  36. intrap: {active: false},
  37. ipress: {active: false},
  38. };
  39.  
  40. try {
  41. document.getElementById("moomooio_728x90_home").style.display = "none"; //Remove sidney's ads
  42. $("#moomooio_728x90_home").parent().css({display: "none"});
  43. } catch (e) {
  44. console.log("error removing ad");
  45. }
  46.  
  47. window.onbeforeunload = null;
  48.  
  49. if (window.localStorage.force != "false" && window.localStorage.force){
  50. console.log(window.localStorage.force);
  51. document.getElementsByClassName("menuHeader")[0].innerHTML = `Servers <span style="color: red;">Force (${window.localStorage.force})</span>`;
  52. }
  53.  
  54.  
  55. var oldAlert = alert;
  56. alert = function(){
  57. $.alert({title: "Full Server!",
  58. content: "This server is full! Would you like to force connect?",
  59. useBootstrap: false,
  60. buttons: {
  61. Back: () => { window.onbeforeunload = null; window.location = "http://moomoo.io"; },
  62. Yes: () => {
  63. let coreURL = new URL(window.location.href);
  64. let server = coreURL.searchParams.get("server");
  65. window.localStorage.force = server;
  66. window.location = `http://moomoo.io`;
  67. },
  68. }
  69. });
  70. }
  71.  
  72.  
  73. class ForceSocket extends WebSocket {
  74. constructor(...args){
  75. if (window.localStorage.force != "false" && window.localStorage.force){
  76. let server = window.localStorage.force;
  77. window.localStorage.force = false;
  78. let sip = "";
  79. for (let gameServer of window.vultr.servers){
  80. if (`${gameServer.region}:${gameServer.index}:0` == server){
  81. sip = gameServer.ip;
  82. }
  83. }
  84. args[0] = `wss://ip_${sip}.moomoo.io:8008/?gameIndex=0`;
  85. }
  86. super(...args);
  87. }
  88.  
  89.  
  90. }
  91.  
  92. WebSocket = ForceSocket;
  93.  
  94.  
  95. window.admob = {
  96. requestInterstitialAd: ()=>{},
  97. showInterstitialAd: ()=>{}
  98. }
  99.  
  100.  
  101. var accessories = [{
  102. id: 12,
  103. name: "Snowball",
  104. price: 1e3,
  105. scale: 105,
  106. xOff: 18,
  107. desc: "no effect"
  108. }, {
  109. id: 9,
  110. name: "Tree Cape",
  111. price: 1e3,
  112. scale: 90,
  113. desc: "no effect"
  114. }, {
  115. id: 10,
  116. name: "Stone Cape",
  117. price: 1e3,
  118. scale: 90,
  119. desc: "no effect"
  120. }, {
  121. id: 3,
  122. name: "Cookie Cape",
  123. price: 1500,
  124. scale: 90,
  125. desc: "no effect"
  126. }, {
  127. id: 8,
  128. name: "Cow Cape",
  129. price: 2e3,
  130. scale: 90,
  131. desc: "no effect"
  132. }, {
  133. id: 11,
  134. name: "Monkey Tail",
  135. price: 2e3,
  136. scale: 97,
  137. xOff: 25,
  138. desc: "Super speed but reduced damage",
  139. spdMult: 1.35,
  140. dmgMultO: .2
  141. }, {
  142. id: 17,
  143. name: "Apple Basket",
  144. price: 3e3,
  145. scale: 80,
  146. xOff: 12,
  147. desc: "slowly regenerates health over time",
  148. healthRegen: 1
  149. }, {
  150. id: 6,
  151. name: "Winter Cape",
  152. price: 3e3,
  153. scale: 90,
  154. desc: "no effect"
  155. }, {
  156. id: 4,
  157. name: "Skull Cape",
  158. price: 4e3,
  159. scale: 90,
  160. desc: "no effect"
  161. }, {
  162. id: 5,
  163. name: "Dash Cape",
  164. price: 5e3,
  165. scale: 90,
  166. desc: "no effect"
  167. }, {
  168. id: 2,
  169. name: "Dragon Cape",
  170. price: 6e3,
  171. scale: 90,
  172. desc: "no effect"
  173. }, {
  174. id: 1,
  175. name: "Super Cape",
  176. price: 8e3,
  177. scale: 90,
  178. desc: "no effect"
  179. }, {
  180. id: 7,
  181. name: "Troll Cape",
  182. price: 8e3,
  183. scale: 90,
  184. desc: "no effect"
  185. }, {
  186. id: 14,
  187. name: "Thorns",
  188. price: 1e4,
  189. scale: 115,
  190. xOff: 20,
  191. desc: "no effect"
  192. }, {
  193. id: 15,
  194. name: "Blockades",
  195. price: 1e4,
  196. scale: 95,
  197. xOff: 15,
  198. desc: "no effect"
  199. }, {
  200. id: 20,
  201. name: "Devils Tail",
  202. price: 1e4,
  203. scale: 95,
  204. xOff: 20,
  205. desc: "no effect"
  206. }, {
  207. id: 16,
  208. name: "Sawblade",
  209. price: 12e3,
  210. scale: 90,
  211. spin: !0,
  212. xOff: 0,
  213. desc: "deal damage to players that damage you",
  214. dmg: .15
  215. }, {
  216. id: 13,
  217. name: "Angel Wings",
  218. price: 15e3,
  219. scale: 138,
  220. xOff: 22,
  221. desc: "slowly regenerates health over time",
  222. healthRegen: 3
  223. }, {
  224. id: 19,
  225. name: "Shadow Wings",
  226. price: 15e3,
  227. scale: 138,
  228. xOff: 22,
  229. desc: "increased movement speed",
  230. spdMult: 1.1
  231. }, {
  232. id: 18,
  233. name: "Blood Wings",
  234. price: 2e4,
  235. scale: 178,
  236. xOff: 26,
  237. desc: "restores health when you deal damage",
  238. healD: .2
  239. }, {
  240. id: 21,
  241. name: "Corrupt X Wings",
  242. price: 2e4,
  243. scale: 178,
  244. xOff: 26,
  245. desc: "deal damage to players that damage you",
  246. dmg: .25
  247. }]
  248.  
  249.  
  250. var hats = hats = [{
  251. id: 45,
  252. name: "Shame!",
  253. dontSell: !0,
  254. price: 0,
  255. scale: 120,
  256. desc: "hacks are for losers"
  257. }, {
  258. id: 51,
  259. name: "Moo Cap",
  260. price: 0,
  261. scale: 120,
  262. desc: "coolest mooer around"
  263. }, {
  264. id: 50,
  265. name: "Apple Cap",
  266. price: 0,
  267. scale: 120,
  268. desc: "apple farms remembers"
  269. }, {
  270. id: 28,
  271. name: "Moo Head",
  272. price: 0,
  273. scale: 120,
  274. desc: "no effect"
  275. }, {
  276. id: 29,
  277. name: "Pig Head",
  278. price: 0,
  279. scale: 120,
  280. desc: "no effect"
  281. }, {
  282. id: 30,
  283. name: "Fluff Head",
  284. price: 0,
  285. scale: 120,
  286. desc: "no effect"
  287. }, {
  288. id: 36,
  289. name: "Pandou Head",
  290. price: 0,
  291. scale: 120,
  292. desc: "no effect"
  293. }, {
  294. id: 37,
  295. name: "Bear Head",
  296. price: 0,
  297. scale: 120,
  298. desc: "no effect"
  299. }, {
  300. id: 38,
  301. name: "Monkey Head",
  302. price: 0,
  303. scale: 120,
  304. desc: "no effect"
  305. }, {
  306. id: 44,
  307. name: "Polar Head",
  308. price: 0,
  309. scale: 120,
  310. desc: "no effect"
  311. }, {
  312. id: 35,
  313. name: "Fez Hat",
  314. price: 0,
  315. scale: 120,
  316. desc: "no effect"
  317. }, {
  318. id: 42,
  319. name: "Enigma Hat",
  320. price: 0,
  321. scale: 120,
  322. desc: "join the enigma army"
  323. }, {
  324. id: 43,
  325. name: "Blitz Hat",
  326. price: 0,
  327. scale: 120,
  328. desc: "hey everybody i'm blitz"
  329. }, {
  330. id: 49,
  331. name: "Bob XIII Hat",
  332. price: 0,
  333. scale: 120,
  334. desc: "like and subscribe"
  335. }, {
  336. id: 8,
  337. name: "Bummle Hat",
  338. price: 100,
  339. scale: 120,
  340. desc: "no effect"
  341. }, {
  342. id: 2,
  343. name: "Straw Hat",
  344. price: 500,
  345. scale: 120,
  346. desc: "no effect"
  347. }, {
  348. id: 15,
  349. name: "Winter Cap",
  350. price: 600,
  351. scale: 120,
  352. desc: "allows you to move at normal speed in snow",
  353. coldM: 1
  354. }, {
  355. id: 5,
  356. name: "Cowboy Hat",
  357. price: 1e3,
  358. scale: 120,
  359. desc: "no effect"
  360. }, {
  361. id: 4,
  362. name: "Ranger Hat",
  363. price: 2e3,
  364. scale: 120,
  365. desc: "no effect"
  366. }, {
  367. id: 18,
  368. name: "Explorer Hat",
  369. price: 2e3,
  370. scale: 120,
  371. desc: "no effect"
  372. }, {
  373. id: 31,
  374. name: "Flipper Hat",
  375. price: 2500,
  376. scale: 120,
  377. desc: "have more control while in water",
  378. watrImm: !0
  379. }, {
  380. id: 1,
  381. name: "Marksman Cap",
  382. price: 3e3,
  383. scale: 120,
  384. desc: "increases arrow speed and range",
  385. aMlt: 1.3
  386. }, {
  387. id: 10,
  388. name: "Bush Gear",
  389. price: 3e3,
  390. scale: 160,
  391. desc: "allows you to disguise yourself as a bush"
  392. }, {
  393. id: 48,
  394. name: "Halo",
  395. price: 3e3,
  396. scale: 120,
  397. desc: "no effect"
  398. }, {
  399. id: 6,
  400. name: "Soldier Helmet",
  401. price: 4e3,
  402. scale: 120,
  403. desc: "reduces damage taken but slows movement",
  404. spdMult: .94,
  405. dmgMult: .75
  406. }, {
  407. id: 23,
  408. name: "Anti Venom Gear",
  409. price: 4e3,
  410. scale: 120,
  411. desc: "makes you immune to poison",
  412. poisonRes: 1
  413. }, {
  414. id: 13,
  415. name: "Medic Gear",
  416. price: 5e3,
  417. scale: 110,
  418. desc: "slowly regenerates health over time",
  419. healthRegen: 3
  420. }, {
  421. id: 9,
  422. name: "Miners Helmet",
  423. price: 5e3,
  424. scale: 120,
  425. desc: "earn 1 extra gold per resource",
  426. extraGold: 1
  427. }, {
  428. id: 32,
  429. name: "Musketeer Hat",
  430. price: 5e3,
  431. scale: 120,
  432. desc: "reduces cost of projectiles",
  433. projCost: .5
  434. }, {
  435. id: 7,
  436. name: "Bull Helmet",
  437. price: 6e3,
  438. scale: 120,
  439. desc: "increases damage done but drains health",
  440. healthRegen: -5,
  441. dmgMultO: 1.5,
  442. spdMult: .96
  443. }, {
  444. id: 22,
  445. name: "Emp Helmet",
  446. price: 6e3,
  447. scale: 120,
  448. desc: "turrets won't attack but you move slower",
  449. antiTurret: 1,
  450. spdMult: .7
  451. }, {
  452. id: 12,
  453. name: "Booster Hat",
  454. price: 6e3,
  455. scale: 120,
  456. desc: "increases your movement speed",
  457. spdMult: 1.16
  458. }, {
  459. id: 26,
  460. name: "Barbarian Armor",
  461. price: 8e3,
  462. scale: 120,
  463. desc: "knocks back enemies that attack you",
  464. dmgK: .6
  465. }, {
  466. id: 21,
  467. name: "Plague Mask",
  468. price: 1e4,
  469. scale: 120,
  470. desc: "melee attacks deal poison damage",
  471. poisonDmg: 5,
  472. poisonTime: 6
  473. }, {
  474. id: 46,
  475. name: "Bull Mask",
  476. price: 1e4,
  477. scale: 120,
  478. desc: "bulls won't target you unless you attack them",
  479. bullRepel: 1
  480. }, {
  481. id: 14,
  482. name: "Windmill Hat",
  483. topSprite: !0,
  484. price: 1e4,
  485. scale: 120,
  486. desc: "generates points while worn",
  487. pps: 1.5
  488. }, {
  489. id: 11,
  490. name: "Spike Gear",
  491. topSprite: !0,
  492. price: 1e4,
  493. scale: 120,
  494. desc: "deal damage to players that damage you",
  495. dmg: .45
  496. }, {
  497. id: 53,
  498. name: "Turret Gear",
  499. topSprite: !0,
  500. price: 1e4,
  501. scale: 120,
  502. desc: "you become a walking turret",
  503. turret: {
  504. proj: 1,
  505. range: 700,
  506. rate: 2500
  507. },
  508. spdMult: .5
  509. }, {
  510. id: 20,
  511. name: "Samurai Armor",
  512. price: 12e3,
  513. scale: 120,
  514. desc: "increased attack speed and fire rate",
  515. atkSpd: .78
  516. }, {
  517. id: 16,
  518. name: "Bushido Armor",
  519. price: 12e3,
  520. scale: 120,
  521. desc: "restores health when you deal damage",
  522. healD: .4
  523. }, {
  524. id: 27,
  525. name: "Scavenger Gear",
  526. price: 15e3,
  527. scale: 120,
  528. desc: "earn double points for each kill",
  529. kScrM: 2
  530. }, {
  531. id: 40,
  532. name: "Tank Gear",
  533. price: 15e3,
  534. scale: 120,
  535. desc: "increased damage to buildings but slower movement",
  536. spdMult: .3,
  537. bDmg: 3.3
  538. }, {
  539. id: 52,
  540. name: "Thief Gear",
  541. price: 15e3,
  542. scale: 120,
  543. desc: "steal half of a players gold when you kill them",
  544. goldSteal: .5
  545. }]
  546.  
  547.  
  548. var objects = [{
  549. id: 0,
  550. name: "food",
  551. layer: 0
  552. }, {
  553. id: 1,
  554. name: "walls",
  555. place: !0,
  556. limit: 30,
  557. layer: 0
  558. }, {
  559. id: 2,
  560. name: "spikes",
  561. place: !0,
  562. limit: 15,
  563. layer: 0
  564. }, {
  565. id: 3,
  566. name: "mill",
  567. place: !0,
  568. limit: 7,
  569. layer: 1
  570. }, {
  571. id: 4,
  572. name: "mine",
  573. place: !0,
  574. limit: 1,
  575. layer: 0
  576. }, {
  577. id: 5,
  578. name: "trap",
  579. place: !0,
  580. limit: 6,
  581. layer: -1
  582. }, {
  583. id: 6,
  584. name: "booster",
  585. place: !0,
  586. limit: 12,
  587. layer: -1
  588. }, {
  589. id: 7,
  590. name: "turret",
  591. place: !0,
  592. limit: 2,
  593. layer: 1
  594. }, {
  595. id: 8,
  596. name: "watchtower",
  597. place: !0,
  598. limit: 12,
  599. layer: 1
  600. }, {
  601. id: 9,
  602. name: "buff",
  603. place: !0,
  604. limit: 4,
  605. layer: -1
  606. }, {
  607. id: 10,
  608. name: "spawn",
  609. place: !0,
  610. limit: 1,
  611. layer: -1
  612. }, {
  613. id: 11,
  614. name: "sapling",
  615. place: !0,
  616. limit: 2,
  617. layer: 0
  618. }, {
  619. id: 12,
  620. name: "blocker",
  621. place: !0,
  622. limit: 3,
  623. layer: -1
  624. }, {
  625. id: 13,
  626. name: "teleporter",
  627. place: !0,
  628. limit: 1,
  629. layer: -1
  630. }]
  631.  
  632. var weapons = [{
  633. id: 0,
  634. type: 0,
  635. name: "tool hammer",
  636. desc: "tool for gathering all resources",
  637. src: "hammer_1",
  638. length: 140,
  639. width: 140,
  640. xOff: -3,
  641. yOff: 18,
  642. dmg: 25,
  643. range: 65,
  644. gather: 1,
  645. speed: 300
  646. }, {
  647. id: 1,
  648. type: 0,
  649. age: 2,
  650. name: "hand axe",
  651. desc: "gathers resources at a higher rate",
  652. src: "axe_1",
  653. length: 140,
  654. width: 140,
  655. xOff: 3,
  656. yOff: 24,
  657. dmg: 30,
  658. spdMult: 1,
  659. range: 70,
  660. gather: 2,
  661. speed: 400
  662. }, {
  663. id: 2,
  664. type: 0,
  665. age: 8,
  666. pre: 1,
  667. name: "great axe",
  668. desc: "deal more damage and gather more resources",
  669. src: "great_axe_1",
  670. length: 140,
  671. width: 140,
  672. xOff: -8,
  673. yOff: 25,
  674. dmg: 35,
  675. spdMult: 1,
  676. range: 75,
  677. gather: 4,
  678. speed: 400
  679. }, {
  680. id: 3,
  681. type: 0,
  682. age: 2,
  683. name: "short sword",
  684. desc: "increased attack power but slower move speed",
  685. src: "sword_1",
  686. iPad: 1.3,
  687. length: 130,
  688. width: 210,
  689. xOff: -8,
  690. yOff: 46,
  691. dmg: 35,
  692. spdMult: .85,
  693. range: 110,
  694. gather: 1,
  695. speed: 300
  696. }, {
  697. id: 4,
  698. type: 0,
  699. age: 8,
  700. pre: 3,
  701. name: "katana",
  702. desc: "greater range and damage",
  703. src: "samurai_1",
  704. iPad: 1.3,
  705. length: 130,
  706. width: 210,
  707. xOff: -8,
  708. yOff: 59,
  709. dmg: 40,
  710. spdMult: .8,
  711. range: 118,
  712. gather: 1,
  713. speed: 300
  714. }, {
  715. id: 5,
  716. type: 0,
  717. age: 2,
  718. name: "polearm",
  719. desc: "long range melee weapon",
  720. src: "spear_1",
  721. iPad: 1.3,
  722. length: 130,
  723. width: 210,
  724. xOff: -8,
  725. yOff: 53,
  726. dmg: 45,
  727. knock: .2,
  728. spdMult: .82,
  729. range: 142,
  730. gather: 1,
  731. speed: 700
  732. }, {
  733. id: 6,
  734. type: 0,
  735. age: 2,
  736. name: "bat",
  737. desc: "fast long range melee weapon",
  738. src: "bat_1",
  739. iPad: 1.3,
  740. length: 110,
  741. width: 180,
  742. xOff: -8,
  743. yOff: 53,
  744. dmg: 20,
  745. knock: .7,
  746. range: 110,
  747. gather: 1,
  748. speed: 300
  749. }, {
  750. id: 7,
  751. type: 0,
  752. age: 2,
  753. name: "daggers",
  754. desc: "really fast short range weapon",
  755. src: "dagger_1",
  756. iPad: .8,
  757. length: 110,
  758. width: 110,
  759. xOff: 18,
  760. yOff: 0,
  761. dmg: 20,
  762. knock: .1,
  763. range: 65,
  764. gather: 1,
  765. hitSlow: .1,
  766. spdMult: 1.13,
  767. speed: 100
  768. }, {
  769. id: 8,
  770. type: 0,
  771. age: 2,
  772. name: "stick",
  773. desc: "great for gathering but very weak",
  774. src: "stick_1",
  775. length: 140,
  776. width: 140,
  777. xOff: 3,
  778. yOff: 24,
  779. dmg: 1,
  780. spdMult: 1,
  781. range: 70,
  782. gather: 7,
  783. speed: 400
  784. }, {
  785. id: 9,
  786. type: 1,
  787. age: 6,
  788. name: "hunting bow",
  789. desc: "bow used for ranged combat and hunting",
  790. src: "bow_1",
  791. req: ["wood", 4],
  792. length: 120,
  793. width: 120,
  794. xOff: -6,
  795. yOff: 0,
  796. projectile: 0,
  797. spdMult: .75,
  798. speed: 600
  799. }, {
  800. id: 10,
  801. type: 1,
  802. age: 6,
  803. name: "great hammer",
  804. desc: "hammer used for destroying structures",
  805. src: "great_hammer_1",
  806. length: 140,
  807. width: 140,
  808. xOff: -9,
  809. yOff: 25,
  810. dmg: 10,
  811. spdMult: .88,
  812. range: 75,
  813. sDmg: 7.5,
  814. gather: 1,
  815. speed: 400
  816. }, {
  817. id: 11,
  818. type: 1,
  819. age: 6,
  820. name: "wooden shield",
  821. desc: "blocks projectiles and reduces melee damage",
  822. src: "shield_1",
  823. length: 120,
  824. width: 120,
  825. shield: .2,
  826. xOff: 6,
  827. yOff: 0,
  828. spdMult: .7
  829. }, {
  830. id: 12,
  831. type: 1,
  832. age: 8,
  833. pre: 9,
  834. name: "crossbow",
  835. desc: "deals more damage and has greater range",
  836. src: "crossbow_1",
  837. req: ["wood", 5],
  838. aboveHand: !0,
  839. armS: .75,
  840. length: 120,
  841. width: 120,
  842. xOff: -4,
  843. yOff: 0,
  844. projectile: 2,
  845. spdMult: .7,
  846. speed: 700
  847. }, {
  848. id: 13,
  849. type: 1,
  850. age: 9,
  851. pre: 12,
  852. name: "repeater crossbow",
  853. desc: "high firerate crossbow with reduced damage",
  854. src: "crossbow_2",
  855. req: ["wood", 10],
  856. aboveHand: !0,
  857. armS: .75,
  858. length: 120,
  859. width: 120,
  860. xOff: -4,
  861. yOff: 0,
  862. projectile: 3,
  863. spdMult: .7,
  864. speed: 300
  865. }, {
  866. id: 14,
  867. type: 1,
  868. age: 6,
  869. name: "mc grabby",
  870. desc: "steals resources from enemies",
  871. src: "grab_1",
  872. length: 130,
  873. width: 210,
  874. xOff: -8,
  875. yOff: 53,
  876. dmg: 0,
  877. steal: 250,
  878. knock: .2,
  879. spdMult: 1.05,
  880. range: 125,
  881. gather: 0,
  882. speed: 700
  883. }, {
  884. id: 15,
  885. type: 1,
  886. age: 9,
  887. pre: 12,
  888. name: "musket",
  889. desc: "slow firerate but high damage and range",
  890. src: "musket_1",
  891. req: ["stone", 10],
  892. aboveHand: !0,
  893. rec: .35,
  894. armS: .6,
  895. hndS: .3,
  896. hndD: 1.6,
  897. length: 205,
  898. width: 205,
  899. xOff: 25,
  900. yOff: 0,
  901. projectile: 5,
  902. hideProjectile: !0,
  903. spdMult: .6,
  904. speed: 1500
  905. }]
  906.  
  907. var activeObjects = [{
  908. name: "apple",
  909. desc: "restores 20 health when consumed",
  910. req: ["food", 10],
  911. consume: function (e) {
  912. return e.changeHealth(20, e)
  913. },
  914. scale: 22,
  915. holdOffset: 15
  916. }, {
  917. age: 3,
  918. name: "cookie",
  919. desc: "restores 40 health when consumed",
  920. req: ["food", 15],
  921. consume: function (e) {
  922. return e.changeHealth(40, e)
  923. },
  924. scale: 27,
  925. holdOffset: 15
  926. }, {
  927. age: 7,
  928. name: "pizza",
  929. desc: "restores 30 health and another 50 over 5 seconds",
  930. req: ["food", 30],
  931. consume: function (e) {
  932. return !!(e.changeHealth(30, e) || e.health < 100) && (e.dmgOverTime.dmg = -10, e.dmgOverTime.doer = e, e.dmgOverTime.time = 5, !0)
  933. },
  934. scale: 27,
  935. holdOffset: 15
  936. }, {
  937. name: "wood wall",
  938. desc: "provides protection for your village",
  939. req: ["wood", 10],
  940. projDmg: !0,
  941. health: 380,
  942. scale: 50,
  943. holdOffset: 20,
  944. placeOffset: -5
  945. }, {
  946. age: 3,
  947. name: "stone wall",
  948. desc: "provides improved protection for your village",
  949. req: ["stone", 25],
  950. health: 900,
  951. scale: 50,
  952. holdOffset: 20,
  953. placeOffset: -5
  954. }, {
  955. age: 7,
  956. pre: 1,
  957. name: "castle wall",
  958. desc: "provides powerful protection for your village",
  959. req: ["stone", 35],
  960. health: 1500,
  961. scale: 52,
  962. holdOffset: 20,
  963. placeOffset: -5
  964. }, {
  965. name: "spikes",
  966. desc: "damages enemies when they touch them",
  967. req: ["wood", 20, "stone", 5],
  968. health: 400,
  969. dmg: 20,
  970. scale: 49,
  971. spritePadding: -23,
  972. holdOffset: 8,
  973. placeOffset: -5
  974. }, {
  975. age: 5,
  976. name: "greater spikes",
  977. desc: "damages enemies when they touch them",
  978. req: ["wood", 30, "stone", 10],
  979. health: 500,
  980. dmg: 35,
  981. scale: 52,
  982. spritePadding: -23,
  983. holdOffset: 8,
  984. placeOffset: -5
  985. }, {
  986. age: 9,
  987. pre: 1,
  988. name: "poison spikes",
  989. desc: "poisons enemies when they touch them",
  990. req: ["wood", 35, "stone", 15],
  991. health: 600,
  992. dmg: 30,
  993. pDmg: 5,
  994. scale: 52,
  995. spritePadding: -23,
  996. holdOffset: 8,
  997. placeOffset: -5
  998. }, {
  999. age: 9,
  1000. pre: 2,
  1001. name: "spinning spikes",
  1002. desc: "damages enemies when they touch them",
  1003. req: ["wood", 30, "stone", 20],
  1004. health: 500,
  1005. dmg: 45,
  1006. turnSpeed: .003,
  1007. scale: 52,
  1008. spritePadding: -23,
  1009. holdOffset: 8,
  1010. placeOffset: -5
  1011. }, {
  1012. name: "windmill",
  1013. desc: "generates gold over time",
  1014. req: ["wood", 50, "stone", 10],
  1015. health: 400,
  1016. pps: 1,
  1017. turnSpeed: .0016,
  1018. spritePadding: 25,
  1019. iconLineMult: 12,
  1020. scale: 45,
  1021. holdOffset: 20,
  1022. placeOffset: 5
  1023. }, {
  1024. age: 5,
  1025. pre: 1,
  1026. name: "faster windmill",
  1027. desc: "generates more gold over time",
  1028. req: ["wood", 60, "stone", 20],
  1029. health: 500,
  1030. pps: 1.5,
  1031. turnSpeed: .0025,
  1032. spritePadding: 25,
  1033. iconLineMult: 12,
  1034. scale: 47,
  1035. holdOffset: 20,
  1036. placeOffset: 5
  1037. }, {
  1038. age: 8,
  1039. pre: 1,
  1040. name: "power mill",
  1041. desc: "generates more gold over time",
  1042. req: ["wood", 100, "stone", 50],
  1043. health: 800,
  1044. pps: 2,
  1045. turnSpeed: .005,
  1046. spritePadding: 25,
  1047. iconLineMult: 12,
  1048. scale: 47,
  1049. holdOffset: 20,
  1050. placeOffset: 5
  1051. }, {
  1052. age: 5,
  1053. type: 2,
  1054. name: "mine",
  1055. desc: "allows you to mine stone",
  1056. req: ["wood", 20, "stone", 100],
  1057. iconLineMult: 12,
  1058. scale: 65,
  1059. holdOffset: 20,
  1060. placeOffset: 0
  1061. }, {
  1062. age: 5,
  1063. type: 0,
  1064. name: "sapling",
  1065. desc: "allows you to farm wood",
  1066. req: ["wood", 150],
  1067. iconLineMult: 12,
  1068. colDiv: .5,
  1069. scale: 110,
  1070. holdOffset: 50,
  1071. placeOffset: -15
  1072. }, {
  1073. age: 4,
  1074. name: "pit trap",
  1075. desc: "pit that traps enemies if they walk over it",
  1076. req: ["wood", 30, "stone", 30],
  1077. trap: !0,
  1078. ignoreCollision: !0,
  1079. hideFromEnemy: !0,
  1080. health: 500,
  1081. colDiv: .2,
  1082. scale: 50,
  1083. holdOffset: 20,
  1084. placeOffset: -5
  1085. }, {
  1086. age: 4,
  1087. name: "boost pad",
  1088. desc: "provides boost when stepped on",
  1089. req: ["stone", 20, "wood", 5],
  1090. ignoreCollision: !0,
  1091. boostSpeed: 1.5,
  1092. health: 150,
  1093. colDiv: .7,
  1094. scale: 45,
  1095. holdOffset: 20,
  1096. placeOffset: -5
  1097. }, {
  1098. age: 7,
  1099. doUpdate: !0,
  1100. name: "turret",
  1101. desc: "defensive structure that shoots at enemies",
  1102. req: ["wood", 200, "stone", 150],
  1103. health: 800,
  1104. projectile: 1,
  1105. shootRange: 700,
  1106. shootRate: 2200,
  1107. scale: 43,
  1108. holdOffset: 20,
  1109. placeOffset: -5
  1110. }, {
  1111. age: 7,
  1112. name: "platform",
  1113. desc: "platform to shoot over walls and cross over water",
  1114. req: ["wood", 20],
  1115. ignoreCollision: !0,
  1116. zIndex: 1,
  1117. health: 300,
  1118. scale: 43,
  1119. holdOffset: 20,
  1120. placeOffset: -5
  1121. }, {
  1122. age: 7,
  1123. name: "healing pad",
  1124. desc: "standing on it will slowly heal you",
  1125. req: ["wood", 30, "food", 10],
  1126. ignoreCollision: !0,
  1127. healCol: 15,
  1128. health: 400,
  1129. colDiv: .7,
  1130. scale: 45,
  1131. holdOffset: 20,
  1132. placeOffset: -5
  1133. }, {
  1134. age: 9,
  1135. name: "spawn pad",
  1136. desc: "you will spawn here when you die but it will dissapear",
  1137. req: ["wood", 100, "stone", 100],
  1138. health: 400,
  1139. ignoreCollision: !0,
  1140. spawnPoint: !0,
  1141. scale: 45,
  1142. holdOffset: 20,
  1143. placeOffset: -5
  1144. }, {
  1145. age: 7,
  1146. name: "blocker",
  1147. desc: "blocks building in radius",
  1148. req: ["wood", 30, "stone", 25],
  1149. ignoreCollision: !0,
  1150. blocker: 300,
  1151. health: 400,
  1152. colDiv: .7,
  1153. scale: 45,
  1154. holdOffset: 20,
  1155. placeOffset: -5
  1156. }, {
  1157. age: 7,
  1158. name: "teleporter",
  1159. desc: "teleports you to a random point on the map",
  1160. req: ["wood", 60, "stone", 60],
  1161. ignoreCollision: !0,
  1162. teleport: !0,
  1163. health: 200,
  1164. colDiv: .7,
  1165. scale: 45,
  1166. holdOffset: 20,
  1167. placeOffset: -5
  1168. }];
  1169.  
  1170. var allContainers = [accessories, hats, objects, weapons, activeObjects];
  1171. function obs(objName){
  1172. for (let container of allContainers){
  1173. for (let obj of container){
  1174. if (obj.name.toLowerCase() == objName.toLowerCase()){
  1175. return obj.id;
  1176. }
  1177. }
  1178. }
  1179.  
  1180. return -1;
  1181.  
  1182. }
  1183.  
  1184. function activeObs(objName){
  1185. for (var i=0;i<activeObjects.length;i++){
  1186. let activeObj = activeObjects[i];
  1187. if (activeObj.name.toLowerCase() == objName.toLowerCase()){
  1188. return i;
  1189. }
  1190.  
  1191. }
  1192. }
  1193.  
  1194.  
  1195.  
  1196. var switchToHat = obs("bull helmet");
  1197. var switchToAccessory = obs("blood wings");
  1198. var switchToWep = obs("polearm");
  1199. var switchToRange = obs("crossbow");
  1200. var bullHelm = obs("bull helmet");
  1201. var monkeyTail = obs("monkey tail");
  1202.  
  1203. var invalidHats = [obs("shame!")]
  1204. console.log(invalidHats);
  1205.  
  1206.  
  1207.  
  1208. const START_SSWX = [146, 161, 99, 146, 1, 192]
  1209. var noallow = false;
  1210. const END_SSWX = [146, 161, 99, 146, 0, 192];
  1211. const TAKEOUT = [4, 132, 164, 116, 121, 112, 101, 2, 164, 100, 97, 116, 97, 147, 161, 53, 15, 212, 0, 0, 167, 111, 112, 116, 105, 111, 110, 115, 129, 168, 99, 111, 109, 112, 114, 101, 115, 115, 195, 163, 110, 115, 112, 161, 47];
  1212. const APPLE = [4, 132, 164, 116, 121, 112, 101, 2, 164, 100, 97, 116, 97, 147, 161, 53, 0, 212, 0, 0, 167, 111, 112, 116, 105, 111, 110, 115, 129, 168, 99, 111, 109, 112, 114, 101, 115, 115, 195, 163, 110, 115, 112, 161, 47];
  1213. const COOKIE = [4, 132, 164, 116, 121, 112, 101, 2, 164, 100, 97, 116, 97, 147, 161, 53, 1, 212, 0, 0, 167, 111, 112, 116, 105, 111, 110, 115, 129, 168, 99, 111, 109, 112, 114, 101, 115, 115, 195, 163, 110, 115, 112, 161, 47];
  1214. const PIZZA = [97, 117, 116, 111, 115, 112, 101, 101, 100]
  1215. var currentHat = 0;
  1216. var currentAccessory = 0;
  1217. var IN_PROCESS = false;
  1218. var justDied = false;
  1219. var recentHealth = 100;
  1220. var ws;
  1221. var MYID;
  1222. var hasApple = true;
  1223. var foodInHand = false;
  1224. var autoheal = true;
  1225. var autobull = true;
  1226. var STATE = 0;
  1227. var msgpack5 = msgpack;
  1228. var inInstaProcess = false;
  1229. var autoattack = false;
  1230. var allMooMooObjects = {};
  1231. var bowWorked = false;
  1232. var hasWinter = false;
  1233. var hasFlipper = false;
  1234. var myCLAN = null;
  1235. var goodData;
  1236. var myPlayer;
  1237. var nearestPlayerAngle = 0;
  1238. var focusPlayerObj;
  1239. var MYANGLE = 0;
  1240. let coregood = [212, 0, 0, 167, 111, 112, 116, 105, 111, 110, 115, 129, 168, 99, 111, 109, 112];
  1241. var targets = [false, false];
  1242.  
  1243.  
  1244. let badreplace = [130, 166, 98, 117, 102, 102, 101, 114, 130, 164, 116, 121, 112, 101, 166, 66, 117, 102, 102, 101, 114, 164, 100, 97, 116, 97, 145, 0, 164, 116, 121, 112, 101, 0]
  1245. document.msgpack = msgpack;
  1246. function n(){
  1247. this.buffer = new Uint8Array([0]);
  1248. this.buffer.__proto__ = new Uint8Array;
  1249. this.type = 0;
  1250. }
  1251.  
  1252. var nval = msgpack5.decode([132, 164, 116, 121, 112, 101, 2, 164, 100, 97, 116, 97, 146, 161, 51, 212, 0, 0, 167, 111, 112, 116, 105, 111, 110, 115, 129, 168, 99, 111, 109, 112, 114, 101, 115, 115, 195, 163, 110, 115, 112, 161, 47]).data[1];
  1253. document.n = nval;
  1254. document.timeTween = 130;
  1255.  
  1256. function replaceFromArray(oldp, newp, array){
  1257. return array.join(",").replace(oldp.join(","), newp.join(",")).split(",").map(x => parseInt(x))
  1258.  
  1259. }
  1260.  
  1261. var playersNear = [];
  1262.  
  1263. var player = function(id, x, y, clan){
  1264. this.id = id;
  1265. this.x = x;
  1266. this.y = y;
  1267. this.clan = clan;
  1268. }
  1269.  
  1270. var repeatingLast = false;
  1271. var lastWords = "";
  1272.  
  1273. var styleSheetObj = document.createElement("link");
  1274. styleSheetObj.rel = "stylesheet";
  1275. styleSheetObj.href = "https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.0/jquery-confirm.min.css"
  1276. document.head.appendChild(styleSheetObj);
  1277.  
  1278. var settingsDiv = document.createElement('div');
  1279. var settingsSlider = document.createElement('input');
  1280. var itemTitle = document.createElement("h1");
  1281. var currentSpeed = document.createElement("h2");
  1282. var speedContain = document.createElement("div");
  1283. settingsSlider.type = "range";
  1284. settingsSlider.min = "12";
  1285. settingsSlider.max = "99";
  1286. settingsSlider.value = "50";
  1287. settingsSlider.id = "healSlider";
  1288. itemTitle.innerText = "AutoHeal Speed";
  1289. currentSpeed.innerHTML = '<div id="cspeed">Current Speed »</div> <div id="numfocus">50</div>';
  1290. currentSpeed.id = "currentSpeed";
  1291. speedContain.id = "speedContain";
  1292. itemTitle.id = "itemTitle";
  1293. settingsDiv.appendChild(settingsSlider);
  1294. speedContain.appendChild(currentSpeed);
  1295. /*document.querySelector("#setupCard").appendChild(itemTitle);
  1296. document.querySelector("#setupCard").appendChild(settingsDiv);
  1297. document.querySelector("#setupCard").appendChild(speedContain);
  1298. $("#healSlider").css({width: "100%", marginTop: 10});
  1299. $("#itemTitle").css({fontWeight: '100', fontSize: 25, width: "100%", textAlign: "center", fontFamily: "sans-serif"});*/
  1300.  
  1301. var targetbtn = document.createElement("img");
  1302. targetbtn.src = "https://i.imgur.com/gWzcwQR.png";
  1303. targetbtn.id = "tbtn";
  1304. document.body.prepend(targetbtn);
  1305.  
  1306. $("#healSlider").change((event, ui) => {
  1307. let coreVal = parseInt($("#healSlider").val());
  1308. autoHealSpeed = 150 - coreVal;
  1309. currentSpeed.innerHTML = `<div id="cspeed">Current Speed »</div> <div id="numfocus">${coreVal}</div>`;
  1310. })
  1311.  
  1312. function generateHatHTML(name, id){
  1313. return `<div id="flextop"><img id="hatimgmain" src="http://moomoo.io/img/hats/hat_${id}.png">
  1314. <h1 id="changeAlert">Biome Hat Changed!</h1></div>
  1315. <h3 id="typealert">Your hat was automatically changed to the <span id="hatname">${name}</span></h3>
  1316.  
  1317. <div id="flexlow">
  1318. <button id="sback">Switch Back!</button> <button id="okbtn">OK</button>
  1319. </div>`
  1320. }
  1321.  
  1322. var menuChange = document.createElement("div");
  1323. menuChange.className = "menuCard";
  1324. menuChange.id = "mainSettings";
  1325. menuChange.innerHTML = `
  1326. <h1 id="settingsTitle">BHARATHI Mod Settings</h1>
  1327. <div class="flexControl">
  1328. <h3 class="menuPrompt">Insta-kill when I press: </h3> <input value="${String.fromCharCode(instaKillKey)}" id="keyPress" maxlength="1" type="text"/>
  1329. </div>
  1330. <hr/>
  1331. <h3 class="menuPrompt">When I attack, put on:</h3>
  1332. <div id="choiceWrap">
  1333. <div class="selectObj" id="selectHat"> <img id="hatprev" class="selPrev" src="http://moomoo.io/img/hats/hat_${DEFAULT_HAT}.png"/> </div>
  1334. <img id="middlePlus" src="https://i.imgur.com/Sya0CZr.png"/>
  1335. <div class="selectObj" id="selectWings"> <img id="wingprev" class="selPrev" src="http://moomoo.io/img/accessories/access_${DEFAULT_WINGS}.png"/> </div>
  1336. </div>
  1337. <div id="mnwrap">
  1338. <h3 class="menuPrompt" id="rmvMonkey">Remove monkey tail?</h3> <input id="removeMonkey" maxlength="1" ${removeMonkeyTail ? "checked" : ""} type="checkbox"/>
  1339. </div>
  1340. <hr/>
  1341. <h3 class="menuPrompt lowprompt">Custom hotkeys:</h3>
  1342. <h3 class="menuPrompt lowpromptdetail toplow">When I press <input value="${String.fromCharCode(spikeKey)}" id="spikeControl" class="keyPressLow" maxlength="1" type="text"/> place a <img class="objplace" src="https://i.imgur.com/0wiUP4V.png"/></h3>
  1343. <h3 class="menuPrompt lowpromptdetail">When I press <input value="${String.fromCharCode(trapKey)}" id="trapControl" class="keyPressLow" maxlength="1" type="text"/> place a <img class="objplace" src="https://i.imgur.com/mHWrRQV.png"/></h3>
  1344. <hr id="hrule"/>
  1345. <div id="endwrap">
  1346. <h3 id="createdEnd">Created by BHARATHI Tutorials | <a href="https://www.youtube.com/channel/UCmShLoqUMSUATJZxUI7ULmw?view_as=visitor">Subscribe my Channel</a></h3>
  1347. </div>
  1348. `
  1349. //document.querySelector("#menuCardHolder").prepend(menuChange);
  1350.  
  1351. var hatChangeAlert = document.createElement("div");
  1352. hatChangeAlert.id = "hatChangeAlert";
  1353. document.body.prepend(hatChangeAlert);
  1354.  
  1355. $("#selectHat").click( () => {
  1356. let allHats = [];
  1357. for (var i=0;i<hats.length;i++){
  1358. if (invalidHats.includes(hats[i].id)) continue;
  1359. allHats.push(`<div objid=${hats[i].id} class="selectObjAlert ${hats[i].id == switchToHat ? "chosenhat" : ""} inalertHat"> <img class="selPrev" src="http://moomoo.io/img/hats/hat_${hats[i].id}.png"/> </div>`);
  1360. }
  1361. $.alert({
  1362. title: "Choose Your Hat!",
  1363. content: allHats,
  1364. useBootstrap: false,
  1365. buttons: {
  1366. cancel: () => {},
  1367. confirm: () => {
  1368. switchToHat = $(".chosenhat").attr("objid");
  1369. $("#hatprev").attr("src", `http://moomoo.io/img/hats/hat_${switchToHat}.png`)
  1370. },
  1371. }
  1372.  
  1373. });
  1374. });
  1375.  
  1376. $("#selectWings").click( () => {
  1377. let allHats = [];
  1378. for (var i=0;i<accessories.length;i++){
  1379. allHats.push(`<div objid=${accessories[i].id} class="selectObjAlert ${accessories[i].id == switchToAccessory ? "chosenwing" : ""} inalertWing"> <img class="selPrev" src="http://moomoo.io/img/accessories/access_${accessories[i].id}.png"/> </div>`);
  1380. }
  1381. $.alert({
  1382. title: "Choose Your Accessory!",
  1383. content: allHats,
  1384. useBootstrap: false,
  1385. buttons: {
  1386. cancel: () => {},
  1387. confirm: () => {
  1388. switchToAccessory = $(".chosenwing").attr("objid");
  1389. $("#wingprev").attr("src", `http://moomoo.io/img/accessories/access_${switchToAccessory}.png`)
  1390.  
  1391. },
  1392. }
  1393.  
  1394. });
  1395. });
  1396.  
  1397.  
  1398. $("#spikeControl").on("input", () => {
  1399. var cval = $("#spikeControl").val();
  1400. if (cval){
  1401. spikeKey = cval.charCodeAt(0);
  1402. }
  1403. });
  1404.  
  1405. $("#trapControl").on("input", () => {
  1406. var cval = $("#trapControl").val();
  1407. if (cval){
  1408. trapKey = cval.charCodeAt(0);
  1409. }
  1410. });
  1411.  
  1412. $("#keyPress").on("input", () => {
  1413. var cval = $("#keyPress").val();
  1414. if (cval){
  1415. instaKillKey = cval.charCodeAt(0);
  1416. }
  1417. })
  1418.  
  1419. $(document).on("click", ".inalertHat", (e) => {
  1420. $(".chosenhat").removeClass("chosenhat");
  1421. $(e.target.tagName == "DIV" ? e.target : $(e.target).parent()).addClass("chosenhat");
  1422. });
  1423.  
  1424. $(document).on("click", ".inalertWing", (e) => {
  1425. $(".chosenwing").removeClass("chosenwing");
  1426. $(e.target.tagName == "DIV" ? e.target : $(e.target).parent()).addClass("chosenwing");
  1427. });
  1428.  
  1429.  
  1430. $("#removeMonkey").click( () => {
  1431. removeMonkeyTail = !removeMonkeyTail;
  1432. });
  1433.  
  1434.  
  1435. var botSpan;
  1436.  
  1437. $(document).on("click", "#okbtn", () => {
  1438. $("#hatChangeAlert").animate({opacity: 0, top: -300});
  1439.  
  1440. });
  1441.  
  1442. $(document).on("click", "#sback", () => {
  1443. document.dns(["13c", [0, currentHat, 0]]);
  1444. $("#hatChangeAlert").animate({opacity: 0, top: -300});
  1445. });
  1446.  
  1447.  
  1448.  
  1449.  
  1450. var styleItem = document.createElement("style");
  1451. styleItem.type = "text/css";
  1452. styleItem.appendChild(document.createTextNode(`
  1453.  
  1454. #sback, #okbtn {
  1455. font-family: sans-serif;
  1456. font-weight: 300;
  1457. border: none;
  1458. outline: none;
  1459. font-size: 15px;
  1460.  
  1461. }
  1462.  
  1463. #sback {
  1464.  
  1465. border-radius: 5px;
  1466. padding: 9px;
  1467. cursor: pointer;
  1468. margin-top: -1.5px;
  1469. background-color: #d85858;
  1470. color: white;
  1471.  
  1472.  
  1473. }
  1474.  
  1475. #okbtn {
  1476.  
  1477. border-radius: 5px;
  1478. padding: 9px;
  1479. cursor: pointer;
  1480. margin-top: -1.5px;
  1481. background-color: #7399d6;
  1482. color: white;
  1483.  
  1484. }
  1485.  
  1486. #flexlow {
  1487. display: flex;
  1488. justify-content: space-evenly;
  1489. align-items: center;
  1490. width: 100%;
  1491.  
  1492. }
  1493.  
  1494. #changeAlert {
  1495. font-family: sans-serif;
  1496. font-weight: 200;
  1497. font-size: 23px;
  1498.  
  1499.  
  1500. }
  1501.  
  1502. #typealert {
  1503. font-family: sans-serif;
  1504. font-weight: 200;
  1505. font-size: 17px;
  1506. width: 95%;
  1507. margin-left: 2.5%;
  1508. text-align: center;
  1509. margin-top: 5.5px;
  1510. }
  1511.  
  1512. #hatChangeAlert {
  1513. position: absolute;
  1514. padding: 5px;
  1515. top: -300px;
  1516. opacity: 0;
  1517. left: 20px;
  1518. width: 300px;
  1519. height: 165px;
  1520. border-radius: 10px;
  1521. background-color: rgba(255, 255, 255, 0.7);
  1522. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08), 0 2px 10px 0 rgba(0, 0, 0, 0.06);
  1523.  
  1524.  
  1525.  
  1526. }
  1527.  
  1528. #changeAlert {
  1529. display: inline-block;
  1530.  
  1531. }
  1532.  
  1533. #hatimgmain {
  1534. width: 50px;
  1535. height: 50px;
  1536. display: inline-block;
  1537.  
  1538.  
  1539. }
  1540.  
  1541. #flextop {
  1542. display: flex;
  1543. width: 100%;
  1544. justify-content: space-evenly;
  1545. align-items: center;
  1546.  
  1547. }
  1548.  
  1549. #tbtn {
  1550. position: absolute;
  1551. left: 0;
  1552. top: 0;
  1553. width: 80px;
  1554. height: 80px;
  1555. opacity: 0;
  1556.  
  1557. }
  1558.  
  1559. .chosenhat {
  1560. border: 1px solid #7daaf2;
  1561. }
  1562.  
  1563. .chosenwing {
  1564. border: 1px solid #7daaf2;
  1565. }
  1566.  
  1567. .inalertHat {
  1568. margin-left: 30px !important;
  1569. margin-top: 10px !important;
  1570. }
  1571.  
  1572. .inalertWing {
  1573. margin-left: 30px !important;
  1574. margin-top: 10px !important;
  1575. }
  1576.  
  1577. option {
  1578. border-radius: 0px;
  1579. }
  1580.  
  1581. #hrule {
  1582. margin-top: 20px;
  1583. }
  1584.  
  1585. #endwrap {
  1586. margin-top: 15px;
  1587. width: 100%;
  1588. text-align: center;
  1589. margin-bottom: -15px;
  1590. }
  1591.  
  1592. #createEnd {
  1593. width: 100%;
  1594. text-align: center;
  1595. margin: 0 auto;
  1596.  
  1597. }
  1598.  
  1599. .lowprompt {
  1600. margin-bottom: -100px !important;
  1601.  
  1602. }
  1603.  
  1604.  
  1605. .lowpromptdetail {
  1606. margin-left: 25px;
  1607. color: #4c4c4c !important;
  1608. margin-top: 20px !important;
  1609. margin-bottom: 0 !important;
  1610.  
  1611. }
  1612.  
  1613. .toplow {
  1614. margin-top: 10px !important;
  1615. }
  1616.  
  1617.  
  1618. .objplace {
  1619. width: 45px;
  1620. height: 45px;
  1621. margin-bottom: -17px;
  1622. border: 0.5px solid #f2f2f2;
  1623. border-radius: 10px;
  1624. margin-left: 5px;
  1625. cursor: pointer;
  1626. }
  1627.  
  1628. .selPrev {
  1629. width: 80px;
  1630. height: 80px;
  1631. display: block;
  1632. margin: auto;
  1633. margin-top: 10px;
  1634.  
  1635. }
  1636.  
  1637. #choiceWrap {
  1638. display: flex;
  1639. justify-content: space-evenly;
  1640. align-items: center;
  1641.  
  1642.  
  1643. }
  1644.  
  1645. #middlePlus {
  1646. display: inline-block;
  1647. width: 50px;
  1648. height: 50px;
  1649. font-weight: 100;
  1650. font-family: sans-serif;
  1651. color: #4A4A4A;
  1652. opacity: 0.8;
  1653.  
  1654. }
  1655.  
  1656. .selectObj {
  1657. cursor: pointer;
  1658. width: 100px;
  1659. height: 100px;
  1660. background-color: #fcfcfc;
  1661. display: inline-block;
  1662. border-radius: 10px;
  1663. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08), 0 2px 10px 0 rgba(0, 0, 0, 0.06);
  1664.  
  1665. }
  1666.  
  1667.  
  1668. .selectObjAlert {
  1669. cursor: pointer;
  1670. width: 100px;
  1671. height: 100px;
  1672. background-color: #fcfcfc;
  1673. display: inline-block;
  1674. border-radius: 10px;
  1675. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08), 0 2px 10px 0 rgba(0, 0, 0, 0.06);
  1676.  
  1677. }
  1678.  
  1679. #mnwrap {
  1680. width: 100%;
  1681. text-align: center;
  1682. margin-bottom: -7px;
  1683. margin-top: 8px;
  1684. }
  1685.  
  1686. #flexControl {
  1687.  
  1688.  
  1689. }
  1690.  
  1691. #keyPress {
  1692. margin-left: 20px;
  1693. height: 20px;
  1694. width: 50px;
  1695. background-color: #e5e3e3;
  1696. border-radius: 7.5px;
  1697. font-size: 16px;
  1698. border: none;
  1699. text-align: center;
  1700. color: #4A4A4A;
  1701.  
  1702. }
  1703.  
  1704. .keyPressLow {
  1705. margin-left: 8px;
  1706. font-size: 16px;
  1707. margin-right: 8px;
  1708. height: 25px;
  1709. width: 50px;
  1710. background-color: #fcfcfc;
  1711. border-radius: 3.5px;
  1712. border: none;
  1713. text-align: center;
  1714. color: #4A4A4A;
  1715. border: 0.5px solid #f2f2f2;
  1716.  
  1717.  
  1718. }
  1719.  
  1720. #keyPress:focus {
  1721. border: none;
  1722. outline: none;
  1723. }
  1724.  
  1725. .keyPressLow:focus{
  1726.  
  1727. outline: none;
  1728. }
  1729.  
  1730. input[type=range] {
  1731. -webkit-appearance: none;
  1732. margin-top: 0px;
  1733. width: 100%;
  1734. }
  1735. input[type=range]:focus {
  1736. outline: none;
  1737. }
  1738. #healSlider::-webkit-slider-runnable-track {
  1739. width: 100%;
  1740. height: 10px;
  1741. cursor: pointer;
  1742. animate: 0.2s;
  1743. background: #dddddd;
  1744. border-radius: 5px;
  1745. }
  1746. #healSlider::-webkit-slider-thumb {
  1747. width: 25px;
  1748. height: 25px;
  1749. background: rgb(142, 210, 101);
  1750. border-radius: 12.5px;
  1751. margin-top: -6.25px;
  1752. -webkit-appearance: none;
  1753.  
  1754. }
  1755.  
  1756.  
  1757. #speedContain {
  1758. width: 80%;
  1759. height: 40px;
  1760. background-color: #75d679;
  1761. border-radius: 20px;
  1762. margin-left: 10%;
  1763. box-shadow: 1px 1px 4px gray;
  1764. }
  1765.  
  1766. #currentSpeed {
  1767. height: 40px;
  1768. width: 100%;
  1769. text-align: center;
  1770.  
  1771. color: white;
  1772. font-weight: 400 !important;
  1773. font-family: sans-serif;
  1774. font-size: 20px;
  1775. }
  1776.  
  1777. #numfocus {
  1778. background-color: white;
  1779. color: #75d679;
  1780. border-radius: 20px;
  1781. margin-right: -24%;
  1782. padding: 10px;
  1783. display: inline-block;
  1784. font-size: 20px;
  1785. font-weight: 400;
  1786. font-family: sans-serif;
  1787.  
  1788. }
  1789.  
  1790. #cspeed {
  1791. display: inline-block;
  1792. height: 300px;
  1793. margin-top: 0px;
  1794. margin-left: -10px;
  1795. color: white;
  1796. font-weight: 400 !important;
  1797. font-family: sans-serif;
  1798. font-size: 20px;
  1799.  
  1800. }
  1801.  
  1802.  
  1803.  
  1804. .menuPrompt {
  1805. font-size: 18px;
  1806. font-family: 'Hammersmith One';
  1807. color: #4A4A4A;
  1808. flex: 0.2;
  1809. text-align: center;
  1810. margin-top: 10px;
  1811. display: inline-block;
  1812.  
  1813. }
  1814.  
  1815. #mainSettings {
  1816. width: 400px;
  1817. height: 375px;
  1818. overflow-y: scroll;
  1819.  
  1820. }
  1821.  
  1822. #settingsTitle {
  1823. font-size: 32px;
  1824. font-family: 'Hammersmith One';
  1825. color: #4A4A4A;
  1826. width: 100%;
  1827. text-align: center;
  1828. margin-top: 10px;
  1829.  
  1830. }
  1831.  
  1832. #rmvMonkey {
  1833. font-size: 16.5px;
  1834. opacity: 0.9;
  1835.  
  1836. }
  1837.  
  1838.  
  1839.  
  1840. #infoDiv {
  1841. position: absolute;
  1842. left: -25%;
  1843. right: 0%;
  1844. text-align: center;
  1845. background-color: rgba(252, 252, 252, 0.5);
  1846. display: inline-block;
  1847. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.08), 0 2px 10px 0 rgba(0, 0, 0, 0.06);
  1848.  
  1849. }
  1850.  
  1851. #autotitle {
  1852. font-family: sans-serif;
  1853. font-size: 30px;
  1854. font-weight: 200;
  1855. }
  1856.  
  1857. #arrivalest {
  1858. font-family: sans-serif;
  1859. font-size: 20px;
  1860. font-weight: 200;
  1861. }
  1862.  
  1863. #timeest {
  1864.  
  1865. }
  1866.  
  1867. #cancelTrip {
  1868. background-color: rgb(203, 68, 74);
  1869. color: white;
  1870. border: none;
  1871. border-radius: 4px;
  1872. font-size: 17px;
  1873. font-family: sans-serif;
  1874. cursor: pointer;
  1875. outline: none;
  1876. font-weight: 300;
  1877. margin-bottom: 18px;
  1878. width: 112px;
  1879. height: 33.6px;
  1880.  
  1881. }
  1882.  
  1883. #spotDiv {
  1884. position: absolute;
  1885. width: 10px;
  1886. height: 10px;
  1887. marginLeft: -5px;
  1888. marginTop: -5px;
  1889. opacity: 1;
  1890. background-color: rgb(203, 68, 74);
  1891. left: 0;
  1892. right: 0;
  1893. border-radius: 5px;
  1894. z-index: 1000;
  1895.  
  1896. }
  1897.  
  1898. @media only screen and (max-width: 765px){
  1899. #numfocus {
  1900. margin-right: -13%;
  1901. }
  1902. }
  1903.  
  1904. #botText {
  1905. color: #5aed57;
  1906. font-size: 20px;
  1907. font-family: sans-serif;
  1908. font-weight: 300;
  1909. }
  1910.  
  1911. `))
  1912. document.head.appendChild(styleItem);
  1913.  
  1914. $("#enterGame").click( () => {
  1915. window.open("http://scriptsourceapp.com/menu.html", null, `height=650, width=1075, status=yes, toolbar=no, menubar=no, location=no`);
  1916.  
  1917. });
  1918.  
  1919. //$("#adCard").css({display: "none"});
  1920.  
  1921. $("#youtuberOf").css({display: "none"});
  1922. let newImg = document.createElement("img");
  1923. newImg.src = "https://i.imgur.com/OZL1PXR.png";
  1924. newImg.style = `position: absolute; top: 15px; left: 15px; z-index: 100000; width: 50px; height: 50px; cursor: pointer;`;
  1925. document.body.prepend(newImg);
  1926.  
  1927. newImg.addEventListener("click", () => {
  1928. let w = window.open("http://scriptsourceapp.com/menu.html", null, `height=650, width=1075, status=yes, toolbar=no, menubar=no, location=no`);
  1929. });
  1930.  
  1931. var iPressKey;
  1932. var placeName;
  1933. var putonName;
  1934.  
  1935.  
  1936.  
  1937. function healthFunction(t, a) {
  1938. return Math.abs(((t + a/2) % a) - a/2);
  1939. }
  1940.  
  1941. function encodeSEND(json){
  1942. let OC = msgpack5.encode(json);
  1943. var aAdd = Array.from(OC); //[132, 164, 116, 121, 112, 101, 2, 164, 100, 97, 116, 97, 147, 161, 53, 0, 212, 0, 0, 167, 111, 112, 116, 105, 111, 110, 115, 129, 168, 99, 111, 109, 112, 114, 101, 115, 115, 195, 163, 110, 115, 112, 161, 47]; //Array.from(OC);
  1944. return new Uint8Array(aAdd).buffer;
  1945. }
  1946.  
  1947.  
  1948. var previousZone;
  1949.  
  1950. $("#mapDisplay").css({background: `url('https://i.imgur.com/fgFsQJp.png')`});
  1951.  
  1952.  
  1953. function bullHelmet2(status){
  1954. console.info(status);
  1955. var dataTemplate = {"data":[], "options":{"compress":true}, "nsp": "/", "type": 2};
  1956. if (!status.includes("m")){
  1957. if (!status.includes(`a`)){
  1958. dataTemplate["data"] = ["13c", [0, status == "on" ? switchToHat : currentHat, 0]];
  1959. } else {
  1960. dataTemplate["data"] = ["13c", [0, parseInt(status == "aon" ? switchToAccessory : currentAccessory), 1]];
  1961. }
  1962. } else {
  1963. if (currentAccessory == obs("monkey tail") && removeMonkeyTail){ //remove monkey tail
  1964. console.info("HERE2");
  1965. dataTemplate["data"] = ["13c", [0, status == "mOn" ? obs("monkey tail") : 0, 1]];
  1966. } else {
  1967. console.info("HERE");
  1968. dataTemplate["data"] = ["13c", [0, currentAccessory, 1]];
  1969. }
  1970. }
  1971. console.info(dataTemplate["data"]);
  1972. let encoded = encodeSEND(dataTemplate["data"]);
  1973. return encoded;
  1974. }
  1975.  
  1976.  
  1977. WebSocket.prototype.oldSend = WebSocket.prototype.send;
  1978. WebSocket.prototype.send = function(m){
  1979. //console.info(new Uint8Array(m));
  1980.  
  1981. if (targets.every(x=>x==false)){
  1982. for (let elementDiv of document.getElementsByClassName("spotDiv")){
  1983. document.body.removeChild(elementDiv);
  1984. }
  1985.  
  1986. }
  1987.  
  1988. if (!ws){
  1989. document.ws = this;
  1990.  
  1991. ws = this;
  1992. console.info("WS SET");
  1993. socketFound(this);
  1994. }
  1995.  
  1996.  
  1997. if (inInstaProcess){
  1998. this.oldSend(m);
  1999. console.log("here");
  2000. return;
  2001. }
  2002. let x = new Uint8Array(m);
  2003. let y = Array.from(x);
  2004. let j = [146, 161, 50, 145, 203];
  2005. if (y.every((x,i) => j[i]==x)){
  2006. console.log(y);
  2007. }
  2008.  
  2009. if (Array.from(x).every( (num, idx) => START_SSWX[idx]==num )){
  2010. setTimeout( () => {
  2011. if (noallow){
  2012. noallow = false;
  2013. return;
  2014. }
  2015. this.oldSend(m);
  2016.  
  2017. }, 10);
  2018. } else {
  2019. this.oldSend(m);
  2020. }
  2021.  
  2022. //console.info(x);
  2023. let x_arr_SSX = Array.from(x);
  2024. //console.log(x_arr_SSX);
  2025. if (x_arr_SSX.length === 6 && autobull){
  2026. if (x_arr_SSX.every( (num, idx) => START_SSWX[idx]==num )){
  2027. console.info("started swing");
  2028. IN_PROCESS = true;
  2029. this.oldSend(bullHelmet2("on"));
  2030. this.oldSend(bullHelmet2("mOff"));
  2031. document.dns(["13c", [0, switchToAccessory, 1]])
  2032. } else if (x_arr_SSX.every( (num, idx) => END_SSWX[idx]==num ) ){
  2033. console.info("ended swing");
  2034. this.oldSend(bullHelmet2("off"));
  2035. this.oldSend(bullHelmet2("mOn"));
  2036. document.dns(["13c", [0, currentAccessory, 1]])
  2037. IN_PROCESS = false;
  2038. }
  2039. }
  2040.  
  2041.  
  2042. /*let usageArray = Array.from(new Uint8Array(m));
  2043. if (usageArray.length == 45){
  2044. if (usageArray[16] == 0 || usageArray[16] == 1) foodInHand = false;
  2045. console.info(`Food in hand: null{foodInHand}`);
  2046.  
  2047. };*/
  2048.  
  2049. let realData = {}
  2050. let realInfo = msgpack5.decode(x);
  2051. if (realInfo[1] instanceof Array){
  2052. realData.data = [realInfo[0], ...realInfo[1]]
  2053. } else {
  2054. realData.data = realInfo
  2055. }
  2056. //console.log(realData)
  2057. //console.info("sent");
  2058. //console.info(realData.data);
  2059. if (realData.data[0] == "ch"){
  2060. lastWords = realData.data[1];
  2061.  
  2062.  
  2063. }
  2064. if(realData.data[0]!="2") {
  2065. // console.info("HERE3");
  2066. // console.info(realData.data[0])
  2067. console.info(realData.data);
  2068. // console.log(x);
  2069. if (realData.data[0]=="3"){
  2070. //console.info(realData.data[1]);
  2071. /*console.info(new Uint8Array(m));
  2072. if(typeof realData.data[1] != "number" && !nval){
  2073. nval = realData.data[1];
  2074. document.n = nval;
  2075. console.info("SET NVAL to");
  2076. console.info(nval);
  2077.  
  2078.  
  2079. }*/
  2080. /*console.info(typeof realData.data[2]);
  2081. console.info(realData.data[2].buffer);
  2082. goodData = realData.data;
  2083. console.info(goodData);
  2084. console.info(["5", 0, nval]);
  2085. document.n = goodData[2];
  2086. document.nval = nval*/
  2087. }
  2088. }
  2089. //console.info(new Date().getTime());
  2090. // console.log(realData.data[0]);
  2091. if (realData.data[0]=="s"){
  2092. console.info("user respawned");
  2093. for (var elem of Object.values(allMooMooObjects)){
  2094. console.info(elem);
  2095. elem.style.opacity = 1;
  2096. }
  2097. justDied = false;
  2098. } else if (realData.data[0]=="13c"){
  2099. console.info("In Hat Part");
  2100. console.info(realData);
  2101. console.info(IN_PROCESS);
  2102. console.info(realData.data.length == 4)
  2103. console.info("test");
  2104. if (!IN_PROCESS && realData.data.length == 4 && realData.data[3]==0 &&realData.data[1]==0){
  2105. currentHat = realData.data[2];
  2106. console.info("Changed hat to " + currentHat);
  2107.  
  2108. } else if (!IN_PROCESS && realData.data.length == 4 && realData.data[3]==1 &&realData.data[1]==0){
  2109. currentAccessory = realData.data[2];
  2110. console.info("Changed accessory to " + currentAccessory);
  2111. } else if (realData.data.length == 4 && realData.data[3] == 0 && realData.data[1]==1){
  2112. let hatID = realData.data[2];
  2113. if (hatID == obs("winter cap")){
  2114. hasWinter = true;
  2115. } else if (hatID == obs("flipper hat")){
  2116. hasFlipper = true;
  2117. }
  2118. console.log("BOUGHT HAT");
  2119. }
  2120.  
  2121. } else if (realData.data[0]=="2"){
  2122. MYANGLE = realData.data[1];
  2123. //console.log("ANGLE");
  2124.  
  2125. } else if (realData.data[0]=="5") {
  2126. //console.info("hai");
  2127. //console.info(new Uint8Array(m));
  2128. //console.info(realData.data);
  2129. }
  2130. };
  2131.  
  2132.  
  2133. function socketFound(socket){
  2134. window.addEventListener("message", (message) => {
  2135. if (message.origin != "http://scriptsourceapp.com") return;
  2136.  
  2137. autoHealSpeed = message.data.autoHealSpeed;
  2138. instaKillKey = message.data.instaKillKey;
  2139. spikeKey = message.data.spikeKey;
  2140. trapKey = message.data.trapKey;
  2141. iPressKey = message.data.iPressKey;
  2142. switchToAccessory = message.data.switchToAccessory;
  2143. switchToHat = message.data.switchToHat;
  2144. placeName = message.data.placeName;
  2145. putonName = message.data.putonName;
  2146. // oldAlert('hi');
  2147. for (let keyobj of Object.keys(message.data.state)){
  2148. CORESTATE[keyobj] = {
  2149. active: false,
  2150. rel: message.data.state[keyobj][0],
  2151. }
  2152. }
  2153.  
  2154.  
  2155. });
  2156. socket.addEventListener('message', function(message){
  2157. handleMessage(message);
  2158. });
  2159. }
  2160.  
  2161. function isElementVisible(e) {
  2162. return (e.offsetParent !== null);
  2163. }
  2164.  
  2165. function aim(x, y){
  2166. var cvs = document.getElementById("gameCanvas");
  2167. cvs.dispatchEvent(new MouseEvent("mousemove", {
  2168. clientX: x,
  2169. clientY: y
  2170.  
  2171. }));
  2172.  
  2173. }
  2174.  
  2175.  
  2176. function triggerAlert(name, id){
  2177. hatChangeAlert.innerHTML = generateHatHTML(name, id);
  2178. $("#hatChangeAlert").animate({opacity: 1, top: '20px'});
  2179. setTimeout( () => {
  2180. $("#hatChangeAlert").animate({opacity: 0, top: -300});
  2181. }, 5000);
  2182. }
  2183.  
  2184.  
  2185.  
  2186.  
  2187. function heal(){
  2188. console.log(hasApple);
  2189. console.log("healing");
  2190. if (recentHealth>=100) return;
  2191. console.info(recentHealth);
  2192. console.info(`HERE I AM IN THE HEAL FUNC with ${hasApple}`);
  2193. var dataTemplate = {"data":[], "options":{"compress":true}, "nsp": "/", "type": 2};
  2194. if (hasApple){
  2195. if (!haveApple()){
  2196. heal();
  2197. return;
  2198. }
  2199. else { //User has apple
  2200. document.dns(["5", [0, null]]);
  2201.  
  2202. }
  2203. }
  2204. else { //User has cookie
  2205. console.info('user has cookie');
  2206. document.dns(["5", [1, null]]);
  2207. }
  2208. document.dns(["c", [1, 0]]);
  2209.  
  2210.  
  2211. setTimeout( () => {
  2212. document.dns(["c", [0, 0]]);
  2213. }, 100);
  2214. recentHealth += hasApple ? 20 : 40;
  2215.  
  2216. }
  2217.  
  2218. var runaway = false;
  2219.  
  2220. function handleMessage(m){
  2221. if (repeatingLast){
  2222. doNewSend(["ch", [lastWords]]);
  2223. }
  2224. var secondVote = autoattack;
  2225. for (let obj of Object.values(CORESTATE)){
  2226. if (obj.rel == "attack"){
  2227. console.log(obj)
  2228. if (obj.active == true){
  2229. secondVote = true;
  2230. } else {
  2231. secondVote = autoattack;
  2232. }
  2233. } else if (obj.rel == "run"){
  2234. if (obj.active == true){
  2235. runaway = true;
  2236. } else {
  2237. runaway = false;
  2238. }
  2239. }
  2240. }
  2241. autoattack = secondVote;
  2242.  
  2243. let td = new Uint8Array(m.data);
  2244. // console.info(td);
  2245. //console.info(td);
  2246. //console.info(td.slice(98,-1));
  2247. var infotest = msgpack5.decode(td);
  2248. var info;
  2249. if(infotest.length > 1) {
  2250. info = [infotest[0], ...infotest[1]];
  2251. if (info[1] instanceof Array){
  2252. info = info;
  2253. }
  2254. } else {
  2255. info = infotest;
  2256. }
  2257.  
  2258. // console.log(info);
  2259. //console.info("received");
  2260. //console.info(new Date().getTime());
  2261. if(!info) return;
  2262. //if(!["c","5", "3"].includes(info[0])) console.log(info[0])
  2263. if (inInstaProcess){
  2264. doNewSend(["2", [nearestPlayerAngle]]);
  2265. }
  2266. // doNewSend(["2", 0.45]);
  2267. if (info[0]=="3"){ //player update
  2268. botTag();
  2269. playersNear = [];
  2270. var locInfoNow = info[1];
  2271. //console.log(locInfoNow)
  2272. //console.info(locInfoNow);
  2273. for (var i=0;i<locInfoNow.length/13;i++){
  2274. var playerData = locInfoNow.slice(13*i, 13*i+13);
  2275. if (playerData[0]==MYID){
  2276. myCLAN = playerData[7];
  2277. myPlayer = new player(playerData[0], playerData[1], playerData[2], playerData[7]);
  2278.  
  2279. var newTraps = [];
  2280. for (let arr of allTraps){
  2281. let objx = arr[1];
  2282. let objy = arr[2];
  2283. let objtype = arr[arr.length-2];
  2284. console.log(myPlayer);
  2285. let totalDist = Math.sqrt( (objx-myPlayer.x)**2 + (objy-myPlayer.y)**2 );
  2286. console.log(totalDist);
  2287. if (objtype == 15 && totalDist < 100){
  2288. let spikeVal;
  2289. if (havePoison()) {
  2290. spikeVal = 8;
  2291. } else if (haveGreat()){
  2292. spikeVal = 7;
  2293. } else if (haveSpinning()){
  2294. spikeVal = 9;
  2295. } else {
  2296. spikeVal = 6;
  2297. }
  2298.  
  2299. for (var j=0;j<20;j++){
  2300. let angle = (-1 * Math.PI + ((Math.PI*2)/20)*j) - 0.1;
  2301. placeSpike(spikeVal, angle);
  2302. console.log("c.data " + j);
  2303. console.log("c.data " + angle);
  2304. }
  2305.  
  2306. CORESTATE.intrap.active = true;
  2307. CORESTATE.intrap.extra = arr[0]; //object id
  2308.  
  2309. } else if (objtype == 15 && totalDist < 1500){
  2310. newTraps.push(arr)
  2311. }
  2312. }
  2313. allTraps = newTraps;
  2314.  
  2315. if (myPlayer.y < 2400){
  2316. CORESTATE.inwater.active = false;
  2317. if (!hasWinter) return;
  2318. if (previousZone != "winter"){
  2319. previousZone = "winter";
  2320. IN_PROCESS = true;
  2321. document.dns(["13c", [0, obs("winter cap"), 0]]);
  2322. IN_PROCESS = false;
  2323. if (askMeAgain) triggerAlert("Winter Cap", obs("winter cap"));
  2324. }
  2325. } else if (myPlayer.y > 6850 && myPlayer.y < 7550){
  2326. CORESTATE.inwater.active = true;
  2327. if (!hasFlipper) return;
  2328. if (previousZone != "river"){
  2329. previousZone = "river";
  2330. IN_PROCESS = true;
  2331. document.dns(["13c", [0, obs("flipper hat") , 0]]);
  2332. IN_PROCESS = false;
  2333. if (askMeAgain) triggerAlert("Flipper Hat", obs("flipper hat"));
  2334. }
  2335. } else {
  2336. CORESTATE.inwater.active = false;
  2337. if (previousZone != "normal"){
  2338. previousZone = "normal";
  2339. $("#hatChangeAlert").animate({opacity: 0, top: -300});
  2340. if (askMeAgain) document.dns(["13c", [0, currentHat, 0]]);
  2341.  
  2342. }
  2343. }
  2344. if (!targets.every(x => x===false)){
  2345. let targetXDir = targets[0];
  2346. let targetYDir = targets[1];
  2347. let correctAngle = Math.atan2(targetYDir-myPlayer.y, targetXDir-myPlayer.x);
  2348. document.dns(["3", [correctAngle]]);
  2349. //For every 1 second of travel, you go forward 320 pixels!
  2350. let totalDist = Math.sqrt( (targetXDir-myPlayer.x)**2 + (targetYDir-myPlayer.y)**2 );
  2351. let totalTime = Math.ceil(totalDist/319.2);
  2352. document.getElementById("timeest").innerHTML = `${totalTime} seconds...`
  2353.  
  2354. if (totalDist < 100){
  2355. targets = [false, false];
  2356. document.dns(["3", [null]]);
  2357. $("#infoDiv").animate({opacity: 0});
  2358. }
  2359.  
  2360. }
  2361. continue
  2362. }
  2363. if (playerData[7]===null || playerData[7] != myCLAN){
  2364. var locPlayer = new player(playerData[0], playerData[1], playerData[2], playerData[7]);
  2365. playersNear.push(locPlayer);
  2366. }
  2367.  
  2368. }
  2369. var nearestPlayerPosition = playersNear.sort( (a,b) => pdist(a, myPlayer) - pdist(b, myPlayer) );
  2370. var nearestPlayer = nearestPlayerPosition[0];
  2371. focusPlayerObj = nearestPlayer;
  2372. if (nearestPlayer){
  2373. CORESTATE.nearenemy.active = true;
  2374. nearestPlayerAngle = Math.atan2( nearestPlayer.y-myPlayer.y, nearestPlayer.x-myPlayer.x);
  2375. if (autoattack){
  2376. doNewSend(["3", [nearestPlayerAngle]]);
  2377. ws.send(encodeSEND([ "c",[1, null] ]));
  2378. aim(nearestPlayer.x-myPlayer.x+window.innerWidth/2, nearestPlayer.y-myPlayer.y+window.innerHeight/2);
  2379.  
  2380. $("#tbtn").css({opacity: 1, marginLeft: nearestPlayer.x-myPlayer.x+window.innerWidth/2-20, marginTop: nearestPlayer.y-myPlayer.y+window.innerHeight/2-20});
  2381. } else if (runaway) {
  2382. doNewSend(["3", [-1 * nearestPlayerAngle]]);
  2383. //$("#tbtn").animate({opacity: 0.5});
  2384. }
  2385. } else {
  2386. CORESTATE.nearenemy.active = false;
  2387. // $("#tbtn").animate({opacity: 0.5});
  2388. }
  2389.  
  2390. }
  2391.  
  2392. if (info[0]=="6"){
  2393. var locInfo = info[1];
  2394. if (locInfo[locInfo.length-1].toString() == MYID){ //Object created
  2395. if (window.innerWidth >= 770){
  2396. console.log(locInfo);
  2397. var itemID = `actionBarItem${locInfo[locInfo.length-2]+16}`;
  2398. var imgURL = document.getElementById(itemID).style.backgroundImage.toString().match(/url\("(.+)?(?=")/)[1];
  2399. console.info(imgURL);
  2400. let mapDisplay = document.getElementById("mapDisplay").getBoundingClientRect();
  2401. let mapSize = [14365, 14365];
  2402. let boxSize = [$("#mapDisplay").width(), $("#mapDisplay").height()];
  2403. let targets = [locInfo[1], locInfo[2]].map(item => (130*item)/14365);
  2404. let x = mapDisplay.x + targets[0] - 6;
  2405. let y = mapDisplay.y + targets[1] - 6;
  2406. let newTarget = document.createElement("div");
  2407. newTarget.rawX = targets[0];
  2408. newTarget.rawY = targets[1];
  2409. newTarget.rimgURL = imgURL;
  2410. newTarget.style = `background-image: url("${imgURL}"); background-size: 12px 12px; width:12px; height:12px; position:absolute; left: ${x}px; top:${y}px; opacity:0; z-index:100; cursor: pointer;`;
  2411. newTarget.className = "mapTarget";
  2412. document.getElementsByTagName("body")[0].appendChild(newTarget);
  2413. $(newTarget).animate({opacity: 1});
  2414. allMooMooObjects[locInfo[0]] = newTarget;
  2415.  
  2416. }
  2417. } else {
  2418. console.log(locInfo);
  2419. for (var i=0;i<locInfo.length/8;i+=1){
  2420. let arr = locInfo.slice(i*8, (i+1)*8); console.log(arr)
  2421. let objtype = arr[arr.length-2];
  2422. if (objtype == 15){
  2423. allTraps.push(arr);
  2424. }
  2425.  
  2426. }
  2427.  
  2428.  
  2429. }
  2430. }
  2431.  
  2432. if (info[0]=="12"){
  2433.  
  2434. var newTraps = [];
  2435. for (let trap of allTraps){
  2436. if (trap[trap.length-2] != info[1]) newTraps.push(trap);
  2437. }
  2438. allTraps = newTraps;
  2439.  
  2440.  
  2441. console.error(info);
  2442. if (Object.keys(allMooMooObjects).includes(info[1].toString())){
  2443. allMooMooObjects[info[1]].remove();
  2444. }
  2445. if (CORESTATE.intrap.active){
  2446. if (CORESTATE.intrap.extra == info[1]){
  2447. CORESTATE.intrap.active = false;
  2448. var newTraps = [];
  2449. for (let trap of allTraps){
  2450. if (trap[trap.length-2] != info[1]) newTraps.push(trap);
  2451. }
  2452. allTraps = newTraps;
  2453. }
  2454. }
  2455. }
  2456.  
  2457. // console.info("-------------")
  2458. if (info[0] == "1" && !MYID){
  2459. MYID = info[1];
  2460. }
  2461.  
  2462.  
  2463. if (info[0] == "18" && info[4]=="1200") {
  2464. console.info(info);
  2465. bowWorked = true;
  2466. }
  2467.  
  2468. if (info[0] == "h" && info[1] == MYID && autoheal){
  2469. console.info("doing stuff");
  2470. console.info(info);
  2471. if (info[2] < 100 && info[2] > 0){
  2472. recentHealth = info[2];
  2473. console.info("RECEIVED:");
  2474. console.info(info);
  2475. //recentHealth += hasApple ? 20 : 40;
  2476. console.info("heal notif sent");
  2477. setTimeout( () => {
  2478. heal();
  2479. }, autoHealSpeed);
  2480. } else if (info[2] > 0) {
  2481. console.info("done healing");
  2482. recentHealth = 100;
  2483. if (foodInHand){
  2484. console.info("okay bad thing happened");
  2485. var dataTemplate5 = {"type": 2, "data":[], "options":{"compress":false}, "nsp": "/"};
  2486. dataTemplate5["data"]=["5", [0, true]];
  2487. let encoded5 = encodeSEND(dataTemplate5["data"]);
  2488. ws.send(encoded5);
  2489. console.info("corrected bad thing");
  2490. }
  2491.  
  2492. } else {
  2493. hasApple = true; //You've died tragically in combat; back to the apple for you!
  2494. console.info("Setting has apple to true from here");
  2495. }
  2496. }
  2497. else if(info[0] == "11"){
  2498. console.info("doing death");
  2499. for (var elem of Object.values(allMooMooObjects)){
  2500. console.info(elem);
  2501. elem.style.opacity = 0;
  2502. }
  2503. hasApple = true;
  2504. justDied = true;
  2505. recentHealth = 100;
  2506.  
  2507. }
  2508.  
  2509. }
  2510.  
  2511. function pdist(player1, player2){
  2512. return Math.sqrt( Math.pow((player2.y-player1.y), 2) + Math.pow((player2.x-player1.x), 2) );
  2513. }
  2514.  
  2515. function haveApple(){
  2516. console.info("Im being used and justDied is:" + justDied);
  2517. if (justDied){
  2518. hasApple = true;
  2519. return true;
  2520. }
  2521. if (hasApple) hasApple = isElementVisible(document.getElementById("actionBarItem16"));
  2522. return hasApple;
  2523. }
  2524.  
  2525. function havePoison(){
  2526. let hasPoison = true;
  2527. if (hasPoison) hasPoison = isElementVisible(document.getElementById("actionBarItem24"));
  2528. return hasPoison;
  2529. }
  2530.  
  2531. /*$(window).resize( () => {
  2532. for (var elem of Object.values(allMooMooObjects)){
  2533. let mapDisplay = document.getElementById("mapDisplay").getBoundingClientRect();
  2534. let mapSize = [14365, 14365];
  2535. let boxSize = [$("#mapDisplay").width(), $("#mapDisplay").height()];
  2536. let x = mapDisplay.x + parseInt(elem.rawX) - 6;
  2537. let y = mapDisplay.y + parseInt(elem.rawY) - 6;
  2538. console.log(x, y);
  2539. elem.style = `background-image: url("${elem.rimgURL}"); background-size: 12px 12px; width:12px; height:12px; position:absolute; left: ${x}px; top:${y}px; opacity:0; z-index:100; cursor: pointer;`;
  2540. }
  2541. });*/
  2542.  
  2543. function haveGreat(){
  2544. let hasGreat = true;
  2545. if (hasGreat) hasGreat = isElementVisible(document.getElementById("actionBarItem23"));
  2546. return hasGreat;
  2547. }
  2548.  
  2549. function haveSpinning(){
  2550. let hasSpinning = true;
  2551. if (hasSpinning) hasSpinning = isElementVisible(document.getElementById("actionBarItem25"));
  2552. return hasSpinning;
  2553. }
  2554.  
  2555. function doNewSend(sender){
  2556. ws.send(encodeSEND(sender));
  2557. }
  2558.  
  2559. function placeSpike(item, angle){
  2560. ws.send(encodeSEND( ["5", [item, null]]));
  2561. ws.send(encodeSEND([
  2562. "c",
  2563. [
  2564. 1,
  2565. angle ? angle : null
  2566. ]
  2567. ]));
  2568.  
  2569. ws.send(encodeSEND([
  2570. "c",
  2571. [
  2572. 0,
  2573. null
  2574. ]
  2575. ])); //spike function by
  2576. }
  2577.  
  2578. $("#mapDisplay").on("click", (event) => {
  2579. if (!targets.every(x=>x===false)) return;
  2580.  
  2581. $("#spotDiv").css({zIndex: 10000});
  2582. var xpos = event.pageX - $("#mapDisplay").offset().left;
  2583. var ypos = event.pageY - $("#mapDisplay").offset().top;
  2584. var mapWidth = $("#mapDisplay").width();
  2585. var mapHeight = $("#mapDisplay").height();
  2586. var shiftX = (xpos/mapWidth)*14365;
  2587. var shiftY = (ypos/mapHeight)*14365;
  2588. targets = [shiftX, shiftY];
  2589. var infoDiv = document.createElement("div");
  2590. infoDiv.innerHTML = `<h1 id="autotitle">You are currently in BHARATHI Mod auto-pilot.</h1>
  2591. <h3 id="arrivalest">You will arrive in <span id="timeest">30 seconds...</span></h3>
  2592.  
  2593. <button type="button" id="cancelTrip">Cancel</button>`;
  2594. infoDiv.id = "infoDiv";
  2595. document.body.prepend(infoDiv);
  2596.  
  2597. let spotDiv = document.createElement("div");
  2598. spotDiv.id = "spotDiv";
  2599. spotDiv.className = "spotDiv";
  2600. document.body.prepend(spotDiv);
  2601. $("#spotDiv").css({left: event.pageX, top: event.pageY});
  2602. $("#spotDiv").animate({width: '50px', height: '50px', marginLeft: '-25px', marginTop: '-25px', borderRadius: '25px', opacity: 0}, 2000);
  2603. var spotDivs = [];
  2604. let coreInterval = setInterval( () => {
  2605. console.log('looping');
  2606. if (targets.every(x=>x===false)){
  2607. clearInterval(coreInterval);
  2608. console.log('clearing');
  2609. for (let elementDiv of document.getElementsByClassName("spotDiv")){
  2610. document.body.removeChild(elementDiv);
  2611. }
  2612.  
  2613. } else {
  2614. let spotDiv = document.createElement("div");
  2615. spotDiv.id = "spotDiv";
  2616. spotDiv.className = "spotDiv";
  2617. document.body.prepend(spotDiv);
  2618. $("#spotDiv").css({left: event.pageX, top: event.pageY});
  2619. $("#spotDiv").animate({width: '50px', height: '50px', marginLeft: '-25px', marginTop: '-25px', borderRadius: '25px', opacity: 0}, 2000);
  2620. spotDivs.push(spotDiv);
  2621. }
  2622. }, 700);
  2623.  
  2624. })
  2625.  
  2626. document.dns = doNewSend;
  2627.  
  2628.  
  2629. function botTag(){
  2630. if (!botSpan || !isElementVisible(botSpan)){
  2631. botSpan = document.createElement("span");
  2632. botSpan.id = "botText";
  2633. var ageDiv = document.getElementById("ageText");
  2634. ageDiv.prepend(botSpan);
  2635. }
  2636.  
  2637. if (autoattack){
  2638. botSpan.innerHTML = "BOT "
  2639. console.log(botSpan);
  2640. console.log(botSpan.id)
  2641. console.log(botSpan.innerHTML)
  2642. } else {
  2643. $("#tbtn").animate({opacity: 0});
  2644. botSpan.innerHTML = "";
  2645. }
  2646. }
  2647.  
  2648. $(document).on("click", "#cancelTrip", () => {
  2649. targets = [false, false];
  2650. document.dns(["3", [null]]);
  2651. $("#infoDiv").animate({opacity: 0});
  2652. })
  2653.  
  2654. document.title="BHARATHI Mod: Autoheal ON"
  2655.  
  2656. document.addEventListener('keypress', (e)=>{
  2657.  
  2658.  
  2659. if (e.keyCode == 116 && document.activeElement.id.toLowerCase() !== 'chatbox'){
  2660. STATE+=1;
  2661. let coreIndex = STATE%2; //STATE%4;
  2662. //let truthArray = [ [1,2].includes(coreIndex), [0,1].includes(coreIndex)];
  2663. //autobull = truthArray[0];
  2664. autoheal = coreIndex == 0; //truthArray[1];
  2665. document.title = document.title=`BHARATHI Mod: Autoheal ${autoheal ? "ON" : "OFF"}` //"Heal " + (autoheal ? "ON" : "OFF") + " / Bull Hat " + (autobull ? "ON" : "OFF");
  2666. } else if (e.keyCode == trapKey && document.activeElement.id.toLowerCase() !== 'chatbox') { //Place a trap
  2667. console.log("UH OH")
  2668. var dataTemplate = {"data":[], "options":{"compress":true}, "nsp": "/", "type": 2};
  2669. var data50 = dataTemplate;
  2670. if (isElementVisible(document.getElementById("actionBarItem31"))){
  2671. data50["data"]=["5", [15, 0]];
  2672. } else {
  2673. data50["data"]=["5", [16, 0]];
  2674. }
  2675. ws.send(encodeSEND(data50["data"]));
  2676. var data51 = dataTemplate;
  2677. data51["data"]=[
  2678. "c",
  2679. [
  2680. 1,
  2681. null
  2682. ]
  2683. ];
  2684. let encoded2 = encodeSEND(data51["data"]);
  2685. ws.send(encoded2);
  2686. dataTemplate["data"]=["c",0, null];
  2687. let encoded = encodeSEND(dataTemplate);
  2688. ws.send(encoded);
  2689.  
  2690. } else if (e.keyCode == 112 && document.activeElement.id.toLowerCase() !== 'chatbox'){
  2691. autoattack = !autoattack
  2692. botTag();
  2693.  
  2694. } else if (e.keyCode == 103 && document.activeElement.id.toLowerCase() !== 'chatbox') {
  2695. repeatingLast = !repeatingLast;
  2696.  
  2697.  
  2698.  
  2699. } else if (e.keyCode == spikeKey && document.activeElement.id.toLowerCase() !== 'chatbox') { //Place a spike
  2700. if (havePoison()) {
  2701. placeSpike(8);
  2702. } else if (haveGreat()){
  2703. placeSpike(7);
  2704. } else if (haveSpinning()){
  2705. placeSpike(9);
  2706. } else {
  2707. placeSpike(6);
  2708. }
  2709.  
  2710. } else if (e.keyCode == instaKillKey && document.activeElement.id.toLowerCase() !== 'chatbox') {
  2711. let allActiveItems = Array.from(document.getElementById("actionBar").children).filter(x=>x.style.display != "none");
  2712. let allActiveIDs = allActiveItems.map(x=>parseInt(x.id.replace("actionBarItem", "")));
  2713. switchToWep = allActiveIDs[0];
  2714. switchToRange = allActiveIDs[1];
  2715. console.info(currentAccessory);
  2716. var ctime = new Date().getTime();
  2717. console.info(inInstaProcess)
  2718. if (!inInstaProcess){
  2719. console.info("got in");
  2720. inInstaProcess = true
  2721. IN_PROCESS = true;
  2722.  
  2723. doNewSend(["13c", [0, bullHelm, 0]]);
  2724. if (currentAccessory == monkeyTail){
  2725. doNewSend(["13c", [0, 0, 1]]);
  2726. }
  2727. doNewSend(["5", [switchToWep, true]]);
  2728. console.info("Starting at 0");
  2729.  
  2730. //after bad
  2731.  
  2732.  
  2733. setTimeout( () => {
  2734. doNewSend(["2", [nearestPlayerAngle]]);
  2735. doNewSend([
  2736. "c",
  2737. [
  2738. 1,
  2739. null
  2740. ]
  2741. ]); //If we're perfect, we only send this once
  2742. console.info(`Sending swing at ${new Date().getTime() - ctime}`);
  2743. ctime = new Date().getTime();
  2744. }, 20);
  2745.  
  2746.  
  2747.  
  2748. setTimeout( () => {
  2749. doNewSend(["2", [nearestPlayerAngle]]);
  2750. doNewSend(["5", [switchToRange, true]]);
  2751. console.info(`Changed weapon at ${new Date().getTime() - ctime}`);
  2752. ctime = new Date().getTime();
  2753. }, document.timeTween); //120-140?
  2754.  
  2755.  
  2756.  
  2757.  
  2758. setTimeout( () => {
  2759. doNewSend(["c", [0, null]]);
  2760. doNewSend(["13c", [0, currentHat, 0]]);
  2761. if (currentAccessory == monkeyTail){
  2762. doNewSend(["13c", [0, currentAccessory, 1]]);
  2763. }
  2764. doNewSend(["5", [switchToWep, true]]);
  2765. console.info(`Finished at ${new Date().getTime() - ctime}`);
  2766. ctime = new Date().getTime();
  2767. }, 600);
  2768.  
  2769. setTimeout( () => {
  2770. if (bowWorked){
  2771. doNewSend(["5", [switchToRange, true]]);
  2772. }
  2773. }, 730);
  2774.  
  2775. setTimeout( () => {
  2776. if (bowWorked){
  2777. doNewSend([
  2778. "c",
  2779. [
  2780. 1,
  2781. null
  2782. ]
  2783. ]);
  2784. }
  2785. }, 840);
  2786.  
  2787. setTimeout( () => {
  2788. if (bowWorked){
  2789. doNewSend(["c", [0, null]]);
  2790. }
  2791. }, 950);
  2792.  
  2793. setTimeout( () => {
  2794. inInstaProcess = false;
  2795. if (bowWorked){
  2796. doNewSend(["5", [switchToWep, true]]);
  2797. setTimeout( () => {
  2798. doNewSend(["c", [0, null]]);
  2799. }, 300);
  2800. bowWorked = false;
  2801. IN_PROCESS = false;
  2802. }
  2803. IN_PROCESS = false;
  2804. }, 1060);
  2805.  
  2806. //if it worked, fire, if it didn't dont fire
  2807. }
  2808.  
  2809. //IT WORKS ON AND OFF
  2810. // WTF ??!?p!?
  2811.  
  2812.  
  2813. } else if (document.activeElement.id.toLowerCase() !== 'chatbox' ){
  2814. if (e.keyCode == 108){ //use pressed "l"; spikes
  2815.  
  2816.  
  2817. let spikeVal;
  2818. if (havePoison()) {
  2819. spikeVal = 8;
  2820. } else if (haveGreat()){
  2821. spikeVal = 7;
  2822. } else if (haveSpinning()){
  2823. spikeVal = 9;
  2824. } else {
  2825. spikeVal = 6;
  2826. }
  2827.  
  2828.  
  2829. for (var i=0;i<4;i++){
  2830. let angle = (Math.PI/2)*i;
  2831. /*let x = Math.cos(angle)*50;
  2832. let y = Math.sin(angle)*50;
  2833. console.log(x, y);
  2834. aim(x, y);*/
  2835. document.dns(["2", [angle]]);
  2836. placeSpike(spikeVal);
  2837.  
  2838. }
  2839.  
  2840.  
  2841. } else if (e.keyCode == 111){ //user pressed "i"; traps
  2842. for (var j=0;j<4;j++){
  2843. document.dns(["2", [(Math.PI/2)*j]]);
  2844. document.dns(["5", [15, 0]]);
  2845. document.dns(["c", [1, null]]);
  2846. document.dns(["c", [0, null]]);
  2847. }
  2848.  
  2849. } else if (e.keyCode == iPressKey){
  2850.  
  2851. if (CORESTATE.ipress.rel){
  2852. if (CORESTATE.ipress.rel == "puton"){
  2853. document.dns(["13c", [0, putonName, 0]]);
  2854. } else if (CORESTATE.ipress.rel == "place"){
  2855. placeSpike(placeName);
  2856. }
  2857. }
  2858. }
  2859. else if (e.keyCode == 104){
  2860. if (focusPlayerObj && focusPlayerObj.clan){
  2861. document.dns(["10", [focusPlayerObj.clan]]);
  2862. }
  2863. }
  2864. }
  2865. });
  2866.  
  2867.  
  2868. document.body.oncontextmenu = (e) => {
  2869.  
  2870. noallow = true;
  2871.  
  2872. setTimeout( () => {
  2873.  
  2874. let allActiveItems = Array.from(document.getElementById("actionBar").children).filter(x=>x.style.display != "none");
  2875. let allActiveIDs = allActiveItems.map(x=>parseInt(x.id.replace("actionBarItem", "")));
  2876. switchToWep = allActiveIDs[0];
  2877. switchToRange = allActiveIDs[1];
  2878. console.info(currentAccessory);
  2879. var ctime = new Date().getTime();
  2880. console.info(inInstaProcess)
  2881. if (!inInstaProcess){
  2882. console.info("got in");
  2883. inInstaProcess = true
  2884. IN_PROCESS = true;
  2885.  
  2886. doNewSend(["13c", [0, bullHelm, 0]]);
  2887. if (currentAccessory == monkeyTail){
  2888. doNewSend(["13c", [0, 0, 1]]);
  2889. }
  2890. doNewSend(["5", [switchToWep, true]]);
  2891. console.info("Starting at 0");
  2892.  
  2893. //after bad
  2894.  
  2895.  
  2896. setTimeout( () => {
  2897. doNewSend(["2", [nearestPlayerAngle]]);
  2898. doNewSend([
  2899. "c",
  2900. [
  2901. 1,
  2902. null
  2903. ]
  2904. ]); //If we're perfect, we only send this once
  2905. console.info(`Sending swing at ${new Date().getTime() - ctime}`);
  2906. ctime = new Date().getTime();
  2907. }, 20);
  2908.  
  2909.  
  2910.  
  2911. setTimeout( () => {
  2912. doNewSend(["2", [nearestPlayerAngle]]);
  2913. doNewSend(["5", [switchToRange, true]]);
  2914. console.info(`Changed weapon at ${new Date().getTime() - ctime}`);
  2915. ctime = new Date().getTime();
  2916. }, document.timeTween); //120-140?
  2917.  
  2918.  
  2919.  
  2920.  
  2921. setTimeout( () => {
  2922. doNewSend(["c", [0, null]]);
  2923. doNewSend(["13c", [0, currentHat, 0]]);
  2924. if (currentAccessory == monkeyTail){
  2925. doNewSend(["13c", [0, currentAccessory, 1]]);
  2926. }
  2927. doNewSend(["5", [switchToWep, true]]);
  2928. console.info(`Finished at ${new Date().getTime() - ctime}`);
  2929. ctime = new Date().getTime();
  2930. }, 600);
  2931.  
  2932. setTimeout( () => {
  2933. if (bowWorked){
  2934. doNewSend(["5", [switchToRange, true]]);
  2935. }
  2936. }, 730);
  2937.  
  2938. setTimeout( () => {
  2939. if (bowWorked){
  2940. doNewSend([
  2941. "c",
  2942. [
  2943. 1,
  2944. null
  2945. ]
  2946. ]);
  2947. }
  2948. }, 840);
  2949.  
  2950. setTimeout( () => {
  2951. if (bowWorked){
  2952. doNewSend(["c", [0, null]]);
  2953. }
  2954. }, 950);
  2955.  
  2956. setTimeout( () => {
  2957. inInstaProcess = false;
  2958. if (bowWorked){
  2959. doNewSend(["5", [switchToWep, true]]);
  2960. setTimeout( () => {
  2961. doNewSend(["c", [0, null]]);
  2962. }, 300);
  2963. bowWorked = false;
  2964. IN_PROCESS = false;
  2965. }
  2966. IN_PROCESS = false;
  2967. }, 1060);
  2968.  
  2969. //if it worked, fire, if it didn't dont fire
  2970. }
  2971.  
  2972. //IT WORKS ON AND OFF
  2973. // WTF ??!?p!?
  2974.  
  2975.  
  2976. }, 150);
  2977. }
  2978.  
  2979.  
  2980. document.ps = placeSpike;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement