Don't click here unless you want to be banned.

LSL Wiki : ScriptDelay

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl423.us.archive.org

Script Delay

Script delay (or just "delay") occurs when either explicitly requested by the developer (scripter) (via llSleep) or when certain functions execute built-in delays. The effects of the delay caused by either of these is identical; this page will document these effects.

The functions that automatically delay the script, whether the developer requests it or not, are:

Delay (sec) Function
20 llEmail
10 llGetSimulatorHostname
10 llLoadURL
5 llTeleportAgentHome
3 llGiveInventory
3 llGiveInventoryList
3 llRemoteDataReply
3 llRemoteLoadScript
3 llRemoteLoadScriptPin
3 llSendRemoteData
2 llInstantMessage
2 llParcelMediaCommandList
2 llParcelMediaQuery
2 llSetParcelMusicURL
1 llCloseRemoteDataChannel
1 llCreateLink
1 llDialog
1 llModPow
1 llOpenRemoteDataChannel
1 llPreloadSound
1 llRequestInventoryData
1 llRequestSimulatorData
.2 llGetPrimitiveParams
.2 llOffsetTexture
.2 llRotateTexture
.2 llScaleTexture
.2 llSetLinkPrimitiveParams
.2 llSetLocalRot
.2 llSetPos
.2 llSetPrimitiveParams
.2 llSetRemoteScriptAccessPin
.2 llSetRot
.2 llSetTexture
.1 llAdjustSoundVolume
.1 llGetNotecardLine
.1 llGetNumberOfNotecardLines
.1 llMakeExplosion
.1 llMakeFire
.1 llMakeFountain
.1 llMakeSmoke
.1 llRequestAgentData
.1 llRezAtRoot
The delay is now indicated in the mouseover tooltip of each function. If you see any new functions which have a delay, please add them to the list above.

Each of these functions performs its task first, then delays the script the set number of seconds.

When a script is being delayed, the event queue still fills, but in a rather peculiar manner:
Event If triggered during the delay...
touch_start
touch_end
it is only executed once after the delay.
listen it is executed the number of times it is triggered.
link_message it is executed the number of times it is triggered, up to the maximum event queue size (64)
Please feel free to add more.

The delay between events can also be changed with llMinEventDelay. By default the delay is .1 seconds between the end of an event and when the next event is fired off (the script sleeps).

Tip

For a specific function to not be delayed (any more than it is with its own delay, if any), put it in a separate script.


events | functions
Comments [Hide comments/form]
I don't know if this belongs here (since I don't know if the delay is in LSL or just in the XML-RPC processing), but I'm noticing a 3.0-3.1 second delay with something like:

Java code:
public class xmlrpctest {
	xmlrpctest() throws Exception {
		while (true) {
			Date	currdate = new Date();
			Date	lastdate = new Date();
			// code to initialize SecondLife XML-RPC connection
			while(true) {
				// code to send llRemoteData request with ival=42, sval=""
				lastdate = currdate;
				currdate = new Date();
				System.out.println("Ping... " + (currdate.getTime() - lastdate.getTime())); // usually gives 3000-3100
			}
		}
	}
LSL:
key chan;
default {
	state_entry() {
		llOpenRemoteDataChannel();
	}
	remote_data(integer type, key channel, key msgid, string sender, integer ival, string sval) {
		if (type == REMOTE_DATA_CHANNEL) {
			llWhisper(0,"Channel is: " + (string)channel);
			chan = channel;
		} else if (type == REMOTE_DATA_REQUEST) {
			llRemoteDataReply(channel, msgid, "whee!", 27);
		}
	}
	state_exit() {
		llCloseRemoteDataChannel(chan);
	}
}

Could someone double-check this to make sure it's LL/LSL and not my connection/XML-RPC library causing the delay?
-- AshByrne (2004-08-02 22:07:12)
Uh, all your java code does is get two dates and the time between them...
I measured round trip time on xmlrpc to average about 400 ms if the script isnt heavily loaded.
-- ChristopherOmega (2004-08-02 22:32:34)
Actually, I shouldnt even say that. You're not importing anything in your header, so Im not even sure where class Date comes from :)
-- ChristopherOmega (2004-08-02 22:33:32)
Yeah, I'm aware of that. Hence the comments. ;P

I didn't include the XML-RPC stuff because I'm not using whatever XML-RPC stuff there is in the Java standard library-- right now I'm using a 'SLchannel' wrapper over the Marquee XML-RPC library. I didn't write SLchannel (a friend of mine did), so I don't know if I have permission to distribute it here.
-- AshByrne (2004-08-02 23:45:06)
Okay, I just tried it out with a PHP XML-RPC implementation.

Looks like the first request takes about 600ms, and all subsequent requests take ~3 seconds. My guess is that it's some sort of rate limiting on the server side.
-- AshByrne (2004-08-05 20:28:44)
Yeah, I only got the 400ms round trip if I spaced my tests about 5 seconds apart. I got about 2 seconds round trip when I spaced them 1 second apart.
-- ChristopherOmega (2004-08-07 02:56:29)
Why are all instances of "delay" (or any of its other forms) italicized?
-- ChristopherOmega (2005-04-16 01:29:54)
Whatever happens to be the term I've been italicizing to emphasize that term as it's used throughout the page. It helps to reinforce the term, I've found...
-- EepQuirk (2005-04-16 20:44:08)
I'm skeptical about the actual usefulness of that, Eep. Can you cite any examples?
-- CatherineOmega (2005-04-18 11:33:31)
Well, I've done it on my RWX site for years and no one's complained. ;)
-- EepQuirk (2005-04-18 22:15:13)
italicizing on this page seems a bit excessive especial since the term isn't the name of the page.
-- BlindWanderer (2005-04-22 23:42:26)
"Delay" is a shortened form of "script delay"...
-- EepQuirk (2005-04-23 13:22:26)
Eep: this is like coding standards. When working on someone's code, stick to their indenting style and tab settings. The common usage on this Wiki is NOT to italicise title keywords like that, so all you're doing is confusing people.
-- ResunaOddfellow (2005-09-19 16:14:33)