1
1
package sections ;
2
2
3
- import org .osbot .rs07 .api .filter .NameFilter ;
4
- import org .osbot .rs07 .api .filter .PositionFilter ;
5
3
import org .osbot .rs07 .api .map .Position ;
6
4
import org .osbot .rs07 .api .model .Entity ;
7
5
import org .osbot .rs07 .api .model .GroundDecoration ;
@@ -72,9 +70,9 @@ public final void onLoop() throws InterruptedException {
72
70
break ;
73
71
case 120 :
74
72
RS2Object gate = getObjects ().closest ("Gate" );
75
- if (gate != null ) {
76
- if (gate .interact ("Open" )){
77
- Sleep .sleepUntil (() -> getProgress () == 130 , 5000 );
73
+ if (gate != null && gate . isVisible () ) {
74
+ if (gate .interact ("Open" )) {
75
+ Sleep .sleepUntil (() -> getProgress () == 130 , 5000 , 500 );
78
76
}
79
77
} else {
80
78
getWalking ().walkPath (PATH_TO_GATE );
@@ -86,15 +84,15 @@ public final void onLoop() throws InterruptedException {
86
84
private void chopTree () {
87
85
Entity tree = getObjects ().closest ("Tree" );
88
86
if (tree != null && tree .interact ("Chop down" )) {
89
- Sleep .sleepUntil (() -> getInventory ().contains ("Logs" ) || !tree .exists (), 10_000 );
87
+ Sleep .sleepUntil (() -> getInventory ().contains ("Logs" ) || !tree .exists (), 10_000 , 500 );
90
88
}
91
89
}
92
90
93
91
private void fish () {
94
92
NPC fishingSpot = getNpcs ().closest ("Fishing spot" );
95
93
if (fishingSpot != null && fishingSpot .interact ("Net" )) {
96
94
long rawShrimpCount = getInventory ().getAmount ("Raw shrimps" );
97
- Sleep .sleepUntil (() -> getInventory ().getAmount ("Raw shrimps" ) > rawShrimpCount , 10_000 );
95
+ Sleep .sleepUntil (() -> getInventory ().getAmount ("Raw shrimps" ) > rawShrimpCount , 10_000 , 500 );
98
96
}
99
97
}
100
98
@@ -109,7 +107,7 @@ private void lightFire() {
109
107
getInventory ().getItem ("Tinderbox" ).interact ("Use" );
110
108
} else if (getInventory ().getItem ("Logs" ).interact ()) {
111
109
Position playerPos = myPosition ();
112
- Sleep .sleepUntil (() -> !myPosition ().equals (playerPos ), 10_000 );
110
+ Sleep .sleepUntil (() -> !myPosition ().equals (playerPos ), 10_000 , 500 );
113
111
}
114
112
}
115
113
@@ -121,7 +119,7 @@ private Optional<Position> getEmptyPosition() {
121
119
List <Position > allPositions = myPlayer ().getArea (10 ).getPositions ();
122
120
123
121
// Remove any position with an object (except ground decorations, as they can be walked on)
124
- for (RS2Object object : getObjects ().getAll ()){
122
+ for (RS2Object object : getObjects ().getAll ()) {
125
123
if (object instanceof GroundDecoration ) {
126
124
continue ;
127
125
}
@@ -140,7 +138,7 @@ private void cook() {
140
138
RS2Object fire = getObjects ().closest ("Fire" );
141
139
if (fire != null && fire .interact ("Use" )) {
142
140
long rawShrimpCount = getInventory ().getAmount ("Raw shrimps" );
143
- Sleep .sleepUntil (() -> getInventory ().getAmount ("Raw shrimps" ) < rawShrimpCount , 5000 );
141
+ Sleep .sleepUntil (() -> getInventory ().getAmount ("Raw shrimps" ) < rawShrimpCount , 5000 , 500 );
144
142
}
145
143
}
146
144
}
0 commit comments