Bonk Commands

Adds lots of commands to bonk.io. Type /? or /help in bonk chat to get started.

当前为 2022-09-30 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Bonk Commands
  3. // @namespace https://greasyfork.org/en/scripts/451341-bonk-commands
  4. // @version 3.1
  5. // @description Adds lots of commands to bonk.io. Type /? or /help in bonk chat to get started.
  6. // @author LEGENDBOSS123 + left paren + mastery3
  7. // @match https://bonk.io/*
  8. // @run-at document-idle
  9. // @grant none
  10. // @unwrap
  11. // ==/UserScript==
  12.  
  13.  
  14. function BonkCommandsScriptInjector(f){
  15. if(document.readyState == "complete"){f();}
  16. else{document.addEventListener('readystatechange',function(){setTimeout(f,1500);});}
  17. }
  18.  
  19. BonkCommandsScriptInjector(function(){
  20. var scope = window;
  21.  
  22. scope.Gwindow = document.getElementById("maingameframe").contentWindow;
  23. scope.Gdocument = document.getElementById("maingameframe").contentDocument;
  24.  
  25. scope.link2pastebin = "https://pastebin.com/2b8XqqYu";
  26. scope.link2greasyfork = "https://greasyfork.org/en/scripts/451341-bonk-commands";
  27.  
  28. if(typeof(scope.injectedBonkCommandsScript)=='undefined'){
  29. scope.injectedBonkCommandsScript = true;
  30. }
  31. else{
  32. for (var i = 0; i < 100000; i++){
  33. clearInterval(i);
  34. }
  35. }
  36.  
  37. if(typeof(scope.originalSend)=='undefined'){scope.originalSend = Gwindow.WebSocket.prototype.send;}
  38. if(typeof(scope.bonkwss)=='undefined'){scope.bonkwss = 0;}
  39. if(typeof(scope.sandboxon)=='undefined'){scope.sandboxon = false;}
  40. if(typeof(scope.sandboxid)=='undefined'){scope.sandboxid = 1;}
  41. if(typeof(scope.playerids)=='undefined'){scope.playerids = {};}
  42. if(typeof(scope.sandboxplayerids)=='undefined'){scope.sandboxplayerids = {};}
  43. function sandboxonclick(){
  44. Gdocument.getElementById("roomlistcreatewindowmaxplayers").value = 1;
  45. Gdocument.getElementById("roomlistcreatewindowunlistedcheckbox").checked = true;
  46. Gdocument.getElementById("roomlistcreatecreatebutton").click();
  47. sandboxon = true;
  48. }
  49. if(Gdocument.getElementById("classic_mid_sandbox")==null){
  50. Gdocument.getElementById("roomlistrefreshbutton").click();
  51. scope.sandboxbutton = Gdocument.createElement("div");
  52. sandboxbutton.id = "classic_mid_sandbox";
  53. sandboxbutton.classList.value = "brownButton brownButton_classic classic_mid_buttons";
  54. sandboxbutton.textContent = "SANDBOX";
  55. sandboxbutton.addEventListener("click",sandboxonclick);
  56. Gdocument.getElementById("classic_mid").insertBefore(sandboxbutton,Gdocument.getElementById("classic_mid_news"));
  57.  
  58. }
  59.  
  60. Gwindow.WebSocket.prototype.send = function(args) {
  61. if(this.url.includes(".bonk.io/socket.io/?EIO=3&transport=websocket&sid=")){
  62. bonkwss = this;
  63. if(args.startsWith('42[26,')){
  64. if(sandboxon){
  65. var jsonargs = JSON.parse(args.substring(2))[1];
  66. if(typeof(sandboxplayerids[jsonargs["targetID"]])!='undefined'){
  67. RECIEVE('42[18,'+jsonargs["targetID"]+','+jsonargs["targetTeam"]+']');
  68.  
  69. }
  70. }
  71. }
  72. if(args.startsWith('42[4,')){
  73. var jsonargs = JSON.parse(args.substring(2));
  74. if(sandboxcopyme && typeof(jsonargs[1]["type"])=="undefined"){
  75. var jsonkeys = Object.keys(sandboxplayerids);
  76. for(var i = 0; i<jsonkeys.length;i++){
  77. RECIEVE('42[7,'+jsonkeys[i].toString()+','+JSON.stringify(jsonargs[1])+']');
  78. }
  79. }
  80. args = "42"+JSON.stringify(jsonargs);
  81. }
  82.  
  83. if(args.startsWith('42[5,')){
  84. var jsonargs = JSON.parse(args.substring(2));
  85.  
  86. if(stopquickplay!=1){
  87. jsonargs[1]["gs"]["wl"] = 999;
  88. }
  89. if(recmodebool){
  90. Gdocument.getElementById("newbonklobby_editorbutton").click();
  91. var newmode = Gdocument.getElementById("mapeditor_modeselect").value;
  92. Gdocument.getElementById("mapeditor_close").click();
  93.  
  94. if(newmode!=""){
  95. RECIEVE('42[26,"b","'+newmode+'"]');
  96. }
  97. else{
  98. if(defaultmode != ""){
  99. RECIEVE('42[26,"b","'+defaultmode+'"]');
  100. }
  101. }
  102. }
  103. args = "42"+JSON.stringify(jsonargs);
  104. }
  105.  
  106. }
  107. if(this.url.includes(".bonk.io/socket.io/?EIO=3&transport=websocket&sid=") && !this.injected){
  108. this.injected = true;
  109.  
  110. var originalRecieve = this.onmessage;
  111. this.onmessage = function(args){
  112. if(args.data.startsWith('42[1,')){
  113. var jsonargs = JSON.parse(args.data.substring(2));
  114. SEND('42[1,{"id":'+jsonargs[2]+'}]');
  115. }
  116. if(args.data.startsWith('42[7,')){
  117. var jsonargs = JSON.parse(args.data.substring(2))[2];
  118. if(typeof(jsonargs["type"]) != "undefined"){
  119. if(jsonargs["type"]=="private chat" && (jsonargs["to"] == username)){
  120. if(typeof(jsonargs["message"])=="object" && typeof(jsonargs["password"]) == "object"){
  121. var password = CRYPT_MESSAGE(private_key,jsonargs["password"]);
  122. var decodedtext = jsonargs["message"].slice(0,400);
  123. var encodedtext = "";
  124. for(var i=0;i<decodedtext.length;i++){
  125. if(password[i%password.length]<1000){
  126. encodedtext+=String.fromCharCode(password[i%password.length]^decodedtext[i]);
  127. }
  128. }
  129. displayInChat("> "+jsonargs["from"]+": "+encodedtext,"#DA0808","#1EBCC1");
  130. }
  131. }
  132. if(jsonargs["type"]=="request public key" && jsonargs["to"] == username){
  133. SEND("42"+JSON.stringify([4,{"type":"public key","from":username,"public key":public_key}]));
  134. }
  135. if(jsonargs["type"]=="public key" && jsonargs["from"] == private_chat && request_public_key_time_stamp+1500>Date.now()){
  136. private_chat_public_key = [private_chat,jsonargs["public key"]];
  137. displayInChat("Private chatting with "+private_chat+".","#DA0808","#1EBCC1");
  138.  
  139. }
  140.  
  141. }
  142. }
  143.  
  144. if(args.data.startsWith('42[4,')){
  145. var jsonargs = JSON.parse(args.data.substring(2));
  146. playerids[jsonargs[1]] = jsonargs[3];
  147.  
  148. }
  149. if(args.data.startsWith('42[5,')){
  150. var jsonargs = JSON.parse(args.data.substring(2));
  151. if(typeof(playerids[jsonargs[1]])!='undefined'){
  152. delete playerids[jsonargs[1]];
  153. }
  154. }
  155. return originalRecieve.call(this,args);
  156. };
  157.  
  158. var originalClose = this.onclose;
  159. this.onclose = function () {
  160. window.bonkwss = 0;
  161. return originalClose.call(this);
  162. }
  163.  
  164. }
  165.  
  166. return originalSend.call(this,args);
  167. };
  168.  
  169. scope.SEND = function(args){
  170. if(bonkwss!=0){
  171. bonkwss.send(args);
  172. }
  173. };
  174. scope.RECIEVE = function(args){
  175. if(bonkwss!=0){
  176. bonkwss.onmessage({data:args});
  177. }
  178. };
  179. Gdocument.getElementById("ingamechatcontent").style["pointer-events"]="all";
  180. Gdocument.getElementById("ingamechatcontent").style["max-height"]="250px";
  181. Gdocument.getElementById("ingamechatcontent").style["height"]="128px";
  182. Gdocument.getElementById("ingamechatbox").style["height"]="250px";
  183.  
  184. document.getElementById('adboxverticalCurse').style["display"] = "none";
  185. document.getElementById('adboxverticalleftCurse').style["display"] = "none";
  186.  
  187. scope.GENERATE_PRIME_NUMBER = function(mini = 0,maxi = 0,choices = []){
  188. if(choices.length == 0){
  189. for(var i = mini;i<maxi+1;i++){
  190. choices.push(i);
  191. }
  192. }
  193. firstTry = choices[Math.floor(Math.random()*choices.length)];
  194. for(var i = 2; i<Math.floor(Math.sqrt(firstTry)+1);i++){
  195. if(i!=firstTry){
  196. if(firstTry%i == 0){
  197. choices.splice(choices.indexOf(firstTry),1);
  198. if(choices.length == 0){
  199. return 0;
  200. }
  201. return GENERATE_PRIME_NUMBER(mini,maxi,choices);
  202. }
  203. }
  204. }
  205. return firstTry;
  206. };
  207.  
  208. scope.GENERATE_KEYS = function(){
  209. interval = [];
  210. for(var i = 100;i<301;i++){
  211. interval.push(i);
  212. }
  213. random_prime = [GENERATE_PRIME_NUMBER(0,0,choices = interval),0];
  214. interval.splice(interval.indexOf(random_prime[0]),1);
  215. random_prime[1] = GENERATE_PRIME_NUMBER(0,0,choices = interval);
  216.  
  217. n = random_prime[0]*random_prime[1];
  218. n2 = (random_prime[0]-1)*(random_prime[1]-1);
  219.  
  220. e = GENERATE_PRIME_NUMBER(2,n2-1);
  221. d = 0;
  222. redo = true;
  223. for(var i = 0;i<1000000;i++){
  224. if((e*i-1)%n2 == 0 && i!=e){
  225. d = i;
  226. redo = false;
  227. break;
  228. }
  229. }
  230. if(redo){
  231. return GENERATE_KEYS();
  232. }
  233. else{
  234. return [[n,e],[n,d]];
  235. }
  236.  
  237. };
  238. scope.CRYPT_NUMBER = function(key, data){
  239.  
  240. result = 1;
  241.  
  242. for(var i = 0;i<key[1];i++){
  243. result*=data;
  244. result = result%key[0];
  245. }
  246. return result%key[0];
  247.  
  248. };
  249.  
  250. scope.CRYPT_MESSAGE = function(key,data){
  251. var resulttext = [];
  252. for(var i = 0;i<data.length;i++){
  253. resulttext.push(CRYPT_NUMBER(key,data[i]));
  254. }
  255. return resulttext;
  256.  
  257. };
  258.  
  259. scope.dontswitch = false;
  260. scope.username = 0;
  261. scope.timedelay = 1400;
  262. scope.ishost = false;
  263. scope.quicki=0;
  264. scope.defaultmode = "d";
  265. scope.recmodebool = false;
  266. scope.freejoin = false;
  267. scope.stopquickplay = 1;
  268. scope.canceled = false;
  269. scope.banned = [];
  270. scope.transitioning = false;
  271. scope.echo_list = [];
  272. scope.message = "";
  273. scope.mode = "";
  274. scope.private_chat = "";
  275. scope.private_chat_public_key = ["",[0,0]];
  276. scope.users = [];
  277. scope.scroll = false;
  278. scope.elem = Gdocument.getElementById("maploadwindowmapscontainer");
  279. scope.npermissions = 1;
  280. scope.space_flag = false;
  281. scope.rcaps_flag = false;
  282. scope.number_flag = false;
  283. scope.private_chat_keys = GENERATE_KEYS();
  284. scope.private_key = private_chat_keys[0];
  285. scope.public_key = private_chat_keys[1];
  286. scope.request_public_key_time_stamp = 0;
  287. scope.sandboxcopyme = false;
  288. scope.help = ["All the commands are:","/help","/?","/advhelp [command]","/space","/rcaps","/number","/echo [username]","/remove [username]","/clearecho","/chatw [username]","/msg [text]","/requestfake \"[mapname]\", \"[mapauthor]\"","/eval [code]","/lobby","/team [letter]","/scroll","/hidechat","/showchat","/notify","/stopnotify","Host commands are:","/startqp","/stopqp","/next","/previous","/freejoin","/start","/balanceA [number]","/rounds [number]","/ban [username]","Sandbox commands are:","/addplayer [number]","/delplayer [number]","/copyme"];
  289.  
  290. scope.adv_help = {"help":"Shows all command names.",
  291. "?":"Shows all command names.",
  292. "advhelp":"Shows a command in detail.",
  293. "space":"Toggles space. When space is on, whatever you type will be spaced apart.",
  294. "rcaps":"Toggles rcaps. When rcaps is on, each letter will randomly get capitalized.",
  295. "number":"Toggles number. When number is on, 'a' becomes 4, 'e' becomes 3, 's' becomes 5, 'o' becomes 0, 'l' and 'i' become 1.",
  296. "echo":"Echoes a username. It copies the username's chat messages.",
  297. "remove":"Removes username from echo list. You will not echo that username anymore.",
  298. "clearecho":"Clears echo list. You will not echo anyone anymore.",
  299. "chatw":"It private chats with username. Type /msg to message that username.",
  300. "msg":"Messages with what username you are chatting with. Type /chatw to chat with a username.",
  301. "requestfake":"Requests a fake map. The host will not see the request.",
  302. "eval":"Evaluates code. Only use this if you are experienced in javascript.",
  303. "lobby":"Makes lobby visible when you are ingame. Type /lobby again to close lobby.",
  304. "team":"Joins a specific team. 'r' = red, 'b' = blue, 'g' = green, 'y' = yellow, and 's' = spectate.",
  305. "scroll":"Toggles a scrollbar in ingame chat.",
  306. "hidechat":"Hides ingame chat. Type /showchat to show it again.",
  307. "showchat":"Shows ingame chat. /hidechat hides the chat.",
  308. "notify":"You will be notified if a person types @MYUSERNAME",
  309. "stopnotify":"You will not be notified if a person types @MYUSERNAME",
  310. "startqp":"Starts cycling maps in your map menu.",
  311. "stopqp":"Stops cycling maps in your map menu.",
  312. "next":"Skips the map. Usable only with /startqp.",
  313. "previous":"Goes to previous map. Usable only with /startqp.",
  314. "freejoin":"Toggles freejoin. If freejoin is on, starts the game instantly if there are 1 or less players currently playing",
  315. "start":"Starts game instantly.",
  316. "balanceA":"Balances everyone with balance number.",
  317. "rounds":"Sets rounds to win.",
  318. "ban":"Bans username from lobby. If they rejoin, it automatically bans.",
  319. "addplayer":"In sandbox, it adds players.",
  320. "delplayer":"In sandbox, it deletes players.",
  321. "copyme":"In sandbox, it makes each player copy your movements."};
  322.  
  323. elem.onclick=function(e){
  324. if(stopquickplay==0 && ishost == true && e.isTrusted == true){
  325. quicki = (Array.from(e.target.parentElement.parentNode.children).indexOf(e.target.parentNode)-1)%(Gdocument.getElementById("maploadwindowmapscontainer").children.length);
  326. }
  327. };
  328. scope.urlify = function(text) {
  329. return text.replace(/(?:https?:\/\/)?(?:[A-Za-z0-9-ßàÁâãóôþüúðæåïçèõöÿýòäœêëìíøùîûñé]+)(?:\.[A-Za-z0-9-ßàÁâãóôþüúðæåïçèõöÿýòäœêëìíøùîûñé]+)+(?:\/(?:[A-Za-z0-9-._~:/?#\[\]@!$&'()*+,;=]|%[0-9a-fA-F]{2})*)?(?:\?(?:[^=]+=[^&](?:&[^=]+=[^&])*)?)?/g, function(url) {
  330. return '<a href="' + url + '" target="_blank" style = "color:orange">' + url + '</a>';
  331. })
  332. };
  333.  
  334. scope.fire = function(type,options,d = Gdocument){
  335. var event=new CustomEvent(type);
  336. for(var p in options){
  337. event[p]=options[p];
  338. }
  339. d.dispatchEvent(event);
  340. };
  341.  
  342. scope.chat = function(message){
  343. mess = Gdocument.getElementById("newbonklobby_chat_input").value;
  344. mess2 = Gdocument.getElementById("ingamechatinputtext").value;
  345. Gdocument.getElementById("newbonklobby_chat_input").value = message;
  346. Gdocument.getElementById("ingamechatinputtext").value = message;
  347. fire("keydown",{keyCode:13});
  348. fire("keydown",{keyCode:13});
  349. Gdocument.getElementById("newbonklobby_chat_input").value = mess;
  350. Gdocument.getElementById("ingamechatinputtext").value = mess2;
  351. };
  352. scope.displayInChat = function(message, LobbyColor, InGameColor, options) {
  353. options = options ?? {};
  354. LobbyColor = LobbyColor ?? "#8800FF";
  355. InGameColor = InGameColor ?? "#AA88FF";
  356. let A = Gdocument.createElement("div");
  357. let B = Gdocument.createElement("span");
  358. B.className = "newbonklobby_chat_status";
  359. B.style.color = LobbyColor;
  360. A.appendChild(B);
  361. B.innerHTML = (options.sanitize ?? true) ? message.replace(/&/g, '&amp;').replace(/>/g, '&gt;').replace(/</g, '&lt;') : message;
  362. let C = Gdocument.createElement("div");
  363. let D = Gdocument.createElement("span");
  364. D.style.color = InGameColor;
  365. C.appendChild(D);
  366. D.innerHTML = (options.sanitize ?? true) ? message.replace(/&/g, '&amp;').replace(/>/g, '&gt;').replace(/</g, '&lt;') : message;
  367. let a = false;
  368. if(Gdocument.getElementById("newbonklobby_chat_content").scrollHeight - Gdocument.getElementById("newbonklobby_chat_content").scrollTop > Gdocument.getElementById("newbonklobby_chat_content").clientHeight - 1) {
  369. a = true;
  370. }
  371. Gdocument.getElementById("newbonklobby_chat_content").appendChild(A);
  372. Gdocument.getElementById("ingamechatcontent").appendChild(C);
  373. if (a) { Gdocument.getElementById("newbonklobby_chat_content").scrollTop = Number.MAX_SAFE_INTEGER;};
  374. Gdocument.getElementById("ingamechatcontent").scrollTop = Number.MAX_SAFE_INTEGER;
  375. };
  376.  
  377. scope.lobby = function(){
  378. if (Gdocument.getElementById("newbonklobby").style["display"]=="none"){
  379.  
  380. Gdocument.getElementById("newbonklobby_editorbutton").click();
  381. Gdocument.getElementById("mapeditor_close").click();
  382. if(Gdocument.getElementsByClassName("newbonklobby_playerentry").length>0){
  383. Gdocument.getElementById("newbonklobby").style["z-index"]=1;
  384. Gdocument.getElementById("maploadwindowcontainer").style["z-index"]=1;
  385. Gdocument.getElementById("mapeditorcontainer").style["z-index"]=1;
  386. Gdocument.getElementById("pretty_top").style["z-index"]=2;
  387. Gdocument.getElementById("settingsContainer").style["z-index"]=2;
  388. Gdocument.getElementById("leaveconfirmwindow").style["z-index"]=2;
  389. Gdocument.getElementById("hostleaveconfirmwindow").style["z-index"]=2;
  390. }
  391. else{
  392. Gdocument.getElementById("newbonklobby").style["opacity"]=0;
  393. Gdocument.getElementById("newbonklobby").style["display"]="none";
  394. Gdocument.getElementById("mapeditorcontainer").style["z-index"]=0;
  395. }
  396.  
  397. }
  398. else if(Gdocument.getElementById("gamerenderer").style["visibility"]!="hidden"){
  399. Gdocument.getElementById("newbonklobby").style["opacity"]=0;
  400. Gdocument.getElementById("newbonklobby").style["display"]="none";
  401. Gdocument.getElementById("mapeditorcontainer").style["z-index"]=0;
  402. }
  403. };
  404.  
  405. scope.lastmessage = function(){
  406. if(Gdocument.getElementById("newbonklobby_chat_content").children.length!=0){
  407. var lm = Gdocument.getElementById("newbonklobby_chat_content").children[Gdocument.getElementById("newbonklobby_chat_content").children.length-1].children;
  408. var lm2 = "";
  409. for(var i = 0; i<lm.length;i++){
  410. lm2+=" "+lm[i].textContent.trim();
  411. }
  412. lm2 = lm2.trim();
  413. if(lm2.startsWith("*")){
  414. return lm2;
  415. }
  416. }
  417. if(Gdocument.getElementById("ingamechatcontent").children.length!=0){
  418. var lm = Gdocument.getElementById("ingamechatcontent").children[Gdocument.getElementById("ingamechatcontent").children.length-1].children;
  419. var lm2 = "";
  420. for(var i = 0; i<lm.length;i++){
  421. lm2+=" "+lm[i].textContent.trim();
  422. }
  423. return lm2.trim();
  424. }
  425. return "";
  426.  
  427. };
  428. scope.map = function(e){
  429. if(e<0){
  430. displayInChat("There is no previous map.","#DA0808","#1EBCC1");
  431. quicki = 0;
  432. return;
  433. }
  434. if(Gdocument.getElementById("maploadwindowmapscontainer").children[e] == undefined){
  435. displayInChat("Click the maps button.","#DA0808","#1EBCC1");
  436. return;
  437. }
  438.  
  439. setTimeout(function(){if(!canceled){
  440. Gdocument.getElementById("maploadwindowmapscontainer").children[e].click();
  441. Gdocument.getElementById("newbonklobby_editorbutton").click();
  442. Gdocument.getElementById("mapeditor_close").click();
  443. Gdocument.getElementById("newbonklobby").style["display"] = "none";
  444. Gdocument.getElementById("mapeditor_midbox_testbutton").click();}
  445. canceled = false;
  446. transitioning = false;
  447. },timedelay);
  448.  
  449. };
  450.  
  451. scope.gotonextmap = function(e){
  452. if(e<0){
  453. displayInChat("There is no previous map.","#DA0808","#1EBCC1");
  454. quicki = 0;
  455. return;
  456. }
  457. if(Gdocument.getElementById("maploadwindowmapscontainer").children[e] == undefined){
  458. displayInChat("Click the maps button.","#DA0808","#1EBCC1");
  459. return;
  460. }
  461. Gdocument.getElementById("maploadwindowmapscontainer").children[e].click();
  462. Gdocument.getElementById("newbonklobby_editorbutton").click();
  463. Gdocument.getElementById("mapeditor_close").click();
  464. Gdocument.getElementById("newbonklobby").style["display"] = "none";
  465. Gdocument.getElementById("mapeditor_midbox_testbutton").click();
  466. Gdocument.getElementById("newbonklobby").style["visibility"] = "visible";
  467. };
  468. scope.commandhandle = function(chat_val){
  469. if (chat_val.substring(1,6)=="echo " && chat_val.replace(/^\s+|\s+$/g, '').length>=7){
  470. if (chat_val.substring(6).replace(/^\s+|\s+$/g, '')==username){
  471. displayInChat("You cannot echo yourself.","#DA0808","#1EBCC1");
  472. return "";
  473. }
  474. else if (echo_list.indexOf(chat_val.substring(6).replace(/^\s+|\s+$/g, ''))===-1) {
  475.  
  476. echo_list.push(chat_val.substring(6).replace(/^\s+|\s+$/g, ''));
  477. displayInChat(chat_val.substring(6).replace(/^\s+|\s+$/g, '') + " is being echoed.","#DA0808","#1EBCC1");
  478. return "";
  479. }
  480. else{
  481. displayInChat(chat_val.substring(6).replace(/^\s+|\s+$/g, '') + " is already being echoed.","#DA0808","#1EBCC1");
  482. return "";
  483. }
  484. }
  485. else if (chat_val.substring(1,8)=="remove " && chat_val.replace(/^\s+|\s+$/g, '').length>=7){
  486. if (echo_list.indexOf(chat_val.substring(7).replace(/^\s+|\s+$/g, ''))!==-1){
  487. echo_list.splice(echo_list.indexOf(chat_val.substring(7).replace(/^\s+|\s+$/g, '')),1);
  488. displayInChat(chat_val.substring(7).replace(/^\s+|\s+$/g, '')+" is not being echoed.","#DA0808","#1EBCC1");
  489. return "";
  490. }
  491. else{
  492. displayInChat("You cannot remove someone that you didn't echo.","#DA0808","#1EBCC1");
  493. return "";
  494. }
  495.  
  496. }
  497. else if (chat_val.substring(1,10)=="clearecho"){
  498. echo_list = [];
  499. displayInChat("Cleared the echo list.","#DA0808","#1EBCC1");
  500. return "";
  501. }
  502. else if (chat_val.substring(1,6)=="space"){
  503. if(space_flag == true){
  504. displayInChat("Space is now off.","#DA0808","#1EBCC1");
  505. space_flag = false;
  506. }
  507. else{
  508. displayInChat("Space is now on.","#DA0808","#1EBCC1");
  509. space_flag = true;
  510. }
  511. return "";
  512. }
  513. else if (chat_val.substring(1,6)=="rcaps"){
  514. if(rcaps_flag == true){
  515. displayInChat("Rcaps is now off.","#DA0808","#1EBCC1");
  516. rcaps_flag = false;
  517. }
  518. else{
  519. displayInChat("Rcaps is now on.","#DA0808","#1EBCC1");
  520. rcaps_flag = true;
  521. }
  522.  
  523. return "";
  524. }
  525. else if (chat_val.substring(1,7)=="number"){
  526. if(number_flag == true){
  527. displayInChat("Number is now off.","#DA0808","#1EBCC1");
  528. number_flag = false;
  529. }
  530. else{
  531. displayInChat("Number is now on.","#DA0808","#1EBCC1");
  532. number_flag = true;
  533. }
  534.  
  535. return "";
  536. }
  537. else if (chat_val.substring(1,12)=="requestfake" && chat_val.replace(/^\s+|\s+$/g, '').length>=13){
  538. var mess = chat_val.substring(13).replace(/^\s+|\s+$/g, '');
  539. var result;
  540. var key;
  541. try{
  542. result = JSON.parse("{"+mess.replaceAll(",",":")+"}");
  543. if(Object.keys(result).length!=1){
  544. throw "";
  545. }
  546. else{
  547. key = Object.keys(result)[0];
  548. }
  549. SEND('42'+JSON.stringify([27,{"m":"","mapname":key.replaceAll(":",","),"mapauthor":result[key].replaceAll(":",",")}]));
  550. return "";
  551. }
  552. catch{
  553. displayInChat('Format: /requestfake "mapname", "mapauthor"',"#DA0808","#1EBCC1");
  554. return "";
  555. }
  556. return "";
  557.  
  558. }
  559. else if (chat_val.substring(1,6)=="eval " && chat_val.replace(/^\s+|\s+$/g, '').length>=7){
  560. var ev = "";
  561. try{
  562. ev = eval(chat_val.substring(6).replace(/^\s+|\s+$/g, ''));
  563. }
  564. catch(e){
  565. displayInChat(e.message,"#DA0808","#1EBCC1");
  566. }
  567. try{
  568. displayInChat(ev.toString(),"#DA0808","#1EBCC1");
  569. }
  570. catch{
  571. }
  572.  
  573. return "";
  574.  
  575. }
  576.  
  577. else if (chat_val.substring(1,9)=="hidechat"){
  578. Gdocument.getElementById("ingamechatcontent").style["max-height"]="0px";
  579. return "";
  580. }
  581. else if (chat_val.substring(1,9)=="showchat"){
  582. Gdocument.getElementById("ingamechatcontent").style["max-height"]="250px";
  583. return "";
  584. }
  585.  
  586. else if (chat_val.substring(1,7)=="scroll"){
  587. if(scroll==false){
  588. scroll = true;
  589. Gdocument.getElementById("ingamechatcontent").style["overflow-y"]="scroll";
  590. Gdocument.getElementById("ingamechatcontent").style["overflow-x"]="hidden";
  591. }
  592. else if(scroll==true){
  593. scroll = false;
  594. Gdocument.getElementById("ingamechatcontent").style["overflow-y"]="hidden";
  595. Gdocument.getElementById("ingamechatcontent").style["overflow-x"]="hidden";
  596. }
  597.  
  598. return "";
  599. }
  600.  
  601. else if (chat_val.substring(1,7)=="chatw "){
  602. var text = chat_val.substring(7).replace(/^\s+|\s+$/g, '');
  603.  
  604. if(username == text){
  605. displayInChat("You cannot private chat with yourself.","#DA0808","#1EBCC1");
  606. return "";
  607. }
  608. private_chat = text;
  609.  
  610. SEND("42"+JSON.stringify([4,{"type":"request public key","from":username,"to":private_chat}]));
  611. request_public_key_time_stamp = Date.now();
  612. setTimeout(function(){if(private_chat_public_key[0]!=private_chat){displayInChat("Failed to connect to "+private_chat+".","#DA0808","#1EBCC1");private_chat = private_chat_public_key[0];}},1600);
  613. return "";
  614. }
  615.  
  616. else if (chat_val.substring(1,5)=="msg " && chat_val.replace(/^\s+|\s+$/g, '').length>=6){
  617. if(private_chat_public_key[1][0] != 0 && private_chat_public_key[1][1] != 0 && private_chat_public_key[0] == private_chat){
  618. var text = chat_val.substring(5).replace(/^\s+|\s+$/g, '');
  619. var password = [];
  620. for(var i = 0;i<5;i++){
  621. password.push(Math.floor(Math.random()*100+50));
  622. }
  623. var text2 = [];
  624. for(var i = 0;i<text.slice(0,400).length ;i++){
  625. text2.push(password[i%password.length]^text.slice(0,400).charCodeAt(i));
  626. }
  627. SEND("42"+JSON.stringify([4,{"type":"private chat","from":username,"to":private_chat,"message":text2,"password":CRYPT_MESSAGE(private_chat_public_key[1],password)}]));
  628. displayInChat("> "+username+": "+text,"#DA0808","#1EBCC1");
  629.  
  630. }
  631. return "";
  632. }
  633. else if (chat_val.substring(1,6)=="lobby"){
  634. lobby();
  635. return "";
  636. }
  637. else if (chat_val.substring(1,6)=="team " && chat_val.replace(/^\s+|\s+$/g, '').length>=7){
  638. var text = chat_val.substring(6).replace(/^\s+|\s+$/g, '');
  639. if(text == "r"){Gdocument.getElementById("newbonklobby_redbutton").click();}
  640. else if(text == "g"){Gdocument.getElementById("newbonklobby_greenbutton").click();}
  641. else if(text == "y"){Gdocument.getElementById("newbonklobby_yellowbutton").click();}
  642. else if(text == "b"){Gdocument.getElementById("newbonklobby_bluebutton").click();}
  643. else if(text == "s"){Gdocument.getElementById("newbonklobby_specbutton").click();}
  644. else if(text == "f"){Gdocument.getElementById("newbonklobby_ffabutton").click();}
  645. return "";
  646. }
  647. else if (chat_val.substring(1,7)=="notify"){
  648.  
  649. npermissions = 1;
  650. return "";
  651. }
  652. else if (chat_val.substring(1,11)=="stopnotify"){
  653.  
  654. npermissions = 0;
  655. return "";
  656. }
  657. else if (chat_val.substring(1,5)=="help" || chat_val.substring(1,2)=="?"){
  658. for(var i = 0;i<help.length;i++){
  659. displayInChat(help[i],"#DA0808","#1EBCC1");
  660.  
  661. }
  662. return "";
  663. }
  664. else if (chat_val.substring(1,9)=="advhelp " && chat_val.replace(/^\s+|\s+$/g, '').length>=10){
  665. var text = chat_val.substring(9).replace(/^\s+|\s+$/g, '');
  666. if(typeof(adv_help[text])!='undefined'){
  667. displayInChat(adv_help[text],"#DA0808","#1EBCC1");
  668. }
  669. return "";
  670. }
  671. else if(ishost){
  672.  
  673. if (chat_val.substring(1,5)=="next" && stopquickplay == 0){
  674. quicki++;
  675. gotonextmap(quicki%(Gdocument.getElementById("maploadwindowmapscontainer").children.length));
  676. displayInChat("Switched to next map.","#DA0808","#1EBCC1");
  677. return "";
  678.  
  679. }
  680. else if (chat_val.substring(1,9)=="freejoin"){
  681. if(freejoin == false){
  682. freejoin = true;
  683. displayInChat("Freejoin is now on.","#DA0808","#1EBCC1");
  684.  
  685. }
  686. else{
  687. freejoin = false;
  688. displayInChat("Freejoin is now off.","#DA0808","#1EBCC1");
  689. }
  690.  
  691. return "";
  692.  
  693. }
  694.  
  695. else if (chat_val.substring(1,9)=="previous" && stopquickplay == 0){
  696. quicki--;
  697. gotonextmap(quicki%(Gdocument.getElementById("maploadwindowmapscontainer").children.length));
  698.  
  699. displayInChat("Switched to previous map.","#DA0808","#1EBCC1");
  700. return "";
  701. }
  702. else if (chat_val.substring(1,6)=="start" && chat_val.length == 6){
  703. Gdocument.getElementById("newbonklobby_editorbutton").click();
  704. Gdocument.getElementById("mapeditor_close").click();
  705. Gdocument.getElementById("newbonklobby").style["display"] = "none";
  706. Gdocument.getElementById("mapeditor_midbox_testbutton").click();
  707.  
  708. return "";
  709. }
  710.  
  711. else if (chat_val.substring(1,8)=="startqp" && stopquickplay == 1){
  712. stopquickplay = 0;
  713. quicki = 0;
  714. displayInChat("Enabled quickplay.","#DA0808","#1EBCC1");
  715. return "";
  716. }
  717. else if (chat_val.substring(1,7)=="stopqp" && stopquickplay == 0){
  718. stopquickplay = 1;
  719. quicki = 0;
  720. displayInChat("Disabled quickplay.","#DA0808","#1EBCC1");
  721. return "";
  722. }
  723.  
  724. else if (chat_val.substring(1,5)=="ban " && chat_val.replace(/^\s+|\s+$/g, '').length>=6){
  725. banned.push(chat_val.substring(5).replace(/^\s+|\s+$/g, ''));
  726. displayInChat("Banned "+chat_val.substring(5).replace(/^\s+|\s+$/g, '')+".","#DA0808","#1EBCC1");
  727. return "/kick '" + chat_val.substring(5).replace(/^\s+|\s+$/g, '') + "'";
  728. }
  729. else if (chat_val.substring(1,10)=="balanceA " && chat_val.replace(/^\s+|\s+$/g, '').length>=11){
  730. var text = chat_val.substring(10).replace(/^\s+|\s+$/g, '');
  731. if(!isNaN(parseInt(text))){
  732. if(Gdocument.getElementById("newbonklobby").style["display"] != "block"){
  733. mess2 = Gdocument.getElementById("ingamechatinputtext").value;
  734. Gdocument.getElementById("ingamechatinputtext").value = "";
  735. Gdocument.getElementById("newbonklobby_editorbutton").click();
  736. Gdocument.getElementById("mapeditor_close").click();
  737. Gdocument.getElementById("newbonklobby").style["display"] = "none";
  738. Gdocument.getElementById("ingamechatinputtext").value = mess2;
  739.  
  740. }
  741. var playing = Gdocument.getElementsByClassName("newbonklobby_playerentry");
  742. for(var i = 0; i<playing.length;i++){
  743. chat("/balance \""+playing[i].children[1].textContent+"\" "+text)
  744. }
  745. }
  746. return "";
  747.  
  748. }
  749. else if (chat_val.substring(1,8)=="rounds " && chat_val.replace(/^\s+|\s+$/g, '').length>=9){
  750. var text = chat_val.substring(8).replace(/^\s+|\s+$/g, '');
  751. if(!isNaN(parseInt(text))){
  752. text = parseInt(text).toString();
  753. SEND('42[21,{w:'+text+'}]');
  754. RECIEVE('42[27,'+text+']');
  755. }
  756. return "";
  757.  
  758. }
  759. else if (chat_val.substring(1,13)=="defaultmode " && chat_val.replace(/^\s+|\s+$/g, '').length>=14){
  760. var text = chat_val.substring(13).replace(/^\s+|\s+$/g, '');
  761. if(text == "default"){
  762. defaultmode = "";
  763. displayInChat("Changed default mode to default.","#DA0808","#1EBCC1");
  764. }
  765. else if(text == "arrows"){
  766. defaultmode = "ar";
  767. displayInChat("Changed default mode to arrows.","#DA0808","#1EBCC1");
  768. }
  769. else if(text == "death arrows"){
  770. defaultmode = "ard";
  771. displayInChat("Changed default mode to death arrows.","#DA0808","#1EBCC1");
  772. }
  773. else if(text == "grapple"){
  774. defaultmode = "sp";
  775. displayInChat("Changed default mode to grapple.","#DA0808","#1EBCC1");
  776. }
  777. else if(text == "classic"){
  778. defaultmode = "b";
  779. displayInChat("Changed default mode to classic.","#DA0808","#1EBCC1");
  780.  
  781. }
  782. else{
  783. displayInChat("Default mode options:","#DA0808","#1EBCC1");
  784. displayInChat("default","#DA0808","#1EBCC1");
  785. displayInChat("classic","#DA0808","#1EBCC1");
  786. displayInChat("arrows","#DA0808","#1EBCC1");
  787. displayInChat("death arrows","#DA0808","#1EBCC1");
  788. displayInChat("grapple","#DA0808","#1EBCC1");
  789. }
  790. return "";
  791.  
  792. }
  793. else if (chat_val.substring(1,8)=="recmode"){
  794. if(recmodebool == true){
  795. recmodebool = false;
  796. displayInChat("Recmode is now off.","#DA0808","#1EBCC1");
  797.  
  798. }
  799. else{
  800. recmodebool = true;
  801. displayInChat("Recmode is now on.","#DA0808","#1EBCC1");
  802.  
  803. }
  804.  
  805. return "";
  806.  
  807. }
  808. else if(sandboxon){
  809. if (chat_val.substring(1,11)=="addplayer " && chat_val.replace(/^\s+|\s+$/g, '').length>=12){
  810. var text = chat_val.substring(11).replace(/^\s+|\s+$/g, '');
  811. if(!isNaN(parseInt(text))){
  812. var text2 = parseInt(text);
  813. if(text2>0){
  814. for(var i = 0;i<text2;i++){
  815. RECIEVE('42[4,'+sandboxid+',"0123456789abcdef","'+sandboxid.toString()+'",true,0,1,{"layers":[],"bc":'+Math.floor(Math.random() * 16777215).toString()+'}]');
  816. sandboxplayerids[sandboxid] = sandboxid.toString();
  817. sandboxid+=1;
  818. }
  819.  
  820. }
  821. }
  822. return "";
  823.  
  824. }
  825. else if (chat_val.substring(1,11)=="delplayer " && chat_val.replace(/^\s+|\s+$/g, '').length>=12){
  826. var text = chat_val.substring(11).replace(/^\s+|\s+$/g, '');
  827. if(!isNaN(parseInt(text))){
  828. var text2 = parseInt(text);
  829. if(text2>0){
  830. if(Gdocument.getElementById("gamerenderer").style["visibility"] == "hidden"){
  831. var jsonkeys = Object.keys(sandboxplayerids).reverse();
  832. for(var i = 0;i<text2 && i<jsonkeys.length;i++){
  833. RECIEVE('42[5,'+jsonkeys[i]+',0]');
  834. delete sandboxplayerids[jsonkeys[i]];
  835. }
  836. }
  837. else{
  838. displayInChat("Cannot delete players while ingame.","#DA0808","#1EBCC1");
  839. }
  840.  
  841. }
  842. }
  843. return "";
  844. }
  845. else if (chat_val.substring(1,7)=="copyme"){
  846. if(sandboxcopyme == true){
  847. displayInChat("Copyme is now off.","#DA0808","#1EBCC1");
  848. sandboxcopyme = false;
  849. }
  850. else{
  851. displayInChat("Copyme is now on.","#DA0808","#1EBCC1");
  852. sandboxcopyme = true;
  853. }
  854.  
  855. return "";
  856. }
  857. }
  858. }
  859. return chat_val;
  860. };
  861.  
  862. scope.flag_manage = function(t){
  863. var text = t;
  864.  
  865. if(rcaps_flag == true){
  866. text = text.split('');
  867. for(var i = 0; i<text.length;i++){
  868. if(Math.floor(Math.random()*2)){
  869. text[i] = text[i].toUpperCase();
  870. }
  871. else{
  872. text[i] = text[i].toLowerCase();
  873. }
  874. }
  875. text = text.join('');
  876. }
  877. if(space_flag == true){
  878. text = text.split('').join(' ')
  879. }
  880. if(number_flag == true){
  881. text = text.replace(/[t|T][Oo]+/g,"2");
  882. text = text.replace(/[f|F][o|O][r|R]/g,"4");
  883. text = text.replace(/[a|A][t|T][e|E]/g,"8");
  884. text = text.replace(/[e|E]/g,"3");
  885. text = text.replace(/[a|A]/g,"4");
  886. text = text.replace(/[o|O]/g,"0");
  887. text = text.replace(/[s|S]/g,"5");
  888. text = text.replace(/[i|I|l|L]/g,"1");
  889. }
  890. return text;
  891. };
  892. Gdocument.getElementById("newbonklobby_chat_input").onkeydown = function(e){
  893. if(e.keyCode==13){
  894.  
  895. var chat_val = Gdocument.getElementById("newbonklobby_chat_input").value;
  896.  
  897. if (chat_val!="" && chat_val[0]=="/"){
  898.  
  899. Gdocument.getElementById("newbonklobby_chat_input").value = "";
  900. chat(commandhandle(chat_val));
  901. }
  902. else{
  903. Gdocument.getElementById("newbonklobby_chat_input").value = "";
  904. chat(flag_manage(chat_val));
  905. }
  906. chat_val = Gdocument.getElementById("ingamechatinputtext").value;
  907. if (chat_val!="" && chat_val[0]=="/"){
  908.  
  909. Gdocument.getElementById("ingamechatinputtext").value = "";
  910. chat(commandhandle(chat_val));
  911. }
  912. else{
  913. Gdocument.getElementById("ingamechatinputtext").value = "";
  914. chat(flag_manage(chat_val));
  915. }
  916.  
  917. }
  918. };
  919. Gdocument.getElementById("ingamechatinputtext").onkeydown = function(e){
  920. if(e.keyCode==13){
  921.  
  922. var chat_val = Gdocument.getElementById("newbonklobby_chat_input").value;
  923. if (chat_val!="" && chat_val[0]=="/"){
  924.  
  925. Gdocument.getElementById("newbonklobby_chat_input").value = "";
  926. chat(commandhandle(chat_val));
  927. }
  928. else{
  929. Gdocument.getElementById("newbonklobby_chat_input").value = "";
  930. chat(flag_manage(chat_val));
  931. }
  932. chat_val = Gdocument.getElementById("ingamechatinputtext").value;
  933.  
  934. if (chat_val!="" && chat_val[0]=="/"){
  935.  
  936. Gdocument.getElementById("ingamechatinputtext").value = "";
  937. chat(commandhandle(chat_val));
  938. }
  939. else{
  940. Gdocument.getElementById("ingamechatinputtext").value = "";
  941. chat(flag_manage(chat_val));
  942. }
  943. }
  944. };
  945. scope.Last_message = "";
  946. scope.Laster_message = "";
  947. scope.new_message = false;
  948. scope.changed_chat = false;
  949. scope.interval = setInterval(timeout123,100);
  950. function timeout123() {
  951.  
  952. if(Gdocument.getElementById("sm_connectingContainer").style["visibility"] == "hidden"){
  953. var chatbox = Gdocument.getElementById("newbonklobby_chat_content");
  954. while (chatbox.firstChild) {
  955. chatbox.removeChild(chatbox.firstChild);
  956. }
  957. rcaps_flag = false;
  958. space_flag = false;
  959. number_flag = false;
  960. echo_list = [];
  961. scroll = false;
  962. stopquickplay = 1;
  963. freejoin = false;
  964. defaultmode = "";
  965. recmodebool = false;
  966. playerids = {};
  967. sandboxplayerids = {};
  968. sandboxcopyme = false;
  969. sandboxon = false;
  970. sandboxid = 1;
  971.  
  972. }
  973. if(Gdocument.getElementById("ingametextwarning_afk").style["display"]=="table"){
  974. Gdocument.getElementById("pretty_top_settings").click();
  975. key2 = Gdocument.getElementById("redefineControls_table").children[0].children[5].children[1].innerHTML.charCodeAt(0);
  976. Gdocument.getElementById("settings_close").click();
  977.  
  978. if(key2>0){
  979. fire("keydown",{keyCode:key2},Gwindow);
  980. setTimeout(function(){fire("keyup",{keyCode:key2},Gwindow)},100);
  981. }
  982.  
  983. }
  984.  
  985. if(Gdocument.getElementById("newbonklobby").style["display"]=="block"){
  986. Gdocument.getElementById("ingamechatinputtext").style["visibility"]="hidden";
  987. }
  988. else{
  989. Gdocument.getElementById("ingamechatinputtext").style["visibility"]="visible";
  990.  
  991. }
  992. mode = Gdocument.getElementById("newbonklobby_modetext").textContent;
  993. var userlist = Gdocument.getElementsByClassName("newbonklobby_playerentry_name");
  994. users = [];
  995. for(var i = 0;i<userlist.length;i++){
  996. users.push(userlist[i].textContent);
  997. }
  998. if(Gdocument.getElementsByClassName('newbonklobby_settings_button brownButton brownButton_classic buttonShadow brownButtonDisabled').length == 0){
  999. ishost = true;
  1000. }
  1001. else if(Gdocument.getElementsByClassName('newbonklobby_settings_button brownButton brownButton_classic buttonShadow brownButtonDisabled').length == 4){
  1002. ishost = false;
  1003. }
  1004.  
  1005. if(Gdocument.getElementById("pretty_top_name")!=null){
  1006. username = Gdocument.getElementById("pretty_top_name").textContent;
  1007. }
  1008. try{
  1009. Last_message = lastmessage()
  1010. } catch{
  1011. Last_message = "";
  1012. }
  1013. if (Laster_message != Last_message){
  1014. Laster_message = Last_message;
  1015. if(changed_chat==false){
  1016. new_message = true;
  1017. }
  1018. else{
  1019. changed_chat = false;
  1020. }
  1021. }
  1022. if(new_message){
  1023. if(freejoin && Last_message.startsWith("* ") && Last_message.endsWith(" has joined the game") && ishost){
  1024.  
  1025. var userjoined = Last_message.substring(2,Last_message.length-20);
  1026.  
  1027. if(Gdocument.getElementById("newbonklobby").style["display"] != "block"){
  1028. mess2 = Gdocument.getElementById("ingamechatinputtext").value;
  1029. Gdocument.getElementById("ingamechatinputtext").value = "";
  1030. Gdocument.getElementById("newbonklobby_editorbutton").click();
  1031. Gdocument.getElementById("mapeditor_close").click();
  1032. Gdocument.getElementById("newbonklobby").style["display"] = "none";
  1033. Gdocument.getElementById("ingamechatinputtext").value = mess2;
  1034.  
  1035. }
  1036. var playing = Gdocument.getElementsByClassName("newbonklobby_playerentry newbonklobby_playerentry_half");
  1037. var inplaying = false;
  1038. for(var i = 0;i<playing.length;i++){
  1039. if(userjoined == playing[i].children[1].textContent){
  1040. inplaying = true;
  1041. break;
  1042. }
  1043. }
  1044.  
  1045. if(playing.length<=2 && inplaying){
  1046. Gdocument.getElementById("newbonklobby_editorbutton").click();
  1047. Gdocument.getElementById("mapeditor_close").click();
  1048. Gdocument.getElementById("newbonklobby").style["display"] = "none";
  1049. Gdocument.getElementById("mapeditor_midbox_testbutton").click();
  1050. if(transitioning == true){
  1051. canceled = true;
  1052. }
  1053. }
  1054.  
  1055. }
  1056. var lm = "";
  1057. try{
  1058. lm = Gdocument.getElementById("newbonklobby_chat_content").children[Gdocument.getElementById("newbonklobby_chat_content").children.length-1].children;
  1059. if (lm[0].className == "newbonklobby_chat_msg_colorbox"){
  1060. lm[2].innerHTML = urlify(lm[2].innerHTML);
  1061. Laster_message = lastmessage();
  1062. }
  1063. if (lm[0].className == "newbonklobby_chat_status"){
  1064. lm[0].innerHTML = urlify(lm[0].innerHTML);
  1065. Laster_message = lastmessage();
  1066. }
  1067. }
  1068. catch{
  1069. lm = "";
  1070. }
  1071.  
  1072. if(Last_message.indexOf("@"+username)!=-1 && npermissions == 1){
  1073. var n = new Notification(Last_message);
  1074. }
  1075.  
  1076. try{
  1077. lm = Gdocument.getElementById("ingamechatcontent").children[Gdocument.getElementById("ingamechatcontent").children.length-1].children;
  1078. if(lm[0].className == "ingamechatname"){
  1079. lm[1].innerHTML = urlify(lm[1].innerHTML);
  1080. Laster_message = lastmessage();
  1081. }
  1082. if(lm[0].className == ""){
  1083. lm[0].innerHTML = urlify(lm[0].innerHTML);
  1084. Laster_message = lastmessage();
  1085. }
  1086. }
  1087. catch{
  1088. lm = "";
  1089. }
  1090.  
  1091. for(i=0;i<echo_list.length;i++){
  1092. if(Last_message.substring(0,echo_list[i].length+2) == echo_list[i]+": "){
  1093. message = Last_message.substring(echo_list[i].length+2);
  1094. chat(flag_manage(message));
  1095. }
  1096. }
  1097. }
  1098. if (ishost==true && new_message){
  1099. for(i=0;i<banned.length;i++){
  1100. if(Last_message == "* "+banned[i]+" has joined the game "){
  1101. chat("/kick '"+banned[i]+"'");
  1102. }
  1103. }
  1104. }
  1105. if(ishost == true && stopquickplay == 0){
  1106.  
  1107. if(Gdocument.getElementById("ingamewinner").style["visibility"]=="inherit" && stopquickplay == 0 && dontswitch == false){
  1108. quicki++;
  1109. transitioning = true;
  1110. map(quicki%(Gdocument.getElementById("maploadwindowmapscontainer").children.length));
  1111.  
  1112. dontswitch = true;
  1113. setTimeout(function(){Gdocument.getElementById("ingamewinner").style["visibility"]="hidden"; dontswitch = false;},timedelay);
  1114.  
  1115. }
  1116. }
  1117. new_message = false;
  1118. };
  1119. });