Advertisement
Guest User

for myself

a guest
Sep 23rd, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 37.05 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Master Upgrade Script
  3. // @namespace -
  4. // @version upgrade with schock monitors by RX stole from RoYaL xd
  5. // @description dont share please
  6. // @author Lol hacked so idk who
  7. // @match *://moomoo.io/*
  8. // @match http://dev.moomoo.io/*
  9. // @match *sandbox.moomoo.io/*
  10. // @match *abc.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. // ==/UserScript==
  17.  
  18. var hud = document.createElement("div");
  19. hud.innerHTML = '<div> <div id="WSDIhtmlDiv" class="hackDisp" border="0" style="opacity: 1;width: 200px; position: absolute;top: 333px;left: 20px;pointer-events: none;"> <input id="WSDirectInputhtml" class="hackDisp" type="text" position="absolute" placeholder="WS Sender" style="padding: 6px;font-size: 20px;color: #fff;background-color: rgba(0, 0, 0, 0.25);-webkit-border-radius: 4px;-moz-border-radius: 4px;border-radius: 4px;pointer-events: all;border: 0;text-align: center;"> </div></div><div style="width: 100%;position: absolute;top: 20px;right: 390px;margin: auto;text-align: center;color: red;font-size: 40px;opacity: 1;" id="TS1Shothtml" class="hackDisp"></div><table id="WSTable" class="hackDisp" style="opacity: 1;min-width: 100px;max-width: 157.8px;max-height: 296px;position: absolute;top: 20px;left: 20px;color: #fff;background-color: rgba(0, 0, 0, 0.25);border-radius: 4px;-moz-border-radius: 4px;-webkit-border-radius: 4px;pointer-events: none;text-align: left;" border="0px"> <tbody><tr> <th id="WS1">No Activity Yet</th> </tr> <tr> <td id="WS2">No Activity Yet</td> </tr> <tr> <td id="WS3">No Activity Yet</td> </tr> <tr> <td id="WS4">No Activity Yet</td> </tr> <tr> <td id="WS5">No Activity Yet</td> </tr> <tr> <td id="WS6">No Activity Yet</td> </tr> <tr> <td id="WS7">No Activity Yet</td> </tr> <tr> <td id="WS8">No Activity Yet</td> </tr> <tr> <td id="WS9">No Activity Yet</td> </tr> <tr> <td id="WS10">No Activity Yet</td> </tr> <tr> <td id="WS11">No Activity Yet</td> </tr> <tr> <td id="WS12">No Activity Yet</td> </tr> <tr> <td id="WS13">No Activity Yet</td> </tr> <tr> <td id="WS14">No Activity Yet</td> </tr> <tr> <td id="WS15">No Activity Yet</td> </tr> <tr> <td><input type="checkbox" id="noShowDWS" style="pointer-events: all;" checked="">Filter Out PD, pp, &amp; rmd</td> </tr> </tbody></table> <table id="WSBTable" class="hackDisp" style="opacity: 1;min-width: 100px;max-height: 296px;position: absolute;top: 20px;left: 185px;color: #fff;background-color: rgba(0, 0, 0, 0.25);border-radius: 4px;-moz-border-radius: 4px;-webkit-border-radius: 4px;pointer-events: none;text-align: left;" border="0px"> <tbody><tr> <th id="WSB1">Focus not set</th> </tr> <tr> <td id="WSB2">Focus not set</td> </tr> <tr> <td id="WSB3">Focus not set</td> </tr> <tr> <td id="WSB4">Focus not set</td> </tr> <tr> <td id="WSB5">Focus not set</td> </tr> <tr> <td id="WSB6">Focus not set</td> </tr> <tr> <td id="WSB7">Focus not set</td> </tr> <tr> <td id="WSB8">Focus not set</td> </tr> <tr> <td id="WSB9">Focus not set</td> </tr> <tr> <td id="WSB10">Focus not set</td> </tr> <tr> <td id="WSB11">Focus not set</td> </tr> <tr> <td id="WSB12">Focus not set</td> </tr> <tr> <td id="WSB13">Focus not set</td> </tr> <tr> <td id="WSB14">Focus not set</td> </tr> <tr> <td id="WSB15">Focus not set</td> </tr> </tbody></table>';
  20. document.getElementsByTagName("body")[0].appendChild(hud);
  21. $(hud).animate({opacity: 1});
  22.  
  23. var ws;
  24. var WSFocus = "all";
  25. var WSBFocus;
  26. var WSBRecord = false;
  27. var WSBList = "data:text/html, <p>";
  28. const START_SSWX = [146, 161, 52, 146, 1, 192]
  29. const END_SSWX = [146, 161, 52, 146, 0, 192]
  30. 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];
  31. 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];
  32. 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];
  33. const PIZZA = [97, 117, 116, 111, 115, 112, 101, 101, 100]
  34. var currentHat = 0;
  35. var currentAccessory = 0;
  36. var IN_PROCESS = false;
  37. var justDied = false;
  38. var recentHealth = 100;
  39. var MYID;
  40. var hasApple = true;
  41. var foodInHand = false;
  42. var autoheal = false;
  43. var autobull = false;
  44. var STATE = 0;
  45. var msgpack5 = msgpack;
  46. var inInstaProcess = false;
  47. var bowWorked = false;
  48. var myCLAN = null;
  49. var goodData;
  50. var myPlayer;
  51. var nearestPlayer;
  52. var nearestPlayerAngle = 0;
  53. var MYANGLE = 0;
  54. let coregood = [212, 0, 0, 167, 111, 112, 116, 105, 111, 110, 115, 129, 168, 99, 111, 109, 112];
  55. var autoreloadloop;
  56. var autoreloadenough = 0;
  57. var constChatLoop;
  58. var constChatLoopAll;
  59. var policeLoop;
  60. var policeLoopC;
  61. var policeLoopAll;
  62. var policeLoopAllC;
  63.  
  64. 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]
  65. document.msgpack = msgpack;
  66. function n(){
  67. this.buffer = new Uint8Array([0]);
  68. this.buffer.__proto__ = new Uint8Array;
  69. this.type = 0;
  70. }
  71.  
  72. 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];
  73. document.n = nval;
  74. document.timeTween = 130;
  75.  
  76. function replaceFromArray(oldp, newp, array){
  77. return array.join(",").replace(oldp.join(","), newp.join(",")).split(",").map(x => parseInt(x))
  78.  
  79. }
  80.  
  81. autoreloadloop = setInterval(function () {
  82. if (autoreloadenough < 200) {
  83. document.title = "autoReloader working";
  84. if (document.getElementById("loadingText").innerHTML == `disconnected<a href="javascript:window.location.href=window.location.href" class="ytLink">reload</a>`) {
  85. document.title = "autoReloader done";
  86. clearInterval(autoreloadloop);
  87. setTimeout(function () {document.title = "Moo Moo";}, 1000)
  88. location.reload();
  89. }
  90. autoreloadenough++;
  91. }
  92. else if (autoreloadenough >= 300) {
  93. clearInterval(autoreloadloop);
  94. document.title = "autoReloader done";
  95. setTimeout(function () {document.title = "Moo Moo";}, 1000)
  96. }
  97. }, 50);
  98.  
  99. function healthFunction(t, a) {
  100. return Math.abs(((t + a/2) % a) - a/2);
  101. }
  102.  
  103. function encodeSEND(json){
  104. let OC = msgpack5.encode(json);
  105. 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);
  106. return new Uint8Array(aAdd).buffer;
  107. }
  108.  
  109. WebSocket.prototype.oldSend = WebSocket.prototype.send;
  110. WebSocket.prototype.send = function(m){
  111. //console.info(new Uint8Array(m));
  112.  
  113. if (!ws){
  114. document.ws = this;
  115.  
  116. ws = this;
  117. console.info("WS SET");
  118. socketFound(this);
  119. }
  120.  
  121.  
  122. if (inInstaProcess){
  123. this.oldSend(m);
  124. console.log("here");
  125. return;
  126. }
  127. let x = new Uint8Array(m);
  128. this.oldSend(m);
  129. //console.info(x);
  130. let x_arr_SSX = Array.from(x);
  131.  
  132. /*let usageArray = Array.from(new Uint8Array(m));
  133. if (usageArray.length == 45){
  134. if (usageArray[16] == 0 || usageArray[16] == 1) foodInHand = false;
  135. console.info(`Food in hand: null{foodInHand}`);
  136.  
  137. };*/
  138.  
  139. let realData = {}
  140. let realInfo = msgpack5.decode(x);
  141. if (realInfo[1] instanceof Array){
  142. realData.data = [realInfo[0], ...realInfo[1]]
  143. } else {
  144. realData.data = realInfo
  145. }
  146.  
  147. //console.log(realData)
  148. //console.info("sent");
  149. //console.info(realData.data);
  150. if(realData.data[0]!="2") {
  151. console.info("HERE3");
  152. console.info(realData.data[0])
  153. console.info(realData.data);
  154. console.log(x);
  155. if (realData.data[0]=="3"){
  156. //console.info(realData.data[1]);
  157. /*console.info(new Uint8Array(m));
  158. if(typeof realData.data[1] != "number" && !nval){
  159. nval = realData.data[1];
  160. document.n = nval;
  161. console.info("SET NVAL to");
  162. console.info(nval);
  163.  
  164.  
  165. }*/
  166. /*console.info(typeof realData.data[2]);
  167. console.info(realData.data[2].buffer);
  168. goodData = realData.data;
  169. console.info(goodData);
  170. console.info(["5", 0, nval]);
  171. document.n = goodData[2];
  172. document.nval = nval*/
  173. }
  174. }
  175. //console.info(new Date().getTime());
  176. var rd0 = realData.data[0];
  177. var rd1 = realData.data[1];
  178. var rd2 = realData.data[2];
  179. var rd3 = realData.data[3];
  180. var rd4 = realData.data[4];
  181.  
  182. if (document.getElementById("noShowDWS").checked == false || document.getElementById("noShowDWS").checked == true && rd0 != 2) {
  183. if (rd0 == "pp" && document.getElementById("noShowDWS").checked == true) {
  184. } else if (rd0 == "rmd" && document.getElementById("noShowDWS").checked == true) {}
  185. else {
  186. if (WSFocus == "all" || WSFocus == realData.toString().slice(0, WSFocus.length)) {
  187. wsLog(rd0, rd1, rd2, rd3, rd4);
  188. }
  189. }
  190. }
  191. if (realData.data[0]=="1"){
  192. console.info("user respawned");
  193. justDied = false;
  194. } else if (realData.data[0]=="13"){
  195. console.info("In Hat Part");
  196. console.info(realData);
  197. console.info(IN_PROCESS);
  198. console.info(realData.data);
  199. console.info("test");
  200. if (!IN_PROCESS && realData.data.length == 4 && realData.data[3]==0 &&realData.data[1]==0){
  201. currentHat = realData.data[2];
  202. console.info("Changed hat to " + currentHat);
  203.  
  204. } else if (!IN_PROCESS && realData.data.length == 4 && realData.data[3]==1 &&realData.data[1]==0){
  205. currentAccessory = realData.data[2];
  206. console.info("Changed accessory to " + currentAccessory);
  207. }
  208.  
  209. } else if (realData.data[0]=="2"){
  210. MYANGLE = realData.data[1];
  211. } else if (realData.data[0]=="5") {
  212. console.info("hai");
  213. console.info(new Uint8Array(m));
  214. console.info(realData.data);
  215. }
  216. };
  217.  
  218. function socketFound(socket){
  219. socket.addEventListener('message', function(message){
  220. handleMessage(message);
  221. });
  222. }
  223.  
  224. function isElementVisible(e) {
  225. return (e.offsetParent !== null);
  226. }
  227.  
  228. function heal(){ //unused but removing could leave holes
  229. console.log("healing");
  230. if (recentHealth>=100) return;
  231. console.info(recentHealth);
  232. console.info(`HERE I AM IN THE HEAL FUNC with ${hasApple}`);
  233. var dataTemplate = {"data":[], "options":{"compress":true}, "nsp": "/", "type": 2};
  234. if (hasApple){
  235. if (!haveApple()){
  236. heal();
  237. return;
  238. }
  239. else { //User has apple
  240. var data2 = dataTemplate;
  241. data2['data'] = goodData != undefined ? goodData : ["5", [0]];
  242. ws.send(encodeSEND(data2['data']));
  243.  
  244. }
  245. }
  246. else { //User has cookie
  247. console.info('user has cookie');
  248. var data3 = dataTemplate;
  249. data3['data'] = ["5", [1]];
  250. ws.send(encodeSEND(data3['data']));
  251. }
  252. dataTemplate["data"]=["c", [
  253. 1, MYANGLE]];
  254. let encoded = encodeSEND(dataTemplate['data']);
  255. ws.send(encoded);
  256.  
  257. recentHealth += hasApple ? 20 : 40;
  258.  
  259. }
  260.  
  261. function handleMessage(m){
  262. let td = new Uint8Array(m.data);
  263. // console.info(td);
  264. //console.info(td);
  265. //console.info(td.slice(98,-1));
  266. var infotest = msgpack5.decode(td);
  267. var info;
  268. if(infotest.length > 1) {
  269. info = [infotest[0], ...infotest[1]];
  270. if (info[1] instanceof Array){
  271. info = info;
  272. }
  273. } else {
  274. info = infotest;
  275. }
  276. // console.log(info);
  277. //console.info("received");
  278. //console.info(new Date().getTime());
  279. if(!info) return;
  280. if (inInstaProcess){
  281. doNewSend(["2", [nearestPlayerAngle]]);
  282. }
  283. // doNewSend(["2", 0.45]);
  284. if (info[0] == "h"){
  285. console.info("doing stuff");
  286. console.info(info);
  287. if (info[1] == MYID) {
  288. if (info[2] < 100 && info[2] > 0 && autoheal){
  289. recentHealth = info[2];
  290. console.info("RECEIVED:");
  291. console.info(info);
  292. //recentHealth += hasApple ? 20 : 40;
  293. console.info("heal notif sent");
  294. setTimeout( () => {
  295. heal();
  296. }, autoHealSpeed);
  297. } else if (info[2] > 0 && autoheal) {
  298. console.info("done healing");
  299. recentHealth = 100;
  300. if (foodInHand){
  301. console.info("okay bad thing happened");
  302. var dataTemplate5 = {"type": 2, "data":[], "options":{"compress":false}, "nsp": "/"};
  303. dataTemplate5["data"]=["5", [0, true]];
  304. let encoded5 = encodeSEND(dataTemplate5["data"]);
  305. ws.send(encoded5);
  306. console.info("corrected bad thing");
  307. }
  308. } else if (autoheal) {
  309. hasApple = true; //You've died tragically in combat; back to the apple for you!
  310. console.info("Setting has apple to true from here");
  311. }
  312. }
  313. }
  314. if (WSBFocus == undefined) {}
  315. else if (WSBFocus == "all" || WSBFocus == info.toString().slice(0, WSBFocus.length)) {
  316. wsbLog(info);
  317. }
  318.  
  319. // console.info("-------------")
  320. if (info[0] == "1" && !MYID){
  321. MYID = info[1];
  322. }
  323.  
  324.  
  325. if (info[0] == "18" && info[4]=="1200") {
  326. console.info(info);
  327. bowWorked = true;
  328. }
  329.  
  330. else if(info[0] == "11"){
  331. console.info("doing death");
  332. hasApple = true;
  333. justDied = true;
  334. recentHealth = 100;
  335. }
  336. }
  337.  
  338. function pdist(player1, player2){
  339. return Math.sqrt( Math.pow((player2.y-player1.y), 2) + Math.pow((player2.x-player1.x), 2) );
  340. }
  341.  
  342. function haveApple(){
  343. console.info("Im being used and justDied is:" + justDied);
  344. if (justDied){
  345. hasApple = true;
  346. return true;
  347. }
  348. if (hasApple) hasApple = isElementVisible(document.getElementById("actionBarItem14"));
  349. return hasApple;
  350. }
  351.  
  352. function doNewSend(sender){
  353. ws.send(encodeSEND(sender));
  354. }
  355.  
  356. function wsLog (rd0, rd1, rd2, rd3, rd4) {
  357. rd1 = (rd1==undefined) ? "" : ", "+rd1;
  358. rd2 = (rd2==undefined) ? "" : ", "+rd2;
  359. rd3 = (rd3==undefined) ? "" : ", "+rd3;
  360. rd4 = (rd4==undefined) ? "" : ", "+rd4;
  361. document.getElementById("WS15").innerHTML = document.getElementById("WS14").innerHTML;
  362. document.getElementById("WS14").innerHTML = document.getElementById("WS13").innerHTML;
  363. document.getElementById("WS13").innerHTML = document.getElementById("WS12").innerHTML;
  364. document.getElementById("WS12").innerHTML = document.getElementById("WS11").innerHTML;
  365. document.getElementById("WS11").innerHTML = document.getElementById("WS10").innerHTML;
  366. document.getElementById("WS10").innerHTML = document.getElementById("WS9").innerHTML;
  367. document.getElementById("WS9").innerHTML = document.getElementById("WS8").innerHTML;
  368. document.getElementById("WS8").innerHTML = document.getElementById("WS7").innerHTML;
  369. document.getElementById("WS7").innerHTML = document.getElementById("WS6").innerHTML;
  370. document.getElementById("WS6").innerHTML = document.getElementById("WS5").innerHTML;
  371. document.getElementById("WS5").innerHTML = document.getElementById("WS4").innerHTML;
  372. document.getElementById("WS4").innerHTML = document.getElementById("WS3").innerHTML;
  373. document.getElementById("WS3").innerHTML = document.getElementById("WS2").innerHTML;
  374. document.getElementById("WS2").innerHTML = document.getElementById("WS1").innerHTML;
  375. document.getElementById("WS1").innerHTML = rd0+rd1+rd2+rd3+rd4;
  376. }
  377.  
  378. function wsbLog (info) {
  379. var i;
  380. for (i = 0; i < info.length; i++) {
  381. info[i] = " | " + info[i] + " | ";
  382. }
  383. document.getElementById("WSB15").innerHTML = document.getElementById("WSB14").innerHTML;
  384. document.getElementById("WSB14").innerHTML = document.getElementById("WSB13").innerHTML;
  385. document.getElementById("WSB13").innerHTML = document.getElementById("WSB12").innerHTML;
  386. document.getElementById("WSB12").innerHTML = document.getElementById("WSB11").innerHTML;
  387. document.getElementById("WSB11").innerHTML = document.getElementById("WSB10").innerHTML;
  388. document.getElementById("WSB10").innerHTML = document.getElementById("WSB9").innerHTML;
  389. document.getElementById("WSB9").innerHTML = document.getElementById("WSB8").innerHTML;
  390. document.getElementById("WSB8").innerHTML = document.getElementById("WSB7").innerHTML;
  391. document.getElementById("WSB7").innerHTML = document.getElementById("WSB6").innerHTML;
  392. document.getElementById("WSB6").innerHTML = document.getElementById("WSB5").innerHTML;
  393. document.getElementById("WSB5").innerHTML = document.getElementById("WSB4").innerHTML;
  394. document.getElementById("WSB4").innerHTML = document.getElementById("WSB3").innerHTML;
  395. document.getElementById("WSB3").innerHTML = document.getElementById("WSB2").innerHTML;
  396. document.getElementById("WSB2").innerHTML = document.getElementById("WSB1").innerHTML;
  397. document.getElementById("WSB1").innerHTML = info;
  398. if (WSBRecord == true) {
  399. WSBList = WSBList + info.toString() + "<br><br>";
  400. }
  401. }
  402.  
  403. function evalCommand (cmd) {
  404. cmd = cmd.slice(1, cmd.length).split("~");
  405. var fb;
  406. switch (cmd[0]) {
  407. case "ConstantChat":
  408. switch (cmd[1]) {
  409. case "onAll":
  410. clearInterval(constChatLoop);
  411. clearInterval(constChatLoopAll);
  412. constChatLoopAll = setInterval(function () {
  413. doNewSend(["ch", ["/CH"+cmd[2]]]);
  414. }, 500);
  415. break;
  416. case "on":
  417. clearInterval(constChatLoop);
  418. clearInterval(constChatLoopAll);
  419. constChatLoop = setInterval(function () {
  420. doNewSend(["ch", [cmd[2]]]);
  421. }, 500);
  422. break;
  423. case "off":
  424. clearInterval(constChatLoop);
  425. clearInterval(constChatLoopAll);
  426. break;
  427. }
  428. break;
  429. case "Siren":
  430. switch (cmd[1]) {
  431. case "on":
  432. if (cmd[2] == "all") {
  433. clearInterval(policeLoopAll);
  434. clearInterval(policeLoop);
  435. clearInterval(policeLoopAllC);
  436. clearInterval(policeLoopC);
  437. policeLoopAll = setInterval(function () {
  438. doNewSend(["ch", ["/WSB 13c/0/15/0"]]);
  439. doNewSend(["13c", [0, 15, 0]]);
  440. setTimeout(function () {
  441. doNewSend(["ch", ["/WSB 13c/0/8/0"]]);
  442. doNewSend(["13c", [0, 8, 0]]);
  443. },500);
  444. }, 1000);
  445. policeLoopAllC = setInterval(function () {
  446. setTimeout(function () {
  447. doNewSend(["ch", ["/CHWOOP WOOP"]]);
  448. }, 20);
  449. setTimeout(function () {
  450. doNewSend(["ch", ["/CHThat'sTheSoundOfThePolice"]]);
  451. },700);
  452. setTimeout(function () {
  453. doNewSend(["ch", ["/CHWOOP WOOP"]]);
  454. },1400);
  455. setTimeout(function () {
  456. doNewSend(["ch", ["/CHThat'sTheSoundOfDaBeast"]]);
  457. },2100);
  458. }, 2800);
  459. } else {
  460. clearInterval(policeLoopAll);
  461. clearInterval(policeLoop);
  462. clearInterval(policeLoopAllC);
  463. clearInterval(policeLoopC);
  464. policeLoop = setInterval(function () {
  465. doNewSend(["13c", [0, 15, 0]]);
  466. setTimeout(function () {
  467. doNewSend(["13c", [0, 8, 0]]);
  468. },500);
  469. }, 1000);
  470. policeLoopC = setInterval(function () {
  471. setTimeout(function () {
  472. doNewSend(["ch", ["WOOP WOOP"]]);
  473. }, 20);
  474. setTimeout(function () {
  475. doNewSend(["ch", ["That'sTheSoundOfThePolice"]]);
  476. },700);
  477. setTimeout(function () {
  478. doNewSend(["ch", ["WOOP WOOP"]]);
  479. },1400);
  480. setTimeout(function () {
  481. doNewSend(["ch", ["That'sTheSoundOfDaBeast"]]);
  482. },2100);
  483. }, 2800);
  484. }
  485. break;
  486. case "off":
  487. if (cmd[2] == "all") {
  488. clearInterval(policeLoopAll);
  489. clearInterval(policeLoop);
  490. clearInterval(policeLoopAllC);
  491. clearInterval(policeLoopC);
  492. } else {
  493. clearInterval(policeLoopAll);
  494. clearInterval(policeLoop);
  495. clearInterval(policeLoopAllC);
  496. clearInterval(policeLoopC);
  497. }
  498. break;
  499. }
  500. break;
  501. case "WSBFocus":
  502. WSBFocus = cmd[1];
  503. fb = "WSBFocus set to: " + cmd[1];
  504. break;
  505. case "WSFocus":
  506. WSFocus = cmd[1];
  507. fb = "WSFocus set to: " + cmd[1];
  508. break;
  509. case "WSBRecord":
  510. switch (cmd[1]) {
  511. case "start":
  512. WSBRecord = true;
  513. fb = "WSB recording started";
  514. break;
  515. case "stop":
  516. WSBRecord = false;
  517. fb = "WSB recording ended";
  518. break;
  519. case "print":
  520. document.getElementById("WSDirectInputhtml").value = WSBList; + "</p>";
  521. break;
  522. }
  523. break;
  524. }
  525. document.getElementById("TS1Shothtml").innerHTML = fb;
  526. setTimeout(function () {document.getElementById("TS1Shothtml").innerHTML = "";}, 1000);
  527. }
  528.  
  529. document.addEventListener('keydown', function (e) {
  530. if (document.activeElement.id == 'chatBox') return;
  531. if (document.activeElement.id == 'allianceInput') return;
  532. if (document.activeElement.id == 'WSDirectInputhtml') {
  533. if (e.keyCode == 13) {
  534. var WSInput = document.getElementById("WSDirectInputhtml").value;
  535. if (WSInput.slice(0, 1) == "/") {
  536. evalCommand(WSInput);
  537. document.getElementById("WSDirectInputhtml").blur();
  538. }
  539. else {
  540. WSInput = document.getElementById("WSDirectInputhtml").value.split(", ");
  541. var t;
  542. for (t = 0; t < WSInput.length; t++) {
  543. WSInput[t] = (parseFloat(WSInput[t]).toString()==WSInput[t]) ? parseFloat(WSInput[t]) : WSInput[t];
  544. }
  545. switch (WSInput.length) {
  546. case 1: doNewSend([WSInput[0]]); break;
  547. case 2: doNewSend([WSInput[0], [WSInput[1]]]); break;
  548. case 3: doNewSend([WSInput[0], [WSInput[1], WSInput[2]]]); break;
  549. case 4: doNewSend([WSInput[0], [WSInput[1], WSInput[2], WSInput[3]]]); break;
  550. case 5: doNewSend([WSInput[0], [WSInput[1], WSInput[2], WSInput[3], WSInput[4]]]); break;
  551. }
  552. document.getElementById("WSDirectInputhtml").blur();
  553. }
  554. } else return;
  555. if (document.activeElement.id == 'nameInput') return;
  556. }
  557. if (e.keyCode == 80) {
  558. if (document.getElementById("WSBTable").style.display == "block") {
  559. var x = document.getElementsByClassName("hackDisp");
  560. var i;
  561. for (i = 0; i < x.length; i++) {
  562. x[i].style.display = "none";
  563. }
  564. } else {
  565. var y = document.getElementsByClassName("hackDisp");
  566. var j;
  567. for (j = 0; j < y.length; j++) {
  568. y[j].style.display = "block";
  569. }
  570. }
  571. }
  572. if (e.keyCode == 9 && document.getElementById("chatBox").style.display ==! "block") {
  573. setTimeout(function () {
  574. document.getElementById("WSDirectInputhtml").blur();
  575. document.getElementById("noShowDWS").blur();
  576. document.getElementById("gameCanvas").focus();
  577. }, 10);
  578. }
  579. }, true);
  580.  
  581. document.getElementById("WSDirectInputhtml").addEventListener('mousedown', function (e) {
  582. if (e.button == 0) {
  583. setTimeout(function () {document.getElementById("WSDirectInputhtml").select();}, 150);
  584. }
  585. }, true);
  586.  
  587. $("#gameCanvas").css('cursor', 'url(http://cur.cursors-4u.net/user/use-1/use153.cur), default');
  588. $("#consentBlock").css({display: "none"});
  589.  
  590.  
  591.  
  592. var ID_WinterCap = 15;
  593. var ID_FlipperHat = 31;
  594. var ID_MarksmanCap = 1;
  595. var ID_BushGear = 10;
  596. var ID_SoldierHelmet = 6;
  597. var ID_AntiVenomGear = 23;
  598. var ID_MusketeerHat = 32;
  599. var ID_MedicGear = 13;
  600. var ID_BullHelmet = 7;
  601. var ID_EmpHelmet = 22;
  602. var ID_BoosterHat = 12;
  603. var ID_BarbarianArmor = 26;
  604. var ID_BullMask = 46;
  605. var ID_WindmillHat = 14;
  606. var ID_SpikeGear = 11;
  607. var ID_BushidoArmor = 16;
  608. var ID_SamuraiArmor = 20;
  609. var ID_ScavengerGear = 27;
  610. var ID_TankGear = 40;
  611. //Turret Gear. "Use if you want to"
  612. var ID_TurretGear = 53;
  613.  
  614. // Keys
  615.  
  616. var TankGearKey = 90;
  617. var BullHelmetKey = 74;
  618. var SoldierHelmetKey = 71;
  619. var TurretKey = 72;
  620. var BoosterHatKey = 16;
  621. var uneqiup = 220;
  622. var SpikeGearKey = 89;
  623. var BarabarianKey = 84;
  624. var SpikeKey = 86
  625.  
  626. // Remove all of the ads on the page.
  627.  
  628. try {
  629. document.getElementById("moomooio_728x90_home").style.display = "none";
  630. $("moomooio728x90_home").parent().css({display: "none"});
  631. } catch (e) {
  632. console.log("There was an error removing the ads.");
  633. }
  634.  
  635.  
  636. var menuChange = document.createElement("div");
  637. menuChange.className = "menuCard";
  638. menuChange.id = "mainSettings";
  639. menuChange.innerHTML = `
  640. <div id="simpleModal" class="modal">
  641. <div class="modal-content">
  642. <div class="modal-header">
  643. <span class="closeBtn">&times;</span>
  644. <h2 style="font-size: 17px;">Hat Macro Settings</h2>
  645. </div>
  646. <div class="modal-body" style="font-size: 17px;">
  647. <div class="flexControl">
  648. <h3 style="color: red; font-size: 17px;">To unquip a hat press: LEFT SHIFT</h3>
  649. <h3 class="menuPrompt">Tank Gear: </h3> <input value="${String.fromCharCode(TankGearKey)}" id="tankGear" class="keyPressLow" onkeyup="this.value = this.value.toUpperCase();" maxlength="1" type="text"/>
  650. <h3 class="menuPrompt">Bull Helmet: </h3> <input value="${String.fromCharCode(BullHelmetKey)}" id="bullHelm" class="keyPressLow" onkeyup="this.value = this.value.toUpperCase();" maxlength="1" type="text"/>
  651. <h3 class="menuPrompt">Soldier Helmet: </h3> <input value="${String.fromCharCode(SoldierHelmetKey)}" id="soldier" class="keyPressLow"onkeyup="this.value = this.value.toUpperCase();" maxlength="1" type="text"/>
  652. <h3 class="menuPrompt">Turret Gear: </h3> <input value="${String.fromCharCode(TurretKey)}" id="turret" class="keyPressLow" maxlength="1" onkeyup="this.value = this.value.toUpperCase();" type="text"/>
  653. <h3 class="menuPrompt">Booster Hat: </h3> <input value="${String.fromCharCode(BoosterHatKey)}" id="booster" class="keyPressLow" maxlength="1" onkeyup="this.value = this.value.toUpperCase();" type="text"/>
  654. <h3 class="menuPrompt">Spike Gear: </h3> <input value="${String.fromCharCode(SpikeGearKey)}" id="spikeg" class="keyPressLow" maxlength="1" onkeyup="this.value = this.value.toUpperCase();" type="text"/>
  655. <h3 class="menuPrompt">Barbarian Armor: </h3> <input value="${String.fromCharCode(BarabarianKey)}" id="barb" class="keyPressLow" onkeyup="this.value = this.value.toUpperCase();" maxlength="1" type="text"/>
  656. <hr>
  657. <h3 style="font-size: 17px;"> Map Settings </h3>
  658.  
  659. <label class="container">Show biomes on the map
  660. <input type="checkbox" id="myCheck">
  661. <span class="checkmark"></span>
  662. </label>
  663. </div>
  664. </div>
  665. <div class="modal-footer">
  666. <h3 style="font-size: 17px;">Edit and live save your changes!</h3>
  667. <p>This hack is free and will always be free!</p>
  668. </div>
  669. </div>
  670. </div>
  671. `
  672. document.body.appendChild(menuChange)
  673.  
  674.  
  675. $("#tankGear").on("input", () => {
  676. var cval = $("#tankGear").val();
  677. if (cval){
  678. TankGearKey = cval.toUpperCase();
  679. TankGearKey = TankGearKey.charCodeAt(0);
  680. console.log(TankGearKey);
  681. }
  682. });
  683.  
  684. $("#bullHelm").on("input", () => {
  685. var cval = $("#bullHelm").val();
  686. if (cval){
  687. BullHelmetKey = cval.toUpperCase();
  688. BullHelmetKey = BullHelmetKey.charCodeAt(0);
  689. console.log(BullHelmetKey);
  690. }
  691. });
  692.  
  693. $("#soldier").on("input", () => {
  694. var cval = $("#soldier").val();
  695. if (cval){
  696. SoldierHelmetKey = cval.toUpperCase();
  697. SoldierHelmetKey = SoldierHelmetKey.charCodeAt(0);
  698. console.log(SoldierHelmetKey);
  699. }
  700. });
  701.  
  702. $("#turret").on("input", () => {
  703. var cval = $("#turret").val();
  704. if (cval){
  705. TurretKey = cval.toUpperCase();
  706. TurretKey = TurretKey.charCodeAt(0);
  707. console.log(TurretKey);
  708. }
  709. });
  710.  
  711.  
  712.  
  713. $("#barb").on("input", () => {
  714. var cval = $("#barb").val();
  715. if (cval){
  716. BarabarianKey = cval.toUpperCase();
  717. BarabarianKey = BarabarianKey.charCodeAt(0);
  718. console.log(BarabarianKey);
  719. }
  720. });
  721.  
  722. $("#booster").on("input", () => {
  723. var cval = $("#booster").val();
  724. if (cval){
  725. BoosterHatKey = cval.toUpperCase();
  726. BoosterHatKey = BoosterHatKey.charCodeAt(0);
  727. console.log(BoosterHatKey);
  728. }
  729. });
  730.  
  731. $("#spikeg").on("input", () => {
  732. var cval = $("#spikeg").val();
  733. if (cval){
  734. SpikeGearKey = cval.toUpperCase();
  735. SpikeGearKey = SpikeGearKey.charCodeAt(0);
  736. console.log(SpikeGearKey);
  737. }
  738. });
  739.  
  740. $("#trap").on("input", () => {
  741. var cval = $("#trap").val();
  742. if (cval){
  743. TrapKey = cval.toUpperCase();
  744. TrapKey = TrapKey.charCodeAt(0);
  745. console.log(TrapKey);
  746. }
  747. });
  748.  
  749. var styleItem = document.createElement("style");
  750. styleItem.type = "text/css";
  751. styleItem.appendChild(document.createTextNode(`
  752. .keyPressLow {
  753. margin-left: 8px;
  754. font-size: 16px;
  755. margin-right: 8px;
  756. height: 25px;
  757. width: 50px;
  758. background-color: #fcfcfc;
  759. border-radius: 3.5px;
  760. border: none;
  761. text-align: center;
  762. color: #4A4A4A;
  763. border: 0.5px solid #f2f2f2;
  764. }
  765.  
  766. .menuPrompt {
  767. font-size: 17px;
  768. font-family: 'Hammersmith One';
  769. color: #4A4A4A;
  770. flex: 0.2;
  771. text-align: center;
  772. margin-top: 10px;
  773. display: inline-block;
  774. }
  775.  
  776. .modal {
  777. display: none;
  778. position: fixed;
  779. z-index: 1;
  780. left: 0;
  781. top: 0;
  782. overflow: auto;
  783. height: 100%;
  784. width: 100%;
  785. }
  786.  
  787. .modal-content {
  788. margin: 10% auto;
  789. width: 40%;
  790. box-shadow: 0 5px 8px 0 rgba(0, 0, 0, 0.2), 0 7px 20px 0 rgba(0, 0, 0, 0.17);
  791. font-size: 14px;
  792. line-height: 1.6;
  793. }
  794.  
  795. .modal-header h2,
  796. .modal-footer h3 {
  797. margin: 0;
  798. }
  799.  
  800. .modal-header {
  801. background: #428bca;
  802. padding: 15px;
  803. color: #fff;
  804. border-top-left-radius: 5px;
  805. border-top-right-radius: 5px;
  806. }
  807.  
  808. .modal-body {
  809. padding: 10px 20px;
  810. background: #fff;
  811. }
  812.  
  813. .modal-footer {
  814. background: #428bca;
  815. padding: 10px;
  816. color: #fff;
  817. text-align: center;
  818. border-bottom-left-radius: 5px;
  819. border-bottom-right-radius: 5px;
  820. }
  821.  
  822. .closeBtn {
  823. color: #ccc;
  824. float: right;
  825. font-size: 30px;
  826. color: #fff;
  827. }
  828.  
  829. .closeBtn:hover,
  830. .closeBtn:focus {
  831. color: #000;
  832. text-decoration: none;
  833. cursor: pointer;
  834. }
  835.  
  836. /* Customize the label (the container) */
  837. .container {
  838. display: block;
  839. position: relative;
  840. padding-left: 35px;
  841. margin-bottom: 12px;
  842. cursor: pointer;
  843. font-size: 16px;
  844. -webkit-user-select: none;
  845. -moz-user-select: none;
  846. -ms-user-select: none;
  847. user-select: none;
  848. }
  849.  
  850. /* Hide the browser's default checkbox */
  851. .container input {
  852. position: absolute;
  853. opacity: 0;
  854. cursor: pointer;
  855. height: 0;
  856. width: 0;
  857. }
  858.  
  859. /* Create a custom checkbox */
  860. .checkmark {
  861. position: absolute;
  862. top: 0;
  863. left: 0;
  864. height: 25px;
  865. width: 25px;
  866. background-color: #eee;
  867. }
  868.  
  869. /* On mouse-over, add a grey background color */
  870. .container:hover input ~ .checkmark {
  871. background-color: #ccc;
  872. }
  873.  
  874. /* When the checkbox is checked, add a blue background */
  875. .container input:checked ~ .checkmark {
  876. background-color: #2196F3;
  877. }
  878.  
  879. /* Create the checkmark/indicator (hidden when not checked) */
  880. .checkmark:after {
  881. content: "";
  882. position: absolute;
  883. display: none;
  884. }
  885.  
  886. /* Show the checkmark when checked */
  887. .container input:checked ~ .checkmark:after {
  888. display: block;
  889. }
  890.  
  891. /* Style the checkmark/indicator */
  892. .container .checkmark:after {
  893. left: 9px;
  894. top: 5px;
  895. width: 5px;
  896. height: 10px;
  897. border: solid white;
  898. border-width: 0 3px 3px 0;
  899. -webkit-transform: rotate(45deg);
  900. -ms-transform: rotate(45deg);
  901. transform: rotate(45deg);
  902. }
  903.  
  904. `))
  905. document.head.appendChild(styleItem);
  906.  
  907.  
  908. $("#adCard").css({display: "none"});
  909.  
  910.  
  911. document.addEventListener('keydown', function(e) {
  912. if (e.keyCode == uneqiup && document.activeElement.id.toLowerCase() !== 'chatbox'){
  913. console.log("done")
  914. storeEquip(0);
  915. } else if (e.keyCode == 27){
  916. if (modal.style.display = "none") {
  917. modal.style.display = "block";
  918. } else {
  919. modal.style.display = "none";
  920. }
  921. } else if (e.keyCode == TankGearKey && document.activeElement.id.toLowerCase() !== 'chatbox'){
  922. storeEquip(ID_TankGear);
  923. } else if (e.keyCode == 72 && document.activeElement.id.toLowerCase() !== 'chatbox'){
  924. storeEquip(ID_FlipperHat);
  925. } else if (e.keyCode == 66 && document.activeElement.id.toLowerCase() !== 'chatbox'){
  926. storeEquip(ID_EmpHelmet);
  927. } else if (e.keyCode == 70 && document.activeElement.id.toLowerCase() !== 'chatbox'){
  928. storeEquip(ID_SoldierHelmet);
  929. } else if (e.keyCode == 71 && document.activeElement.id.toLowerCase() !== 'chatbox'){
  930. storeEquip(ID_BullHelmet);
  931. } else if (e.keyCode == 16 && document.activeElement.id.toLowerCase() !== 'chatbox'){
  932. storeEquip(ID_BoosterHat);
  933. } else if (e.keyCode == BarabarianKey && document.activeElement.id.toLowerCase() !== 'chatbox'){
  934. storeEquip(ID_BarbarianArmor);
  935. } else if (e.keyCode == SpikeGearKey && document.activeElement.id.toLowerCase() !== 'chatbox'){
  936. storeEquip(ID_SpikeGear);
  937. } else if (e.keyCode == 192 && document.activeElement.id.toLowerCase() !== 'chatbox'){
  938. storeEquip(ID_TurretGear);
  939. } else if (e.keyCode == 67 && document.activeElement.id.toLowerCase() !== 'chatbox'){
  940. storeEquip(ID_SamuraiArmor);
  941. }
  942. })
  943.  
  944. // Get modal element
  945. var modal = document.getElementById("simpleModal");
  946. // Get close button
  947. var closeBtn = document.getElementsByClassName('closeBtn')[0];
  948.  
  949. // Events
  950. closeBtn.addEventListener('click', closeModal);
  951. window.addEventListener('click', outsideClick);
  952.  
  953. // Close
  954. function closeModal() {
  955. modal.style.display = 'none';
  956. }
  957.  
  958. // Close If Outside Click
  959. function outsideClick(e) {
  960. if (e.target == modal) {
  961. modal.style.display = 'none';
  962. }
  963. }
  964.  
  965. var checkbox = document.querySelector("#myCheck")
  966.  
  967. checkbox.addEventListener('change', function() {
  968. if (this.checked) {
  969. $("#mapDisplay").css({background: `url('https://i.imgur.com/fgFsQJp.png')`});
  970. console.log('checked')
  971. } else {
  972. $("#mapDisplay").css({background: `rgba(0, 0, 0, 0.25)`})
  973. console.log('unchecked')
  974. }
  975. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement