[Opensim-users] Hypergrid Outbound Probs & HG AddressConfusion
Ai Austin
ai.ai.austin at gmail.com
Fri Sep 23 07:50:39 UTC 2011
Here is a script we use to show the xloc,yloc of a region to display
it to our visitors...
In "MapGrid ", the grid name computation method is not general, so
alter that for your own grid machines. I just hacked it a bit to
paste here, so hope it works fine still in a new grid environment.
// Give information on xloc,yloc of Region/Sim on grid
// Useful for Hypergrid Travellers who should not try to travel
// more than 4096,4096 regions/sims in one hop
// Ai Austin, Vue and OpenVCE.net, 28-Oct-2010
string gridname;
string gridhgurl;
string gridtext;
string simhost;
string region;
string xloc;
string yloc;
vector textcolour = <0.6,0.6,0.6>;
float texttrans = 1.0;
GetRegionDetails() {
vector sim_coord = llGetRegionCorner();
simhost = llGetSimulatorHostname();
region = llGetRegionName();
xloc = (string)((integer)(sim_coord.x / 256.0));
yloc = (string)((integer)(sim_coord.y / 256.0));
}
MapGrid (string simhost, string region) {
if ((simhost == "KILLEGRAY") || (simhost == "SHUNA")) gridname =
"Openvue";
else if (simhost == "ARRAN") {
if ((region == "Vue-3200") || (region ==
"Vue-6400")) gridname = "OSGrid";
else gridname = "Openvue";
}
else gridname = "Unknown";
if (gridname == "Openvue") {gridhgurl =
"virtual.aiai.ed.ac.uk:8002"; gridtext = gridhgurl;}
else if (gridname="OSGrid") {gridhgurl = "hg.osgrid.org:80";
gridtext = gridhgurl;}
else {gridhgurl = "unknown"; gridtext = "Host "+simhost;}
}
default
{
state_entry()
{
GetRegionDetails();
MapGrid(simhost, region);
llSetText(gridtext+"\n"+region+" at ("+xloc+","+yloc+")",
textcolour, texttrans);
}
on_rez (integer start_param)
{
GetRegionDetails();
MapGrid(simhost, region);
llSetText(gridtext+"\n"+region+" at ("+xloc+","+yloc+")",
textcolour, texttrans);
}
changed(integer change) { // something changed
if (change & CHANGED_REGION) { // and it was a region/sim change
GetRegionDetails();
MapGrid(simhost, region);
llSetText(gridtext+"\n"+region+" at
("+xloc+","+yloc+")", textcolour, texttrans);
}
}
touch_start(integer num_detected) {
key agentKey = llDetectedKey(0);
GetRegionDetails();
MapGrid(simhost, region);
llSetText("http://"+gridtext+"\n"+region+" at
("+xloc+","+yloc+")", textcolour, texttrans);
// llSay(0,"http://"+gridtext+" "+region+" at ("+xloc+","+yloc+")");
llInstantMessage(agentKey,"http:"+gridtext+" "+region+" at
("+xloc+","+yloc+")");
if (gridname != "Unknown")
llInstantMessage(agentKey,"To return here in Viewer 1
click secondlife://"+gridtext+":"+region+"/");
// llInstantMessage(agentKey,"To return here Find this in
the Map\n"+gridhgurl+"/ \""+region+"\"");
}
}
More information about the Opensim-users
mailing list