Two new script functions: wolfGetAgentCountry and wolfGetAgentIPHash
19 October 2026 · Lone Wolf
Scripters on Wolf Territories asked for a way to greet visitors in their own language and to tell visitors apart without handling personal data. Two new functions do exactly that, and they are going out across the grid in the rolling restart that is running now.
wolfGetAgentCountry(key avatar)
Returns the two-letter ISO country code of the avatar's connection - "GB", "DE", "US", "FR" and so on - looked up on the region itself from a local IP-to-country database. The address never leaves the server and never reaches a script, so there is nothing to send to an outside service any more. Use it to pick a language for greeters, posters, terminals and notecards.
It answers "" (and wolfGetLastError() tells you why) for NPCs, for WolfStorm browser users (they reach the grid through our proxy, so the region never sees their address) and for addresses the database has no country for. It is a country, not a locale. Countries with more than one language - Belgium, Switzerland, Canada - are best greeted in all of them, as the example below does; which language to use is always the script's decision.
Why not osGetAgentCountry? That OSSL function, and osDetectedCountry, read a country field in the user profile that no OpenSimulator grid ever fills in - so they return "" everywhere, and for hypergrid visitors they fail outright.
wolfGetAgentIPHash(key avatar)
Returns a stable, opaque hash of the avatar's connection for this grid. Two avatars on the same connection get the same hash; the hash cannot be turned back into an address. For greeters that want to recognise a returning visitor, or vendors that want one entry per connection, without ever seeing an IP.
Where to find them
Both are documented in the LSL guide on this site (LSL in the top menu) and appear in WolfStorm's script editor and in WolfViewer's syntax highlighting after your next login. Like every wolf* function they work only on Wolf Territories.
Example:
default
{
state_entry() { llSensorRepeat("", NULL_KEY, AGENT, 20.0, PI, 10.0); }
sensor(integer n)
{
integer i;
for (i = 0; i < n; ++i)
{
key who = llDetectedKey(i);
string cc = wolfGetAgentCountry(who);
string hello = "Welcome!";
if (cc == "DE" || cc == "AT") hello = "Willkommen!";
else if (cc == "FR") hello = "Bienvenue !";
else if (cc == "NL") hello = "Welkom!";
else if (cc == "BE") hello = "Welkom! Bienvenue !"; // Belgium: Dutch and French
else if (cc == "CH") hello = "Willkommen! Bienvenue ! Benvenuti!"; // Switzerland: German, French, Italian
else if (cc == "ES" || cc == "MX" || cc == "AR") hello = "Bienvenido!";
llRegionSayTo(who, 0, hello);
}
}
}
IP geolocation by DB-IP (db-ip.com), updated monthly.