Log in

View Full Version : GetSystemTime



Yago
02-24-2011, 02:56 AM
Ive seen it in many scripts... Just wondering what the heck it does or records.

I know its got something to do with time...

Thanks for helping :)

Train
02-24-2011, 04:13 AM
Get the amount of milliseconds the system has been online for. Used for benchmarking and time outs.

Wanted
02-24-2011, 04:23 AM
You'll see


var
T: Integer;

begin
T := GetSystemTime;
WriteLn(T);
end.

out puts


19962745

which is the number of milliseconds the system has been online for at any given time, this number increases 1 per a millisecond, so at any given time in the future it will be X amount greater than before and the difference between the current value and the old value will be the amount of milliseconds that have passed.


var
T: Integer;

begin
T := GetSystemTime;
Wait(1000);
WriteLn(GetSystemTime - T);
end.

Yago
02-24-2011, 04:56 AM
Is it refering to the system of runescape or of simba or of smart?

Wanted
02-24-2011, 04:57 AM
Is it refering to the system of runescape or of simba or of smart?

Your computer.

Daniel
02-24-2011, 08:21 AM
Here's an example of its' use (in English):

I call GetSystemTime.
I then run my wood chopping procedure.
I then call GetSystemTime again and get the difference. I can then see how long it took to cut down those trees and if it has been cutting for more then 10 minutes then I know something is wrong (as it never takes 10 minutes to cut a tree!) and I can log that player out to prevent it from getting banned.

:)

marpis
02-24-2011, 09:13 AM
There's also GetTimeRunning: integer; which also results in milliseconds, but this time the time your script has been running.


begin
Wait(1000);
Writeln(GetTimeRunning);
end.


:)

You can turn milliseconds into minutes like this:
1000 = 1 second (just like 1000 millimeters is 1 meter)
60 seconds = 1 minute

--> 1000*60 = 1 minute
--> 1000*60*60 = 1 hour

Yago
02-24-2011, 05:03 PM
Ok thanks :). Ill use these tactics. Thanks alot. Btw, I have a lot more questions :)

anonymity
02-24-2011, 05:29 PM
A little while back, I had a lot of time related questions. If it helps you out at all you can read through this thread (http://villavu.com/forum/showthread.php?t=56976).

What other questions do you have?

Yago
02-24-2011, 11:44 PM
Edit: Found A Way around the bank thing.

Is there A way I can tell what floor my character is on?

Like 1rst 2nd or 3rd floor of lumby castle?

anonymity
02-25-2011, 03:33 AM
Right when you login? or when you are script navigating?

login:
- i dunno.

script navigating:
- well, you could add a simple floor counter.
- - it would add and subtract so you know which floor you are on. make floor zero the base, + would be up, and - would be basement.

Yago
02-25-2011, 04:01 AM
No, but I wanna do something as a failsafe to make sure I went up the lumby stairs. Ill use symbol finding but its innacurate so ... Untill Somebody else knows a way then Im screwed.

KingKong
02-25-2011, 05:00 AM
I think this will tell you what level you're on: GetPlaneIndex

Yago
02-26-2011, 02:58 AM
Ok thank alot again for your help. Yes that was the correct function. As for now no more questions ... Off To fix my lumbylobcooker