Automatic Re-Join · Bonk.io

This script will automatically attempt to rejoin a full room. <sup>Based off of [UnmatchedBracket's script](https://gf.qytechs.cn/en/scripts/449381-auto-rejoin).</sup>

目前为 2022-12-21 提交的版本。查看 最新版本

// ==UserScript==
// @name         Automatic Re-Join · Bonk.io
// @namespace    https://gf.qytechs.cn/en/users/962705
// @version      1.0.3
// @license      GPL-3.0
// @description  This script will automatically attempt to rejoin a full room.  <sup>Based off of [UnmatchedBracket's script](https://gf.qytechs.cn/en/scripts/449381-auto-rejoin).</sup>
// @author       rrreddd
// @match        https://bonk.io/*
// @run-at       document-end
// @grant        none
// ==/UserScript==

var target = document.getElementById("sm_connectingWindow_text")

let roompass = ""

var observer = new MutationObserver(function(mutations) {
    if ((target.innerText.includes("room_full")) || (target.innerText.includes("no_entry_client"))) {
        roompass = document.getElementById("roomlistjoinpasswordtext").value
        setTimeout(()=>{
            document.getElementById("sm_connectingWindowCancelButton").click()
            setTimeout(()=>{
                document.getElementById("roomlistjoinbutton").click()
                setTimeout(()=>{
                    if (document.getElementById("roomlistjoinpasswordwindowcontainer").style.visibility == "visible") {
                        document.getElementById("roomlistjoinpasswordtext").value = roompass
                        setTimeout(()=>{document.getElementById("roomlistpassjoinbutton").click()}, 2000)
                    }
                }, 1000)
            }, 1000)
        }, 1000)
    }
});

observer.observe(target, {
    attributes:    true,
    childList:     true,
    characterData: true
});

QingJ © 2025

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