diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ff71a327e0..e4e4ddeac7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,9 +27,9 @@ jobs: uses: "marvinpinto/action-automatic-releases@latest" with: repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "1.5.6" + automatic_release_tag: "1.5.7" prerelease: false - title: "Release 1.5.6" + title: "Release 1.5.7" files: | /home/runner/work/microbot/microbot/runelite-client/target/microbot-*.jar diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index a2a6f7e6c6..fb59d2dbb3 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -41,7 +41,7 @@ nogit false false - 1.5.6 + 1.5.7 diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/Microbot.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/Microbot.java index a16511878f..3758c649ea 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/Microbot.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/Microbot.java @@ -294,10 +294,12 @@ public static void drag(Rectangle start, Rectangle end) { } public static void click(Rectangle rectangle, NewMenuEntry entry) { - - Point point = Rs2UiHelper.getClickingPoint(rectangle, true); - mouse.click(point, entry); - + if (entry.getType() == MenuAction.WALK) { + mouse.click(new Point(entry.getParam0(), entry.getParam1()), entry); + } else { + Point point = Rs2UiHelper.getClickingPoint(rectangle, true); + mouse.click(point, entry); + } if (!Microbot.getClient().isClientThread()) { sleep(50, 100); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/menu/NewMenuEntry.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/menu/NewMenuEntry.java index a5d906b5a7..5e0899f771 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/menu/NewMenuEntry.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/menu/NewMenuEntry.java @@ -21,8 +21,8 @@ public class NewMenuEntry implements MenuEntry { private Widget widget; public NewMenuEntry(int param0, int param1, int opcode, int identifier, int itemId, String target) { - this.option = "Use"; - this.target = target; + this.option = target; + this.target = ""; this.identifier = identifier; this.type = MenuAction.of(opcode); this.param0 = param0; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/Rs2Walker.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/Rs2Walker.java index b55d882a6a..ea22356069 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/Rs2Walker.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/Rs2Walker.java @@ -316,19 +316,19 @@ public static void walkFastCanvas(WorldPoint worldPoint) { public static void walkFastCanvas(WorldPoint worldPoint, boolean toogleRun) { Rs2Player.toggleRunEnergy(toogleRun); Point canv; - if (Microbot.getClient().isInInstancedRegion()) { - worldPoint = WorldPoint.toLocalInstance(Microbot.getClient(), worldPoint).stream().findFirst().get(); - LocalPoint localPoint = LocalPoint.fromWorld(Microbot.getClient(), worldPoint); + if (Microbot.getClient().getTopLevelWorldView().isInstance()) { + worldPoint = WorldPoint.toLocalInstance(Microbot.getClient().getTopLevelWorldView(), worldPoint).stream().findFirst().get(); + LocalPoint localPoint = LocalPoint.fromWorld(Microbot.getClient().getTopLevelWorldView(), worldPoint); canv = Perspective.localToCanvas(Microbot.getClient(), localPoint, Microbot.getClient().getPlane()); } else { - canv = Perspective.localToCanvas(Microbot.getClient(), LocalPoint.fromScene(worldPoint.getX() - Microbot.getClient().getBaseX(), worldPoint.getY() - Microbot.getClient().getBaseY(), Microbot.getClient().getTopLevelWorldView().getScene()), Microbot.getClient().getPlane()); + LocalPoint localPoint = LocalPoint.fromScene(worldPoint.getX() - Microbot.getClient().getTopLevelWorldView().getBaseX(), worldPoint.getY() - Microbot.getClient().getTopLevelWorldView().getBaseY()); + canv = Perspective.localToCanvas(Microbot.getClient(), localPoint, Microbot.getClient().getTopLevelWorldView().getPlane()); } int canvasX = canv != null ? canv.getX() : -1; int canvasY = canv != null ? canv.getY() : -1; - Microbot.doInvoke(new NewMenuEntry(canvasX, canvasY, MenuAction.WALK.getId(), 0, -1, "Walk here"), new Rectangle(1, 1, Microbot.getClient().getCanvasWidth(), Microbot.getClient().getCanvasHeight())); - //Rs2Reflection.invokeMenu(canvasX, canvasY, MenuAction.WALK.getId(), 0, -1, "Walk here", "", -1, -1); + Microbot.doInvoke(new NewMenuEntry(canvasX, canvasY, MenuAction.WALK.getId(), 0, 0, "Walk here"), new Rectangle(canvasX, canvasY, Microbot.getClient().getCanvasWidth(), Microbot.getClient().getCanvasHeight())); } public static WorldPoint walkCanvas(WorldPoint worldPoint) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/vorkath/VorkathScript.java b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/vorkath/VorkathScript.java index 159b22c5b1..0851a4b2c1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/microbot/vorkath/VorkathScript.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/microbot/vorkath/VorkathScript.java @@ -576,6 +576,21 @@ private void handleAcidWalk() { WorldPoint safeTile = findSafeTile(); WorldPoint playerLocation = Microbot.getClient().getLocalPlayer().getWorldLocation(); + if (safeTile != null) { + if (playerLocation.equals(safeTile)) { + Rs2Npc.interact(vorkath, "attack"); + } else { + Rs2Player.eatAt(75); + Rs2Walker.walkFastLocal(LocalPoint.fromWorld(Microbot.getClient(), safeTile)); + } + } + } + //Only use this for testing purpose on sleeping vorkath + private void testWooxWalk() { + vorkath = Rs2Npc.getNpc(NpcID.VORKATH_8059); + WorldPoint safeTile = findSafeTile(); + WorldPoint playerLocation = Microbot.getClient().getLocalPlayer().getWorldLocation(); + if (safeTile != null) { if (playerLocation.equals(safeTile)) { Rs2Npc.interact(vorkath, "attack");