diff --git a/Test_Updater.lsl b/Test_Updater.lsl new file mode 100644 index 0000000..0e94625 --- /dev/null +++ b/Test_Updater.lsl @@ -0,0 +1,77 @@ +// ==================================================================== +// Test Updater - Debug llRemoteLoadScriptPin +// ==================================================================== +// Simple test to see if llRemoteLoadScriptPin works at all + +string TEST_VERSION = "1.0.0"; +integer UPDATER_CHANNEL = -7723847; + +// Test state +key targetGameKey = NULL_KEY; +integer testPin = 0; +integer testStep = 0; + +// Simple test script content +string TEST_SCRIPT = "default {\n state_entry() {\n llOwnerSay(\"โœ… Test script installed successfully!\");\n llOwnerSay(\"๐Ÿ“ This proves llRemoteLoadScriptPin is working.\");\n }\n}"; + +default { + state_entry() { + llOwnerSay("๐Ÿงช Test Updater v" + TEST_VERSION + " ready"); + llOwnerSay("๐Ÿ“ This will test llRemoteLoadScriptPin with a tiny script"); + llOwnerSay("๐Ÿ‘† Touch your Peril Dice game, then touch this updater"); + + llListen(UPDATER_CHANNEL, "", NULL_KEY, ""); + + llSetText("๐Ÿงช Test Updater\nReady to test llRemoteLoadScriptPin\nTouch your game first, then me", + <1.0, 0.8, 0.2>, 1.0); + } + + listen(integer channel, string name, key id, string message) { + if (channel != UPDATER_CHANNEL) return; + + list parts = llParseString2List(message, ["|"], []); + string command = llList2String(parts, 0); + + if (command == "TEST_REQUEST") { + string version = llList2String(parts, 1); + integer pin = (integer)llList2String(parts, 2); + + llOwnerSay("๐Ÿ“จ Test request from " + name + " (PIN: " + (string)pin + ")"); + + // Store the test info + targetGameKey = id; + testPin = pin; + testStep = 1; + + // Start the test + llOwnerSay("๐Ÿš€ Step 1: Testing tiny script installation..."); + llOwnerSay("๐Ÿ“Š Script size: " + (string)llStringLength(TEST_SCRIPT) + " characters"); + llOwnerSay("๐ŸŽฏ Target: " + (string)targetGameKey); + llOwnerSay("๐Ÿ”‘ PIN: " + (string)testPin); + + // Try to install the test script + llRemoteLoadScriptPin(targetGameKey, TEST_SCRIPT, testPin, TRUE, 0); + + llOwnerSay("โœ… llRemoteLoadScriptPin called - check your game for new script"); + llOwnerSay("๐Ÿ’ก If successful, you'll see a 'Test script installed' message"); + } + else if (command == "PING_UPDATER") { + llRegionSayTo(id, UPDATER_CHANNEL, "TEST_UPDATER_AVAILABLE|" + TEST_VERSION); + } + } + + touch_start(integer total_number) { + key toucher = llDetectedKey(0); + + if (testStep == 0) { + llOwnerSay("๐Ÿ” Touch your Peril Dice game first to set up the PIN"); + llOwnerSay("๐Ÿ“ The game needs to call llSetRemoteScriptAccessPin()"); + } else { + llOwnerSay("๐Ÿงช Test Status:"); + llOwnerSay("๐Ÿ“ Target: " + (string)targetGameKey); + llOwnerSay("๐Ÿ”‘ PIN: " + (string)testPin); + llOwnerSay("๐Ÿ“Š Test script size: " + (string)llStringLength(TEST_SCRIPT) + " chars"); + llOwnerSay("โ“ Did you see 'Test script installed successfully' message?"); + } + } +} \ No newline at end of file diff --git a/Update_Receiver.lsl b/Update_Receiver.lsl index fc9e33e..37cddae 100644 --- a/Update_Receiver.lsl +++ b/Update_Receiver.lsl @@ -197,6 +197,7 @@ showUpdateCommands() { llOwnerSay("๐Ÿ’ฌ Manual commands still available:"); llOwnerSay(" /1 check - Check GitHub for updates"); llOwnerSay(" /1 scan - Scan for nearby updater boxes"); + llOwnerSay(" /1 test - Test llRemoteLoadScriptPin with tiny script"); llOwnerSay(" /1 help - Show these commands"); } @@ -236,6 +237,22 @@ default { else if (msg == "scan") { scanForUpdaters(); } + else if (msg == "test") { + // Test llRemoteLoadScriptPin with tiny script + llOwnerSay("๐Ÿงช DEBUG: Testing llRemoteLoadScriptPin..."); + + // Generate test PIN + integer testPin = (integer)(llFrand(1000000)) + 100000; + llSetRemoteScriptAccessPin(testPin); + + llOwnerSay("๐Ÿ”‘ Test PIN set: " + (string)testPin); + llOwnerSay("๐Ÿ“ก Broadcasting test request on channel " + (string)UPDATER_CHANNEL); + + // Broadcast test request to any test updaters + llRegionSay(UPDATER_CHANNEL, "TEST_REQUEST|" + CURRENT_VERSION + "|" + (string)testPin); + + llOwnerSay("๐Ÿท๏ธ If you have a Test_Updater nearby, it should respond now"); + } else { llOwnerSay("โ“ Unknown command. Say '/1 help' for available commands"); }