dreameo Posted June 4, 2019 Posted June 4, 2019 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 { ... }
serenada Posted June 4, 2019 Author Posted June 4, 2019 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