From 7e8de1cc01e3bde3389e6399609107a3a84de79b Mon Sep 17 00:00:00 2001 From: RebeccaNod1 Date: Thu, 18 Sep 2025 12:26:14 -0500 Subject: [PATCH] Fix LSL validation errors in Bot_Manager, Controller_Memory, Player_RegistrationManager, and Floater_Manager MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Bot_Manager.lsl: Fixed 3 variable name conflicts (response, botIdx, botLives) - Controller_Memory.lsl: Fixed 2 variable name conflicts (usedMemory, memoryPercentage) - Player_RegistrationManager.lsl: Fixed 1 variable name conflict (i) - Floater_Manager.lsl: Fixed 1 variable name conflict (i) - Progress: 115 → 108 total errors (-7) --- Bot_Manager.lsl | 14 +++++++------- Controller_Memory.lsl | 12 ++++++------ Floater_Manager.lsl | 4 ++-- Player_RegistrationManager.lsl | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Bot_Manager.lsl b/Bot_Manager.lsl index d38f651..1d513c6 100644 --- a/Bot_Manager.lsl +++ b/Bot_Manager.lsl @@ -126,8 +126,8 @@ doBotPick(string botName, integer count, integer diceMax, list avoidNumbers) { } else { llOwnerSay("[Bot Manager] ❌ " + botName + " cannot pick any numbers - all " + (string)diceMax + " numbers are taken!"); // Still send empty response to prevent game hanging - string response = "BOT_PICKED:" + botName + ":"; - llMessageLinked(LINK_SET, -9997, response, NULL_KEY); + string emptyResponse = "BOT_PICKED:" + botName + ":"; + llMessageLinked(LINK_SET, -9997, emptyResponse, NULL_KEY); return; } } @@ -183,15 +183,15 @@ doBotPick(string botName, integer count, integer diceMax, list avoidNumbers) { // Helper to respond to peril roll commands doBotRoll(string botName, integer diceMax) { // Validate bot exists and is still alive - integer botIdx = llListFindList(names, [botName]); - if (botIdx == -1) { + integer rollBotIdx = llListFindList(names, [botName]); + if (rollBotIdx == -1) { llOwnerSay("[Bot Manager] ❌ Bot '" + botName + "' not found in game - ignoring roll command"); return; } - integer botLives = llList2Integer(lives, botIdx); - if (botLives <= 0) { - llOwnerSay("[Bot Manager] ❌ Bot '" + botName + "' is eliminated (lives=" + (string)botLives + ") - ignoring roll command"); + integer rollBotLives = llList2Integer(lives, rollBotIdx); + if (rollBotLives <= 0) { + llOwnerSay("[Bot Manager] ❌ Bot '" + botName + "' is eliminated (lives=" + (string)rollBotLives + ") - ignoring roll command"); return; } diff --git a/Controller_Memory.lsl b/Controller_Memory.lsl index 4f3996f..23650fa 100644 --- a/Controller_Memory.lsl +++ b/Controller_Memory.lsl @@ -68,16 +68,16 @@ emergencyMemoryCleanup() { } reportMemoryStats() { - integer usedMemory = llGetUsedMemory(); - float memoryPercentage = (float)usedMemory / 65536.0; + integer statsUsedMemory = llGetUsedMemory(); + float statsMemoryPercentage = (float)statsUsedMemory / 65536.0; llOwnerSay("📊 [Memory Monitor] Memory Monitor Stats:"); - llOwnerSay(" Helper Memory Used: " + (string)usedMemory + " bytes (" + - (string)llRound(memoryPercentage * 100.0) + "% of 64KB)"); + llOwnerSay(" Helper Memory Used: " + (string)statsUsedMemory + " bytes (" + + (string)llRound(statsMemoryPercentage * 100.0) + "% of 64KB)"); string memoryStatus; - if (memoryPercentage > MEMORY_CRITICAL_THRESHOLD) { + if (statsMemoryPercentage > MEMORY_CRITICAL_THRESHOLD) { memoryStatus = "CRITICAL"; - } else if (memoryPercentage > MEMORY_WARNING_THRESHOLD) { + } else if (statsMemoryPercentage > MEMORY_WARNING_THRESHOLD) { memoryStatus = "WARNING"; } else { memoryStatus = "NORMAL"; diff --git a/Floater_Manager.lsl b/Floater_Manager.lsl index 8af47df..c481775 100644 --- a/Floater_Manager.lsl +++ b/Floater_Manager.lsl @@ -193,8 +193,8 @@ list getPicksFor(string nameInput) { // Converts a player's key into their name (if registered) string getNameFromKey(key id) { - integer i = llListFindList(alivePlayers, [id]); - if (i != -1) return llList2String(aliveNames, i); + integer idx = llListFindList(alivePlayers, [id]); + if (idx != -1) return llList2String(aliveNames, idx); return (string)id; } diff --git a/Player_RegistrationManager.lsl b/Player_RegistrationManager.lsl index 8772472..c52cf30 100644 --- a/Player_RegistrationManager.lsl +++ b/Player_RegistrationManager.lsl @@ -142,9 +142,9 @@ handlePlayerRegistration(string regData, key requesterId) { } else { // Build lives string dynamically string livesStr = ""; - integer i; - for (i = 0; i < llGetListLength(names); i++) { - if (i > 0) livesStr += ","; + integer j; + for (j = 0; j < llGetListLength(names); j++) { + if (j > 0) livesStr += ","; livesStr += "3"; // Everyone starts with 3 lives } syncMessage = livesStr + "~EMPTY~NONE~" + llList2CSV(names);