Jump to content

teresasama

Resident
  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

0 Neutral

About teresasama

  • Rank
    Newbie
  1. @Xiija Thank you very much Xiija, everything is working as intended.
  2. @Xiija It's not working with llGetAgentList(). Well looks like it's complex, you can try this code in world it won't work, but if you're gonna try it don't forget to change the keys for the avatar keys in the same region you're in. list my_list = [ "43a2cd19-eb07-47a6-b1c3-94ea7924e4f7", "7a6b9c04-b610-4017-9982-80962eda2619" ]; list ListXandY(list myList, list scanList ) { // return a list of elements common to both lists list lz = []; integer x; integer n = llGetListLength( scanList ); for (x = 0; x < n; x++) { if (~llListFindList( myList, llList2List( scanList, x, x))) { lz += llList2List( scanList, x, x); } } return lz; } default { touch_start(integer total_number) { list avatarsInRegion = llGetAgentList(AGENT_LIST_REGION, []); list result = ListXandY(my_list, avatarsInRegion); list names; integer y; for(; y < llGetListLength(result) ; ++y) { key currKEY = llList2Key(result,y); names += llGetUsername( currKEY ); } string tmp = llDumpList2String( names, "\n"); llOwnerSay( "\nFound: \n" + tmp ); } }
  3. @Innula Zenovka @Rolig Loon This code compiles but for some reason it doesn't work. The avatar keys from my_list they were present in the same sim, so I expected a message coming from llOwnerSay() but nothing happened. list my_list = ["43a2cd19-eb07-47a6-b1c3-94ea7924e4f7", "369fac38-c0e6-4c65-b7ca-ff6da91c3d94"]; list ListXandY(list lx, list ly) { // return a list of elements common to both lists list lz = []; integer x; integer n = llGetListLength(ly); for (x = 0; x < n; x++) { if (~llListFindList(lx,llList2List(ly,x,x))) { lz = lz + llList2List(ly,x,x); } else { ; } } return lz; } default { touch_start(integer total_number) { list avatarsInRegion = llGetAgentList(AGENT_LIST_REGION, []); list result = ListXandY(avatarsInRegion, my_list); llOwnerSay(llGetUsername(llList2Key(result, 0))); } }
  4. @Innula Zenovka I was about to make a method to strip the "Resident" out of it, I'm glad you told me about the llGetUsername, thanks a lot Innula Zenovka.
  5. @Rolig Loon Thanks Rolig Loon. I'm gonna use llKey2Name(llList2Key(my_list, 0)); so I can get the first element which is a key then convert it to a username.
  6. That's what I'm looking for! Thanks Innula Zenovka. Just a final touch to get this done. ListXandY returns me a new list right? I wanna get the first index with the avatar username/key of that list. How to get like the first avatar/key from a list? For example if there're 10 usernames in common, I just want the first username no matter how it is sorted by. So I need to get the first index + username from that list.
  7. Let me explain better. I need to know which avatar and index was found in my list, like it's gonna be a big list with 50 usernames, llGetAgentList will get all avatars keys in the sim right? So if it finds 1 or more usernames/keys which are in my list, it must return the username from the respective index which was found in my list, so i can know which avatar was found among the others. Get it?
  8. Hello, I wanna make a list of usernames which checks if there's any matches with avatars in the same sim, I'm not good at scripting but I guess we can take advantage of llGetAgentSize(id), llSetTimerEvent(0.1) and timer() in order to keep checking the list every 0.1 ms. For example: list x = ["user A", "user B", "user C"]; If user A is present, it returns to me: llOwnerSay(user A); However if more than 1 username in the list are present, it must return just 1 username either A, B or C.
×
×
  • Create New...