Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
HUD AntiAFK_HUD  

AntiAFK_HUD

The Main Script - you need this script plus the HUDF positioner, and then add any sounds you want to play when AFK

Category: HUD
By : Noland Brokken
Created: 2010-11-08 Edited: 2010-11-08
Worlds: Second Life

the Zip file

Download all files for AntiAFK_HUD
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. AntiAFK_HUD_1.lsl
Get file # 2. AntiAFK_HUD_2.lsl
1 // Super simple stay awake HUD. Looks like an "8" when off
2 // and a lemniscate (infinity) when on
3 // Public Domain by Noland Brokken.
4 //
5 vector C0 = <0,0.4,0>; // Off Color
6 vector C1 = <1,0.4,0>; // On Color
7 vector C2 = <1,1,1>; // Triggered Color
8 float timespan = 0.5; // time between checks
9 float Volume = 1.0; // Volume for sound fx (0.0 - 1.0)
10
11
12 key OwnerKey;
13 integer active;
14 integer numsounds;
15 string soundfile;
16
17 upd()
18 {
20 llSetTimerEvent(active * timespan);
21 llSetRot(llEuler2Rot(<active * PI_BY_TWO,0,0>));
22 }
23
24 default
25 {
27 {
28 OwnerKey = llGetOwner();
29 active = FALSE;
32 {
34 }
35 upd();
36 }
38 {
39 llOwnerSay("Click me to enable/disable.");
40 }
41
42 changed(integer change)
43 {
44 if(change & (128 | CHANGED_INVENTORY))
45 // You'd better put this in the
46 // changed() event when you use llGetOwner
47 { // by way of precaution.
49 }
50 }
51
52 timer()
53 {
54 if(llGetAgentInfo(OwnerKey) & AGENT_AWAY) {
56 do { llStopAnimation("away");}
57 while(llGetAgentInfo(OwnerKey) & AGENT_AWAY);
58 integer n = llFloor(llFrand((float)numsounds- .00001));
59 soundfile = llGetInventoryName(INVENTORY_SOUND, n);
60 if(Volume > 0.0)
61 if(llGetInventoryType(soundfile) != -1)
62 llTriggerSound(soundfile, Volume);
64 }
65 }
67 {
68 if(llDetectedKey(0) != OwnerKey) return;
69 active = !active;
70 upd();
71 }
72 }

AntiAFK_HUD

Position the HUD on attach

Category: HUD
By : Noland Brokken
Created: 2010-11-08 Edited: 2010-11-08
Worlds: Second Life

1 vector brOffset = <0.0, 0.04, 0.1>;
2 vector bmOffset = <0.0, 0.0, 0.1>;
3 vector blOffset = <0.0, -0.04, 0.1>;
4 vector trOffset = <0.0, 0.04, -0.06>;
5 vector tmOffset = <0.0, 0.0, -0.06>;
6 vector tlOffset = <0.0, -0.04, -0.06>;
7
8 default
9 {
10 attach(key id)
11 {
12 if(id != NULL_KEY)
13 {
14 integer attachPoint = llGetAttached();
15
16 // Nasty if else block
17
18 if(attachPoint == 32) // HUD Top Right
19 {
20 llSetPos(trOffset);
21 }
22 else if(attachPoint == 33) // HUD Top
23 {
24 llSetPos(tmOffset);
25 }
26 else if(attachPoint == 34) // HUD Top Left
27 {
28 llSetPos(tlOffset);
29 }
30 else if(attachPoint == 36) // HUD Bottom Left
31 {
32 llSetPos(blOffset);
33 }
34 else if(attachPoint == 37) // HUD Bottom
35 {
36 llSetPos(bmOffset);
37 }
38 else if(attachPoint == 38) // HUD Bottom Right
39 {
40 llSetPos(brOffset);
41 }
42 }
43 }
44 }

Back to the Best Free Tools in Second Life and OpenSim.