Dab in a Lab Posted March 9, 2019 Share Posted March 9, 2019 Every time it attacks a seagull and its leveling Attack, it clicks on Attack exp style. Doesn't do it for Strength or Defense. Can't seem to notice why When training Attack, the logger will read : Training Attack # Can attack seagull Attacking seagull Spoiler private void fightingSeagulls() throws InterruptedException { if (!portSarim.contains(myPlayer())) { getWalking().webWalk(seagulls); } switchSword(); seagullEXP(); if (!myPlayer().isUnderAttack() && myPlayer().isAttackable()) { log("Can attack seagull"); NPC seagull = getNpcs().closest("Seagull"); if (seagull != null && !seagull.isUnderAttack() && seagull.isAttackable() && !seagull.isHitBarVisible()) seagull.interact("Attack"); log("Attacking seagull"); switch (getConfigs().get(173)) { case 0: getWidgets().interact(160, 22, "Toggle Run"); break; } if (getCombat().isFighting()) { new ConditionalSleep(300000, 10000) { @Override public boolean condition() throws InterruptedException { return !getCombat().isFighting(); } }.sleep(); } } } private void seagullEXP() { switch (getConfigs().get(43)) { case 0: if (getSkills().getDynamic(Skill.STRENGTH) < 5) { getTabs().open(Tab.ATTACK); getWidgets().interact(593, 8, 4, "Slash"); log("Training strength 1"); } else if (((getSkills().getDynamic(Skill.ATTACK) >= 5) && getSkills().getDynamic(Skill.ATTACK) < 10) && getSkills().getDynamic(Skill.STRENGTH) < 10) { getTabs().open(Tab.ATTACK); getWidgets().interact(593, 8, 4, "Slash"); log("Training strength 2"); } else if (((getSkills().getDynamic(Skill.ATTACK) >= 10) && getSkills().getDynamic(Skill.ATTACK) < 15) && getSkills().getDynamic(Skill.STRENGTH) < 15) { getTabs().open(Tab.ATTACK); getWidgets().interact(593, 8, 4, "Slash"); log("Training strength 3"); } else if (((getSkills().getDynamic(Skill.ATTACK) >= 15) && getSkills().getDynamic(Skill.ATTACK) < 20) && getSkills().getDynamic(Skill.STRENGTH) < 20) { getTabs().open(Tab.ATTACK); getWidgets().interact(593, 8, 4, "Slash"); log("Training strength 4"); } else if (((getSkills().getDynamic(Skill.ATTACK) >= 20) && getSkills().getDynamic(Skill.ATTACK) < 25) && getSkills().getDynamic(Skill.STRENGTH) < 25) { getTabs().open(Tab.ATTACK); getWidgets().interact(593, 8, 4, "Slash"); log("Training strength 5"); } else if (((getSkills().getDynamic(Skill.ATTACK) >= 25) && getSkills().getDynamic(Skill.ATTACK) < 30) && getSkills().getDynamic(Skill.STRENGTH) < 30) { getTabs().open(Tab.ATTACK); getWidgets().interact(593, 8, 4, "Slash"); log("Training strength 6"); } else if (((getSkills().getDynamic(Skill.ATTACK) >= 30) && getSkills().getDynamic(Skill.ATTACK) < 35) && getSkills().getDynamic(Skill.STRENGTH) < 35) { getTabs().open(Tab.ATTACK); getWidgets().interact(593, 8, 4, "Slash"); log("Training strength 7"); } else if (((getSkills().getDynamic(Skill.ATTACK) >= 35) && getSkills().getDynamic(Skill.ATTACK) < 40) && getSkills().getDynamic(Skill.STRENGTH) < 40) { getTabs().open(Tab.ATTACK); getWidgets().interact(593, 8, 4, "Slash"); log("Training strength 8"); } else if ((getSkills().getDynamic(Skill.ATTACK) >= 40) && (getSkills().getDynamic(Skill.STRENGTH) >= 40)) { getWidgets().interact(593, 16, 4, "Block"); log("Training defence"); } case 1: if ((getSkills().getDynamic(Skill.STRENGTH) >= 5) && (getSkills().getDynamic(Skill.ATTACK) < 5)) { getTabs().open(Tab.ATTACK); getWidgets().interact(593, 4, 4, "Chop"); log("Training Attack 1"); } else if ((getSkills().getDynamic(Skill.STRENGTH) >= 10) && (getSkills().getDynamic(Skill.ATTACK) < 10)) { getTabs().open(Tab.ATTACK); getWidgets().interact(593, 4, 4, "Chop"); log("Training Attack 2"); } else if ((getSkills().getDynamic(Skill.STRENGTH) >= 15) && (getSkills().getDynamic(Skill.ATTACK) < 15)) { getTabs().open(Tab.ATTACK); getWidgets().interact(593, 4, 4, "Chop"); log("Training Attack 3"); } else if ((getSkills().getDynamic(Skill.STRENGTH) >= 20) && (getSkills().getDynamic(Skill.ATTACK) < 20)) { getTabs().open(Tab.ATTACK); getWidgets().interact(593, 4, 4, "Chop"); log("Training Attack 4"); } else if ((getSkills().getDynamic(Skill.STRENGTH) >= 25) && (getSkills().getDynamic(Skill.ATTACK) < 25)) { getTabs().open(Tab.ATTACK); getWidgets().interact(593, 4, 4, "Chop"); log("Training Attack 5"); } else if ((getSkills().getDynamic(Skill.STRENGTH) >= 30) && (getSkills().getDynamic(Skill.ATTACK) < 30)) { getTabs().open(Tab.ATTACK); getWidgets().interact(593, 4, 4, "Chop"); log("Training Attack 6"); } else if ((getSkills().getDynamic(Skill.STRENGTH) >= 35) && (getSkills().getDynamic(Skill.ATTACK) < 35)) { getTabs().open(Tab.ATTACK); getWidgets().interact(593, 4, 4, "Chop"); log("Training Attack 7"); } else if ((getSkills().getDynamic(Skill.STRENGTH) >= 40) && (getSkills().getDynamic(Skill.ATTACK) < 40)) { getTabs().open(Tab.ATTACK); getWidgets().interact(593, 4, 4, "Chop"); log("Training Attack 6"); } else if ((getSkills().getDynamic(Skill.ATTACK) >= 40) && (getSkills().getDynamic(Skill.STRENGTH) >= 40)) { getWidgets().interact(593, 16, 4, "Block"); log("Training defence "); } } } Quote Link to comment Share on other sites More sharing options...
HunterRS Posted March 9, 2019 Share Posted March 9, 2019 (edited) Don't use hard coded widgets. 16 minutes ago, Apaec said: I'm sure you can find the reason by putting log statements around the code and seeing where it gets to. However this problem could easily be avoided and debugged a lot quicker by making your code more general. Edited March 9, 2019 by HunterRS Quote Link to comment Share on other sites More sharing options...
Apaec Posted March 9, 2019 Share Posted March 9, 2019 I'm sure you can find the reason by putting log statements around the code and seeing where it gets to. However this problem could easily be avoided and debugged a lot quicker by making your code more general. 4 Quote Link to comment Share on other sites More sharing options...