Bonk Commands

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

目前為 2022-09-27 提交的版本,檢視 最新版本

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