11package sections ;
22
3- import org .osbot .rs07 .api .filter .NameFilter ;
4- import org .osbot .rs07 .api .filter .PositionFilter ;
53import org .osbot .rs07 .api .map .Position ;
64import org .osbot .rs07 .api .model .Entity ;
75import org .osbot .rs07 .api .model .GroundDecoration ;
@@ -72,9 +70,9 @@ public final void onLoop() throws InterruptedException {
7270 break ;
7371 case 120 :
7472 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 );
7876 }
7977 } else {
8078 getWalking ().walkPath (PATH_TO_GATE );
@@ -86,15 +84,15 @@ public final void onLoop() throws InterruptedException {
8684 private void chopTree () {
8785 Entity tree = getObjects ().closest ("Tree" );
8886 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 );
9088 }
9189 }
9290
9391 private void fish () {
9492 NPC fishingSpot = getNpcs ().closest ("Fishing spot" );
9593 if (fishingSpot != null && fishingSpot .interact ("Net" )) {
9694 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 );
9896 }
9997 }
10098
@@ -109,7 +107,7 @@ private void lightFire() {
109107 getInventory ().getItem ("Tinderbox" ).interact ("Use" );
110108 } else if (getInventory ().getItem ("Logs" ).interact ()) {
111109 Position playerPos = myPosition ();
112- Sleep .sleepUntil (() -> !myPosition ().equals (playerPos ), 10_000 );
110+ Sleep .sleepUntil (() -> !myPosition ().equals (playerPos ), 10_000 , 500 );
113111 }
114112 }
115113
@@ -121,7 +119,7 @@ private Optional<Position> getEmptyPosition() {
121119 List <Position > allPositions = myPlayer ().getArea (10 ).getPositions ();
122120
123121 // 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 ()) {
125123 if (object instanceof GroundDecoration ) {
126124 continue ;
127125 }
@@ -140,7 +138,7 @@ private void cook() {
140138 RS2Object fire = getObjects ().closest ("Fire" );
141139 if (fire != null && fire .interact ("Use" )) {
142140 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 );
144142 }
145143 }
146144 }
0 commit comments