Renzanity
2015-05-11 01:37:14
Hi everyone,
I decided I'd update my previous scripts and then I came across this problem. The script compiles, but when it's time to initiate the pRep() procedure, it terminates the script and shows Error: Invalid floating point operation on the debug.
This code works with my other script (Lumby Jug Filler), but for some reason it won't on my Vial Filler.
vialCount is counted using DTM, vialOfWaterPrice and vialPrice are manually typed on the playerForm.
Thanks in advance for helping me if you're able to.:)
Have a good one!
I decided I'd update my previous scripts and then I came across this problem. The script compiles, but when it's time to initiate the pRep() procedure, it terminates the script and shows Error: Invalid floating point operation on the debug.
This code works with my other script (Lumby Jug Filler), but for some reason it won't on my Vial Filler.
vialCount is counted using DTM, vialOfWaterPrice and vialPrice are manually typed on the playerForm.
procedure pRep();
var
gpPerHour, tgpMade: integer;
begin
tgpMade := ((vialCount * vialOfWaterPrice) - (vialCount * vialPrice));
{gpPerHour := round((tgpMade * 60) / (ScriptTimer.getTime() / 60000));} //This line's the one that's getting the error.
//When I use getTimeRunning() for it, it works fine,
clearDebug; //But when I use ScriptTimer.getTime(), that's when
writeLn('v4.0'); //I start to get the error
writeLn('/=======================================\');
writeLn('|======Renzanity Lumby Vial Filler======|');
writeLn('|=======================================|');
writeLn(PadR('| Time Ran: ' + msToTime(ScriptTimer.getTime(), TIME_SHORT), 40) + '|');
writeLn(PadR('| No. of breaks taken: ' + intToStr(BreaksTaken), 40) + '|');
writeLn(PadR('| Vials filled: ' + intToStr(vialCount) + ' pcs', 40) + '|');
writeLn(PadR('| Batches done: ' + intToStr(vialBatch) + ' batches', 40) + '|');
writeLn(PadR('| Estimated Total Profit: ' + intToStr(tgpMade) + ' gp', 40) + '|');
writeLn(PadR('| Estimated profit/hr: ' + intToStr(gpPerHour) + ' gp', 40) + '|');
writeLn('\=======================================/');
Thanks in advance for helping me if you're able to.:)
Have a good one!