Skip to content
This repository was archived by the owner on Feb 9, 2022. It is now read-only.

Commit 197de7a

Browse files
NubebusterExplv
authored andcommitted
Fixed stuck at fighting section (#12)
The bots would sometimes use the wrong door and be stuck indefinitely there.
1 parent f16aabd commit 197de7a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/sections/FightingSection.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public final class FightingSection extends TutorialSection {
1313
private static final Area LADDER_AREA = new Area(3108, 9523, 3114, 9529);
1414
private static final Area INSIDE_RAT_CAGE_GATE_AREA = new Area(3107, 9517, 3110, 9520);
1515
private static final Area OUTSIDE_RAT_CAGE_GATE_AREA = new Area(3111, 9516, 3113, 9521);
16+
private static final Area WRONG_DOOR = new Area(3090, 9508, 3097, 9496);
1617

1718
private final CachedWidget VIEW_EQUIPMENT_STATS_WIDGET = new CachedWidget(new WidgetActionFilter("View equipment stats"));
1819

@@ -102,7 +103,9 @@ private boolean inRatCage() {
102103
private void enterRatCage() {
103104
if (!OUTSIDE_RAT_CAGE_GATE_AREA.contains(myPosition())) {
104105
getWalking().walk(OUTSIDE_RAT_CAGE_GATE_AREA);
105-
} else if (getObjects().closest("Gate").interact("Open")) {
106+
} else if (getObjects()
107+
.closest(ob -> ob.getName() != null && ob.getName().equals("Gate") && !WRONG_DOOR.contains(ob))
108+
.interact("Open")) {
106109
Sleep.sleepUntil(this::inRatCage, 5000, 600);
107110
}
108111
}

0 commit comments

Comments
 (0)