Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- integer Key2Chan(key ID)
- {
- return 0x80000000 | (integer)("0x"+(string)ID);
- }
- key ID;
- integer rez_channel = -9523;
- integer female_dialog_channel = -696969;
- integer internal_channel;
- list male_IDs = [];
- list male_profiles = [];
- integer num_entries;
- integer index = 0;
- integer listenhandle;
- integer listenhandle2;
- integer listenhandle3;
- integer listenhandle4;
- string profiletext = "";
- key DefaultTexture = "f5c7a51c-e05f-5c9b-d4ba-64b86fb53296";
- string URL_RESIDENT = "http://world.secondlife.com/resident/";
- key uuid;
- string meta_find = "<meta name=\"imageid\" content=\"";
- default
- {
- on_rez(integer r)
- {
- listenhandle = llListen(rez_channel, "", "", "");
- listenhandle2 = llListen(female_dialog_channel, "", "", "");
- listenhandle3 = llListen(female_dialog_channel+1, "", "", "");
- }
- state_entry()
- {
- llSetTexture(DefaultTexture,ALL_SIDES);
- }
- listen(integer chan, string name, key ID, string text)
- {
- //llOwnerSay(text);
- if (chan == rez_channel)
- {
- key attach_ID = (key)text;
- llRequestPermissions(attach_ID, PERMISSION_ATTACH);
- }
- if (chan == female_dialog_channel)
- {
- male_IDs = llParseString2List(text, ["|"], []);
- num_entries = llGetListLength(male_IDs);
- }
- if (chan == female_dialog_channel+1)
- {
- male_profiles = llParseString2List(text, ["|"], []);
- }
- if (chan == internal_channel)
- {
- if(text == "next")
- {
- if(index< num_entries)
- {
- uuid = llList2Key(male_IDs, index);
- llHTTPRequest( URL_RESIDENT + (string)uuid,[HTTP_METHOD,"GET"],"");
- }
- }
- if(text == "like!")
- {
- llSay(0, llGetDisplayName(ID) + " mag " + llGetDisplayName(uuid));
- //llSay(-17022023, )
- }
- if(text == "report")
- {
- llSay(0, llGetDisplayName(uuid) + " ist doof");
- }
- llDialog(ID, "\n"+ llGetDisplayName(uuid) +" ("+llKey2Name(uuid)+ ")\n\n"+llList2String(male_profiles, index)+"\n", ["like!", "next", "report"], internal_channel);
- ++index;
- if(index == num_entries)index = 0;
- }
- }
- run_time_permissions(integer perm)
- {
- llAttachToAvatarTemp(ATTACH_HUD_TOP_RIGHT);
- }
- attach(key ava)
- {
- if (ava) // Object has been attached, so request permissions again
- {
- ID = ava;
- //llRequestPermissions(ava,PERMISSION_ATTACH);
- internal_channel = Key2Chan(ava);
- listenhandle4 = llListen(internal_channel, "", "", "");
- }
- }
- touch_end(integer n)
- {
- index = 0;
- llSetTexture("f5c7a51c-e05f-5c9b-d4ba-64b86fb53296", ALL_SIDES);
- llDialog(llDetectedKey(0), "\nStart your tour!\n", ["next"], internal_channel);
- }
- http_response(key req,integer stat, list met, string body)
- {
- integer meta_pos = llSubStringIndex(body, meta_find) + llStringLength(meta_find);
- string texture = llGetSubString(body, meta_pos, meta_pos + 35);
- llSetTexture(texture, ALL_SIDES);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement