// ==UserScript== // @name Bonk Kicked Alert // @version 1.1.0 // @author Blu // @description A userscript to add additional alerts in chat // @match https://bonk.io/gameframe-release.html // @run-at document-start // @grant none // @namespace https://greasyfork.org/users/826975 // @downloadURL none // ==/UserScript== // for use as a userscript ensure you have Excigma's code injector userscript // https://greasyfork.org/en/scripts/433861-code-injector-bonk-io const injectorName = `BonkKicked`; const errorMsg = `Whoops! ${injectorName} was unable to load. This may be due to an update to Bonk.io. If so, please report this error! This could also be because you have an extension that is incompatible with \ ${injectorName}`; function injector(src){ let newSrc = src; // on recv packet 24, handle player kicked when ingame or in lobby newSrc = newSrc.replace(`i9a[2]=X8tDL;`, `$& let playerArr = F21[20]; let player = playerArr[arguments[0]]; let lobby = F21[90]; let ingame = F21[51]; if (lobby) lobby.showStatusMessage("* " + player.userName + " was KICKED!", "#cc3333", false); if (ingame) ingame.chatStatus("* " + player.userName + " was KICKED!");`); // on recv packet 40, handle player record newSrc = newSrc.replace(`H1N.L77(2271)`, `$& + " by " + S$w[80].playerArray[arguments[0]].userName`); // on recv packet 29, handle map updated newSrc = newSrc.replace(`D$s[8]=X8tDL;`, `$& if(arguments[0].m.n.includes(' (edit)')){ let lobby = F21[90]; let ingame = F21[51]; if (lobby) lobby.showStatusMessage("* Host edited map", "#cc3333", false); if (ingame) ingame.chatStatus("* Host edited map"); }`); if(src === newSrc) throw "Injection failed!"; console.log(injectorName+" injector run"); return newSrc; } // Compatibility with Excigma's code injector userscript if(!window.bonkCodeInjectors) window.bonkCodeInjectors = []; window.bonkCodeInjectors.push(bonkCode => { try { return injector(bonkCode); } catch (error) { alert(errorMsg); throw error; } }); console.log(injectorName+" injector loaded");