Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list lookfor=[
- "object a", "object b", "object c"
- ];
- default
- {
- state_entry()
- {
- //llSay(0, "Hello, Avatar!");
- }
- touch_start(integer total_number)
- {
- llSensor("","",ACTIVE|PASSIVE,92.0,PI);
- }
- no_sensor()
- {
- llOwnerSay("didn't find anything");
- }
- sensor(integer total_number)
- {
- list detected;
- integer i;
- integer max;
- string s;
- while(i<total_number){
- s = llToLower(llStringTrim(llDetectedName(i),STRING_TRIM));
- if(~llListFindList(lookfor,[s])){
- detected =[s]+detected;
- }
- i++;
- }
- if(detected ==[]){
- llOwnerSay("didn't find anything");
- }
- else{
- llOwnerSay("Found "+llList2CSV(detected));
- max = llGetListLength(lookfor);
- i=0;
- while(i<max){
- s = llList2String(lookfor,i);
- if(!~llListFindList(detected,[s])){
- llOwnerSay("didn't find "+s);
- }
- i++;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment