format your data into enums so it's easier to manage/update
private enum Product {
ARROW_SHAFT("Logs", 270, 14, 38);
private final String log;
private final int[] widget;
Product(String log, int... widget) {
this.log = log;
this.widget = widget;
}
}
private RS2Widget getWidget(Product product) {
return getWidgets().get(product.widget[0], product.widget[1], product.widget[2]);
}
then you can simplify that ugly if else method a bit
int level = skills.getDynamic(Skill.FLETCHING);
if (level >= 70) {
} else if (level >= 55) {
} else if (level >= 50) {
} else if (level >= 40) {
} else if (level >= 35) {
} else if (level >= 25) {
} else if (level >= 10) {
} else {
return ARROW_SHAFT;
}
do yourself a favor and simplify those nasty ConditionalSleeps
public boolean sleep(int ms, BooleanSupplier supplier) {
return new ConditionalSleep(ms) {
@Override
public boolean condition() throws InterruptedException {
return supplier.getAsBoolean();
}
}.sleep();
}
sleep(5000, () -> bank.isOpen());