Jump to content
Sign in to follow this  
ChaosFear

Possible Help?

Recommended Posts

I am wanting to edit this script and make it possible for people to be able to also drop nocateds in, aswell as recieve... if that makes sense... Here's the script




//•/•/•/•/•/•/•/Ð/A/M/E/N/•/H/A/X/•/•/•/•/•/•/•/•/•//

// Do not sell this; Karma knowz where you live ☠

// Inventory Menu modified to be a notecard giver, for public use

key user;
string object_desc = "(Touch for Menu;)";
list inventory_list;
integer being_used = FALSE;
integer menu_channel;
integer menu_handle;
integer menu_counter;
integer menu_parts;
integer inventory_type = INVENTORY_NOTECARD;
integer prim_face = ALL_SIDES;
float menu_timeout = 30.0;

set_listen(){
llListenRemove(menu_handle);
llSetTimerEvent(menu_timeout);
menu_handle = llListen(menu_channel, "", "", "");
}

inventory_load(){
integer i;
menu_parts=0;
inventory_list = [];
for(i=0; i <= -1 + llGetInventoryNumber(inventory_type);i++){
inventory_list += [llGetInventoryName(inventory_type,i)];
menu_parts++;
}
}

inventory_menu(){
list menu_buttons;
integer i;
menu_buttons = [];
if(menu_counter > 0)
menu_buttons += ["•Back"];
else
menu_buttons += [" "];
menu_buttons += ["1st Page"];
if(menu_counter*8+8 < menu_parts - 1)
menu_buttons += ["Next•"];
else
menu_buttons += [" "];
for(i=menu_counter*8; (i <= menu_counter*8+8) && (i <= menu_parts - 1);i++){
menu_buttons += [llGetSubString(llGetInventoryName(inventory_type, i),0,23)];
}
llDialog(user, "\n\n (select \"Ignore\" when done.)", menu_buttons, menu_channel);
}

string Name2full(string str1){//Hen Streeter
integer u=0;
for(;u<llGetInventoryNumber(inventory_type);u++){
if(llGetSubString(llGetInventoryName(inventory_type,u),0,23)==str1)//33..
return llGetInventoryName(inventory_type,u);
}return "";
}

default{
//
state_entry(){
menu_channel = (integer)llFrand(DEBUG_CHANNEL) * -1;
inventory_load();
llSetObjectDesc(object_desc);
}
//
changed(integer c){
if(c & CHANGED_OWNER) llResetScript();
if(c & CHANGED_INVENTORY) inventory_load();
}
//
touch_start(integer total_number){
if(being_used){
llSay(0,"Sorry, I'm currently being used by someone else.");
return;
}
being_used = TRUE;
user = llDetectedKey(0);
set_listen();
inventory_menu();
}
//
timer(){
being_used = FALSE;
user = NULL_KEY;
llSetTimerEvent(0.0);
llListenRemove(menu_handle);
}
//
listen(integer chan, string who, key id, string msg){
if(llGetOwnerKey(id) != user) return;
if(chan == menu_channel){
llSetTimerEvent(menu_timeout);
if(msg == "•Back"){
menu_counter--;
inventory_menu();
}
else if(msg == "1st Page"){
menu_counter=0;
inventory_menu();
}
else if(msg == "Next•"){
menu_counter++;
inventory_menu();
}
else if(llListFindList(inventory_list,[Name2full(msg)])!=-1){
msg=Name2full(msg);
llGiveInventory(user,msg);
llSetTimerEvent(0.1);
}
}
}
//
}

Share this post


Link to post
Share on other sites

It already does that for people who have mod perms for your object.  If you want other people to be able to drop stuff in, just add llAllowInventoryDrop(TRUE); to your state_entry event.  Just be careful, though.  Once you let anyone drop things in, they will.  You can get a lot of garbage in your object before long. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...