05-26-2007 18:29
I'm basically a cut an paste artist - this is an attempt at developing a Staff Indicator Notecard giver. I am trying to avoid as far as possible the staff member having to wear and object or having to have a Hud.

Still in development - anyy discussion - improvements - or additional ideas welcome - here it is warts and all:

CODE

//Pilfered or to-be-pilfered scripts include:
//___________________________
// Email-to-IM
// DoteDote Edison
//____________________________
//VQ UUID Detector {Freebie!}
//Lynn Kukulcan
//_____________________________
//Online Status Indicator Script v3
//Dan Seamans

// The online indicator will turn on for the first
// user that touches the indicator

// TBD - make group specific (ie. only a member of Medusa Spa staff group can turn it on---------------------


string whotocheck= "";
string active= "ON";

string HText = "Zena's Test Notecard Giver!"; //This is the text you wish to be displayed above your object, leave blank if you do not wish for anything to be displayed. To make a new line of text, add '\n' to your text to tell the script to start a new line.

vector Color = <1,0,0>; //This is the color you wish for the hover text to be displayed as. Its is currently red.

float Alpha = 1; //This is the transparency of the HoverText, 1 is solid, 0 is Transparent.


default
{

state_entry()
{
llSetTimerEvent(60);
llSetText(HText,Color,Alpha); //set above
llInstantMessage(llGetObjectDesc(),"001 Active staus" + active);// test line only
}

touch_start(integer num)
{

// llInstantMessage(llGetObjectDesc(),"002 Active staus" + active);// test line only

if(llGetObjectDesc()== "")//If this is the first touch set staff member as object name
{
llSay(0,"Indicator set to " + llKey2Name(llDetectedKey(0)));
llSay(0,"It may take a minute to update the status indicator");
llSetObjectDesc(llDetectedKey(0)); // set object Description as staff member key
llSetObjectName("Staff " + llKey2Name(llDetectedKey(0)));// set Object name to staff member name
active = "ON";//set active to ON
}

// llInstantMessage(llGetObjectDesc(),"003 Active staus" + active);// test line only

//If staff member touches again switch ON/OFF
if(llGetObjectDesc()== (llDetectedKey(0)))
{
if(active == "ON")//and active = "ON"
{
active = "OFF";
}
else //and active = "OFF"
{
active = "ON";
}
}
llInstantMessage(llGetObjectDesc(),"004 Active staus" + active);// Tell the Staff Member their active state

// When a prospective client touches send staff member the Land Mark and IM
if (active == "ON")
{
llGiveInventory(llGetObjectDesc(),llGetInventoryName(INVENTORY_LANDMARK, 0));
llInstantMessage(llGetObjectDesc(), "LandMark giver at Zena's WSorkshop" + llGetRegionName() +
" has just been used by " + llKey2Name(llDetectedKey(0)) + "!");
// TBD add SL birthdate --------------------------------------------------
}


whotocheck = llDetectedKey(0);// get the prospecrive client's key

//Thank the prospective client for their enquiry and give them the staff member's Note Card
llInstantMessage(whotocheck,"Thank you for requesting " + llKey2Name(llGetObjectDesc()) + " information");
// TBD Tell client if the Staff Member is available----------------------------
llGiveInventory(whotocheck,llGetInventoryName(INVENTORY_NOTECARD, 0));

//Notify the owner of the enquiry (ie. Owner of Medisa Spa - Me)
llInstantMessage(llGetOwner(), "LandMark giver at Zena's WSorkshop" + llGetRegionName() +
" has been used by " + llKey2Name(llDetectedKey(0)) + "!");

}

timer()
//TBD default the timer to fast-------------------------
//TBD Fast and Slow timer slow when staff member is off line--------------------
{
llRequestAgentData((llGetObjectDesc()), DATA_ONLINE);//Check if the Staff Member is online
}

// Show the online or off line texture
dataserver(key queryid, string data)
//TBD Highlight texture------------------------------
{
if ((integer)data == 1)//and And Active is ON ------------
{
//Timer set to FAST-------------------------------
if (active == "ON")
{
// llInstantMessage(llGetObjectDesc(),"005 Active staus" + active);// test line only

llSetTexture("online",ALL_SIDES);// Staff Member active
}
else
{
llSetTexture("offline",ALL_SIDES);}
}
//} ????? I would have thought this was needed????
else
{
//Timer set to SLOW
llSetTexture("offline",ALL_SIDES);// Staff member inactive
active = "ON";// set active to ON ready for next login
}
}
}