Janford Flax
Resident-
Posts
8 -
Joined
-
Last visited
Content Type
Forums
Blogs
Knowledge Base
Everything posted by Janford Flax
-
Change hover text to chat in prim count script
Janford Flax replied to Janford Flax's topic in LSL Scripting
Many thanks. -
Love this script but I would like it to say the list in chat instead of scrolling it in hover text. I got it to say it in chat but it repeats the list as many times as there are prim owners, adding one person at a time until it repeats the whole list, instead saying the whole list at once just once. Clearly I'm not a scripter. But if someone could help that would be great. Thanks! http://wiki.secondlife.com/wiki/LlGetParcelPrimOwners // Show a floating text list of prim owners on this parcel, // Sorted by prim count per owner. Highest users first. // Omei Qunhua // The object has the same permisions to view prim parcel owners // as its owner (In About Land >> Objects >> Object Owners ) // Example: If you can't return group object, you won't see group objects // If you can't return any objects, an empty list will be returned. // If the prim is deeded to the right group, it should always get a full list // Note: Only works on group owned land when the object owner is in the Sim // Deeded objects always work (group is always online?) list gListCountsAndOwners; // Sorted list count+owner pairs list gListNamesAndCounts; // List of owner names + prim counts integer gOffset; integer gIndex; key gDataserverID; integer gListLength; default { state_entry() { llSetText("Parcel Prim Owner List\n", <1,1,1>, 1); list TempList = llGetParcelPrimOwners( llGetPos() ); gListLength= llGetListLength(TempList); if (!gListLength) { llSetText("[ERROR]\n Couldn't get Parcel Prim Owners", <1,0,0>, 1); } else { // Produce a copy of the list suitable for sorting by count, i.e. count then key integer x; for ( ; x < gListLength; x += 2) { gListCountsAndOwners += llList2Integer(TempList, x+1); gListCountsAndOwners += llList2String(TempList, x); } // Sort the list in descending order of prim count gListCountsAndOwners = llListSort(gListCountsAndOwners, 2, FALSE); // Lookup each owner's name. Start at the beginning of our sorted list gDataserverID = llRequestAgentData( llList2String(gListCountsAndOwners, 1), DATA_NAME ); } } dataserver( key request_id, string data) { string TempStr = "Parcel Prim Owner List\n"; if ( request_id == gDataserverID ) { gListNamesAndCounts += data; gListNamesAndCounts += llList2String(gListCountsAndOwners, gIndex); // process the count as a string gIndex += 2; // bump through the strided list if (gIndex < gListLength ) { // lookup name of next owner in our list gDataserverID = llRequestAgentData( llList2String(gListCountsAndOwners, gIndex +1) , DATA_NAME ); } integer x; for (; x < 16; x+=2) // show an 8-name subset of the list, starting at 'gOffset' { // If we run off the end of the list, we just pick up nulls, so no harm done TempStr += llList2String(gListNamesAndCounts, gOffset+x) + " : " + llList2String(gListNamesAndCounts, gOffset+x+1) + "\n"; } llSetText(TempStr, <1,1,1>, 1); if ( (gListNamesAndCounts != []) > 14) // If list is longer than 14 (7 owners + counts) ... { gOffset += 2; // scroll the list forwards llSleep(2); // at 2 second intervals } } } touch_start(integer total_number) { llResetScript(); // On touch, start the whole process over again } }
-
Thank you!
-
Can I impose on you again and ask how I can make this poseball script owner-only? // Basic pose ball script. by Dora Gustafson, Studio Dora 2010// Free for anybody to read, copy, modify, compile, use, rip apart, trample on and flush// v1.3 with Set Click Actionstring animation = "stand"; // name of built-in animation or animation in prim inventorydefault{ state_entry() { llSitTarget( <0.0, 0.0, 0.01>, ZERO_ROTATION ); llSetSitText(llToUpper(animation)); llSetClickAction(CLICK_ACTION_SIT); } changed(integer change) { if (change & CHANGED_LINK) { key sitter = llAvatarOnSitTarget(); if(sitter != NULL_KEY) llRequestPermissions(sitter , PERMISSION_TRIGGER_ANIMATION); else { if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) llStopAnimation(animation); llSetAlpha(1.0, ALL_SIDES); // show prim } } } run_time_permissions(integer perm) { if ( perm & PERMISSION_TRIGGER_ANIMATION ) { llSetAlpha(0.0, ALL_SIDES); // hide prim llStartAnimation(animation); llStopAnimation("sit"); } }}
-
Thanks for the great script. How can I modify it to be owner-only?
-
Got it. First test successful, yay. Thanks so much.
-
Many thanks! Unfortuanately, the script needs to be reset when you change the size of the prim. So when I resize the curtains I have to reset the script. Maybe I can make sure the prim is the correct size before I put the script in. Not as elegant but might work. Thank you so much for you help.
-
My abilities are limited to modifying existing scripts and I've had some good luck so far. But I cannot figure out how to make this script work only for the owner. It's the curtain script that I found on the old forums. I read through a lot of forum stuff and found that if(llDetectedKey(0)==llGetOwner()) after the touchstart code does indeed restrict using the curtains to the owner. However, when someone else touches the curtains the state_entry seems to be triggered so when I come back later to the curtains in the open position, where I left them, they open again, which is going the wrong direction and I end up with a little sliver of a prim. My goal is for only me to be able to operate the curtains. Any assistance is greatly appreciated! //When touched the prim is retracted towards one end and when touched again stretched back out. // //Prim moves/changes size along the local coordinate specified in the offset vector below. // //To change the overall size, edit the prim when stretched out and reset the script when done. // //The script works both in unlinked and linked prims. // // Copyright (C) 2008 Zilla Larsson // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License version 3, as // published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/> vector offset = <1,0,0>; //Prim moves/changes size along this local coordinate float hi_end_fixed = FALSE; //Which end of the prim should remain in place when size changes? //The one with the higher (local) coordinate? float min = 0.15; //The minimum size of the prim relative to its maximum size integer ns = 10; //Number of distinct steps for move/size change default { state_entry() { offset *= ((1.0 - min) / ns) * (offset * llGetScale()); hi_end_fixed -= 0.5; } touch_start(integer detected) { integer i; do llSetPrimitiveParams([PRIM_SIZE, llGetScale() - offset, PRIM_POSITION, llGetLocalPos() + ((hi_end_fixed * offset) * llGetLocalRot())]); while ((++i) < ns); offset = - offset; } }