Is there an alternative to llGetTime()?

Creating scripts
Post Reply
User avatar
Tess Juel
Posts: 443
Joined: Sun Sep 11, 2016 4:24 pm
Has thanked: 359 times
Been thanked: 533 times

Is there an alternative to llGetTime()?

Post by Tess Juel »

I'm struggling with this code snippet:

Code: Select all

    touch(integer total_number)
    {
	integer send=1;
        if(llGetTime() >= 0.5 && send==1)
            {
                llResetTime();
                llMessageLinked(LINK_SET, pos,"move", "");
                send=0;
            }
    }
The idea is that llMessageLinked() is triggered once if and only if the object is touched and held for half a second. Unfortunately it turns out opensim doesn't support the llGetTime() function.
Does anybody know of a workaround for this?
User avatar
Ilan Tochner
Posts: 6816
Joined: Sun Dec 23, 2012 8:44 am
Has thanked: 5406 times
Been thanked: 4749 times
Contact:

Re: Is there an alternative to llGetTime()?

Post by Ilan Tochner »

Hi Tess,

You can check whether any of the supported OSSL functions can help you: http://opensimulator.org/wiki/Category:OSSL_Functions
User avatar
Tess Juel
Posts: 443
Joined: Sun Sep 11, 2016 4:24 pm
Has thanked: 359 times
Been thanked: 533 times

Re: Is there an alternative to llGetTime()?

Post by Tess Juel »

Ilan Tochner wrote: Thu May 08, 2025 9:32 am You can check whether any of the supported OSSL functions can help you: http://opensimulator.org/wiki/Category:OSSL_Functions
Thank you Ilan, that is always good advice! It didn't help in this case though, OSSL doesn't have any alternative to llGetTime(). That's a bit weird but it is what it is.

I did find a solution using a combination of the touch start, touch end and timer events. It's a bit of a crude hack since the script already used the timer event for something else, but it works.
Post Reply