...its attached on me and if i type "/1list" give me the list of agents near me (range 96mt), and this is exactly what i want from this script..xDbut sometimes, when i change sim or simply relog, keep in memory the last scanning data..
i call "bug" this issue but i'm sure that is a programming fault...

CODE
string data ;
key lastOwner;
default {
attach(key id) {
llOwnerSay("type /1 list on chat to start the scanning");
if(lastOwner!=llGetOwner()) {
llResetScript();
}
}
state_entry() {
lastOwner=llGetOwner();
llSetAlpha(0.0, ALL_SIDES);
llSensorRepeat("", NULL_KEY, AGENT, 96.0, 2*PI, 0.1);
llListen(1,"",llGetOwner(),"");
}
sensor(integer num_detected) {
data = "--" + (string)num_detected + " agents detected 96mt--\n ";
integer p = 0;
for(p = 0; p< num_detected; ++p) {
string status = "";
integer s = llGetAgentInfo( llDetectedKey(p) );
if(s & AGENT_AWAY){status += "A ";}
if(s & AGENT_BUSY){status += "B ";}
if(s & (AGENT_FLYING | AGENT_IN_AIR)){status += "F ";}
if(s & AGENT_MOUSELOOK){status += "M ";}
if(s & AGENT_ON_OBJECT){status += "O ";}
if(s & AGENT_SITTING){status += "S ";}
if(s & AGENT_TYPING){status += "T ";}
if(s & AGENT_WALKING){status += "W ";}
data += llDetectedName(p) + " (" + (string)llRound(llVecDist(llDetectedPos(p), llGetPos())) + "m) " + status + "\n ";
}
}
listen(integer a, string b, key c, string msg) {
if(msg == "list") {
llOwnerSay(data);
}
}
}
;