Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. onMultiChat = (user, message) => {
  2.     if (currentIP === "") return;
  3.     if(user == 'SERVER' && message[0] == '/') {
  4.         var split = message.slice(1, message.length).split(': ');
  5.         var command = split[0];
  6.         split.splice(0,1);
  7.         var response = split.join().trim();
  8.         if(command == 'playerid') console.log(`%c  Player ID: ${response}  `, 'background: #262626 ; color: #ffd700; font-size:10px; font-family: "Segoe UI"'); myid = response;
  9.     }
  10. };
  11.  
  12. updatePlayerID = () => setTimeout(() => { sendChat('/getmyid'); }, 200);
  13. setInterval(()=> {
  14.     if ((typeof(myCells) !== 'undefined' ? myCells.length : 0) <= 2 && isJoinedGame === true) split(16);
  15. }, 7500);
  16.  
  17. var split = (splitTimes) => {
  18.     var data = new DataView(new ArrayBuffer(1));
  19.     data.setUint8(0, 17);
  20.     for (var index = 0; index < splitTimes; index++) {
  21.         setTimeout(() => {
  22.             webSocket.send(data.buffer);
  23.         }, index * 50);
  24.     }
  25. };
  26.  
  27. unsafeWindow.crown = function(a) {
  28.     var delay;
  29.     typeof(a) !== 'undefined' ? delay = 500 : delay = 0;
  30.     setTimeout(() => {
  31.         var waitForFb = setInterval(() => {
  32.             if (typeof(myid) === "undefined" ? false : myid !== ""){
  33.                 playerDetails[myid].hat = "crown";
  34.                 $('#skinurl').val("https://cdn.discordapp.com/emojis/413082647955505173.png");
  35.                 playerDetails[myid].skinUrl = "https://cdn.discordapp.com/emojis/413082647955505173.png";
  36.                 console.log(`%c  Crown loaded for ${playerDetails[myid].name === "" ? 'Unnamed' : playerDetails[myid].name}👑 `, 'background: #262626 ; color: #ffd700; font-size:16px; font-family: "Segoe UI"');
  37.                 clearInterval(waitForFb);
  38.             }
  39.         }, 50);
  40.     }, delay);
  41. };
  42.  
  43. $("#maincard").on("click", "button", function (e) {
  44.     if (currentIP === "") return;
  45.     if($(this).text() === 'Play' ){
  46.         updatePlayerID();
  47.         console.log('%c  Loading crown...  ', 'background: #262626 ; color: #ffd700; font-size:14px; font-family: "Segoe UI"');
  48.         crown();
  49.     }
  50. });
  51.  
  52. $("body").on("keydown",function(e){
  53.     if (currentIP === "") return;
  54.     if (e.keyCode === Object.entries(JSON.parse(getLocalStorage('hotkeyMapping'))).find(i => i[1] === "hk_start_new_game")[0].charCodeAt(0) && !$('#input_box2').is(':focus')) {
  55.         updatePlayerID();
  56.         console.log('%c  Loading crown...  ', 'background: #262626 ; color: #ffd700; font-size:14px; font-family: "Segoe UI"');
  57.         crown(true);
  58.     }
  59. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement