No Usernames

A userscript to remove all usernames from ingame

当前为 2022-03-28 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name No Usernames
  3. // @version 1.0.0
  4. // @author Blu
  5. // @description A userscript to remove all usernames from ingame
  6. // @match https://bonk.io/gameframe-release.html
  7. // @run-at document-start
  8. // @grant none
  9. // @namespace https://greasyfork.org/users/826975
  10. // ==/UserScript==
  11.  
  12. // for use as a userscript ensure you have Excigma's code injector userscript
  13. // https://greasyfork.org/en/scripts/433861-code-injector-bonk-io
  14.  
  15. const injectorName = `NoUsernames`;
  16. const errorMsg = `Whoops! ${injectorName} was unable to load.
  17. This may be due to an update to Bonk.io. If so, please report this error!
  18. This could also be because you have an extension that is incompatible with \
  19. ${injectorName}`;
  20.  
  21. function injector(src){
  22. let newSrc = src;
  23. // o1k[8] = this.playerObject.userName => o1k[8] = ""
  24. newSrc = newSrc.replace(`o1k[8]=this[o1k[7][1576]][o1k[7][568]];`, `o1k[8]="";`);
  25. if(src === newSrc) throw "Injection failed!";
  26. console.log(injectorName+" injector run");
  27. return newSrc;
  28. }
  29.  
  30. // Compatibility with Excigma's code injector userscript
  31. if(!window.bonkCodeInjectors) window.bonkCodeInjectors = [];
  32. window.bonkCodeInjectors.push(bonkCode => {
  33. try {
  34. return injector(bonkCode);
  35. } catch (error) {
  36. alert(errorMsg);
  37. throw error;
  38. }
  39. });
  40.  
  41. console.log(injectorName+" injector loaded");