Randomize Xopar Tracker Room Name

Adds a button to Xopar Tracker that randomizes the room name

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Randomize Xopar Tracker Room Name
// @namespace    https://github.com/RuiNtD
// @version      1.0
// @description  Adds a button to Xopar Tracker that randomizes the room name
// @author       RuiNtD
// @match        https://ootr-random-settings-tracker.web.app/
// @icon         https://icons.duckduckgo.com/ip2/ootrandomizer.com.ico
// @grant        none
// @license      MIT
// ==/UserScript==

const btn = document.createElement("button");
btn.innerText = "Random Name";
btn.classList.add("ready");
btn.addEventListener("click", () => {
  const chars =
    "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  let id = "";
  for (var i = 0; i < 20; i++)
    id += chars.charAt(Math.floor(Math.random() * chars.length));

  /** @type {HTMLInputElement} */
  const roomID = document.querySelector("#room_id");
  roomID.value = id;
  roomID.dispatchEvent(new MouseEvent("input"));
});

setTimeout(() => {
  const eleAfter = document.querySelector("br");
  document.body.insertBefore(btn, eleAfter);
});