Beacon Setup (Not mandatory )

Your beacon is a small script that runs inside your OpenSim region and quietly reports your live visitor count to OpenSim Regions, so it shows on your region’s page here. It updates automatically — you set it up once and forget about it. The beacon only works on regions and is not suitable for entire grids.

It is worth mentioning that this website will not allow false stats and attempts to inflate the numbers of real live avatars on a region. Use of the beacon is purely voluntary and is not required to post your listing. We may or may not add the beacon to the main listings in the future but it will appear on your post page.

You’ll need two things inside a prim in your region: the beacon script and a notecard containing your unique beacon key. Follow these steps.

Step 1 — Get your beacon key
Log in to OpenSim Regions and go to your own region’s page. You’ll see a box titled “Your Beacon Key” with a code like osr-xxxxxxxx. This key is unique to your region — copy it and keep it handy. Make sure it’s the key shown on YOUR region’s page — each region has its own.

Step 2 — Create a prim in your region
Rez a simple object (a cube is fine) anywhere in your region. This will be your beacon. You can make it invisible or hide it later if you like.

Step 3 — Add the beacon script
Right-click the prim and choose Edit, then open the Contents tab. Click New Script, open it, delete the default code, and paste in the beacon script (copy it from the button below). Click Save. The prim will show red floating text asking for a notecard — that’s normal.

Step 4 — Add your key as a notecard
Still in the Contents tab, click New Note. Rename it exactly beacon_key (all lowercase, with the underscore). Open it, paste your beacon key from Step 1 on the first line, and click Save. The red text will disappear.

That’s it. Within a few minutes your visitor count will appear on your region’s page. The beacon reports automatically from then on.

The beacon script

// OpenSim Regions Beacon
// Setup: create a notecard named "beacon_key", paste your key on line 1, save.

string ENDPOINT = "https://opensimregions.com/wp-json/osr-beacon/v1/report";
string NOTECARD = "beacon_key";
float  INTERVAL = 300.0;

string  TOKEN     = "";
integer lastCount = -1;
integer minsIdle  = 0;
key     ncQuery;

reportCount()
{
    if (TOKEN == "") return;

    integer real = llGetListLength(llGetAgentList(AGENT_LIST_REGION, []));

    if (real != lastCount || minsIdle >= 6)
    {
        lastCount = real;
        minsIdle  = 0;
        string body = "token=" + TOKEN
                    + "&count=" + (string)real
                    + "&region=" + llEscapeURL(llGetRegionName());
        llHTTPRequest(ENDPOINT,
            [HTTP_METHOD, "POST", HTTP_MIMETYPE, "application/x-www-form-urlencoded"],
            body);
    }
    else minsIdle++;
}

loadKey()
{
    if (llGetInventoryType(NOTECARD) == INVENTORY_NOTECARD)
    {
        ncQuery = llGetNotecardLine(NOTECARD, 0);
    }
    else
    {
        llSetText("Beacon: add a notecard called 'beacon_key' with your key", <1,0.3,0.3>, 1.0);
    }
}

default
{
    state_entry()
    {
        loadKey();
    }

    on_rez(integer p) { llResetScript(); }

    changed(integer c)
    {
        if (c & CHANGED_INVENTORY) llResetScript();
    }

    dataserver(key q, string data)
    {
        if (q == ncQuery)
        {
            TOKEN = llStringTrim(data, STRING_TRIM);
            if (TOKEN != "")
            {
                llSetText("", ZERO_VECTOR, 0.0);
                reportCount();
                llSetTimerEvent(INTERVAL);
            }
        }
    }

    timer() { reportCount(); }

    http_response(key id, integer status, list meta, string body)
    {
    }
}

Troubleshooting

  • Red text won’t go away: check the notecard is named exactly beacon_key and your key is on the very first line.
  • Count not showing on your page: make sure the key in your notecard matches the one shown on your region’s page exactly — a mismatched key won’t display.
  • Nothing at all: your grid may block outbound web requests. Most open grids allow them; some restrict them.

Note: You may also collect a beacon ready to use ”In world”, with the only requirement that you drop your unique beacon code into the beacon notecard. The beacons can be found at the following locations:

Saku Island ( Wolf Territories )
hop://grid.wolfterritories.org:8002/Saku%20Island/50/116/22

Neverworld Welcome NW
hop://hg.neverworldgrid.com:8002/NW%20Welcome/95/108/35

Alternate Metaverse
hop://alternatemetaverse.com:8002/AMV%20Street%20Party/185/143/26


Regions Showcase

Welcome to OpenSim Regions, your trusted guide to discovering the best destinations in OpenSim. We are committed to keeping the directory current and reliable. Regions are regularly reviewed, inactive listings are removed, and information is updated whenever possible, giving you confidence that the places you discover are still there to explore.

Useful Links