SRL Archive - OSR Help

XP/hour won work right


ogustuce

2012-04-08 22:41:06

i wonder what i did wrong? here is what it looks like in my script:


ExpHr := Round((Rcxp * 3600) / (GetSystemTime / 1000));

somewhere in my script i put


incEx(RcXp,452);

this is the lin in the proggy


writeln(' XP: ' + IntToStr(RCxp));
writeln(' XP/h: ' + IntToStr(ExpHr));

and i always get results like this (in the debug box)

XP: 5876
XP/h: 446

enyone knows why the math is wrong?

ogustuce

2012-04-08 22:47:36

if it seems confusing above, here's a better exemple of the script


...

incEx(Rcxp,452);

...

procedure Proggy;

ExpHr := Round((RcXp * 3600) / (GetSystemTime / 1000));

writeln('| XP: ' + IntToStr(RcXp));
writeln('| XP/h: ' + IntToStr(ExpHr));


Nebula

2012-04-08 22:49:01

XPH := Round((Exp * 3600) / (GetTimeRunning / 1000));

ogustuce

2012-04-08 22:51:13

???

bolshak25

2012-04-08 22:52:52

you need getsystemtime-starttime not just getsystemtime.
at the start of your script youd need starttime:=getsystemtime

ogustuce

2012-04-08 23:05:40

so the equation should be this?

ExpHr := Round((RcXp * 3600) / (GetSystemTime-StartTime / 1000));

bolshak25

2012-04-08 23:07:55

yes, and you need to declare starttime as a global variable. then at the start of the script put

Starttime := GetSystemTime;

ogustuce

2012-04-08 23:08:30

kk thnx, ill try this out

NKN

2012-04-09 07:21:00

Why not just use Starttime. Isn't that a built in procedure?

Abu

2012-04-09 09:24:38

Use GetTimeRunning - it gets the time since the script was started, that's what you want to use.