/* * Scan and find objects by UUID * Version 2, 21 February 2023 * By Buzzy Cnayl ( https://opensimworld.com/user/Cnayl_Rainbow ) * With thanks to Kelso.Uxlay ( https://opensimworld.com/user/Kelso.Uxlay ) for pointing out that * instead of using llSensor which limits you to 96m, using llGetObjectDetails allows you to scn entire sim */ // Listen channel for dialogs integer channel = -13172428; integer gListener = -1; string lookingFor; key kUser; vector vPos; // Tidy up listens stopListen() { if (gListener != -1) { llListenRemove(gListener); gListener = -1; } } default { touch_start(integer total_number) { gListener = llListen( channel, "", "", ""); kUser = llDetectedKey(0); llTextBox(kUser, "\nEnter UUID to search for in the entire sim.", channel); llSetTimerEvent(45); } listen(integer channel, string name, key id, string message) { if (gListener != -1) { // First check if user is replying to the YES/NO option from the found item dialog if(message == "YES") { osLocalTeleportAgent(kUser, vPos, ZERO_VECTOR, ZERO_VECTOR, OS_LTPAG_FORCEFLY); llListenRemove(gListener); } else if (message == "NO") { stopListen(); } else { // Wasn't YES or NO so assume is the UUID user wishes to search for lookingFor = message; list results = llGetObjectDetails((key)lookingFor, [OBJECT_NAME, OBJECT_DESC, OBJECT_POS]); vPos = llList2Vector(results,2); if ( results != [] ) { message = "\nFOUND!\n \nName:\t" + llList2String(results, 0) + "\n Desc:\t" + llList2String(results, 1) + "\n \nat " + llList2String(results, 2) + "\n \n Teleport to it?" ; llDialog(kUser, message, ["YES", "NO"], channel); llSetTimerEvent(45); } else { llOwnerSay("Sory, can't find object with key:" + lookingFor); stopListen(); } } } } timer() { llSetTimerEvent(0); stopListen(); } }