Petey Carver
Resident-
Posts
20 -
Joined
-
Last visited
Content Type
Forums
Blogs
Knowledge Base
Everything posted by Petey Carver
-
Update my radar that uses Sensor to use llGetAgentList
Petey Carver replied to Petey Carver's topic in LSL Scripting
Thanks, that clears up that issue! The wiki has an example of sorting the list // Orders new list based on distance // and returns names and distances on touch default { touch_start(integer num_detected) { list keys = llGetAgentList(AGENT_LIST_REGION, []); integer numberOfKeys = llGetListLength(keys); vector currentPos = llGetPos(); list newkeys; key thisAvKey; integer i; for (i = 0; i < numberOfKeys; ++i) { thisAvKey = llList2Key(keys,i); newkeys += [llRound(llVecDist(currentPos, llList2Vector(llGetObjectDetails(thisAvKey, [OBJECT_POS]), 0))), thisAvKey]; } newkeys = llListSort(newkeys, 2, FALSE); // sort strided list by descending distance for (i = 0; i < (numberOfKeys * 2); i += 2) { llOwnerSay(llGetDisplayName(llList2Key(newkeys, i+1)) +" ["+ (string) llList2Integer(newkeys, i) + "m]"); } } } -
Update my radar that uses Sensor to use llGetAgentList
Petey Carver replied to Petey Carver's topic in LSL Scripting
The radar keeps the build rezzed while an avatar is in range. It doesn't report any specific names. So, that is also what I was trying to figure out. Does it need some logic like no agents found, or check each agent found for in range or not and does llGetAgentList work that way. Primsave tells your rezzer to keep a build rezzed while avatars are in range, and derez when no avatars are in range. You put the range and number of prims in the object description like this 45#112 and the ceiling and floor in the script. -
I need to update my radar listed second below that uses sensor to use llGetAgentList listed first below so that it will work for the entire region. It works with Primsave so it needs to keep the same output. What's the best way to do that? llGetAgentList //https://wiki.secondlife.com/wiki/LlGetAgentList // Orders new list based on distance // and returns names and distances on touch default { touch_start(integer num_detected) { list keys = llGetAgentList(AGENT_LIST_REGION, []); integer numberOfKeys = llGetListLength(keys); vector currentPos = llGetPos(); list newkeys; key thisAvKey; integer i; for (i = 0; i < numberOfKeys; ++i) { thisAvKey = llList2Key(keys,i); newkeys += [llRound(llVecDist(currentPos, llList2Vector(llGetObjectDetails(thisAvKey, [OBJECT_POS]), 0))), thisAvKey]; } newkeys = llListSort(newkeys, 2, FALSE); // sort strided list by descending distance for (i = 0; i < (numberOfKeys * 2); i += 2) { //llOwnerSay(llGetDisplayName(llList2Key(newkeys, i+1)) llSay(0,llGetDisplayName(llList2Key(newkeys, i+1)) +" ["+ (string) llList2Integer(newkeys, i) + "m]"); } } } Radar ///////////////////// User variables: /////////////////////////////// // If the scan-distance is a sphere, this cuts off the bottom & top. float ceiling = 90 ; // how high above the rezz-prim do we stop detecting float floor = -90 ; // how low below the rezz-prim do we stop detecting, use negative integer height_adjusted = 1 ; // Set to 1 to activate, 0 to de-activate to reduce lag integer set_name = 0 ; // This sets the name of for what avi came first in the scan, as // hover text over the rezzer. integer rezzer_coms__C = -940369920 ; // The channel that is used for all // rezzers in the sim, to communicate & give commands. // Below here nothing needs to be changed for proper operation // ////////////////////////////////////////////////////////////////// integer periodic_clean = 0 ; //a boolean that will be set when the next sensor is to do a simple clean vector prim_z ; // the height of the rezzer at rezz-time (not on script reset) integer to_rez_prims = 0 ; // How many prims will this rezzer rezz ? integer message_given = FALSE ; // prevents error message to be repeated float scan_distance = 3 ; // distance to the avatar integer rezzed = 0 ; // keep track of whether objects where rezzed already integer position ; // counts down a number of Position commands after rezz, // because it turns out sometimes objects are rezzed, but do not position. // In all cases thusfar, one Position command did it. // Never did a Clean command not derezz everything integer avDistance; vector rPos; integer i; // A function that returns the amount of free prims on the land. integer check_free ( integer verbose ) { integer max ; //maximum prims allowed integer here ; // prims that are rezzed, total count max = llGetParcelMaxPrims ( llGetPos ( ) , TRUE ) ; here = llGetParcelPrimCount ( llGetPos ( ) , PARCEL_COUNT_TOTAL , TRUE ) ; if ( verbose ) { llWhisper ( 0 , "free prim space: " // + " rezzed: " + ( string ) here + " free: " + ( string ) ( max - here ) ) ; } return max - here ; // how many still allowed } // rezzes the stuff rezz ( ) { if ( 3 != rezzed ) // unrezzed { if ( to_rez_prims < check_free ( 0 ) ) { // there are enough prims free ///////////// Set name on rezzer: if ( set_name ) { string avin ; // the one who entered (first) avin = llDetectedName ( 0 ) ; // find avi to give message llSetText ( avin , < 1 , 0 , 1 > , .4 ) ; // For the Fairy Inn, determines who owns the house } //////////// ^ rezzed = 3 ; // keep track of rezzed status //llSay ( 0 , "Optional rezz message" ) ; // <--> here we rezz stuff // check if the primspace is there: // HERE WE ARE DOING THE REZZ COMMAND: llMessageLinked ( LINK_THIS , 0 , // unused "Build" , // copy over the received message "" ) ; // copy over, but it is unused position = 16 ; // We say on the coms what we do. llRegionSay ( rezzer_coms__C , "rezzing" + ":" + ( string ) to_rez_prims ) ; } else // not enough free prims, give message once { key avi ; // the one who entered (first) avi = llDetectedKey ( 0 ) ; // find avi to give message if ( FALSE == message_given ) { llRegionSayTo ( avi , 0 , "Not enough free prim space" ) ; message_given = TRUE ; // remember to prevent spam } } } // We have to give the position order repeatedly, lag issues etc. if ( position ) // run down the positioning calls { if ( 0 == ( position % 5 ) ) // on ever count to 5, 3 times { llMessageLinked ( LINK_THIS , 0 , // unused "Position" , // copy over the received message "" ) ; // copy over, but it is unused } position -- ; } } de_rezz ( ) { message_given = FALSE ; // reset if ( rezzed ) { //llSay ( derezz_channel , "derezz" ) ; // <--> here we derezz stuff llMessageLinked ( LINK_THIS , 0 , // unused "Clean" , // copy over the received message "" ) ; // copy over, but it is unused if ( 3 == rezzed ) { //llSay ( 0 , "Optional de-rezz-message" ) ; llRegionSay ( rezzer_coms__C , "deleting" + ":" + ( string ) to_rez_prims ) ; } rezzed -- ; // keep track of rezzed status } else if ( periodic_clean ) { // <--> here we derezz stuff llMessageLinked ( LINK_THIS , 0 , // unused "Clean" , // copy over the received message "" ) ; // copy over, but it is unused periodic_clean = 0 ; // Done it, prevent re-execution on next sensor } ///////////// Set name on rezzer: llSetText ( "" , < 1 , 0 , 1 > , 1 ) ; // clear ///////////// ^ } /* utility function from public library */ string left(string src, string divider) { integer index = llSubStringIndex( src, divider ); if(~index) return llDeleteSubString( src, index, -1); return src; } string right(string src, string divider) { integer index = llSubStringIndex( src, divider ); if(~index) return llDeleteSubString( src, 0, index + llStringLength(divider) - 1); return src; } default { on_rez ( integer in ) { llResetScript ( ) ; } state_entry ( ) { scan_distance = ( float ) ( left ( llGetObjectDesc ( ) , "#" ) ) ; // object description field sets scan-distance. to_rez_prims = ( integer ) ( right ( llGetObjectDesc ( ) , "#" ) ) ; // object description field sets scan-distance. llSay ( 0 , "Scan distance (objdesc): " + ( string ) scan_distance + " meter. This rezzer rezzes: " + ( string ) to_rez_prims + " LI/prims" ) ; llSensorRepeat( "", NULL_KEY , AGENT , scan_distance , PI , 2.0 ); // the number is the range to search 96 = max // It turns out that sometimes by lag there are still objects that remain // rezzed despite the sensor system, probably because the object-rezzing is so // slow/lagged that they are rezzed after that the cleaning already has passed. // Therefore here is a periodic check & clean system, on a slower time tick to // reduce adding lag. Since nothing should be rezzed, or after one succesful clean // nothing remains rezzed, the clean command given will not be qued to other // scripts, because they are no longer there. Hence it should not be causing a // lot of lag anyway. // uncomment to use: // llOwnerSay ( "Rezzer script initiation delay (30-60 seconds)..." ) ; // llSleep ( 30 + ( integer ) llFrand ( 30 ) ) ; // This causes the timer to start at random, // so that not all these rezzers will do their periodic clean at the same second. // They could otherwise be close to each other, when they are rezzed out by the Crown. // Incidentally this also makes the Crown rezzing a little more comfortable, because // some large distance rezzers will start rezzing themselves automatically, if people // are even merely at ground level where the Crown is. llSetTimerEvent ( 60 ) ; // This seems to be fairly reasonable. llOwnerSay ( "Operational ..." ) ; } timer( ) { // We are going to set a boolean, that will be used by the next sensor-sweep to do a // one time simple additional cleaning command, regardless of what is thought to be rezzed // by this script. It is not worth the additional trouble to create a check toward rezzed // objects periodic_clean = 1 ; // Next no-sensor will do a simple additional clean. } // The key code of the sencor and no-sencor events is written as a function, // because the no-sencor event is executed both by itself, and the sencor // event which is turned into a no-sencor event if the avi is detected in // the exclusion zones sensor ( integer number ) { if ( height_adjusted ) // going to reject the scan find if out of high/low bounds // This is meant to reduce lag, as it is often executed { // Compare z-axis (vertical), if the avi is outside the range, // the whole sensor should not have activated and hence all code // is skipped. vector location_avi = llDetectedPos ( 0 ) ; // Where is the avi // Detected in range, now detract the top/bottom ends. prim_z = llGetPos ( ) ; // where is the rezzer if ( ( ( floor + prim_z.z ) < location_avi.z ) && // avi above floor ( ( ceiling + prim_z.z ) > location_avi.z ) ) // avi below ceiling {// inside of sensor-range rezz ( ) ; // This is de-facto the sencor event } else { de_rezz ( ) ; // turn the sencor in the no_sencor event } } else // We don't care about the height limits, and so it is always a good sensor find. { rezz ( ) ; } } // sensor does not detect owner if it's attached no_sensor() { de_rezz ( ) ; // remove it } }
-
Set Linkset Prim Faces Random Color Touch On Off
Petey Carver replied to Petey Carver's topic in LSL Scripting
Wow Thanks! That's amazing. I tried another method with llSetLinkColor it it worked a little bit, but doesn't change all of the sides after I touch it. I have to touch it several times to get all of the sides colored. It seems to be not the correct loop counter. // integer on = FALSE; // // // simple switch // if on turn off // if off turn on // switcher() { if ( on ) { llOwnerSay ( "Switching OFF" ); on = FALSE; integer n; for (n = 0; n <= llGetNumberOfPrims(); n++) { integer i; float j = llFrand(1); for (i = 0; i < llGetNumberOfSides(); i++) { if (llFrand(1000) > 950) { llSetLinkColor(n,<255, 255, 255>, i); } } } } else { llOwnerSay ( "Switching ON" ); on = TRUE; integer n; for (n = 0; n <= llGetNumberOfPrims(); n++) { integer i; float j = llFrand(1); for (i = 0; i < llGetNumberOfSides(); i++) { if (llFrand(1000) > 950) { llSetLinkColor(n,<llFrand(j), llFrand(j), llFrand(j)>, i); } } } } } // // At startup switched on automatically // init() { switcher(); } default { state_entry() { init(); } on_rez( integer param ) { init(); } touch_start( integer num ) { // Touch to switch on and off switcher(); } } -
I want to set the linkset prim faces to a random color for each prim in the linkset. The script doesn't have any errors but it doesn't do anything. What's the best way to do that? //Function: llSetLinkPrimitiveParamsFast( integer link, list rules ); //353 Function ID //0.0 Forced Delay //10.0 Energy //Sets the prims parameters according to rules. //• integer link – Link number (0: unlinked, 1: root prim, >1: child prims and seated avatars) or a LINK_* flag //• list rules integer on = FALSE; // // // switch // if on turn off // if off turn on // switcher() { if ( on ) { integer i=1; while (i <= llGetNumberOfPrims()) { if (i > 1) // If not the root prim { integer f=1; while (f <= 16) { llSetLinkPrimitiveParamsFast(i,[PRIM_COLOR,f, <llFrand(1),llFrand(1),llFrand(1)>, 1]); } ++f; } ++i; on = FALSE; } } else { integer i=1; while (i <= llGetNumberOfPrims()) { if (i > 1) // If not the root prim { //count faces and set to white with while integer f=1; while (f <= 16) { llSetLinkPrimitiveParamsFast(i,[PRIM_COLOR,f, <255, 255, 255>, 1]); } ++f; } ++i; on = TRUE; } } llOwnerSay("Done!"); } // // At startup switch on automatically // init() { switcher(); } default { state_entry() { init(); } on_rez( integer param ) { init(); } touch_start( integer num ) { // Touch to switch on and off switcher(); } }
-
Rare, Over 20 Region Rez Zone, Protected Waterfront! 43968 m2 Jeogeot Gulf All the room for your Castle, Shipping, Sailing, Marina, Building, Sandbox, Mountain Switchback RailRoad, Winter Skii Slope, Snow Board, Skate Board, Offroad, it's Huge!!! http://maps.secondlife.com/secondlife/Third Space/150/54/95 Bay City,Horizons,Nautilus City,Blockchain,Crypto,NFT
-
Wow, thanks for posting that. Do you know how that compares to NFT land like Decentraland MANA. These crypto currencies like meme stocks seem to have a value based on whether or not Elon Musk is endorsing them. Once the value for crypto games is established. SL may look like it would be a good buy for gazillionaires . It already has a dedicated resident base.
-
Renter Wants to Assign Private Group to Rental Parcel
Petey Carver replied to Petey Carver's question in Land
Thanks for your replies. Sheim said someone else let herm rent and use a private group. Maybe it was on a private region. Sheims never even been on the land that my visitor list detected. I don't even have the land posted for rent. More likely someone trying to take land. -
Renter Wants to Assign Private Group to Rental Parcel
Petey Carver replied to Petey Carver's question in Land
I think it was unchecking under Accounting, Pay group liabilities and receive Group Dividends. And uncheck create new roles so someone can't add a role and change that setting. -
Renter Wants to Assign Private Group to Rental Parcel
Petey Carver replied to Petey Carver's question in Land
Thanks for all of your replies! I think there was a box that disabled the sale price of land going to all the group members. I set it up about 15 years ago so I don't remember how I did that. -
Renter Wants to Assign Private Group to Rental Parcel
Petey Carver replied to Petey Carver's question in Land
The deed land to group button pops up a message that shows 'The purchase price of the land is not refunded to the owner. If a deeded parcel is sold, the sale price will be divided evenly among group members.' -
Renter Wants to Assign Private Group to Rental Parcel
Petey Carver replied to Petey Carver's question in Land
The page on http://wiki.secondlife.com/wiki/Groups_and_Land shows that: Sale of group land ANY OWNER OR OFFICER of the group (or any member with the proper "ability" in the group) can sell the land to whomever they wish (even themselves for L$0) without prior approval from other owners, officers or members. There is nothing you can do if a rogue officer "steals" all the land from others. Period. So be careful. Normally, all land sale proceeds of group land are equally distributed amongst all group members. However, the settings in the group can be adjusted so that not everyone receives a share of these proceeds. -
Renter Wants to Assign Private Group to Rental Parcel
Petey Carver replied to Petey Carver's question in Land
Thanks, my parcel is almost 1/4 region on the mainland. If they put some content on it that doesn't comply with terms does that get my account banned? -
Renter Wants to Assign Private Group to my Parcel, does doing that allow them to sell the land? Does that have any other risks?
-
I'm going to give up on flying airplanes on SL
Petey Carver replied to Tony Giffen's topic in General Discussion Forum
I have a wearable glider that flies really good and I can teleport with it. Do you know of any full perms scripts for airplanes, boats and other vehicles? -
I'm going to give up on flying airplanes on SL
Petey Carver replied to Tony Giffen's topic in General Discussion Forum
I thought if you set it to temp it didn't count in the LI.