Okay. So stepping back from the StaNav HUD project madness. I am pivotting over to the bus announcement script that I had started a while couple weeks ago. This is meant to be a prim worn by an avatar that will provide ADA and other service related announcements. I am trying to make it easier for users to quickly reconfigure their announcement when swapping to a new route. It's features include/should include. Posting messages at certain times (Need Improvement - I'd rather have it select a random message from a list each run but right each message is based on a certain static time or interval with in a 5 minute window.)Reading Config From Notecard (WIP - Trying to get this working but the rest of the scipt is functionally brokenCurrent Issue: For some reason after introducing the notecard reading functionality it doesn't even signal to the user that it was attached or anything is loaded. I can't even start the timer using the "/9 enableann" trigger. The only i/o I get from it is when the config notecard doesn't exist. Here is the script: integer count;
integer ON;
key gSetupQueryId;
integer gSetupNotecardLine;
string gSetupNotecardName = "Config";
//define config variables here
string ServiceRoute;
string ServiceNumer;
string DriverID;
readSettingsNotecard()
{
gSetupNotecardLine = 0;
gSetupQueryId = llGetNotecardLine(gSetupNotecardName,gSetupNotecardLine);
}
default
{
attach(key id)
{
if (id) // is a valid key and not NULL_KEY
{
llOwnerSay("ARTA Bus Announcements v. 0.1 Loaded! Use \"/9 enableann\" to enable the messages.");
}
else
{
llOwnerSay("ARTA Bus Announcements v. 0.1 Unloaded! Have a great day!");
}
}
state_entry()
{
// Check the notecard exists, and has been saved
if (llGetInventoryKey(gSetupNotecardName) == NULL_KEY)
{
llOwnerSay( "Notecard '" + gSetupNotecardName + "' missing or unwritten");
return;
}
// listen on channel nine (9) for any chat spoken by the object owner.
llListen(9,"",llGetOwner(),"");
readSettingsNotecard();
}
listen(integer channel, string name, key id, string message)
{
if (llToLower(message) == "enableann")
{
llOwnerSay("ADA announcements successfully Reset. Use \"/9 enableann\". to renable announcements.");
llSetTimerEvent(0.0);
}
if (llToLower(message) == "enableann")
{
llOwnerSay("ARTA Bus Announcements successfully enabled. Use \"/6 disableann\". to disable announcements.");
llSetTimerEvent(1.0* (ON = !ON)); //Turns timer ON and OFF
}
}
dataserver(key queryId, string data)
{
if(queryId == gSetupQueryId)
{
if(data != EOF)
{
list tmp = llParseString2List(data, ["="], []);
string setting = llList2String(tmp,0);
if (setting == "ServiceRoute")
{
ServiceRoute=llList2String(tmp,1);
}
//add more if statements here, for each config variable
//you can also do stuff like variable=val1,val2,val3, simply
//do llCSV2List(llList2String(tmp,1));
gSetupQueryId = llGetNotecardLine(gSetupNotecardName,++gSetupNotecardLine);
}
else
{
state running;
}
}
}
changed(integer change)
{
if (change&CHANGED_INVENTORY)
llResetScript();
}
timer()
{
++count;
if(count%30 == 0)
{
llSay(0,"Route 57 service to "+ServiceRoute);
}
if(count == 60)
{
//Say this message at the one (1) minute mark
llSay(0,"Please make priority seating available to passengers with disabiltites and seniors.");
}
if(count == 120)
{
//Say this message at the two (2) minute
llSay(0,"Driven by operator 15484");
}
if(count == 240)
{
//Say this message at the four (4) minute mark
llSay(0, "Please be curterous. Riders and strollers must share space aboard the bus.");
}
if(count == 300)
{
//Reset script time and restart messages from first message
llGetAndResetTime();
llSetTimerEvent(1.0* (ON = !ON)); //Turns timer ON and OFF
llOwnerSay("Meeasge Timer Reset.");
}
}
}
state running
{
changed(integer change)
{
if (change&CHANGED_INVENTORY)
llResetScript();
}
}Any ideas? Thnak you in advance for any help rendered.