View Full Version : Error: divide by Zero at line 322
anybody know how to fix this error, will save my whole proggy on script, can't figure it out. thanks
DRose
06-06-2012, 08:35 PM
Think you change the player integer to 0 if you have 1 in the script
Think you could post line 322?
Post the procedure.
Also if you have a division like X/Y try
X/(Y+1)
isntead of
X/Y
YoHoJo
06-06-2012, 08:37 PM
Post entire script/procedure.
ok, btw this isn't my script i'm fixing up somebodys cooker script with permission but any here it is
procedure:
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;
line:
CookPerHour := (Round((FishCooked * 3600) / (GetTimeRunning / 1000)))
Post the procedure.
Also if you have a division like X/Y try
X/(Y+1)
isntead of
X/Y
No, try. Literally.
try x := y/z; except end;
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.
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.
you sir, are a genius.
it worked :D
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.