User:Horrible Calamity

From Second Life Wiki
Jump to navigation Jump to search
Profile
HCProfile.png
Born:
12/18/09
About:
Beware The Calamity.
Achievements:
  • Avid programmer, advanced in:
    • C/C++/C#
    • Python (& Django)
    • x86/MIPS/Z80/6502/ARM7+ ASM
    • LSL
  • Good at:
    • PowerPC ASM
    • Perl
    • Ruby (& RoR)
    • D
    • Go

About

I have been incarnated in several forms, mostly as Jana Kamachi (completely purged from the SL database) and Coder Kas, with Horrible Calamity being the latest reincarnation both as my avatar and as a brand. Many of the things I've done in the past are now outdated, and if you were redirected to this page after following an old link, its because its no longer usable, or an updated version may be available. Some of it may still be here as a historical reference.


Snippets

Various snippets for little things.

Ladders

This is a fun shape that, without requiring scripts or anything other than a single prim, allows you to walk 90˚ straight up. It can be used for making ladders and/or walkable walls. The 'best' size is 5m high and 1m wide, too high and you lose 'traction'. However, you can chain as many as you want to make a ladder straight into the sky.

Note: This is a bug, but it's been around for years and likely isn't going away anytime soon.

  1. Make a new prim
  2. Insert the following script, save, and run

<lsl> default {

   state_entry()
   {
       llSetPrimitiveParams([PRIM_TYPE, 1, 0, <0.0, 1.0, 0.0>, 0.0, <1.0, -1.0, 0.0>, <1.0, 1.0, 0.0>,
            <0.0, 0.0, 0.0>, PRIM_SIZE, <0.01, 1.0, 5.0>]);
       llRemoveInventory(llGetScriptName());
   }

} </lsl>

Avatar Profile Picture

This was a snippet I released almost 3 years ago and since then - with the great work of Moriash Moreau and Debbie Trilling - has been used in literally hundreds of items. Its a very simple snippet for getting the UUID of an avatars profile picture given an avatars key. The key use for it is personalization, allowing you to make more flexible products, like fireworks, projectors, visitor boards, employee status boards, HUD's, and many more things. The original snippet posted in 2007 is as below:

<lsl> string URL_RESIDENT = "http://world.secondlife.com/resident/"; default {

   touch_start(integer p){
       llHTTPRequest( URL_RESIDENT + (string)llDetectedKey(0),[HTTP_METHOD,"GET"],"");
   }
   
   http_response(key req,integer stat, list met, string body){
       llSetTexture((key)llGetSubString(body,llSubStringIndex(body,"<img alt=\"profile image\" src=\"http://secondlife.com/app/image/")+
           llStringLength("<img alt=\"profile image\" src=\"http://secondlife.com/app/image/"),llSubStringIndex(body,"\" class=\"parcelimg\" />")-3),ALL_SIDES);
   }

} </lsl>

There have been several changes to the database since I wrote this, so I highly recommend you pick up Debbie's version here.

How It Works

Around 2007 it was announced that the Second Life search - which had up till that point been using a custom, in-house solution - would switch to using Google Mini and would offer a new, web-based search. Using LSL's existing HTTP methods, we can retrieve the contents of this search for our own uses in-world. This is essentially what all variations and updates of this script do - it loads their profile, looks for the image tag, gets the UUID of the image (or the meta tag in newer versions), and then returns it.

Minor Caveats

This script is considered a TOS violation by Linden Labs (even though they've added support for it) and several people have reported getting warnings from LL. I've never heard of someone actually being banned over it, and most versions now ask the user for permission before they display the image. Apparently, setting an image as your public profile picture doesn't make it public.

Avatar Tracker - Obsolete

This is another old script that, although obsolete, I keep here for historical reasons. An exploit originally identified by JCool410 Wildcat, a person could at the time use llGetObjectDetails to follow an avatar when they teleported to another sim. This is clearly a TOS violation, but it was incredibly fun, and was the 6th most viewed script in the forums for some time. You can see what the old version used too look like from a posting on lslwiki.net. SVC-744 broke/fixed this behaviour.