CODE
string TARGET = "copybot";
integer gScanning = FALSE;
default
{
state_entry()
{
gScanning = FALSE;
llListen (0, "", NULL_KEY, "");
}
listen (integer channel, string from, key id, string message)
{
if (gScanning)
{
// todo: message saying chat is coming too fast?
return;
}
string name = llToLower (from);
if (llSubStringIndex (name, TARGET) != -1)
{
gScanning = TRUE;
llSensor ("", id, ACTIVE | PASSIVE | SCRIPTED, 100.0, PI);
}
}
no_sensor()
{
llOwnerSay ("unable to locate object!");
gScanning = FALSE;
}
sensor (integer count)
{
llOwnerSay ("found " + llDetectedName(0) + " at " + (string)llDetectedPos (0));
gScanning = FALSE;
}
}
Usage, I guess, is to put the script into a prim and wear/rez the prim when you want to find one of these annoying copybot defeaters. If something with "copybot" in its name speaks in open chat, this will scan for it and display the current name & location.