innula

Untitled

Jun 21st, 2012
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. list lookfor=[
  2. "object a", "object b", "object c"
  3. ];
  4.  
  5.  
  6. default
  7. {
  8. state_entry()
  9. {
  10. //llSay(0, "Hello, Avatar!");
  11. }
  12. touch_start(integer total_number)
  13. {
  14. llSensor("","",ACTIVE|PASSIVE,92.0,PI);
  15. }
  16.  
  17. no_sensor()
  18. {
  19. llOwnerSay("didn't find anything");
  20. }
  21.  
  22. sensor(integer total_number)
  23. {
  24. list detected;
  25. integer i;
  26. integer max;
  27. string s;
  28. while(i<total_number){
  29. s = llToLower(llStringTrim(llDetectedName(i),STRING_TRIM));
  30. if(~llListFindList(lookfor,[s])){
  31. detected =[s]+detected;
  32. }
  33. i++;
  34. }
  35. if(detected ==[]){
  36. llOwnerSay("didn't find anything");
  37. }
  38. else{
  39. llOwnerSay("Found "+llList2CSV(detected));
  40. max = llGetListLength(lookfor);
  41. i=0;
  42. while(i<max){
  43. s = llList2String(lookfor,i);
  44. if(!~llListFindList(detected,[s])){
  45. llOwnerSay("didn't find "+s);
  46. }
  47. i++;
  48. }
  49. }
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment