bdhtrn

phxviewer-radar

Sep 10th, 2011
876
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. list noobkeys;
  2.  
  3. dispAvFeed(){
  4.     string targetlist="";
  5.     key thisnub;
  6.     string tgtname;
  7.     vector tgtpos;
  8.     integer dist=0;
  9.     integer i;
  10.     for(i=0;i<llGetListLength(noobkeys);i++){
  11.         thisnub=llList2Key(noobkeys,i);
  12.         list tgtintel=llGetObjectDetails(thisnub,[OBJECT_NAME,OBJECT_POS]);
  13.         tgtname=llList2String(tgtintel,0);
  14.         tgtpos=llList2Vector(tgtintel,1);
  15.         dist=(integer)llVecDist(llGetPos(),tgtpos);
  16.         targetlist+=tgtname+" ["+(string)dist+"]\n";
  17.     }
  18.     llSetText(targetlist,<1,1,1>,1);
  19. }
  20.  
  21. updateList(integer flag, list nubs){
  22.     integer i;
  23.     string currnub; integer nubFound;
  24.     for(i=0;i<llGetListLength(nubs);i++){
  25.         currnub=llList2String(nubs,i);
  26.         nubFound=llListFindList(noobkeys,[currnub]);
  27.         if(flag>0 && nubFound==-1 && currnub!=llGetOwner()){
  28.             noobkeys+=currnub;
  29.         }
  30.         else if(flag==0 && nubFound>-1)
  31.             noobkeys=llDeleteSubList(noobkeys,nubFound,nubFound);
  32.     }
  33.     dispAvFeed();
  34. }
  35. default{
  36.     on_rez(integer p){
  37.         llResetScript();
  38.     }
  39.     state_entry(){
  40.         noobkeys=[];
  41.         llSetText("",<0,0,0>,1);
  42.         llListen(-777777777,"","","");
  43.         llTriggerSound("76c78607-93f9-f55a-5238-e19b1a181389",1);
  44.         llSetTimerEvent(5);
  45.     }
  46.     listen(integer chan,string who,key id,string msg){
  47.         //llOwnerSay(msg);
  48.         list nubs=llParseString2List(msg,[","],[]);
  49.         integer feedflag=(integer)llList2String(nubs,1);
  50.         nubs=llDeleteSubList(nubs,0,1);
  51.         updateList(feedflag,nubs);
  52.     }
  53.     changed(integer chg){
  54.         if(chg & CHANGED_REGION){
  55.             noobkeys=[];
  56.             llSetText("",<0,0,0>,1);
  57.             llTriggerSound("76c78607-93f9-f55a-5238-e19b1a181389",1);
  58.         }
  59.     }
  60.     timer(){
  61.         dispAvFeed();
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment