Avatar Detector

Written by: Headmaster
//
//    SHOP ZERO Tips25 AvatorDetector v1.0
//
//                   Created by Zero2000 Kid     2008/04/06
// 
 
integer input_ch = 34;
integer range=96;
integer handle;
string target;
string simname;
 
output_info (vector v , string name) {
    string pos=(string)v.x + "/" + (string)v.y + "/" + (string)v.z;
    llInstantMessage(llGetOwner(),name+"--> secondlife://"+simname+"/"+pos);
}
 
default {
    state_entry(){
        handle = llListen(input_ch,"",llGetOwner(),"");
    }
 
    on_rez(integer param){
        llResetScript();
    }
 
    listen(integer ch, string name, key id, string message) {
        target=message;
        simname=llGetRegionName();
        llInstantMessage(llGetOwner(),"Searching " + target + " ....");
        llSensor("", NULL_KEY, AGENT, range, PI);
    }
 
    sensor(integer total_number) {
        integer i;
        for (i = 0; i < total_number; i++) {
            if (llSubStringIndex(llToLower(llDetectedName(i)),llToLower(target))!=-1) {
                output_info(llDetectedPos(i),llDetectedName(i));
            }
        }
        llInstantMessage(llGetOwner(),"Searching complete.");
    }
 
    no_sensor() {
        llInstantMessage(llGetOwner(),"Searching complete.");
    }
 
}

 

Category: