SRL Archive - OSR Help

Reset TimeRunning


CephaXz

2012-05-23 17:21:57

Can I reset the TimeRunning in a procedure or somewhere in a script?

Because I want it wait until its logged in, and do some other procedure, then just start the time count.

Home

2012-05-23 17:26:20

From: CephaXz
Can I reset the TimeRunning in a procedure or somewhere in a script?

Because I want it wait until its logged in, and do some other procedure, then just start the time count.


You can use MarkTime.


~Home

putonajonny

2012-05-23 17:29:30

as home said
MarkTime(LoggedIn);
then when you want to know how long it has been since:
TimeFromMark(LoggedIn);

CephaXz

2012-05-23 17:34:19

So how do I make it in my progress report? Using InttoStr?

EDIT: I got it to become the time running on my progress report. But I could not get it to become the XP/Hour because I need the time to be divided by 1000.

xtrapsp

2012-05-24 06:29:56

Of the top of my head i believe it would be

Writeln(Timefrommark(Loggedin));


Or something along those lines

Witht the divided by 1000 i think its

Procedure(blabla() / 1000); or something along those lines to :3

Nava2

2012-05-24 07:33:21

TimeFromMark just returns an integer. Do your math on that, then use IntToStr() in your string.

For example:


var
mark, time: Integer;

MarkTime(mark);
//.. do some stuff
Stuff();
time = timeFromMark(mark);
WriteLn('XP per hour: ' + floattoStr(time/1000/3600));

I think that's the right maths.. :P

CephaXz

2012-05-24 10:05:19

Thanks everyone for the help. I'll try it when I get home, although I don't know what's a float lol

Abu

2012-05-24 16:43:19

From: CephaXz
Thanks everyone for the help. I'll try it when I get home, although I don't know what's a float lol


…
Definition: Float is short for floating point and is a fundamental (i.e. built into the compiler) type used to define numbers with fractional parts.
The float type can represent values ranging from approximately 1.5 × 10−45 to 3.4 × 1038 with a precision of 7 digits.