Double-click Ready to Start - Bonk.io

Starts the game without a countdown if you doubleclick the Ready button.

  1. // ==UserScript==
  2. // @name Double-click Ready to Start - Bonk.io
  3. // @version 1.0.0
  4. // @description Starts the game without a countdown if you doubleclick the Ready button.
  5. // @author Excigma
  6. // @namespace https://gf.qytechs.cn/users/416480
  7. // @license GPL-3.0
  8. // @match https://bonk.io/gameframe-release.html
  9. // @run-at document-idle
  10. // ==/UserScript==
  11.  
  12. (() => {
  13. // Whether Ready was double clicked
  14. let quickStart = false;
  15.  
  16. // Main canvas where the game is drawn on
  17. const gamerenderer = document.getElementById("gamerenderer");
  18. // Test button that starts the game right away from the map editor
  19. const mapeditor_midbox_testbutton = document.getElementById("mapeditor_midbox_testbutton");
  20. // Close map editor
  21. const mapeditor_close = document.getElementById("mapeditor_close");
  22. // Button to open map editor
  23. const newbonklobby_editorbutton = document.getElementById("newbonklobby_editorbutton");
  24. // Ready button
  25. const newbonklobby_readybutton = document.getElementById("newbonklobby_readybutton");
  26. // Start button
  27. const newbonklobby_startbutton = document.getElementById("newbonklobby_startbutton");
  28.  
  29. // Detect double click
  30. newbonklobby_readybutton.addEventListener("dblclick", () => {
  31. if (!newbonklobby_startbutton.classList.contains("brownButtonDisabled")) {
  32. quickStart = true;
  33. // Open the editor
  34. newbonklobby_editorbutton.click();
  35. // Start the game using the button from the editor
  36. mapeditor_midbox_testbutton.click();
  37. }
  38. });
  39.  
  40. new MutationObserver(mutationsList => {
  41. for (const mutation of mutationsList) {
  42. // The "gamerenderer" has been hidden (this is used to render the match and stuffs)
  43. // In short, this means we have left the game or returned to the lobby
  44. if (gamerenderer.style.visibility === "hidden") {
  45. // If quick start was used, then close the map editor
  46. // because the map editor will open after the round ends
  47. if (quickStart) {
  48. mapeditor_close.click();
  49. quickStart = false;
  50. }
  51. }
  52. }
  53. }).observe(gamerenderer, {
  54. attributeFilter: ["style"]
  55. });
  56. })();

QingJ © 2025

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