[Opensim-users] Floating text not going away

Jor3l Boa jor3l at foravatars.com
Thu Mar 17 04:23:01 UTC 2011


And you can do the same HOUR:MINUTES thing with just:

---
default
{
state_entry()
{
llSetTimerEvent(30); // Why every 2 seconds if you show minutes :)
}
timer()
{
list timestamp = llParseString2List(llGetTimestamp(), ["-", ":"], ["T"]);
llSetText(llDumpList2String(llList2List(timestamp, 4, 5), ":"), <1,1,1>, 1);
}
}
----

2011/3/16 InuYasha Meiji <inuyasha.meiji at gmail.com>

>  On 3/16/2011 11:57 AM, Lindy McKeown wrote:
>
> Prims always remember floating text even  after the script creating it are
> removed. So to remove you have to put nothing  in the floating text. Then it
> will replace your time with nothing and remember that when you remove the
> floating text  script. It allows you to label and unlabel items. Useful for
> objects that give their contents so you don't also get the floating text
> script given to you.
> Lindy
> On Mar 16, 2011 8:47 AM, "Robert Klein" <rtkwebman at gmail.com> wrote:
> > I have a script that puts the current time floating above an object. When
> I
> > remove the script from the object contents the text still remains
> floating
> > above the object showing the time from when the script was removed. The
> time
> > does not continue to update but it will not go away. Anyone else have
> this
> > problem and if so how did you get the text to go away without deleting
> the
> > object and starting over?
> >
> > Here is the script:
> >
> > // HoverText Clock Script
> > // By Ben Linden
> > //
> > // Drop on an object to make it display the PST time.
> > //
> > // If you are interested in scripting, check out
> > // the Script Help under the help menu.
> >
> > // The double slash means these lines are comments
> > // and ignored by the computer.
> >
> >
> >
> >
> > // Global Variables
> > // a string is a collection of characters.
> > string smin; // Represents minutes
> > string sseconds; //Represens seconds
> >
> > // All scripts have a default state, this will be
> > // the first code executed.
> > default
> > {
> > // state_entry() is an event handler, it executes
> > // whenever a state is entered.
> > state_entry()
> > {
> > // llSetTimerEvent() is a function that sets
> > // up a timer event in seconds.
> > llSetTimerEvent(2.0); // call a timer event
> > // every 2 seconds.
> > }
> >
> >
> > // timer() is an event handler, it executes on an
> > // interval defined by llSetTimerEvent()
> > timer()
> > {
> > // llFloor is a function that rounds down all numbers.
> > // llGetWallClock is a function that returns the time
> > // of day in seconds, on a 24 hour clock.
> > integer seconds = llFloor(llGetWallclock());
> > // Convert the total number of seconds into a integer (whole number)
> > integer min = llFloor(seconds/60);
> > // Figure out how many minutes that is
> > seconds = seconds - (min*60);
> > //Work out the remaining number of seconds
> > integer hour = llFloor(min/60);
> > // figure out how many hours it represents.
> > min = min - (hour*60);
> > // figure out the number of minutes remaining
> >
> > // if is a conditional statement, it will only execute if the
> > conditions are met.
> > if(hour > 12) {hour = hour - 12;} // if the hours are greater than
> > 12, convert to 12 hour time
> > string shour = (string)hour; //convert the number into a string
> > if(min < 10) {smin = "0"+(string)min;} // if less than 10 minutes,
> > put a 0 in the minute string
> > else { smin = (string)min;}
> > if(seconds < 10) { sseconds = "0"+(string)seconds;} // if less than
> > 10 sec, put a 0 in the second string
> > else {sseconds = (string)seconds;}
> >
> >
> > string time = shour + ":" + smin; // build the seperate strings into
> > a complete string, with colons
> >
> > // llSetText is a function that displays a string over the object.
> > llSetText(time, ZERO_VECTOR, 1.0); //Display the string in solid
> > black.
> > }
> >
> > }
> >
> >
> > Thanks,
> >
> > Robert
> > ttps://lists.berlios.de/mailman/listinfo/opensim-users
>
> Adding my two cents.,.  This is also true for objects that produce particle
> efects.
>
> -InuYasha
>
> --
> ________________________________________________________________
> Opensim User: Standalone Grid on Version 0.7.0.2 with 49 Regions
> On Windows 7, 64-bit. Quad Core With a Terrabyte Drive, and 8gig
> Used XAMPP to load PHP Version 5.3.0, and MySQL 5.1.41-community
> ________________________________________________________________
>
>
> _______________________________________________
> Opensim-users mailing list
> Opensim-users at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-users/attachments/20110316/620aeab9/attachment.html>


More information about the Opensim-users mailing list