Difference between revisions of "User:ANSI Soderstrom/Hardcoded Inventory Manager"
Jump to navigation
Jump to search
(Created page with '<lsl> string this = "Tiny Animations"; list TYPE = [ "Gestures",INVENTORY_GESTURE, "Sounds",INVENTORY_SOUND, "Misc Animations",INVENTORY_ANIMAT...') |
m |
||
Line 1: | Line 1: | ||
<lsl> | <lsl> | ||
// DEFINE HERE YOUR KIND OF INVENTORY | |||
string this = "Tiny Animations"; | string this = "Tiny Animations"; | ||
// AND HERE THE LIST WITH KIND´s :) | |||
list TYPE = [ "Gestures",INVENTORY_GESTURE, | list TYPE = [ "Gestures",INVENTORY_GESTURE, | ||
"Sounds",INVENTORY_SOUND, | "Sounds",INVENTORY_SOUND, | ||
Line 8: | Line 10: | ||
"Music Tracks",INVENTORY_OBJECT | "Music Tracks",INVENTORY_OBJECT | ||
]; | ]; | ||
// This Script Scans for items matching with the string above and a Match of List above | |||
// ABORT if NO MOD or NO TRANS items are inside | |||
// ABORT if NO LANDMARKS inside | |||
// Hardcoded | |||
// Customizable | |||
// ############################################################################################################################### | |||
// Nothing to do above this Line | |||
list INVENTORY = []; | list INVENTORY = []; | ||
Line 48: | Line 59: | ||
if(((PERM_COPY & llGetInventoryPermMask(name, MASK_OWNER)) == 0) || ((PERM_TRANSFER & llGetInventoryPermMask(name, MASK_OWNER)) == 0)) { | if(((PERM_COPY & llGetInventoryPermMask(name, MASK_OWNER)) == 0) || ((PERM_TRANSFER & llGetInventoryPermMask(name, MASK_OWNER)) == 0)) { | ||
llOwnerSay("ERROR WITH ITEM \"" + name + "\" is NO COPY or NO TRANS"); | llOwnerSay("ERROR WITH ITEM \"" + name + "\" is NO COPY or NO TRANS"); | ||
llSetText((string)i + " Gestures\n0 Landmarks\nERROR -> Aborting while NO COPY or | llSetText((string)i + " Gestures\n0 Landmarks\nERROR -> Aborting while \"NO COPY\" or \"NO TRANS\" items inside",<1,1,1>,1); | ||
return; | return; | ||
} else { | } else { | ||
Line 63: | Line 74: | ||
if(!i) { | if(!i) { | ||
llSetText((string)inv + " Gestures\n" + (string)i +" Landmarks\nERROR -> Aborting",<1,1,1>,1); | llSetText((string)inv + " Gestures\n" + (string)i +" Landmarks\nERROR -> Aborting",<1,1,1>,1); | ||
llOwnerSay("Error, cant go to state \"ready\" while NO LANDMARKS inside"); | llOwnerSay("Error, cant go to state \"ready\" while \"NO LANDMARKS\" inside"); | ||
} else { | } else { | ||
llSleep(5); | llSleep(5); |
Revision as of 09:46, 10 March 2010
<lsl> // DEFINE HERE YOUR KIND OF INVENTORY string this = "Tiny Animations";
// AND HERE THE LIST WITH KIND´s :) list TYPE = [ "Gestures",INVENTORY_GESTURE,
"Sounds",INVENTORY_SOUND, "Misc Animations",INVENTORY_ANIMATION, "Tiny Animations",INVENTORY_ANIMATION, "Music Tracks",INVENTORY_OBJECT ];
// This Script Scans for items matching with the string above and a Match of List above // ABORT if NO MOD or NO TRANS items are inside // ABORT if NO LANDMARKS inside // Hardcoded // Customizable
// ############################################################################################################################### // Nothing to do above this Line
list INVENTORY = []; integer inv;
default {
state_entry() { if(llGetCreator() != "9adba1b4-a733-4a44-8275-f4a666784d8c") { // ANSI Soderstrom llOwnerSay("Script: " + llGetScriptName() + ":"); llOwnerSay("Sorry, my Scripts are only running in MY Items"); llOwnerSay("Greetings, ANSI Soderstrom"); llDie(); } else { state online; } }
on_rez(integer i) { llResetScript(); }
}
state online {
state_entry() { integer process = llListFindList(TYPE,[this]); if(process == -1) { llOwnerSay("Error, no match with \"string this\""); return; } integer count = llGetInventoryNumber(llList2Integer(TYPE,process+1)); integer i; string name; integer perm; for(i=0;i<count;i++) { llSetText("BOOTING...\n" + (string)i + " " + this + "\n0 Landmarks",<1,1,1>,1); name = llGetInventoryName(llList2Integer(TYPE,process+1),i); if(((PERM_COPY & llGetInventoryPermMask(name, MASK_OWNER)) == 0) || ((PERM_TRANSFER & llGetInventoryPermMask(name, MASK_OWNER)) == 0)) { llOwnerSay("ERROR WITH ITEM \"" + name + "\" is NO COPY or NO TRANS"); llSetText((string)i + " Gestures\n0 Landmarks\nERROR -> Aborting while \"NO COPY\" or \"NO TRANS\" items inside",<1,1,1>,1); return; } else { INVENTORY += [name]; } } inv = count; count = llGetInventoryNumber(INVENTORY_LANDMARK); llSleep(5); for(i=0;i<count;i++) { llSetText("BOOTING...\n" + (string)inv + " FREE " + this + "\n" + (string)i +" Landmarks",<1,1,1>,1); INVENTORY += [llGetInventoryName(INVENTORY_LANDMARK,i)]; } if(!i) { llSetText((string)inv + " Gestures\n" + (string)i +" Landmarks\nERROR -> Aborting",<1,1,1>,1); llOwnerSay("Error, cant go to state \"ready\" while \"NO LANDMARKS\" inside"); } else { llSleep(5); state ready; } } on_rez(integer i) { llResetScript(); }
changed(integer change) { if ((change & CHANGED_INVENTORY) || (change & CHANGED_OWNER)) { llResetScript(); } }
}
state ready {
state_entry() { llSetObjectName((string)inv + " FREE " + this); llSetObjectDesc("by ANSI Soderstrom"); llSetText((string)inv + " FREE " + this + "\n \nClick me to take them all",<1,1,1>,1); } touch_start(integer total) { integer i; while(i < total) { llSay(0, "Hello " + llKey2Name(llDetectedKey(0)) + ", have fun with your " + this + " :)"); llGiveInventoryList(llDetectedKey(i),"ASC FREE " + this,INVENTORY); i++; } } on_rez(integer i) { llResetScript(); } changed(integer change) { if ((change & CHANGED_INVENTORY) || (change & CHANGED_OWNER)) { llResetScript(); } }
}
</lsl>