Difference between revisions of "Typing linkset alpha toggle"
Jump to navigation
Jump to search
BETLOG Hax (talk | contribs) (Created page with '{{LSL Header}} ====Typing linkset alpha toggle==== --BETLOG Hax UTC+10: 20090928 1705 [SLT: 20090928 0005] <br> Put script in root prim of your fancy "i am t...') |
m (<lsl> tag to <source>) |
||
(One intermediate revision by one other user not shown) | |||
Line 14: | Line 14: | ||
<br> | <br> | ||
I just wrote it, didn't test much, It's trivial but there will probably be a glaring oversight in there somewhere. | I just wrote it, didn't test much, It's trivial but there will probably be a glaring oversight in there somewhere. | ||
< | <source lang="lsl2"> | ||
//============================================================== | //============================================================== | ||
// BETLOG Hax | // BETLOG Hax | ||
Line 29: | Line 29: | ||
// Or: | // Or: | ||
// -Link to the wiki URL from which you copied this script. | // -Link to the wiki URL from which you copied this script. | ||
// https://wiki.secondlife.com/wiki/Typing_linkset_alpha_toggle | |||
// -Document: "Uses parts of <scriptname> by BETLOG Hax" | // -Document: "Uses parts of <scriptname> by BETLOG Hax" | ||
// **** LICENCE END **** | // **** LICENCE END **** | ||
Line 77: | Line 78: | ||
} | } | ||
//============================================================== | //============================================================== | ||
</ | </source> | ||
[[Category:LSL Examples]] | [[Category:LSL Examples]] |
Latest revision as of 17:11, 24 January 2015
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Typing linkset alpha toggle
--BETLOG Hax UTC+10: 20090928 1705 [SLT: 20090928 0005]
Put script in root prim of your fancy "i am typing now" novelty prim keyboard.
Start typing -> prims become visible
Stop typing -> prims become INvisible
Only one script required.
I just wrote it, didn't test much, It's trivial but there will probably be a glaring oversight in there somewhere.
//==============================================================
// BETLOG Hax
// UTC+10: 20090928 1642 [SLT: 20090927 2342]
// For Jullalana Mornington because I saw the ye-olde one she was using had a script in every prim. This sort of script does NOT need a script in every prim. Yes realy.
//----------------------------------
// **** LICENCE START ****
// http://creativecommons.org/licenses/by-sa/3.0/
// Attribution licence:
// You must:
// -Include this unaltered licence information.
// -Supply my original script with your modified version.
// -Retain the original scripts' SL permissions. [+c/+m/+t]
// Or:
// -Link to the wiki URL from which you copied this script.
// https://wiki.secondlife.com/wiki/Typing_linkset_alpha_toggle
// -Document: "Uses parts of <scriptname> by BETLOG Hax"
// **** LICENCE END ****
//==============================================================
integer gVisible;
//----------------------------------
f_toggle(integer visible)
{ llSetLinkAlpha(LINK_SET, (float)visible, ALL_SIDES);
}
//----------------------------------
f_perms() //make it still operate when entering no script areas
{ if(llGetAttached())
llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS);
}
//==============================================================
default
{ state_entry()
{ if(llGetAttached())//DEV
f_perms();
else
llOwnerSay("You must be wearing me for this to operate.");
}
attach(key id)
{ f_perms();
}
run_time_permissions(integer perm)
{ if(perm & PERMISSION_TAKE_CONTROLS)
{ f_toggle(gVisible=FALSE);
llSetTimerEvent(0.444444);
}
}
control(key id, integer pressed, integer change)
{ //make it still operate when entering no script areas
}
timer()
{ if(AGENT_TYPING & llGetAgentInfo(llGetOwner()) )
{ if(!gVisible)
{ f_toggle(gVisible=TRUE);
}
}
else
{ if(gVisible)
{ f_toggle(gVisible=FALSE);
}
}
}
}
//==============================================================