By the way: the scripts format may not be so good because the Vb code is not working...
CODE
//------------------- NoteCard Giver V 1.0 by Russ Allen -------------------//
//--------------------------------------------------------------------------//
//-------------- Thanks to LSLEditor 2.4 and www.lslwiki.net ---------------//
//--------------------------------------------------------------------------//
//--------------------------------------------------------------------------//
//----- I hope my comments have given enough information on configuring ----//
//-------- this script. If you still need help contact me inworld. ---------//
//--------------------------------------------------------------------------//
//------ If you are looking to hire a scripter send me an IM I may be ------//
//------ Available ;) ------//
//--------------------------------------------------------------------------//
list given_to;
integer range = 50; // Range form the object in which it will give the notecard.
float rate = 5; // Rate in seconds of scan for people to give notecard too. Should increase with range.
// NOTE: the lower it is the more laggy it is so think before you put it on 0.1.
string notecard = "MyNotecard"; // The notecard to give (must be in objects inventory)
integer time_or_length = TRUE; // Defines whether it resets the list specific amount of time (which you define in
// reset_list_every) or when it reaches a certain length.
// TRUE = time
// FALSE = length
// NOTE: The reason for reseting is so it does not use alot of memory and become
// very laggy.
float reset_list_every = 600; // Time in seconds before reseting the list. Only used if time_or_length is set
// to TRUE
integer max_length = 100; // Maximum length the list can reach before reseting. Only used if time_or_length is
// set to FALSE
integer progress = TRUE; // If set to TRUE it will talk more often saying what its doing like when it resets
// the list etc. if its annoying just set it to FALSE
integer current_number = 0;
default
{
state_entry()
{
llSay(0, "Activated.");
llSensorRepeat("","","",range,PI,rate);
llListen(0, "", llGetOwner(), "");
if(time_or_length == TRUE)
{
llSetTimerEvent(reset_list_every);
}
}
sensor(integer total_number)
{
while(current_number < total_number)
{ if(llListFindList(given_to, [llDetectedKey(current_number)] != -1)
{
llGiveInventory(llDetectedKey(current_number),notecard);
given_to += [llDetectedKey(current_number)];
}
}
current_number = 0;
if(time_or_length == FALSE)
{
if(llGetListLength(given_to) >= max_length)
{
if(progress)
{
llSay(0, "Reseting list...");
}
given_to = [];
}
}
}
timer()
{
if(progress)
{
llSay(0, "Reseting list...");
}
given_to = [];
}
listen(integer channel, string name, key id, string message)
{
if(message == "help")
{
llOwnerSay("Here are a list of commands:");
llOwnerSay("help");
llOwnerSay("reset");
}
if(message == "reset")
{
given_to = [];
}
}
}