Textbox2Hovertext

From Second Life Wiki
Revision as of 21:36, 28 January 2013 by Strife Onizuka (talk | contribs) (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.)
Jump to navigation Jump to search

<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>