I have this script I wrote that is used to contact greeters at a SIM. The greeter UUIDs are stored in a notecard. It seems that the script keeps freezing and i need to reset it manually about 4 times a week. I am trying to figure out where this might be locking up. One odd thing. I also have a few llSetPrimitiveParams in the script but somehow if I include them here, I get an HTTP 404 error when I post the thread, so I removed the instances (but I indicated where they are with //llSetPrimitiveParams ). I wonder if that is what is causing the problem since they are not happing inside this box. Thank you for having a look.
Dmitriy
CODE
//menu variables
integer menu_channel = -65877;
float seconds2wait;
string menu_message;
list menu_buttons;
//initialization variables
key caller_key;
string caller_name;
string config_notecard = "Greeters";
integer nLine;
key loadUUIDS;
key callGreeters;
integer count;
//dataserver variables
list temp;
string greeter_key;
string greeter_name;
list greeterUUIDS;
list greeterNames;
default
{
changed(integer change)
{
if (change & CHANGED_INVENTORY)
{
llOwnerSay("Greeter Notecard Updated");
llResetScript();
}
}
on_rez(integer start_param)
{
llOwnerSay("Greeter Data Loaded");
llResetScript();
}
state_entry()
{
if (llGetInventoryType(config_notecard) == INVENTORY_NOTECARD)
{
llOwnerSay("Notecard Data Loaded");
loadUUIDS = llGetNotecardLine(config_notecard, nLine );
}
else
{
llOwnerSay("Configuration notecard not found!");
}
llSetTouchText("Call");
menu_message = "Hi,\nYou are about to call for a Greeter.\n";
menu_message += "Are you sure you want to send this to all available Greeters?";
menu_buttons = ["YES", "NO"];
seconds2wait = 10.0;
}
touch_start(integer num_detected)
{
//llSetPrimitiveParams - I set this so the greeter call button is not full bright
caller_name = llDetectedName(0);
caller_key = llDetectedKey(0);
llSetTimerEvent(seconds2wait);
llListen(menu_channel, caller_name, caller_key, "");
llDialog(caller_key, "\n" + menu_message, menu_buttons, menu_channel);
}
listen(integer channel, string name, key ID, string message)
{
if (message == "NO")
{
llSetTimerEvent(0.0);
state default;
}
else if (message == "YES")
{
llSetTimerEvent(0.0);
llSetTimerEvent(seconds2wait);
//llSetPrimitiveParams - I set this so the greeter call button IS full bright
count = 0;
callGreeters = llRequestAgentData(llList2Key(greeterUUIDS, count), DATA_ONLINE);
llInstantMessage(caller_key, "Your call has been sent to the greeter group. If one is available, they will come shortly. Please be patient.");
}
}
dataserver( key queryid, string data )
{
if (queryid == loadUUIDS)
{
if (data != EOF)
{
temp = llCSV2List(data);
greeter_key = llList2String(temp,1);
greeter_name = llList2String(temp,0);
++nLine;
greeterUUIDS += greeter_key;
greeterNames += greeter_name;
loadUUIDS = llGetNotecardLine(config_notecard, nLine); //here.
}
}
if (queryid == callGreeters)
{
if (data == "1")
{
greeter_key = llList2String(greeterUUIDS,count);
llInstantMessage(greeter_key,caller_name + " requires assistance");
}
else
{
//llSay(0,(llList2String(greeterNames,count) + " is offline"));
}
if (count < llGetListLength(greeterUUIDS) - 1)
{
++count;
callGreeters = llRequestAgentData(llList2Key(greeterUUIDS, count), DATA_ONLINE);
}
else
{
//llSetPrimitiveParams - I set this so the greeter call button is not full bright
}
}
}
}CODE
;