Jump to content

Climax Bailey

Resident
  • Posts

    2
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. thanks for pointing that out. I forgot to put listenHandle = before the llListen
  2. Well i tried some of the code snippets here and it didn't worked for me as the list index exist of 2 names (fullnameCuttedName) so i wrote a script that make a couple of lists and make a dialog of the cutted names. and return full names by click a cutted name in dialog. list avKeysInRegion; // all the avKeys in regionlist NEWavKeysInRegion; // all the keys without yourselfinteger numOfAvatars; // total avatars in regionlist fullNames; // full names listlist cuttedNames; // cutted names list for llDialoginteger listenChannel;integer listenHandle;listener(){// open listener and set timer llListenRemove(listenHandle); listenChannel = 0x80000000 | (integer)("0x"+(string)llGetKey()); listenHandle = llListen(listenChannel, "", "", ""); llSetTimerEvent(20);}// function that look for avatarslookForAvatars(){ avKeysInRegion = []; // empty this list first NEWavKeysInRegion = []; // empty this list first numOfAvatars = 0; // empty this integer first fullNames = []; // empty this list first cuttedNames = []; // empty this list first avKeysInRegion = llGetAgentList(AGENT_LIST_REGION, []); // grab all keys in region numOfAvatars = llGetListLength(avKeysInRegion) -1; // total number of avatars in region -1 yourself integer i; // counter while (i < numOfAvatars) // while counter is lower then avatars in region { key id = llList2Key(avKeysInRegion, i); // grab keys ( its a while loop so go on till total avatars reached string name = llKey2Name(id); // and offcourse their names from the key id above if( id != llGetOwner() ) // if the key is not owner key { fullNames += name; // fill fullNames list with the names of avatars in region NEWavKeysInRegion += id; // fill in the new keys but without the key of yourself cuttedNames += llGetSubString(name, 0, 11); // now fill the cuttedNames list for the llDialog } ++i; // count up till last avatar is reached } llDialog(llGetOwner(), "avatars", cuttedNames, listenChannel); // give dialog menu with the cuttedNames}default{ touch_start(integer total_number) { if( llDetectedKey(0) == llGetOwner() ) // if toucher is yourself { listener(); // trigger the listener function lookForAvatars(); // then trigger the lookForAvatars function } } listen(integer channel, string name, key id, string msg) { integer index = llListFindList(cuttedNames, [msg]); // returns -1 if not found if(index != -1) {// if index is higher then -1 llOwnerSay("\n---------------------------------\nYou choose: " + msg + "\nFullname: " + llList2String( fullNames, index )); llListenRemove(listenHandle); llSetTimerEvent(0); } } timer() { llSetTimerEvent(0); llOwnerSay("You can close the dialog, the listener is removed anywayzzz"); llListenRemove(listenHandle); }} Offcourse this script does NOT handle more then 12 buttons but it is just a script so people can see how you can do this. I know that some people like numeric buttons, i tried that and i found it not so nice, but for some items its better, for my item it look awfull, so i decided to use cutted names this script i gonna build in more then 12 buttons offcourse but for now its just cuttednames to fullnames dialoger Have fun:) Climax Bailey
×
×
  • Create New...