The Script Library contains some useful functions I often need in my scripts. I'm pretty
sure they can be helpful to other scripters as well. Just copy the necessary functions to
your scripts to use them.
The Script Library is full perm and given for free. It's licensed under the BSD license
with the addition that it must not be resold or otherwise given away standalone in parts
or as whole. All functions can be used freely in your scripts as long as these license
conditions are met. It also contains some script examples from the Second Life Wiki. The
copyright on those remains with the appropriate authors and the license may differ. The
authorship is marked in the script as comment to the affected functions.
The Script Library contains a small testframe to test some typical usecases and special
cases of the included functions. Just rez a prim, drop the scripts in and touch it. Check
the output manually. Be sure to verify your usecases as well.
Feel free to report bugs, request features, give feedback or write a nice MP review ^^
Store policies and info about custom scripting at my MP store and the inworld terminals.
Provided functions:
- compare strings lexically
- replace all occurences of one string in another (in 2 different implementations)
- get substring that is enclosed by a start and an end string, e.g. to parse simple XML data
- parse a string into a list without the 8 items limit
- print long strings, split into max. 1024 bytes long parts at line breaks
- get string length in bytes
- convert characters to their 7 bit and 8 bit ASCII code and vice versa
- convert integers and floats to their hexadecimal notation
- round floats and vectors with a specified precision, returned as string
- get whether a given string is an integer, a float, Base64-encoded, a vector or a rotation
- norm and scale rotations, constrain to a plane, interpolate rotations
- get the position at the given distance in front of your avatar
- check the VM the script is running on (Mono or LSO)
- get a list of an object's inventory items of a given type
- get number of prims of an object (without seated avatars) and number of seated avatars
- create random listener channels or channels based on given UUID(s)
- get legacy name of an agent with a given ID, but without " Resident"
- get display name of an agent with a given ID, or legacy name if only ??? can be read
- get first name of an agent with a given ID (using display name if possible, otherwise legacy name)
- get combined display and legacy name of an agent with a given ID
- get about name URL of an agent with a given ID (suitable for display in the viewer)
- get agent link URL of an agent with a given ID (suitable for display in the viewer)
- check ownership of an object even if it's group-owned
- show a dialog with buttons ordered correctly
- get whether a given year is a leap year
- get number of days in a given month of a given year
- get numeric day of week, month or year for a given date or timestamp, starting with 1
- convert color and alpha to/from integer representation of the ARGB value
- compress and decompress UUIDs/keys to save memory
Changelog:
- v0.47 ... Initial release version
- v0.48 ... Added shuiShowDialog
- v0.49 ... Added shuiIsMonoVM and some optimizations
- v0.50 ... Added shuiGetChannelFor2, shuiGetOrd*, shuiGetChr*
- v0.51 ... Added shuiPrintString
- v0.52 ... Fixed bug in shuiRoundFloat
- v0.53 ... Avination compatibility
- v0.54 ... Fixed shuiOrd7, shuiIsVector and shuiIsRotation
- v0.55 ... Fixed shuiIsVector and shuiIsRotation again, added shuiNormRot, shuiScaleRot,
shuiConstrainRotToPlane, shuiInterpolateRot, shuiGetPosInFrontOf
- v0.56 ... Fixed order in shuiGetInventoryList
- v0.57 ... Added shuiGetStringBytes, date functions independent, test rework
- v0.58 ... Fixed shuiGetFirstName for leading spaces, added shuiFindMatch
- v0.59 ... Changed shuiRoundFloat, added many new functions, split library
- v0.60 ... Added shuiCompressKey and shuiDecompressKey
- v0.61 ... Added shuiInteger2Hex, shuiFloat2Hex, shuiIsBase64,
shuiGetDayOfWeek, shuiGetDayOfWeekTS, shuiGetDayOfMonthTS
- v0.62 ... Added shuiIsOwner, OpenSim compatibility for shuiCompressKey
- Handling display names
- Date functions
- String functions
- Rounding functions
- Full perm, BSD license

![[.Shuggles.] Seat Textures Script v0.48](https://slm-assets.secondlife.com/assets/10938729/view_small/_.Shuggles.__Texturizer_Image.jpg?1421495205)
![[.Shuggles.] Config Handler Script](https://slm-assets.secondlife.com/assets/16426066/view_small/_.Shuggles.__Config_Handler.jpg?1487882316)
![[.Shuggles.] Colorizer Script](https://slm-assets.secondlife.com/assets/10938693/view_small/_.Shuggles.__Colorizer_Image.jpg?1421494856)
![[.Shuggles.] Coverizer Script](https://slm-assets.secondlife.com/assets/10938710/view_small/_.Shuggles.__Coverizer_Image.jpg?1421494951)
![[.Shuggles.] Book Script](https://slm-assets.secondlife.com/assets/10859794/view_small/_.Shuggles.__Book_Script_Image.jpg?1420215776)
![[.Shuggles.] Card Script](https://slm-assets.secondlife.com/assets/10859810/view_small/_.Shuggles.__Card_Script_Image.jpg?1420215869)
![[.Shuggles.] Multi-purpose HUD v1](https://slm-assets.secondlife.com/assets/11529663/view_small/_.Shuggles.__Multi-purpose_HUD_v1_Image.jpg?1430477547)
![[.Shuggles.] Multi-purpose HUD v1 Demo](https://slm-assets.secondlife.com/assets/11529818/view_small/_.Shuggles.__Multi-purpose_HUD_v1_Demo_Image.jpg?1430479439)