Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Looking for suggestion box script

Esch Snoats
Artist, Head Minion
Join date: 2 May 2006
Posts: 261
08-20-2006 03:37
I'm looking for a simple script that will accept just notecards for use with a suggestion box. I did a search but didn't find anything. Does anyone have one that I could use? Thank you!!

E
Kayla Stonecutter
Scripting Oncalupen
Join date: 9 Sep 2005
Posts: 224
08-20-2006 04:30
CODE
default
{
state_entry()
{
llAllowInventoryDrop(TRUE);
}
}
Put that into the object, then have them hold down control while dragging the notecards onto the object. This will allow them to drop anything other than scripts into it's contents. If you really want only notecards, then you'll need to react to the changed event and check for non-notecards, then delete them. In which case use this script (tested inworld):
CODE
default
{
state_entry()
{
//Allow other people to drop items by holding Ctrl and dragging
llAllowInventoryDrop(TRUE);
}

changed(integer change)
{
//If someone dropped something
if((change & CHANGED_ALLOWED_DROP) == CHANGED_ALLOWED_DROP)
{
integer x;
//Get number of inventory items
integer Num = llGetInventoryNumber(INVENTORY_ALL);
list RemoveList = [];
//cycle through them all
for(x = 0; x < Num; ++x)
{
//get the name of the item
string InvenName = llGetInventoryName(INVENTORY_ALL, x);
//if it's not a notecard, and not this script
if((llGetInventoryType(InvenName) != INVENTORY_NOTECARD) && (InvenName != llGetScriptName()))
{
//add to a list to be removed
RemoveList += [InvenName];
}
}
Num = llGetListLength(RemoveList);
//remove anything in the list
for(x = 0; x < Num; ++x) llRemoveInventory(llList2String(RemoveList, x));
}
}
}
_____________________
Esch Snoats
Artist, Head Minion
Join date: 2 May 2006
Posts: 261
08-20-2006 06:32
Thank you very much! I have a question about holding down CTRL. Why is that necessary to do in order to drag something into the object? Is it because they don't own the object?

I saw a suggestion box elsewhere in game and the hover text said nothing about holding CTRL down to drag the notecard into it, that's why I ask. Thank you!!!

E
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
08-20-2006 14:24
For a notecard it shouldn't be necessary, because none of the other options make sense.

For textures and objects it stops them being painted or rezzed, dropping them into inventory instead.
_____________________
Eloise's MiniMall
Visit Eloise's Minimall
New, smaller footprint, same great materials.

Check out the new blog
Kayla Stonecutter
Scripting Oncalupen
Join date: 9 Sep 2005
Posts: 224
08-21-2006 13:16
From: Esch Snoats
Thank you very much! I have a question about holding down CTRL. Why is that necessary to do in order to drag something into the object? Is it because they don't own the object?

I saw a suggestion box elsewhere in game and the hover text said nothing about holding CTRL down to drag the notecard into it, that's why I ask. Thank you!!!

E
I never tried dropping items without Ctrl from non-owners, just went by the LSL Wiki page on llAllowInventoryDrop(), which says Ctrl needs to be held down. Ask someone to see if they can drop a notecard without Ctrl, and if it works then don't bother telling others that :)
_____________________