From 20eb7eb170e23aaf3a35f7f04c7fb66bb47f1cca Mon Sep 17 00:00:00 2001 From: chsami Date: Mon, 24 Nov 2025 20:02:13 +0100 Subject: [PATCH 1/2] refactor(sailing): improve world point retrieval based on boat status --- .../client/plugins/microbot/example/ExampleScript.java | 7 ++++++- .../microbot/util/gameobject/Rs2GameObject.java | 10 +++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) 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); } From 5f6268befbc6199b149a00c91ccf5d53fee88e26 Mon Sep 17 00:00:00 2001 From: chsami Date: Mon, 24 Nov 2025 20:03:57 +0100 Subject: [PATCH 2/2] chore(pom): update microbot version to 2.0.54 --- runelite-client/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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