SRL Archive - Outdated / Broken

Timed waits in scripts..


Krazy_Meerkat

2006-04-21 23:24:07

I started a procedure for this which used readfile and write file, but I'm just a bit lazy atm.. Anyway
To improve scripts, I suggest using timed waits. (To keep a very constant environment for scripts)
What it basically means is, when you use a random wait, you have to make up the rest of the time.

Time:= 4000;
RandomTime:= 1000;
ActualWait:= (Time + random(RandomTime));
Wait(ActualWait);
Do some stuff;
Wait((Time + RandomTime) - ActualWait);

It means that you can make a script which will run for exactly 16 seconds or whatever you want. So, for an auto-teleporting script, you can click on teleport and wait a certain amount of time while teleporting without the script getting ahead or behind itself.
Good scripting standards are what set us above the rest.

Sdcit

2006-04-22 00:29:00

yesyes, good idea :) ive made something like that for my woodcutter if i recall.

XxKanexX

2006-04-22 21:34:39

Still studying this? Good idea.

Krazy_Meerkat

2006-04-23 09:42:55

I'm almost finished the procedure.. I just have to add something for the finalwait, if it's even needed :/ I imagine looping scripts won't need a finalwait but I'll have a think about it later..