Jump to content

Srry, u can delete this


Recommended Posts

Posted
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 {
  ...
}
Posted
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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