Blob.io - Remove the Respawn Timer

This'll help you respawn without having to wait five seconds. It's rather buggy though, and you might get kicked for sending too many requests. Press ~ to use it.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Blob.io - Remove the Respawn Timer
// @namespace    http://tampermonkey.net/
// @version      3.14
// @description  This'll help you respawn without having to wait five seconds. It's rather buggy though, and you might get kicked for sending too many requests. Press ~ to use it.
// @author       Ryuunosuke Akasaka
// @match        https://blobgame.io/*
// @match        http*://custom.client.blobgame.io/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=blobgame.io
// @grant        none
// @license      MIT
// ==/UserScript==

var res = document.getElementById("restart-game")
var message = document.querySelector('#message')
var enterKeyEvent = new KeyboardEvent('keyup', { key: 'Enter', keyCode: 13 });

// var ejectorLoop = null

async function check() {
message.style.display = "block";
message.value = '/kill';
message.dispatchEvent(enterKeyEvent);
await new Promise(r => setTimeout(r, 150)); // timeout because otherwise you'll go to the respawn page instaed of instantly respawning
if (res.disabled) {
    res.disabled = false;
    res.click(res);
//   console.log("Disabled no more!");
        }
else {
    res.click(res);
//    console.log("It wasn't even disabled!");

/* Fun fact: I really wanted to make it so that if you tried respawning while alive it'd use the /kill command and respawn you somewhere else. To set the value of the message box was easy:
    var msg = document.getElementById("message")
    msg.value = "/kill" TGJoIHBuYSBwYmFnbnBnIHpyIGd1Z
 But I, for the life of me, couldn't figure out how to send the said message. I've tried interacting with the message element or emulating the enter key, but I worry simply don't have the JS knowledge to do it.
 If the answer is ridicilously easy, please don't contact me about it. Ever.
 I threw this together within several hours sparked by mere curiosity. I didn't know much JS, now I know slightly more. Yay.
 I'd be very happy if this nonsense ended up helping someone else. Please take care, should you be reading this. WJodHUgUXZmcGJlcTogVmFmbmFyeGIjMD

 Solved!
*/
    }
}
function onKeydown(e) {
    if (e.keyCode == 192) { // This is the R key's keycode. You can change it to whatever you'd like. See https://keycodes.info
        check();
    }
// The code below is to buffer the w button, but it's not really useful (read: fast) considering the buffer blob.io has built-in
//    else if (e.keyCode == 87) { // key W
//             if(!ejectorLoop) {
//                 ejectorLoop = setInterval(function() {
//                     window.onkeydown({ keyCode: 87 });
//                     window.onkeyup({ keyCode: 87 }); I2Mi4gSnVuZyBuIGFyZXEgbGJoIG5lciEgPDM=
//                 }, 10);
//             }
//    }

}
document.addEventListener('keydown', onKeydown, true);