As a business owner on an OpenSpace sim, I found this bit of code useful for me. Maybe it will be useful to others. This will only compile in the 1.21.6 release of the viewer (also compiles in some of the 1.21 RCs). Enjoy!
// Region Agent Counter and Notifier - A very simple script to Get Notified by Email when your Region Agent Count goes outside a desired range. Also shows Region Agent Count above the prim that the script is in.
// Written by Zena Juran Oct. 17th, 2008. No licensing expressed.. do what you want with this code.
// Place script in any prim.
// Touch prim to reset counter if necessary.
// ***** Change the Below Values to Suit Your Needs *****
// Minimum Number of Agents - Receive email when Region Agent Count goes below this value.
integer MinAgents = 1;
// Maximum Number of Agents - Recieve an email when Region Agent Count goes above this value.
integer MaxAgents = 10;
// Notification Email Address
string addy = "id@host.net";
// Normal Scan Time (seconds) - Time in between scans when Region Agent Count is inside of MinAgents/MaxAgents range.
float scan = 10;
// Abnormal Scan Time (seconds) - Time in between scans when Region Agent Count is outside of MinAgents/MaxAhents range. This is also how often you will receive an email when the Region Agent Count is outside of MinAgents/MaxAgents range.
float notify = 120;
// ***** End of any necessary changes *****
default
{
state_entry()
{
llSetTimerEvent(1);
}
touch_start(integer num_detected)
{
llSay(0,"Agent Counter has Reset"
;llResetScript();
}
timer()
{
{if(llGetRegionAgentCount() >= MinAgents && llGetRegionAgentCount() <= MaxAgents)
llSetText("Agent Count: " + (string)llGetRegionAgentCount(), <1.0,1.0,1.0>,1);
llSetTimerEvent(scan);
}
{if(llGetRegionAgentCount() < MinAgents)
llEmail(addy,"Windchimes Paradise Island Agent Count","Number of Agents is less than: " + (string)MinAgents);
llSetText("Agent Count: " + (string)llGetRegionAgentCount(), <1.0,1.0,1.0>,1);
llSetTimerEvent(notify);
}
{if(llGetRegionAgentCount() > MaxAgents)
llEmail(addy,"Windchimes Paradise Island Agent Count","Number of Agents is greater than: " + (string)MaxAgents);
llSetText("Agent Count: " + (string)llGetRegionAgentCount(), <1.0,1.0,1.0>,1);
llSetTimerEvent(notify);
}
}
}