Advertisement
emanuel-lurch

Untitled

Feb 17th, 2023
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. integer Key2Chan(key ID)
  2. {
  3.     return 0x80000000 | (integer)("0x"+(string)ID);
  4. }
  5. key ID;
  6. integer rez_channel = -9523;
  7. integer female_dialog_channel = -696969;
  8. integer internal_channel;
  9. list male_IDs = [];
  10. list male_profiles = [];
  11. integer num_entries;
  12. integer index = 0;
  13. integer listenhandle;
  14. integer listenhandle2;
  15. integer listenhandle3;
  16. integer listenhandle4;
  17. string profiletext = "";
  18. key DefaultTexture = "f5c7a51c-e05f-5c9b-d4ba-64b86fb53296";
  19. string URL_RESIDENT = "http://world.secondlife.com/resident/";
  20. key uuid;
  21. string meta_find = "<meta name=\"imageid\" content=\"";
  22.  
  23. default
  24. {
  25.     on_rez(integer r)
  26.        {
  27.           listenhandle = llListen(rez_channel, "", "", "");
  28.           listenhandle2 = llListen(female_dialog_channel, "", "", "");
  29.           listenhandle3 = llListen(female_dialog_channel+1, "", "", "");
  30.         }
  31.          
  32.    
  33.     state_entry()  
  34.     {
  35.         llSetTexture(DefaultTexture,ALL_SIDES);
  36.     }
  37.    
  38.     listen(integer chan, string name, key ID, string text)
  39.     {
  40.         //llOwnerSay(text);
  41.         if (chan == rez_channel)
  42.         {
  43.             key attach_ID = (key)text;
  44.             llRequestPermissions(attach_ID, PERMISSION_ATTACH);
  45.         }
  46.         if (chan == female_dialog_channel)
  47.         {
  48.             male_IDs = llParseString2List(text, ["|"], []);
  49.             num_entries = llGetListLength(male_IDs);
  50.         }
  51.        
  52.         if (chan == female_dialog_channel+1)
  53.         {
  54.             male_profiles = llParseString2List(text, ["|"], []);
  55.         }
  56.        
  57.         if (chan == internal_channel)
  58.         {
  59.             if(text == "next")
  60.             {
  61.                 if(index< num_entries)
  62.                 {
  63.                 uuid = llList2Key(male_IDs, index);
  64.                 llHTTPRequest( URL_RESIDENT + (string)uuid,[HTTP_METHOD,"GET"],"");
  65.                 }
  66.             }
  67.             if(text == "like!")
  68.             {
  69.                 llSay(0, llGetDisplayName(ID) + " mag " + llGetDisplayName(uuid));
  70.                 //llSay(-17022023, )  
  71.             }
  72.             if(text == "report")
  73.             {
  74.                 llSay(0, llGetDisplayName(uuid) + " ist doof");
  75.             }
  76.             llDialog(ID, "\n"+ llGetDisplayName(uuid) +" ("+llKey2Name(uuid)+ ")\n\n"+llList2String(male_profiles, index)+"\n", ["like!", "next", "report"], internal_channel);
  77.             ++index;
  78.             if(index == num_entries)index = 0;
  79.         }
  80.        
  81.     }
  82.    
  83.     run_time_permissions(integer perm)
  84.     {
  85.         llAttachToAvatarTemp(ATTACH_HUD_TOP_RIGHT);
  86.     }
  87.    
  88.     attach(key ava)
  89.     {
  90.         if (ava)  // Object has been attached, so request permissions again
  91.         {
  92.             ID = ava;
  93.             //llRequestPermissions(ava,PERMISSION_ATTACH);
  94.             internal_channel = Key2Chan(ava);
  95.             listenhandle4 = llListen(internal_channel, "", "", "");
  96.  
  97.         }
  98.     }
  99.    
  100.     touch_end(integer n)
  101.     {
  102.         index = 0;
  103.         llSetTexture("f5c7a51c-e05f-5c9b-d4ba-64b86fb53296", ALL_SIDES);
  104.         llDialog(llDetectedKey(0), "\nStart your tour!\n", ["next"], internal_channel);
  105.     }
  106.    
  107.     http_response(key req,integer stat, list met, string body)
  108.     {
  109.         integer meta_pos =  llSubStringIndex(body, meta_find) + llStringLength(meta_find);
  110.         string texture = llGetSubString(body, meta_pos, meta_pos + 35);
  111.         llSetTexture(texture, ALL_SIDES);
  112.     }
  113. }
  114.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement