Bonk Commands

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

当前为 2022-10-01 提交的版本,查看 最新版本

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

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址