Bultenen   0 Posted August 10, 2020 Hello! 😀 I'm working on a combat script and i want to switch between Attack, Defense etc.. I currently have this: if(getSkills().getRealLevel(Skill.ATTACK) <= 10) { switchCombat(0, 593, 3, 0, "Attack"); } else if(getSkills().getRealLevel(Skill.STRENGTH) <= 10 && getSkills().getRealLevel(Skill.ATTACK) >= 10) { switchCombat(1, 593, 7, 0, "Strength"); } else if(getSkills().getRealLevel(Skill.DEFENCE) <= 10 && getSkills().getRealLevel(Skill.ATTACK) >= 10 && getSkills().getRealLevel(Skill.STRENGTH) >= 10) { switchCombat(3, 593, 15, 0, "Defense"); } But everytime this script always goes into the combat tab widget and chooses "Stab" wich is Attack, even if my attack level is over 10. So what am i doing wrong? 😅
TheCloakdOne   389 Posted August 10, 2020 Looks like your widget child ID's are incorrect (this is weapon dependant dont forget) Widget cbtWidget = ctx.getWidgets().getWidget(593); if (cbtWidget == null) { return 0; } case ATTACK: cbtWidget.getChild(4).interact(); break; case STRENGTH: cbtWidget.getChild(8).interact(); break; case DEFENCE: cbtWidget.getChild(16).interact(); break;
Bultenen   0 Author Posted August 10, 2020 4 hours ago, TheRevelo said: Does it even continue Stabbing when its 11? Yes it does 😂
Bultenen   0 Author Posted August 10, 2020 1 hour ago, TheCloakdOne said: Looks like your widget child ID's are incorrect (this is weapon dependant dont forget) Widget cbtWidget = ctx.getWidgets().getWidget(593); if (cbtWidget == null) { return 0; } case ATTACK: cbtWidget.getChild(4).interact(); break; case STRENGTH: cbtWidget.getChild(8).interact(); break; case DEFENCE: cbtWidget.getChild(16).interact(); break; OH yeah that makes sense! Will try and will most definitely work! Thank you 😊
TheRevelo   7 Posted August 10, 2020 1 minute ago, Bultenen said: Yes it does 😂 Did you try out @TheCloakdOne 's solution? Edit: Just reloaded page and saw that you already answered, nvm.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.