}
}
break;
case SOLVE:
final RSInterface solver = interfaces.get(CHEST_INTERFACE_PARENT);
if (solver.isValid()) {
if (solved()) {
if (solver.getComponent(CHEST_INTERFACE_UNLOCK).doClick()) {
return random(600, 900);
}
return 0;
}
final RSComponent container = solver.getComponent(CHEST_INTERFACE_CENTER);
final String s = solver.getComponent(32).getText();
if (s.contains("Bowl")) {
index = 0;
} else if (s.contains("Ring")) {
index = 1;
} else if (s.contains("Coin")) {
index = 2;
} else if (s.contains("Bar")) {
index = 3;
}
for (int i = 0; i < 3; i++) {
final RSComponent target = solver.getComponent(INTERFACE_SOLVE_IDS[index][i]);
final int y = target.getRelativeY();
int direction;
if (y < 50 && y > -50) {
direction = 0;
} else if (y >= 50) {
direction = 1;
} else {
direction = random(0, 2);
}
final RSComponent arrow = solver.getComponent(ARROWS[i][direction]);
while (container.isValid() && target.isValid() && arrow.isValid() &&
!container.getArea().contains(target.getCenter()) && new Timer(10000).isRunning()) {
if (arrow.doClick()) {
sleep(random(800, 1200));
}