Jump to content
Ranqers

Division

Recommended Posts

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 by Ranqers
Link to comment
Share on other sites

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 by Bixby Sayz
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...