Jump to content

Srry, u can delete this


serenada

Recommended Posts

12 hours ago, serenada said:

Hi, i have a problem with script for switching combat style. 

Im using this(attrDif means +3)

if((def + attrDif) <= atk || (def + attrDif) <= str) {
setDef();
}
sleep(1500);
if((atk + attrDif) <= str || (atk + attrDif) <= def) {
setAtk();
}
sleep(1500);
if((str + attrDif) <= atk || (str + attrDif) <= def) {
setStr();

 

Can anyone see something wrong in this because, for example ..My bot was like 5 def 15 Str 15Atk and was choosing combat style for Str instead of Def. 

Thanks 

 

 

So logically you have this:

if(8 <= 15) // true - setDef()

if(18 <= 15 OR 18 <= 5) // false - don't execute

if(18 <= 15 OR 18 <= 5) // false - don't execute

It looks fine but using if-else might be useful.

if(..){

}else if(...){

else {
  ...
}
Link to comment
Share on other sites

2 hours ago, dreameo said:

So logically you have this:

if(8 <= 15) // true - setDef()

if(18 <= 15 OR 18 <= 5) // false - don't execute

if(18 <= 15 OR 18 <= 5) // false - don't execute

It looks fine but using if-else might be useful.


if(..){

}else if(...){

else {
  ...
}

Hmm, sounds good, ill give it chance, thanks

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.
Note: Your post will require moderator approval before it will be visible.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...