serenada Posted June 3, 2019 Share Posted June 3, 2019 (edited) Sorry Edited June 4, 2019 by serenada Quote Link to comment Share on other sites More sharing options...
dreameo Posted June 4, 2019 Share Posted June 4, 2019 On 6/3/2019 at 9:52 PM, 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 Expand 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 { ... } Quote Link to comment Share on other sites More sharing options...
serenada Posted June 4, 2019 Author Share Posted June 4, 2019 On 6/4/2019 at 10:50 AM, 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 { ... } Expand Hmm, sounds good, ill give it chance, thanks Quote Link to comment Share on other sites More sharing options...