Looks good, but may I suggest making it a more 'universal' method? I've edited slightly on here so there may be a few errors etc, but this gives you an idea. This way instead of editing the method everytime to edit it to your combat style, you can just select which style you want. You could even make an AttackStyle enum for readability, rather than using ints.
public boolean switchCombatStyle(int combatStyle) {
int style = getConfigs().get(43);
if (combatStyle == style) {
return true;
}
switch (combatStyle) {
case 0:
RS2Widget attButton = getWidgets().get(593, 3);
if (attButton != null && getTabs().open(Tab.ATTACK)) {
if (attButton.interact()) {
// sleep until style equals desired.
}
}
break;
case 1:
RS2Widget strButton = getWidgets().get(593, 7);
etc
break;
case 2:
break;
case 3:
RS2Widget defButton = getWidgets().get(593, 15);
etc
break;
}
return combatStyle == getConfgs().get(43);
}