Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- link_message(integer sender_num, integer num, string message, key id)
- {
- string thisScript = llGetScriptName();
- string itemName = message;
- integer separator = llSubStringIndex(message,"|");
- //llOwnerSay("Separator "+(string)separator);
- string input = llGetSubString(message,0,separator -1);
- string boatname = llGetSubString(input,llSubStringIndex(input,"(")+1,
- llSubStringIndex(input,")")-1);
- integer length = llStringLength(message);
- string command;
- //llOwnerSay("Length: "+(string)length+" & Sep: "+(string)separator);
- if(length != separator+1){
- command = llGetSubString(message,separator +1,-1);
- // llOwnerSay(command);
- if(command=="Update")
- {
- // llOwnerSay(boatname);
- // llOwnerSay(input);
- separator = llSubStringIndex(input," add-on ");
- string itemrequest= llGetSubString(message,0,separator -1);
- // llOwnerSay(itemrequest);
- list InventoryList;
- integer count = llGetInventoryNumber(INVENTORY_ALL); // Count of all items in prim's contents
- string ItemName;
- while (count--)
- {
- ItemName = llGetInventoryName(INVENTORY_ALL, count);
- integer itemnr = llSubStringIndex(ItemName,boatname);
- // llOwnerSay((string)itemnr);
- if (itemnr >0) {
- // llOwnerSay("Candidate: " + ItemName);
- length = llStringLength(itemrequest);
- // llOwnerSay(itemrequest);
- // llOwnerSay((string)length);
- if (llGetSubString(ItemName, 0, length-1) == itemrequest) {
- // llOwnerSay("Final item to send: "+ ItemName);
- itemName=ItemName;
- }
- }
- }
- }
- }//endif seperator
- if (itemName != thisScript)
- {
- if (llGetInventoryPermMask(itemName, MASK_OWNER) & PERM_COPY)
- {
- llGiveInventory(id, itemName); // 3.0 seconds delay
- ++total;
- setmessage="Last item sent:\n";
- setmessage+=itemName +"\n";
- setmessage+=(string)total + " items sent.";
- llSetText(setmessage, <1,1,1>, 1.0);
- llInstantMessage(llGetOwner(), itemName + " update sent to: secondlife:///app/agent/" +(string)id + "/about");
- }
- else
- {
- llInstantMessage(id, "Unable to find a copyable item named '" + itemName + "'.");
- llOwnerSay("Unable to find a copyable item named '" + itemName + "'.");
- }
- }
- // llInstantMessage(id, "Please accept the DMS security gesture and activate it in your inventory for easy access to your Dolphin Power Security.");
- // llWhisper(0, "Gesture sent");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement