Automatic Re-Join · Bonk.io

This script will automatically attempt to rejoin a full room.

  1. // ==UserScript==
  2. // @name Automatic Re-Join · Bonk.io
  3. // @namespace https://greasyfork.org/en/users/962705
  4. // @version 1.0.5
  5. // @license GPL-3.0
  6. // @description This script will automatically attempt to rejoin a full room.
  7. // @author rrreddd
  8. // @match https://bonk.io/*
  9. // @run-at document-end
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. var target = document.getElementById("sm_connectingWindow_text")
  14.  
  15. let roompass = ""
  16.  
  17. var observer = new MutationObserver(function(mutations) {
  18. if ((target.innerText.includes("room_full")) || (target.innerText.includes("no_entry_client"))) {
  19. roompass = document.getElementById("roomlistjoinpasswordtext").value
  20. setTimeout(()=>{
  21. document.getElementById("sm_connectingWindowCancelButton").click()
  22. setTimeout(()=>{
  23. document.getElementById("roomlistjoinbutton").click()
  24. setTimeout(()=>{
  25. if (document.getElementById("roomlistjoinpasswordwindowcontainer").style.visibility == "visible") {
  26. document.getElementById("roomlistjoinpasswordtext").value = roompass
  27. setTimeout(()=>{document.getElementById("roomlistpassjoinbutton").click()}, 2000)
  28. }
  29. }, 1000)
  30. }, 1000)
  31. }, 1000)
  32. }
  33. });
  34.  
  35. observer.observe(target, {
  36. attributes: true,
  37. childList: true,
  38. characterData: true
  39. });