Skip to content

Commit f24ac9e

Browse files
authored
Merge pull request #1672 from Chillibloke/feat/mushtree-and-digsite-transport
Feat/mushtree and digsite transport
2 parents d3508a0 + 75b1f16 commit f24ac9e

File tree

6 files changed

+234
-33
lines changed

6 files changed

+234
-33
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
package net.runelite.client.plugins.microbot.shortestpath;
2+
3+
import lombok.Getter;
4+
import lombok.RequiredArgsConstructor;
5+
import net.runelite.api.TileObject;
6+
import net.runelite.api.coords.WorldPoint;
7+
import net.runelite.client.plugins.microbot.util.player.Rs2Player;
8+
import net.runelite.client.plugins.microbot.util.widget.Rs2Widget;
9+
10+
import static net.runelite.client.plugins.microbot.util.Global.sleepUntil;
11+
12+
/**
13+
* Handles the Magic Mushtree (Mycelium Transportation System) on Fossil Island.
14+
* The mushtree network connects four locations:
15+
* - House on the Hill
16+
* - Verdant Valley
17+
* - Sticky Swamp
18+
* - Mushroom Meadow
19+
*/
20+
@Getter
21+
@RequiredArgsConstructor
22+
public enum MagicMushtree {
23+
HOUSE_ON_THE_HILL("House on the Hill", new WorldPoint(3764, 3879, 1)),
24+
VERDANT_VALLEY("Verdant Valley", new WorldPoint(3760, 3758, 0)),
25+
STICKY_SWAMP("Sticky Swamp", new WorldPoint(3676, 3755, 0)),
26+
MUSHROOM_MEADOW("Mushroom Meadow", new WorldPoint(3676, 3871, 0));
27+
28+
private final String destinationName;
29+
private final WorldPoint destination;
30+
31+
// Object IDs for the Magic Mushtrees
32+
public static final int MUSHTREE_HOUSE_ON_HILL = 30920;
33+
public static final int MUSHTREE_OTHER = 30924;
34+
35+
private static final int OFFSET = 10;
36+
37+
/**
38+
* Checks if the given object ID is a Magic Mushtree.
39+
*/
40+
public static boolean isMagicMushtree(int objectId) {
41+
return objectId == MUSHTREE_HOUSE_ON_HILL || objectId == MUSHTREE_OTHER;
42+
}
43+
44+
/**
45+
* Checks if the given TileObject is a Magic Mushtree.
46+
*/
47+
public static boolean isMagicMushtree(TileObject tileObject) {
48+
return tileObject != null && isMagicMushtree(tileObject.getId());
49+
}
50+
51+
/**
52+
* Handles the Magic Mushtree transport after the initial "Use" interaction.
53+
* Waits for the menu to appear, then clicks the appropriate destination.
54+
*
55+
* @param transport The transport containing the destination
56+
* @return true if the transport was handled successfully
57+
*/
58+
public static boolean handleTransport(Transport transport) {
59+
WorldPoint dest = transport.getDestination();
60+
MagicMushtree destination = getByDestination(dest);
61+
62+
if (destination == null) {
63+
return false;
64+
}
65+
66+
// Wait for the mushtree menu widget to appear
67+
if (!sleepUntil(() -> Rs2Widget.hasWidget("Mycelium"), 5000)) {
68+
return false;
69+
}
70+
71+
// Click the destination option
72+
if (!Rs2Widget.clickWidget(destination.getDestinationName())) {
73+
return false;
74+
}
75+
76+
// Wait until we arrive at destination
77+
sleepUntil(() -> Rs2Player.getWorldLocation().distanceTo(dest) < OFFSET, 10000);
78+
return true;
79+
}
80+
81+
/**
82+
* Gets the MagicMushtree enum by destination WorldPoint.
83+
*/
84+
public static MagicMushtree getByDestination(WorldPoint destination) {
85+
if (destination == null) return null;
86+
87+
for (MagicMushtree mushtree : values()) {
88+
WorldPoint dest = mushtree.getDestination();
89+
if (dest.equals(destination)) {
90+
return mushtree;
91+
}
92+
// Also match by X and Y only (ignore plane differences in destination matching)
93+
if (dest.getX() == destination.getX() && dest.getY() == destination.getY()) {
94+
return mushtree;
95+
}
96+
}
97+
return null;
98+
}
99+
}

runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/bank/enums/BankLocation.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import net.runelite.api.gameval.VarbitID;
1212
import net.runelite.client.plugins.microbot.Microbot;
1313
import net.runelite.client.plugins.microbot.util.equipment.Rs2Equipment;
14+
import net.runelite.client.plugins.microbot.util.inventory.Rs2Inventory;
1415
import net.runelite.client.plugins.microbot.util.player.Rs2Player;
1516

1617
@Getter
@@ -132,7 +133,9 @@ public boolean hasRequirements() {
132133
boolean isWearingCraftingGuild = (Rs2Equipment.isWearing("brown apron") || Rs2Equipment.isWearing("golden apron")) ||
133134
(Rs2Equipment.isWearing("max cape") || Rs2Equipment.isWearing("max hood")) ||
134135
(Rs2Equipment.isWearing("crafting cape") || Rs2Equipment.isWearing("crafting hood"));
135-
return isWearingCraftingGuild && (hasMaxedCrafting || hasFaladorHardDiary);
136+
// Also check if crafting cape is in inventory (can equip it to teleport and enter)
137+
boolean hasCraftingCapeInInventory = Rs2Inventory.contains("crafting cape") || Rs2Inventory.contains("crafting cape(t)");
138+
return (isWearingCraftingGuild || hasCraftingCapeInInventory) && (hasMaxedCrafting || hasFaladorHardDiary);
136139
case LUMBRIDGE_BASEMENT:
137140
return Rs2Player.getQuestState(Quest.RECIPE_FOR_DISASTER__ANOTHER_COOKS_QUEST) == QuestState.FINISHED;
138141
case COOKS_GUILD:

runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/poh/data/MountedDigsite.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public boolean execute() {
3535
return false;
3636
}
3737
if (pendant.getId() == objectId) {
38-
//The correct id for the object means it has the right left click option, so we can just use that.
38+
// The correct id for the object means it has the right left click option, so we can just use that.
3939
return Rs2GameObject.interact(pendant, destinationName);
4040
}
4141
Widget widget = getWidget();
@@ -49,6 +49,10 @@ public boolean execute() {
4949
return Rs2Widget.clickWidget(destinationName);
5050
}
5151

52+
private static Widget getWidget() {
53+
return Rs2Widget.getWidget(InterfaceID.MENU, 3);
54+
}
55+
5256
public static final Integer[] IDS = {ObjectID.POH_AMULET_DIGSITE, ObjectID.POH_AMULET_DIG_LITHKREN, ObjectID.POH_AMULET_DIG_FOSSIL, ObjectID.POH_AMULET_DIG_DIGSITE};
5357

5458
public static DecorativeObject getObject() {
@@ -63,10 +67,6 @@ public static boolean isMountedDigsite(DecorativeObject go) {
6367
return false;
6468
}
6569

66-
private static Widget getWidget() {
67-
return Rs2Widget.getWidget(InterfaceID.MENU, 3);
68-
}
69-
7070
@Override
7171
public String displayInfo() {
7272
return "MountedDigsite -> " + destinationName;

runelite-client/src/main/java/net/runelite/client/plugins/microbot/util/walker/Rs2Walker.java

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,9 +1605,8 @@ private static boolean handleTransports(List<WorldPoint> path, int indexOfStartP
16051605
}
16061606

16071607
if (object != null) {
1608-
System.out.println("Object Type: " + Rs2GameObject.getObjectType(object));
1609-
1610-
if (!(object instanceof GroundObject)) {
1608+
// Skip reachability check for GroundObjects and Magic Mushtrees
1609+
if (!(object instanceof GroundObject) && !MagicMushtree.isMagicMushtree(transport.getObjectId())) {
16111610
if (!Rs2Tile.isTileReachable(transport.getOrigin())) {
16121611
break;
16131612
}
@@ -1811,6 +1810,11 @@ private static boolean handleObjectExceptions(Transport transport, TileObject ti
18111810
sleepUntil(() -> Rs2Player.getWorldLocation().distanceTo2D(transport.getDestination()) < OFFSET, 10000);
18121811
return true;
18131812
}
1813+
1814+
// Handle Magic Mushtree (Fossil Island Mycelium Transportation System)
1815+
if (MagicMushtree.isMagicMushtree(tileObject)) {
1816+
return MagicMushtree.handleTransport(transport);
1817+
}
18141818
return false;
18151819
}
18161820

@@ -1925,6 +1929,18 @@ private static boolean handleInventoryTeleports(Transport transport, int itemId)
19251929

19261930
if (itemAction.equalsIgnoreCase("open") && itemId == ItemID.BOOKOFSCROLLS_CHARGED) {
19271931
return handleMasterScrollBook(destination);
1932+
} else if (isDialogueBasedTeleportItem(transport.getDisplayInfo())) {
1933+
// Multi-destination teleport items: wait for destination selection dialogue
1934+
Rs2Dialogue.sleepUntilSelectAnOption();
1935+
Rs2Dialogue.clickOption(destination);
1936+
log.info("Traveling to {} - ({})", transport.getDisplayInfo(), transport.getDestination());
1937+
return true;
1938+
} else if (transport.getDisplayInfo().toLowerCase().contains("burning amulet")) {
1939+
// Burning amulet in inventory: confirm wilderness teleport
1940+
Rs2Dialogue.sleepUntilInDialogue();
1941+
Rs2Dialogue.clickOption("Okay, teleport to level");
1942+
log.info("Traveling to {} - ({})", transport.getDisplayInfo(), transport.getDestination());
1943+
return true;
19281944
} else if (wildernessTransport) {
19291945
Rs2Dialogue.sleepUntilInDialogue();
19301946
return Rs2Dialogue.clickOption("Yes", "Okay");
@@ -1960,6 +1976,28 @@ private static boolean handleWearableTeleports(Transport transport, int itemId)
19601976
return false;
19611977
}
19621978

1979+
/**
1980+
* Checks if the teleport item requires dialogue-based destination selection.
1981+
* These are items that, when rubbed/activated, show a dialogue menu to choose destination.
1982+
*
1983+
* @param displayInfo the displayInfo from the transport
1984+
* @return true if the item requires dialogue handling
1985+
*/
1986+
private static boolean isDialogueBasedTeleportItem(String displayInfo) {
1987+
if (displayInfo == null) return false;
1988+
String lowerDisplayInfo = displayInfo.toLowerCase();
1989+
return lowerDisplayInfo.contains("slayer ring")
1990+
|| lowerDisplayInfo.contains("games necklace")
1991+
|| lowerDisplayInfo.contains("skills necklace")
1992+
|| lowerDisplayInfo.contains("ring of dueling")
1993+
|| lowerDisplayInfo.contains("ring of wealth")
1994+
|| lowerDisplayInfo.contains("amulet of glory")
1995+
|| lowerDisplayInfo.contains("combat bracelet")
1996+
|| lowerDisplayInfo.contains("digsite pendant")
1997+
|| lowerDisplayInfo.contains("necklace of passage")
1998+
|| lowerDisplayInfo.contains("giantsoul amulet");
1999+
}
2000+
19632001
/**
19642002
* Checks if the player's current location is within the specified area defined by the given world points.
19652003
*

runelite-client/src/main/resources/net/runelite/client/plugins/microbot/shortestpath/fairy_rings.tsv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,4 @@
109109
1651 3010 0 9650=1 5 AJP
110110
1359 2941 0 9650=1 5 CKQ
111111
1429 3324 0 9650=1 5 AIS
112+
2926 10455 0 5 DLP

runelite-client/src/main/resources/net/runelite/client/plugins/microbot/shortestpath/transports.tsv

Lines changed: 84 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,7 +1492,24 @@
14921492
3666 3809 0 3685 3756 0 Jump on;Rubber cap mushroom;30606
14931493
3663 3808 0 3685 3756 0 Jump on;Rubber cap mushroom;30606
14941494
3664 3808 0 3685 3756 0 Jump on;Rubber cap mushroom;30606
1495-
3665 3808 0 3685 3756 0 Jump on;Rubber cap mushroom;30606
1495+
3665 3808 0 3685 3756 0 Jump on;Rubber cap mushroom;30606
1496+
# Magic Mushtree - Fossil Island Mycelium Transportation System
1497+
# House on the Hill mushtree (ID 30920)
1498+
3764 3880 1 3760 3758 0 Use;Magic Mushtree;30920
1499+
3764 3880 1 3676 3755 0 Use;Magic Mushtree;30920
1500+
3764 3880 1 3676 3871 0 Use;Magic Mushtree;30920
1501+
# Verdant Valley mushtree (ID 30924)
1502+
3758 3756 0 3764 3879 1 Use;Magic Mushtree;30924
1503+
3758 3756 0 3676 3755 0 Use;Magic Mushtree;30924
1504+
3758 3756 0 3676 3871 0 Use;Magic Mushtree;30924
1505+
# Sticky Swamp mushtree (ID 30924)
1506+
3677 3755 0 3764 3879 1 Use;Magic Mushtree;30924
1507+
3677 3755 0 3760 3758 0 Use;Magic Mushtree;30924
1508+
3677 3755 0 3676 3871 0 Use;Magic Mushtree;30924
1509+
# Mushroom Meadow mushtree (ID 30924)
1510+
3674 3871 0 3764 3879 1 Use;Magic Mushtree;30924
1511+
3674 3871 0 3760 3758 0 Use;Magic Mushtree;30924
1512+
3674 3871 0 3676 3755 0 Use;Magic Mushtree;30924
14961513
3768 3868 1 3768 3868 0 Climb-down;Trapdoor;30725
14971514
3768 3868 0 3768 3868 1 Climb-up;Ladder;30727
14981515
3767 3868 1 3768 3868 0 Climb-down;Trapdoor;30725
@@ -1544,27 +1561,63 @@
15441561
2775 3234 1 2776 3235 0 Climb-down;Ship's ladder;9745
15451562
2808 3162 0 2808 3162 1 Climb-up;Ladder;16683 3
15461563
2808 3162 1 2808 3162 0 Climb-down;Ladder;16679 3
1547-
2744 3153 0 2713 9564 0 Pay;Dungeon entrance;20877 875 Coins
1548-
2713 9564 0 2744 3153 0 Leave;Exit;20878
1549-
2691 9564 0 2689 9564 0 Chop-down;Vines;21731 1351;1349;1361;1353;1355;1357;1359
1550-
2689 9564 0 2691 9564 0 Chop-down;Vines;21731 1351;1349;1361;1353;1355;1357;1359
1551-
2683 9568 0 2683 9570 0 Chop-down;Vines;21732 1351;1349;1361;1353;1355;1357;1359
1552-
2683 9570 0 2683 9568 0 Chop-down;Vines;21732 1351;1349;1361;1353;1355;1357;1359
1553-
2649 9591 0 2643 9595 2 Walk-up;Stairs;21722
1554-
2650 9591 0 2643 9595 2 Walk-up;Stairs;21722
1555-
2643 9595 2 2649 9591 0 Walk-down;Stairs;21724
1556-
2647 9557 0 2649 9562 0 Jump-from;Stepping Stone;21739 3
1557-
2649 9562 0 2647 9557 0 Jump-from;Stepping Stone;21738 3
1558-
2636 9517 0 2636 9510 2 Walk-up;Stairs;21725
1559-
2637 9517 0 2636 9510 2 Walk-up;Stairs;21725
1560-
2636 9510 2 2636 9517 0 Walk-down;Stairs;21726
1561-
2682 9506 0 2687 9506 0 Walk-across;Log balance;20882 3
1562-
2687 9506 0 2682 9506 0 Walk-across;Log balance;20884 3
1563-
2698 9500 0 2698 9492 0 Squeeze-through;Pipe;21727
1564-
2698 9492 0 2698 9500 0 Squeeze-through;Pipe;21727
1565-
2697 9436 0 2684 9436 0 Enter;Crevice;30198
1566-
2684 9436 0 2697 9436 0 Enter;Crevice;30198
1567-
1564+
# Main Entrance - ID 20877
1565+
# With coin requirement (875 coins for entry)
1566+
2744 3154 0 2713 9564 0 Enter;Dungeon entrance;20877 875 Coins
1567+
2744 3153 0 2713 9564 0 Enter;Dungeon entrance;20877 875 Coins
1568+
2745 3154 0 2713 9564 0 Enter;Dungeon entrance;20877 875 Coins
1569+
2743 3154 0 2713 9564 0 Enter;Dungeon entrance;20877 875 Coins
1570+
# Permanent access (after paying 1.5m one-time fee)
1571+
2744 3154 0 2713 9564 0 Enter;Dungeon entrance;20877
1572+
2744 3153 0 2713 9564 0 Enter;Dungeon entrance;20877
1573+
2745 3154 0 2713 9564 0 Enter;Dungeon entrance;20877
1574+
2743 3154 0 2713 9564 0 Enter;Dungeon entrance;20877
1575+
# Exit from inside
1576+
2713 9564 0 2744 3153 0 Leave;Exit;20878
1577+
# Vines (axe IDs: bronze, iron, steel, black, mithril, adamant, rune, dragon, 3rd age, infernal, crystal)
1578+
2689 9564 0 2691 9564 0 Chop-down;Vines;21731 1351;1349;1353;1361;1355;1357;1359;6739;20011;13241;23673;25066;28222
1579+
2691 9564 0 2689 9564 0 Chop-down;Vines;21731 1351;1349;1353;1361;1355;1357;1359;6739;20011;13241;23673;25066;28222
1580+
2683 9568 0 2683 9570 0 Chop-down;Vines;21732 1351;1349;1353;1361;1355;1357;1359;6739;20011;13241;23673;25066;28222
1581+
2683 9570 0 2683 9568 0 Chop-down;Vines;21732 1351;1349;1353;1361;1355;1357;1359;6739;20011;13241;23673;25066;28222
1582+
2674 9499 0 2672 9499 0 Chop-down;Vines;21733 1351;1349;1353;1361;1355;1357;1359;6739;20011;13241;23673;25066;28222
1583+
2672 9499 0 2674 9499 0 Chop-down;Vines;21733 1351;1349;1353;1361;1355;1357;1359;6739;20011;13241;23673;25066;28222
1584+
2676 9479 0 2674 9479 0 Chop-down;Vines;21734 1351;1349;1353;1361;1355;1357;1359;6739;20011;13241;23673;25066;28222
1585+
2674 9479 0 2676 9479 0 Chop-down;Vines;21734 1351;1349;1353;1361;1355;1357;1359;6739;20011;13241;23673;25066;28222
1586+
2693 9482 0 2695 9482 0 Chop-down;Vines;21735 1351;1349;1353;1361;1355;1357;1359;6739;20011;13241;23673;25066;28222
1587+
2695 9482 0 2693 9482 0 Chop-down;Vines;21735 1351;1349;1353;1361;1355;1357;1359;6739;20011;13241;23673;25066;28222
1588+
# 87 Agility Vine Shortcut
1589+
2673 9583 0 2670 9583 2 Climb;Vine;26880
1590+
2670 9583 2 2673 9583 0 Climb;Vine;26882
1591+
# Stairs
1592+
2649 9591 0 2643 9595 2 Walk-up;Stairs;21722
1593+
2643 9595 2 2649 9591 0 Walk-down;Stairs;21724
1594+
2636 9517 0 2636 9510 2 Walk-up;Stairs;21725
1595+
2636 9510 2 2636 9517 0 Walk-down;Stairs;21726
1596+
# Stepping Stones
1597+
2647 9557 0 2649 9562 0 Jump-from;Stepping stone;21739
1598+
2649 9562 0 2647 9557 0 Jump-from;Stepping stone;21738
1599+
2695 9533 0 2697 9525 0 Cross;Stepping stone;19040
1600+
2697 9525 0 2695 9533 0 Cross;Stepping stone;19040
1601+
2690 9547 0 2682 9548 0 Cross;Stepping stone;19040
1602+
2682 9548 0 2690 9547 0 Cross;Stepping stone;19040
1603+
# Log Balance
1604+
2682 9506 0 2687 9506 0 Walk-across;Log balance;20882
1605+
2687 9506 0 2682 9506 0 Walk-across;Log balance;20884
1606+
# Pipes
1607+
2698 9500 0 2698 9492 0 Squeeze-through;Pipe;21727
1608+
2698 9492 0 2698 9500 0 Squeeze-through;Pipe;21727
1609+
2655 9573 0 2655 9566 0 Squeeze-through;Pipe;21728
1610+
2655 9566 0 2655 9573 0 Squeeze-through;Pipe;21728
1611+
# Crevice
1612+
2684 9436 0 2697 9436 0 Enter;Crevice;30198
1613+
2697 9436 0 2684 9436 0 Enter;Crevice;30198
1614+
# Brimhaven Dungeon - CKR Fairy Ring Alternate Entrance
1615+
2761 3062 0 2734 9478 0 Climb;Rope;66
1616+
2761 3063 0 2734 9478 0 Climb;Rope;66
1617+
2760 3064 0 2734 9478 0 Climb;Rope;66
1618+
2760 3061 0 2734 9478 0 Climb;Rope;66
1619+
2734 9478 0 2760 3061 0 Use;Crevice;30201
1620+
15681621
# Karamja Volcano
15691622
2855 3169 0 2855 9569 0 Climb-down;Rocks;11441
15701623
2855 9569 0 2856 3167 0 Climb;Climbing rope;18969
@@ -3971,7 +4024,11 @@
39714024
2621 3690 0 2472 3994 0 Travel;Fremennik Boat;37432 2
39724025
2598 3608 0 2596 3608 0 Cross;Broken bridge;4616 2
39734026
2596 3608 0 2598 3608 0 Cross;Broken bridge;4615 2
3974-
4027+
4028+
# Waterbirth Island
4029+
2523 3740 0 2442 10146 0 Enter;Cave entrance;8929
4030+
2442 10146 0 2523 3740 0 Climb;Steps;8966
4031+
39754032
# Isle of Stone
39764033
2465 4010 0 2461 10417 0 Enter;Cave;37433
39774034
2461 10417 0 2465 4010 0 Exit;Steps;37411
@@ -5195,4 +5252,7 @@
51955252
2763 2952 1 2763 2951 0 Climb-down;Ladder;16679
51965253
# woodcutting guild
51975254
1574 3483 1 1575 3483 0 Climb-down;Rope ladder;28858
5198-
1575 3483 0 1574 3483 1 Climb-up;Rope ladder;28857
5255+
1575 3483 0 1574 3483 1 Climb-up;Rope ladder;28857
5256+
#Grimstone Dungeon
5257+
2902 10454 0 2902 10456 0 Climb;Uneven stone ledges;60120
5258+
2902 10456 0 2902 10454 0 Climb;Uneven stone ledges;60120

0 commit comments

Comments
 (0)