From: Shay
No need, the script is coded incorrectly.
XPH := Round(XP * (3600.0 / (GetTimeRunning / 1000.0)));
Is how it should be. I know I used to do
Sec:= (1+((Getsystemtime-StartTime)/1000));
XPH := (3600*XP) / (SeC);
which gave me the negative integer error.
we should be lookin at the root issue, not just creating ways to bypass it. the second equations is mathmatically correct (as far as i can see). the picture above looks like my script, so in most of my scripts, i use:
ExpPerHour := (3600*Exp) / ((Getsystemtime-StartTime)/1000+1);
so that is:
3600*(GetXPBarTotal-StartExp)
-----------------------------------
(Getsystemtime-StartTime)/1000+1
for this to be a negative number, one side of the equation (ether numerator or denom.) would have to be a negative number. so lets look at this one by one:
3600*(GetXPBarTotal-StartExp)
StartExp := GetXPBarTotal; //called at the beginning of script
StartExp is called and set at the beginning of the script, and is never changed by a mutator method. so if you can get a positive integer off of this, then that means that this part of the equation will correctly display a positive integer. this is because i only use GetXPBarTotal, and if it works correctly in the beginning, it
should work correctly every time.
(Getsystemtime-StartTime)/1000+1
StartTime := GetSystemTime; // called at the beginning of script
once again, i never reset StartTime. It is called at the beginning of the script, and does not change. It uses GetSystemTime, and if that is correct, then it
should be correct every time. If GetSystemTime is correct, then i do not see how this equation could be a negative number.
with that said, i do not see how either part of the equation can be a negative number. only four scenarios could occur to create the error:
1. I somehow messed up on my math, if so,
please explain how as that equation looks solid to me.
2. GetSystemTime has a bug that will return a negative/small number at times.
3. GetXPBarTotal has a bug that will return a negative/small number at times.
4. numerical overflow error, so maybe use a Int64?