QAZ
2012-06-06 16:28:56
anybody know how to fix this error, will save my whole proggy on script, can't figure it out. thanks
2012-06-06 16:28:56
2012-06-06 16:35:37
2012-06-06 16:36:45
2012-06-06 16:36:59
X/(Y+1)
isntead of
X/Y
2012-06-06 16:37:06
2012-06-06 16:39:26
procedure PrintProggy; // proggys
var
CookPerHour:Integer;
begin
ClearDebug;
CookPerHour := (Round((FishCooked * 3600) / (GetTimeRunning / 1000)))
writeln(' ');
writeln('~~~~~~~~~~ Al Kharid Cooker by Chris ~~~~~~~~~~');
writeln('Cooking Fish: ' + Fish2Cook + ' Cooked: ' + inttostr(FishCooked) + ',' + ' Burned: ' +
inttostr(FishBurned) + '.');
writeln(' Experience Gained: ' + inttostr(FishCooked * XpPerFish));
writeln(' Time Ran: ' + TimeRunning);
writeln(' Cooking per hour: ' + inttostr(CookPerHour));
writeln(' Experience per hour: ' + inttostr(CookPerHour*XpPerFish));
writeln(' Current Activity: ' + DoingATM);
if AddToStats then
begin
IncVars;
Stats_Commit;
end;
end; 2012-06-06 16:47:36
From: Main
Post the procedure.
Also if you have a division like X/Y try
X/(Y+1)
isntead of
X/Y
try x := y/z; except end;
2012-06-06 16:56:07
FishCooked*GetTimeRunning/3600000;
2012-06-06 17:01:42
From: Main
Lol sex, yeah forgot about that.
But erm
(Round((FishCooked * 3600) / (GetTimeRunning / 1000)))
GetTimeRunning/1000 is the amount of second you have run. Try
FishCooked*GetTimeRunning/3600000;
Example:
If FishCooked is 500 and the script have be run for half hour:
500*1800000/36000000=250 :)
No need to worry about divide by 0.