Region Info Board
A sign that says where you are, who else is here, and whether the region is having a good day.
What it does
It builds a few lines out of what the region knows about itself and writes them as hover text: the region's name, how many people are in it, its own clock, and how hard it is working. It only writes when the words have actually changed, which at the default ten seconds means five refreshes out of six cost nothing, because a clock in whole minutes moves once a minute and the visitor count hardly at all. Every write it avoids is a message about the object that never has to go out to everybody nearby.
What you can build with it
A board at the landing point, a sign at a shop saying how busy it is, a notice in a sandbox. It is also worth a prim while you are building: switch SHOW_HEALTH on and watch the line change as you add things, and you will learn more about what costs a region than any guide will tell you.
How to use it
Settings you can change
7Edit these at the top of the script. Everything works on the defaults · change them only when you need to.
// =====================================================================
// Region Info Board
// skimi3d script library
// https://grid.skimi3d.com/scripts/region-info-board
//
// A sign that says where you are, who else is here, and whether the
// region is having a good day.
//
// Useful at a landing point, and more useful than it looks while you
// are building: the time dilation line is the region telling you
// honestly how hard it is working, and watching that number while you
// add things teaches more than any guide.
//
// Plain LSL.
// =====================================================================
// ---------------------------------------------------------------------
// Settings
// ---------------------------------------------------------------------
// A line of your own above the rest. Empty for none.
string TITLE = "";
// Which lines to show.
integer SHOW_REGION = TRUE; // the name of the region
integer SHOW_VISITORS = TRUE; // how many people are in it
integer SHOW_TIME = TRUE; // the region's own clock
integer SHOW_HEALTH = FALSE; // how hard the region is working
// Seconds between refreshes. Ten is smooth and costs almost nothing;
// below about two you are writing changes faster than anybody's viewer
// is told about them.
float REFRESH = 10.0;
// Colour of the text.
vector COLOUR = <1.0, 1.0, 1.0>;
// ---------------------------------------------------------------------
// Everything below here is the machinery
// ---------------------------------------------------------------------
string gLast = "";
// How hard the region is working, in words rather than a number.
//
// Time dilation is the share of a second the region actually managed to
// get through. 1.0 is a region keeping up; 0.5 means everything in it is
// happening at half speed.
string health()
{
float d = llGetRegionTimeDilation();
if (d > 0.95) return "running easily";
if (d > 0.85) return "busy";
if (d > 0.70) return "working hard";
return "struggling";
}
string build()
{
list lines = [];
if (TITLE != "") lines += [TITLE];
if (SHOW_REGION) lines += [llGetRegionName()];
if (SHOW_VISITORS)
{
integer n = llGetListLength(llGetAgentList(AGENT_LIST_REGION, []));
if (n == 1) lines += ["1 person here"];
if (n != 1) lines += [(string)n + " people here"];
}
if (SHOW_TIME)
{
// The region's own clock, in whole minutes. Seconds would make
// the sign rewrite itself for ever and tell nobody anything.
integer secs = (integer)llGetWallclock();
integer h = secs / 3600;
integer m = (secs % 3600) / 60;
string hh = (string)h;
if (h < 10) hh = "0" + hh;
string mm = (string)m;
if (m < 10) mm = "0" + mm;
lines += [hh + ":" + mm];
}
if (SHOW_HEALTH) lines += [health()];
return llDumpList2String(lines, "\n");
}
show()
{
string now = build();
// Only write when the words have actually changed.
//
// At ten seconds this saves five writes in six, because the clock
// only moves once a minute and the visitor count hardly at all.
// Every avoided write is a message about this object that never has
// to go out to everybody nearby.
if (now == gLast) return;
llSetText(now, COLOUR, 1.0);
gLast = now;
}
default
{
state_entry()
{
gLast = "";
show();
llSetTimerEvent(REFRESH);
}
timer()
{
show();
}
touch_start(integer total)
{
// A touch is a request for the current state, which costs
// nothing and saves waiting for the next refresh.
show();
}
on_rez(integer start)
{
llResetScript();
}
}
Copy it, make a new script inworld, paste over what is there and save. Nothing here phones home.