Ranqers Posted December 15, 2012 Share Posted December 15, 2012 (edited) i've come up with a way to make a good guess on how long it will take to kill npcX. here's the method: [scar] const level = 99; // Skill LEVEL (range) begin repeat attackCode; Wait(650000 / level); // if level = 99 then it should wait 6565 seconds until(false); end; [/scar] problem I'm having is a type mismatch error with the "Wait(650000 / level);" off-topic: 50th post:D - - - Updated - - - Solved, thanks Scar-Divi.com! Edited December 15, 2012 by Ranqers Quote Link to comment Share on other sites More sharing options...
LordJashin Posted December 15, 2012 Share Posted December 15, 2012 Some differences. Slash will divide it without rounding it. So it can be a float value e.g. 3.323423. While as using div, will round it respectively Quote Link to comment Share on other sites More sharing options...
FHannes Posted December 15, 2012 Share Posted December 15, 2012 Keep in mind that "div" is integer division, it always rounds down. Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted December 16, 2012 Share Posted December 16, 2012 (edited) Keep in mind that "div" is integer division, it always rounds down. You can always perform a floating point division then round it up or down to suit your needs with Round() and Trunc() respectively. IntResult := Round((IntVar1 * 1.0) / IntVar2); // This would round up IntResult := Trunc((IntVar1 * 1.0) / IntVar2); // This is the same as IntVar1 div IntVar2 Edited December 16, 2012 by Bixby Sayz Quote Link to comment Share on other sites More sharing options...
FHannes Posted December 16, 2012 Share Posted December 16, 2012 Actually, "Ceil()" rounds up, "Round()" uses standard rounding rules. "Floor()" rounds down and "Trunc()" just removes the decimals. (Essentially Trunc and Floor behave the same.) Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted December 16, 2012 Share Posted December 16, 2012 You're right. My bad. I'm really rusty. Haven't done any active development work with Delphi/Pascal in 6+ yrs. Quote Link to comment Share on other sites More sharing options...