From 2c7e43ed500a4904a7114e07685902ff5820d495 Mon Sep 17 00:00:00 2001 From: Cube14yt Date: Sun, 24 Aug 2025 19:59:51 +0800 Subject: [PATCH] Update cubesstuff.js --- mods/cubesstuff.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/mods/cubesstuff.js b/mods/cubesstuff.js index 7bd31da7..5715b03f 100644 --- a/mods/cubesstuff.js +++ b/mods/cubesstuff.js @@ -567,10 +567,17 @@ keybinds["KeyT"] = function () { tpsPrompt() } -function addRow() { +function addRowWhenReady() { const table = document.getElementById("controlsTable"); - const rowCount = table.rows.length; + if (!table) { + // Table not ready yet, try again in 100ms + setTimeout(addRowWhenReady, 100); + return; + } + + // Table exists, add the row + const rowCount = table.rows.length; const newRow = table.insertRow(rowCount - 1); const cell1 = newRow.insertCell(0); @@ -578,9 +585,13 @@ function addRow() { cell1.textContent = "Change TPS"; cell2.innerHTML = "T"; + + console.log("Row added successfully!"); } -addRow() +// Start the process +addRowWhenReady(); + elements.randomizer = { buttonColor: ["#ff0000", "#ff8800", "#ffff00", "#00ff00", "#00ffff", "#0000ff", "#ff00ff"], @@ -1843,3 +1854,4 @@ elements.adjustable_cooler = { }; +