Textbox2Hovertext: Difference between revisions
Jump to navigation
Jump to search
Ackley Bing (talk | contribs) No edit summary |
channel and handle numbers are different. I do not like how you use a slow loop to remove listens but it's a clever solution that should work. |
||
| Line 9: | Line 9: | ||
touch_start(integer num) | touch_start(integer num) | ||
{ | { | ||
key target = llGetOwner();// or llDetectedKey(0) | |||
llSetTimerEvent(30.0); | llSetTimerEvent(30.0); | ||
listenhandle = llListen(1, "", target, ""); | |||
llTextBox( target, "Set Hovertext", 1 ); | |||
} | } | ||
listen(integer channel, string name, key id, string message) | listen(integer channel, string name, key id, string message) | ||
Revision as of 21:36, 28 January 2013
<lsl> // Textbox2Hovertext.LSL by Ackley Bing . January 2013 // A simple script to allow hovertext to be set with a dialog text box
integer listenhandle;
default {
touch_start(integer num)
{
key target = llGetOwner();// or llDetectedKey(0)
llSetTimerEvent(30.0);
listenhandle = llListen(1, "", target, "");
llTextBox( target, "Set Hovertext", 1 );
}
listen(integer channel, string name, key id, string message)
{
llSetText(message, <1.0,1.0,1.0>, 1.0);
}
timer()
{
if (listenhandle) llListenRemove(listenhandle--);
else llSetTimerEvent(0.0);
}
} </lsl>