Sumomo Cheri Posted June 13, 2017 Share Posted June 13, 2017 i keep trying to do up a click add avatar name or legacy name to float text waiting list ,that is group touch only and either has a way to remove names and it reorder the ones below to be next in line .so far ive only found boards that do this and boards are not what im looking for i just need simple float text , avatar waiting list on touch , 1 touch per avatar. if anyone has a script that can help me i would be deeply appreciated Link to comment Share on other sites More sharing options...
Sumomo Cheri Posted June 13, 2017 Author Share Posted June 13, 2017 (edited) what im working with so far but not sure how many names it will limit me to . and when owner clicking to remove names from top of list isn't working list user_names; update_text(){ string text = "Sorting Hat Waiting List\n===========\n"; integer i; integer count = llGetListLength(user_names); for(i=0;i<count;i++){ text += llList2String(user_names, i)+"\n"; } llSetText(text, <1,1,1>, 1); } default { state_entry() { update_text(); } touch_start(integer total_number) { if(llListFindList(user_names, [llDetectedName(0)]) == -1){ user_names += [llDetectedName(0)]; } else { llSay(0, "Your already on the list"); } if(llDetectedKey(0) == llGetOwner()){ llDeleteSubList(user_names, 0,0); llSleep(1); } update_text(); } } Edited June 13, 2017 by Sumomo Cheri Link to comment Share on other sites More sharing options...
Sumomo Cheri Posted June 13, 2017 Author Share Posted June 13, 2017 or maybe help changing this to add names to a notecard menu or list that wont eat up the float text and stop showing names when it reaches limit that i can come in and collect and have all the names in order they were added either from touching it my self or grabing the notecard out of the object the script would be running in as it is now it is not holding but a hand full of names before it stops showing names in the llSetText Link to comment Share on other sites More sharing options...
Ruthven Ravenhurst Posted June 13, 2017 Share Posted June 13, 2017 (edited) Try this. I moved the if tests around a bit. Also when you are removing an element from a list, you need to write the name of the list equals...for example listname = llDeleteSubList(listname,idx,idx) list user_names; update_text(){ string text = "Sorting Hat Waiting List\n===========\n"; integer i; integer count = llGetListLength(user_names); for(i=0;i<count;i++){ text += llList2String(user_names, i)+"\n"; } llSetText(text, <1,1,1>, 1); } default { state_entry() { update_text(); } touch_start(integer total_number) { if(llDetectedKey(0) == llGetOwner()) { usernames = llDeleteSubList(user_names, 0,0); llSleep(1); } else { if(llListFindList(user_names, [llDetectedName(0)]) == -1) { user_names += [llDetectedName(0)]; } else { llSay(0, "Your already on the list"); } } update_text(); } } Edited June 13, 2017 by Ruthven Willenov Link to comment Share on other sites More sharing options...
Innula Zenovka Posted June 13, 2017 Share Posted June 13, 2017 (edited) I don't think a notecard is going to help you -- the limit you're running into looks like the one mentioned in the Wiki for llSetText -- 254 bytes (so about 254 characters or maybe a few less) as the maximum size of the hovertext. I think you're on the right track adding the names to a list which, assuming the script is compiled in mono, is certainly going to hold more than "a handful of names". Then you can come along every so often, touch the prim, and have it chat them all out to you. Maybe the hovertext could display that last few names added? Edited June 13, 2017 by Innula Zenovka 3 Link to comment Share on other sites More sharing options...
Qie Niangao Posted June 13, 2017 Share Posted June 13, 2017 Yeah, another option would be a stack of linked prims that each get hover text for sequential parts of the complete list. And/or scrolling a 200-some subset of the entire text on a timer, kinda like the bottom of screen "crawl" ticker on cable news. (That's lots of object updates on the network, though.) If the list doesn't need to be constantly displayed, could have the script serve up the list via HTTP to a browser window. 2 Link to comment Share on other sites More sharing options...
Sumomo Cheri Posted June 14, 2017 Author Share Posted June 14, 2017 well keeping it simple , the remove names from top of list part still doesn't work even moving the if for that up it just now keeps me from entering my name but does nothing towards removing names from the list. not sure what im missing Link to comment Share on other sites More sharing options...
Ruthven Ravenhurst Posted June 14, 2017 Share Posted June 14, 2017 4 minutes ago, Sumomo Cheri said: well keeping it simple , the remove names from top of list part still doesn't work even moving the if for that up it just now keeps me from entering my name but does nothing towards removing names from the list. not sure what im missing Right, I mentioned what you were missing in my comment above Link to comment Share on other sites More sharing options...
Sumomo Cheri Posted June 14, 2017 Author Share Posted June 14, 2017 i see where mine was still diff thanks Link to comment Share on other sites More sharing options...
Sumomo Cheri Posted June 14, 2017 Author Share Posted June 14, 2017 Would there be a way to use the count in the line that pulls User_name to number each entry ? Link to comment Share on other sites More sharing options...
Innula Zenovka Posted June 14, 2017 Share Posted June 14, 2017 Try for(i=0;i<count;i++){ text += (string)(i + 1)+": "+llList2String(user_names, i)+"\n"; } It's i + 1 because LSL starts counting at 0 but humans prefer to start at 1. Link to comment Share on other sites More sharing options...
Sumomo Cheri Posted June 14, 2017 Author Share Posted June 14, 2017 thanks Link to comment Share on other sites More sharing options...
Ruthven Ravenhurst Posted June 14, 2017 Share Posted June 14, 2017 (edited) and going with Qie's mention of a timer to scroll through the names I put together this. I added in a test list of names. I also added in a line in the text to show how many pages there are, as well as total number of names in the list list user_names = ["name test1","name test2","name test3","name test4","name test5","name test6","name test7","name test8","name test9","name test10","name test11","name test12","name test13","name test14","name test15","name test16","name test17","name test18","name test19","name test20","name test21","name test22","name test23","name test24","name test25","name test26","name test27","name test28","name test29","name test30","name test31","name test32","name test33","name test34","name test35","name test36","name test37","name test38","name test39","name test40"]; integer pglen = 10;//this is how many names you want in each page integer page; integer pages; integer total; float time = 2.5; update_text() { list temp = llList2List(user_names,page*pglen,page*pglen+(pglen-1)); string text = "Sorting Hat Waiting List\n===========\nPage " + (string)(page+1) + " of " +(string)pages + "\n===========\n"+(string)total + " Names\n===========\n"; integer i; integer count = llGetListLength(temp); for(i=0;i<count;i++){ text += (string)(pglen*page+i+1)+". "+llList2String(temp, i)+"\n"; } llSetText(text, <1,1,1>, 1); } default { state_entry() { llSetTimerEvent(0); total = llGetListLength(user_names); pages = total/pglen; pages += (pages*pglen < total); if(total){llSetTimerEvent(time);} update_text(); } touch_start(integer total_number) { if(llDetectedKey(0) == llGetOwner()) { user_names = llDeleteSubList(user_names, 0,0); page = 0; llSleep(0.25); } else { if(llListFindList(user_names, [llDetectedName(0)]) == -1) { user_names += [llDetectedName(0)]; } else { llSay(0, "Your already on the list"); } } llSetTimerEvent(0); total = llGetListLength(user_names); pages = total/pglen; pages += (pages*pglen < total); if(total){llSetTimerEvent(time);} update_text(); } timer() { ++page; if(page == pages){page = 0;} update_text(); } } Edited June 14, 2017 by Ruthven Willenov Looks like it was getting a math error if the number of names was less than the desired page length 2 Link to comment Share on other sites More sharing options...
Xiija Posted June 15, 2017 Share Posted June 15, 2017 here is a snippet to display a small subset of a list at a time on hovertext. list names = [ "name lastname 0", "name lastname 1", "name lastname 2", "name lastname 3", "name lastname 4", "name lastname 5", "name lastname 6", "name lastname 7", "name lastname 8", "name lastname 9", "name lastname 10" ]; integer len; integer k; integer index; list display; string msg = "Waiting List: \n \n"; default { state_entry() { len = llGetListLength(names); llSetText("Line Closed",<0,1,0>,1.0); } touch_start(integer total_number) { if(k = !k) { llSetTimerEvent(0.5); } else { llSetTimerEvent(0.0); llSetText("Line Closed",<0,1,0>,1.0); index = 0; } } timer() { display = llList2List(names, index, (index+ 3) ); string tmp = llDumpList2String(display,"\n"); llSetText(msg + tmp,<0,1,0>,1.0); index = ++index%len; llSetTimerEvent(1.5); } } 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now