diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index 8a5b6f256e..9288e06563 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -41,7 +41,7 @@ nogit false false - 2.0.53 + 2.0.54 nogit diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/example/ExampleScript.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/example/ExampleScript.java index 679a4dfc04..2de6c7670f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/example/ExampleScript.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/example/ExampleScript.java @@ -38,11 +38,16 @@ public class ExampleScript extends Script { * Main entry point for the performance test script. */ public boolean run() { - var boatPathFollower = new BoatPathFollower(PortPaths.PORT_SARIM_PANDEMONIUM.getFullPath(true)); + //var boatPathFollower = new BoatPathFollower(PortPaths.PORT_SARIM_PANDEMONIUM.getFullPath(true)); mainScheduledFuture = scheduledExecutorService.scheduleWithFixedDelay(() -> { try { if (!Microbot.isLoggedIn()) return; + WorldPoint worldPoint = WorldPoint.fromRegion(Microbot.getClient().getLocalPlayer().getWorldLocation().getRegionID(), + 35, + 34, + Microbot.getClient().getTopLevelWorldView().getPlane()); + Rs2Bank.openBank(); Rs2Bank.withdrawAll("coins"); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/gameobject/Rs2GameObject.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/gameobject/Rs2GameObject.java index fce1fe8019..308e0d8c0b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/gameobject/Rs2GameObject.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/gameobject/Rs2GameObject.java @@ -27,6 +27,7 @@ import java.util.*; import java.util.function.Function; import java.util.function.Predicate; +import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -527,7 +528,14 @@ public static List getAll(Predicate List getAll(Predicate predicate, int distance) { - var worldPoint = Microbot.getClientThread().invoke(Rs2Sailing::getPlayerBoatLocation); + Supplier s = Rs2Sailing::isOnBoat; + var isOnBoat = Microbot.getClientThread().invoke(s); + WorldPoint worldPoint; + if (!isOnBoat) { + worldPoint = Microbot.getClient().getLocalPlayer().getWorldLocation(); + } else { + worldPoint = Rs2Sailing.getPlayerBoatLocation(); + } return getAll(predicate, worldPoint, distance); }