Skip to content

Instantly share code, notes, and snippets.

View typhartez's full-sized avatar

Typhaine Artez typhartez

View GitHub Profile
@typhartez
typhartez / Access.lsl
Last active March 1, 2021 23:05
Authorization reusable script
// Access reusable script: define authorizations from an access control list notecard
// Typhaine Artez 2021
// Under Creative Commons License Attribution-NonCommercial-ShareAlike 4.0 International
//
// Sample .access notecard (/* and */ are not part of the notecard content):
/*
# Authorization notecard. Empty lines or lines starting with # are ignored
# Without configuration, only the owner is allowed to use
# mode = group to enable everyone wearing the same group tag than the object
# mode = all to enable everyone
@typhartez
typhartez / base64linkmap.lsl
Created December 31, 2020 15:18
Base64 for linkmap
// testing base64 packing of link/face definitions based on a list of parts
// base on uriesk work: https://github.com/uriesk/opensim-body-scripts/blob/master/src/body-main.lsl
#define DBG(_msg) llOwnerSay(_msg)
// definition of links (each item represents a link number)
list linkmap = [
1,2,3,4,5,6,7,8,9,10,11,12,13
,14,15
,16,17,18,19,20,21,22,23
@typhartez
typhartez / is09.md
Created December 16, 2020 12:07
Detect OpenSim 0.9

KISS detection is we are on old OpenSim 0.8.x or more recent (0.9.x onward)

integer is09() {
    return !~llSubStringIndex(llGetEnv("sim_version"), "OpenSim 0.8");
}

default {
    state_entry() {
 llOwnerSay("Is 0.9.x = "+(string)is09());
@typhartez
typhartez / beampos.md
Last active December 7, 2020 09:44
Moving a beam with parent prim rotation?

I want to make some lights with a retractable beam: the beam is minimized and centered into the root prim when inactive. The light can rotate while the beam is active or not, and I want only one script in the root prim to control the beam.

FIXED: do not apply any rotation! In fact, when setting PRIM_POS_LOCAL, it seems OpenSim also computes the offset due to root rotation.

Here is a picture of the action:

Diagram of beam movement

The active size of the beam is saved before it's hidden, so it can be used when restoring it.

@typhartez
typhartez / lm2-lg2-sh.md
Created April 3, 2020 13:44
LM2-LG2-SH Script

LockGuard & Lockmeister all-in-one script Version 1.1

OVERVIEW (A.K.A What is this thing anyway?)

This script is a combination LockGuard and Lockmeister script for use in cuffs, collars, harnesses, and other similar attachments. It combines the functionality of both LockGuard and Lockmeister systems - two different systems used for drawing chains between cuffs/etc. and pieces of furniture - into one low-memory script. It is fully compliant with both LockGuard V2 and Lockmeister specifications, and will even accept LockGuard V2 configuration notecards if desired.

USAGE (A.K.A. Why should I be using this?)

The LockGuard & Lockmeister script is meant to be used for any worn object where either LockGuard or combined LockGuard + Lockmeister functionality is desired. This can be useful both for more complex restraints as well as for simple "Combo Cuffs" often distributed with pieces of bondage furniture or equipment. Not only does the script combine both systems into one simple-to-use script, it d

@typhartez
typhartez / lgv2.md
Created April 3, 2020 13:42
LockGuard V2 Protocol

Description of how LockGuard is supposed to work.

Specification were taken on SecondLife Wiki:

Protocol

This is very simple. An object sends commands on the channel -9119, following this format:

@typhartez
typhartez / loopback-linux.md
Created April 3, 2020 13:36
Local Opensim with NAT Loopback on Linux

Prepare things

Gather important information about the local network and public IP. Example:

  • local IP: 192.168.1.1 (network 192.168.1.0/24)
  • external IP: 88.88.88.88 (easier with fixed IP, but works with dynamic ones)
  • Opensim port: 9000 (example in standalone)
  • Region port: 9000 (and any additionnal ones...)

IP addresses can be obtained with the natloopback script below.

@typhartez
typhartez / 3D-text-blender.md
Last active July 14, 2024 03:18
3D Mesh text with blender
  • num5 num7
  • Add Text
  • do whatever you want with the text
  • num3
  • r x 90
  • In toolshelf, use Data tab (F)
  • Geometry: play with Extrude
  • Object Mode
  • alt+C -> Mesh from Curve/Meta/Surf/Text
@typhartez
typhartez / sim-hostname.md
Created April 3, 2020 13:32
Simulator Hostname script

The function `llGetSimulatorHostname()\ has a 10 seconds delay. It's maybe good in SL or for region owners renting parcels, but not for region owners.

Taken from the SL Wiki, llGetEnv() gives the same result without delay.

// llGetEnv now offers an equivalent function without the 10 second delay.
SaySimulatorHostname()
{ 
    llOwnerSay("Simulator Hostname: " + llGetEnv("simulator_hostname") );
}
@typhartez
typhartez / key2chan.md
Last active December 7, 2020 10:03
Key to channel

Make a llListen() usable integer from an UUID, using an application key (integer specific to that product).

The channel will follow the application key sign (if negative, the channel will be negative too).

integer APP_KEY = 455867;

integer key2chan(key id, integer app) {
    integer mult = 1;
    if (app < 0) mult = -1;