SRL Archive - OSR Help

Negative Exp Rates?


Sk1nyNerd

2014-02-07 17:04:40

OSR

when i run my script for a long time for some reason one of the exp per hours will result in a negative number as seen below and make its way back 0? what would be the cause of this and any tips on how to fix it?

second time it has occured in the last few days when running long hours

[ATTACH=CONFIG]22892[/ATTACH]

The Mayor

2014-02-07 18:11:41

From: Sk1nyNerd
OSR

when i run my script for a long time for some reason one of the exp per hours will result in a negative number as seen below and make its way back 0? what would be the cause of this and any tips on how to fix it?

second time it has occured in the last few days when running long hours

[ATTACH=CONFIG]22892[/ATTACH]


It's the formula you used to calculate your XP per hour. Post it here so I can see.

Sk1nyNerd

2014-02-07 18:19:11

From: The Mayor
It's the formula you used to calculate your XP per hour. Post it here so I can see.


when ever the prog is over 12 hours one goes negative (i havent seen it switch to negative but at 11 hours they were positive, check back few hours later negative). before it was the WCxph that was negative

i dont see what could be wrong with the math

  WCxph := Round((WCxp*3600) / (GetTimeRunning/1000));
LogsCutph := Round((LogsCut*3600) / (GetTimeRunning/1000));
FMxph := Round((FMxp*3600) / (GetTimeRunning/1000));
LogsBurnedph := Round((LogsBurned*3600) / (GetTimeRunning/1000));

The Mayor

2014-02-07 18:21:25

From: Sk1nyNerd
when ever the prog is over 12 hours one goes negative (i havent seen it switch to negative but at 11 hours they were positive, check back few hours later negative). before it was the WCxph that was negative

i dont see what could be wrong with the math

  WCxph := Round((WCxp*3600) / (GetTimeRunning/1000));
LogsCutph := Round((LogsCut*3600) / (GetTimeRunning/1000));
FMxph := Round((FMxp*3600) / (GetTimeRunning/1000));
LogsBurnedph := Round((LogsBurned*3600) / (GetTimeRunning/1000));


Use this:


WCxph := Round((WCxp * 60) / (getTimeRunning() / 60000));
LogsCutph := Round((LogsCut * 60) / (getTimeRunning() / 60000));
FMxph := Round((FMxp * 60) / (getTimeRunning() / 60000));
LogsBurnedph := Round((LogsBurned * 60) / (getTimeRunning() / 60000));

Sk1nyNerd

2014-02-07 18:29:04

From: The Mayor
Use this:


WCxph := Round((WCxp * 60) / (getTimeRunning() / 60000));
LogsCutph := Round((LogsCut * 60) / (getTimeRunning() / 60000));
FMxph := Round((FMxp * 60) / (getTimeRunning() / 60000));
LogsBurnedph := Round((LogsBurned * 60) / (getTimeRunning() / 60000));


alright, i see how that could work. ill let you know in a few days ha

thanks

Sk1nyNerd

2014-02-09 21:15:10

From: The Mayor
Use this:


WCxph := Round((WCxp * 60) / (getTimeRunning() / 60000));
LogsCutph := Round((LogsCut * 60) / (getTimeRunning() / 60000));
FMxph := Round((FMxp * 60) / (getTimeRunning() / 60000));
LogsBurnedph := Round((LogsBurned * 60) / (getTimeRunning() / 60000));


gives me a cant divide by zero error when it comes to using it. i had that happen before but i dont remember how i fixed it

Flight

2014-02-09 21:28:02

From: Sk1nyNerd
gives me a cant divide by zero error when it comes to using it. i had that happen before but i dont remember how i fixed it


I believe that's because when you called your report your getTimeRunning() was still 0. I think…

Olly

2014-02-09 21:32:45

max(1, getTimeRunning()) :D

Flight

2014-02-09 21:36:34

From: Olly
max(1, getTimeRunning()) :D


You make me feel dumb sometimes, you know that?

Olly

2014-02-09 21:56:17

From: Flight
You make me feel dumb sometimes, you know that?


Noes! It's the other way around!

Sjoe

2014-02-09 22:19:03

declare your vars as Int64; instead of Integer;