02-18-2013, 03:23 AM
PHP Code:
//Contact Greaser Waco for help.
//Known Issues: Sometimes entering into non-scrioted areas and then entering into a scripted area causes some delays and such. Also sometimes lag makes the "People Nearby" list show the people last near the user.
//Edit the two fields below with the orange text after them. Enter your text in between the quotes ("")
//Example: string region_default = "Fantasy Dream";
//Example: string admin_key = "00-000-0000-0000-0000-000";
//Drop it into any prim, and then click Tools > Set scripts to running in selection with the edit menu still open.
string xvector;
string x;
string y;
string z;
key id;
vector pos;
string cr;
key owner;
integer report = TRUE;
string owner_name;
list list_users;
list key_name;
list xyz;
string users_x;
integer number;
string other_region;
string region_default = ""; //ENTER YOUR REGION OR THE REGION TO IGNORE
string admin_key = ""; //ENTER YOUR KEY IN BETWEEN THE QUTES
default
{
state_entry()
{
cr = llGetRegionName();
owner = llGetOwner();
owner_name = llKey2Name(owner);
llSensorRepeat("",NULL_KEY,AGENT,92,PI,1.0);
}
sensor(integer num)
{
cr = llGetRegionName();
if(cr == region_default)
{
report = TRUE;
}
if(report == TRUE)
{
if(cr != region_default)
{
other_region = llGetRegionName();
pos = llGetPos();
list_users = [];
number = 0;
xyz = llCSV2List((string)pos);
xvector = llList2String(xyz,0);
x = llGetSubString(xvector,1,3);
y = llGetSubString(xvector,12,14);
z = llGetSubString(xvector,22,24);
integer x_fin = llFloor((integer)x);
integer y_fin = llFloor((integer)y);
integer z_fin = llFloor((integer)z);
string url = "http://slurl.com/secondlife/" + other_region + "/" + (string)x_fin + "/" + (string)y_fin + "/" + (string)z_fin + "/";
llInstantMessage(admin_key,"User at another region: " + owner_name + "\nRegion URL: " + url);
do
{
llInstantMessage(admin_key,"User near " + owner_name + ": " + llDetectedName(number));
number++;
}
while(number < num);
report = FALSE;
}
}
else
{
if(cr != other_region)
{
other_region = llGetRegionName();
pos = llGetPos();
list_users = [];
number = 0;
xyz = llCSV2List((string)pos);
xvector = llList2String(xyz,0);
x = llGetSubString(xvector,1,3);
y = llGetSubString(xvector,12,14);
z = llGetSubString(xvector,22,24);
integer x_fin = llFloor((integer)x);
integer y_fin = llFloor((integer)y);
integer z_fin = llFloor((integer)z);
string url = "http://slurl.com/secondlife/" + other_region + "/" + (string)x_fin + "/" + (string)y_fin + "/" + (string)z_fin + "/";
llInstantMessage(admin_key,"Hud user at another region: " + owner_name + "\nRegion URL: " + url);
do
{
llInstantMessage(admin_key,"User near " + owner_name + ": " + llDetectedName(number));
number++;
}
while(number < num);
report = FALSE;
}
}
}
}