 |
|
 |
|
Advanced

Group: Elite Members
Posts: 89
Joined: 20-February 09
Member No.: 843,883
|
|
 |
|
 |

|
Slightly modified Avatar Radar.
E-mails the specified e-mail a list of avatars within 96m of the object. Will not scan in NoScript Areas.
Instructions Rez a cube and drop the script in. Set it to phantom. Take it into your inventory. Search your inventory for "Avatar Detector". Take "Avatar Detector" and drop it somewhere. Code
integer i; vector Vec; integer IntX; integer IntY; integer IntZ; //string Position; vector Pos; string Compass; float Angle; float Opposite; float Hypotenuse; string Distance; string Output; vector Color = <.2, .8, .4>; string mail = "Put a throwaway e-mail here in quotes" default { state_entry() { llSetTexture("f54a0c32-3cd1-d49a-5b4f-7b792bebc204", ALL_SIDES); llSetPrimitiveParams([PRIM_PHANTOM, TRUE]); llSetObjectName("Avatar Detector"); llTargetOmega(<1,0,0>, -PI/4, 1); llSensorRepeat("", NULL_KEY, AGENT, 96, PI, 0.1); } sensor(integer num_detected) { Output = ""; for (i = 0; i < num_detected; ++i) { Compass = ""; Vec = llDetectedPos(i); //IntX = (integer)Vec.x; //IntY = (integer)Vec.y; //IntZ = (integer)Vec.z; //Position = "<" + (string)IntX + ", " + (string)IntY + ", " + (string)IntZ + ">"; Distance = (string)llRound(llVecDist(llGetPos(), llDetectedPos(i))); Vec.z = 0; Pos = llGetPos(); Pos.z = 0; Opposite = Vec.y - Pos.y; Hypotenuse = llVecDist(Vec, Pos); if(Hypotenuse == 0) { Hypotenuse = 0.01; } Angle = llAsin(Opposite/Hypotenuse) * (180/PI); if((Angle >= 22.5) && (Angle <= 90)) { Compass = "N"; } if((Angle <= -22.5) && (Angle >= -90)) { Compass = "S"; } if(((Angle >= -67.5) && (Angle <= 67.5)) && (Vec.x < Pos.x)) { Compass = Compass + "W"; } if(((Angle >= -67.5) && (Angle <= 67.5)) && (Vec.x > Pos.x)) { Compass = Compass + "E"; } Output = Output + llDetectedName(i) + " (" + Compass + " @ " + Distance + "m)\n"; } llEmail(mail, "AVATARS DETECTED", Output); llInstantMessage(llGetOwner(), "AVATARS DETECTED: " + Output); //Can be turned off by adding slashes. llSleep(30); } no_sensor() { } }
|