// "MagnaMural Update Script - Main" // // by Apollia Pirandello // // Free, public domain, open source. May be used and modified // for any purpose, including commercial purposes. // // If you like it, or even if you don't, I welcome donations of // any size. // // MagnaMural Home Page, with manual and scripts: // http://magnamural.astroblahhh.com/ //These are just to make it easy to change the file names throughout //the script, if necessary. string MagnaMuralMessagerScriptName="00-MagnaMural Messager Script"; string MagnaMuralDroneScript1="00-MagnaMural Drone Script One"; string MagnaMuralDroneScript2="00-MagnaMural Drone Script Two"; string MagnaMuralPDManual="*-Astroblahhh.Com MagnaMural Manual - Public Domain"; string MagnaMuralPDSummary="*-Astroblahhh.Com MagnaMural Commands Summary - Public Domain"; string UpdaterDroneScriptName2="MagnaMural Update Drone Script for Prim Two"; string UpdaterDroneScriptName3="MagnaMural Update Drone Script for Prim Three"; string UpdaterDroneScriptName4="MagnaMural Update Drone Script for Prim Four"; //Here are the variables where various important UUID keys will be stored: key prim2_key; key prim3_key; key prim4_key; key owner_key; //And a generic key variable for whatever key... key allpurpose_key; Update() { llOwnerSay("Now unlinking, so the new MagnaMural scripts can be copied into the MagnaMural's other prims..."); llBreakAllLinks(); //Then all the new files are put in their proper prims. llGiveInventory(prim2_key, MagnaMuralMessagerScriptName); llGiveInventory(prim2_key, MagnaMuralPDManual); llGiveInventory(prim2_key, MagnaMuralPDSummary); llGiveInventory(prim2_key, UpdaterDroneScriptName2); llGiveInventory(prim3_key, MagnaMuralDroneScript1); llGiveInventory(prim3_key, UpdaterDroneScriptName3); llGiveInventory(prim4_key, MagnaMuralDroneScript2); llGiveInventory(prim4_key, UpdaterDroneScriptName4); llSleep(3); //Just to give Second Life some time to give the inventory. //And we relink the prims in their proper order. llCreateLink(prim4_key, TRUE); //The "TRUE" means that this prim will be the parent prim //of the prim that was just relinked. llCreateLink(prim3_key, TRUE); llCreateLink(prim2_key, TRUE); llOwnerSay("Relinked."); llOwnerSay("Please take the MagnaMural, then re-rez it, and delete the copy in your inventory. Then, right-click on the re-rezzed MagnaMural and select Edit from the pie menu. Go to the Tools menu and select \"Set Scripts to Running in Selection\". Then, your MagnaMural should be updated, and it would be a good idea to take a copy of it into inventory."); //Then, we delete all of the files that were just copied into the other prims, //as well as the old MagnaMural main script in the root prim. llRemoveInventory("\"00-MagnaMural Script One"); llRemoveInventory(MagnaMuralMessagerScriptName); llRemoveInventory(MagnaMuralDroneScript1); llRemoveInventory(MagnaMuralDroneScript2); llRemoveInventory(MagnaMuralPDManual); llRemoveInventory(MagnaMuralPDSummary); llRemoveInventory(UpdaterDroneScriptName2); llRemoveInventory(UpdaterDroneScriptName3); llRemoveInventory(UpdaterDroneScriptName4); llRemoveInventory("Readme - MagnaMural Updater Info"); llRequestPermissions(owner_key, FALSE); //Just to remove the link permissions that were requested before. //Then, the script deletes itself. llRemoveInventory(llGetScriptName()); } default { state_entry() { llOwnerSay("Please click the MagnaMural whenever you wish to begin the update process."); } touch_start(integer total_number) { owner_key=llGetOwner(); allpurpose_key=llDetectedKey(0); if (allpurpose_key==owner_key) { if ( llGetInventoryType("00-MagnaMural Main Script") == INVENTORY_NONE || llGetInventoryType(MagnaMuralMessagerScriptName) == INVENTORY_NONE || llGetInventoryType(MagnaMuralDroneScript1) == INVENTORY_NONE || llGetInventoryType(MagnaMuralDroneScript2) == INVENTORY_NONE || llGetInventoryType(UpdaterDroneScriptName2)==INVENTORY_NONE || llGetInventoryType(UpdaterDroneScriptName3)==INVENTORY_NONE || llGetInventoryType(UpdaterDroneScriptName4)==INVENTORY_NONE || llGetInventoryType(MagnaMuralPDManual)==INVENTORY_NONE || llGetInventoryType(MagnaMuralPDSummary)==INVENTORY_NONE ) { llOwnerSay("Please click again once all the scripts and notecards in the 'MagnaMural Update Folder' are in this prim."); } else { prim2_key=llGetLinkKey(2); prim3_key=llGetLinkKey(3); prim4_key=llGetLinkKey(4); llOwnerSay("Please grant link permissions, so the MagnaMural can unlink itself so the new scripts can be moved to its individual prims, and then relink itself when it's done."); llRequestPermissions(owner_key, PERMISSION_CHANGE_LINKS); } } } run_time_permissions(integer perm) { if (perm==0) { llOwnerSay("Sorry, this script won't work unless you grant link permissions, so the MagnaMural can unlink itself so the new scripts can be moved to its individual prims, and then relink itself when it's done."); } else { Update(); } } }