Rabrg 83 Posted May 11, 2016 import org.dreambot.api.Client; import org.dreambot.api.methods.MethodContext; import org.dreambot.api.methods.MethodProvider; import org.dreambot.api.methods.map.Tile; import org.dreambot.api.methods.tabs.Tab; import org.dreambot.api.wrappers.widgets.WidgetChild; public final class MinigameTeleport { public enum Minigame { BARBARIAN_ASSAULT("Barbarian Assault"), BLAST_FURNACE("Blast Furnace"), BURTHORPE_GAMES_ROOM("Burhorpe Games Room"), CASTLE_WARS("Castle Wars"), CLAN_WARS("Clan Wars"), DAGGANNOTH_KINGS("Dagannoth Kings"), FISHING_TRAWLER("Fishing Trawler"), GOD_WARS("God Wars"), NIGHTMARE_ZONE("Nightmare Zone"), PEST_CONTROL("Pest Control"), PLAYER_OWNED_HOUSES("Player Owned Houses"), RAT_PITS("Rat Pits"), SHADES_OF_MORTTON("Shades of Mort'ton"), SHIELD_OF_ARRAV("Shield of Arrav"); private final String text; Minigame(final String text) { this.text = text; } private String getText() { return text; } } public static boolean teleport(final Minigame minigame) { final MethodContext ctx = Client.getClient().getMethodContext(); final WidgetChild selectedWidget = ctx.getWidgets().getChildWidget(76, 11); final WidgetChild teleport = ctx.getWidgets().getChildWidget(76, 31); final Tile initialTile = ctx.getLocalPlayer().getTile(); if ((ctx.getTabs().isOpen(Tab.QUEST) || ctx.getTabs().open(Tab.QUEST)) && (selectedWidget.getText().equals(minigame.getText()) || selectedWidget.interact() && ctx.getWidgets().getWidgetChildrenContainingText(minigame.getText()).get(0).interact()) && teleport.interact()) MethodProvider.sleepUntil(() -> !initialTile.equals(ctx.getLocalPlayer().getTile()), 20000); return !initialTile.equals(ctx.getLocalPlayer().getTile()); } }
Mad 86 Posted May 11, 2016 wat if ((ctx.getTabs().isOpen(Tab.QUEST) || ctx.getTabs().open(Tab.QUEST)) && (selectedWidget.getText().equals(minigame.getText()) || selectedWidget.interact() && ctx.getWidgets().getWidgetChildrenContainingText(minigame.getText()).get(0).interact()) && teleport.interact()) MethodProvider.sleepUntil(() -> !initialTile.equals(ctx.getLocalPlayer().getTile()), 20000); return !initialTile.equals(ctx.getLocalPlayer().getTile()); } }
Mad 86 Posted May 11, 2016 why didnt u just put the method inside the enum class, it doesnt need to be wrapped with MinigameTeleport, then u dont need to pass in a param
Recommended Posts
Archived
This topic is now archived and is closed to further replies.