Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package nopackageweb;
- import impsoft.bots.reflection.NPC;
- import impsoft.bots.reflection.PhysicalObject;
- import impsoft.scripting.ibot.aryanweb.AryanLine;
- import impsoft.scripting.ibot.aryanweb.AryanLineBase;
- import impsoft.scripting.ibot.aryanweb.AryanLineOneWay;
- import impsoft.scripting.ibot.aryanweb.AryanWebChanged;
- import impsoft.scripting.ibot.aryanweb.AryanWebReCalc;
- import impsoft.scripting.ibot.aryanweb.CachedInformation;
- import impsoft.scripting.ibot.aryanweb.ItemRequirement;
- import impsoft.scripting.ibot.enums.Quest;
- import impsoft.scripting.ibot.itemrec.ItemCondition;
- import impsoft.scripting.ibot.itemrec.ItemNameExact;
- import impsoft.scripting.ibot.structs.AryanTile;
- import impsoft.scripting.types.ColorSkeltonScriptable;
- import impsoft.utils.uber.UberClickOptions;
- import impsoft.utils.uber.UberNPCOptions;
- import impsoft.utils.uber.UberPhysicalObjectOptions;
- import impsoft.utils.uber.UberScriptUtils;
- import java.util.EnumSet;
- import java.util.regex.Pattern;
- public class WorldMapOlafDungeon {
- public static AryanLineBase[] getMap() {
- AryanTile DIG_TILE_ENTER = new AryanTile(2749, 3733, 0, "DIG_TILE_ENTER");
- AryanTile DIG_TILE_EXIT = new AryanTile(2697, 10121, 0, "DIG_TILE_EXIT");
- AryanTile BOULDER_TILE = new AryanTile(2693, 10123, 0, "BOULDER_TILE");
- AryanTile EXIT_TILE = new AryanTile(2692, 10124, 0, "EXIT_TILE");
- AryanTile OLAF_TILE = new AryanTile(2724, 3722, 0, "OLAF_TILE");
- return new AryanLineBase[] {
- new AryanLine(new AryanTile(2744, 3719, 0), DIG_TILE_ENTER), /* Fairy ring to DIG_TILE */
- new AryanLineOneWay(DIG_TILE_ENTER, DIG_TILE_EXIT) {
- @Override
- public boolean doActionForAToB(ColorSkeltonScriptable cs) throws InterruptedException, AryanWebReCalc, AryanWebChanged {
- cs.theTabs.Inventory.setSelected();
- cs.log("Using spade.");
- return cs.theTabs.Inventory.doAction("Spade", "Dig", 1, true) != 0;
- }
- @Override
- public boolean hasActionFromAToB() {
- return true;
- }
- ItemCondition item = new ItemNameExact("Spade");
- ItemRequirement req[] = new ItemRequirement[] { new ItemRequirement(item, 1) };
- public ItemRequirement[] getItemRequirementsFromAToB() {
- return req;
- }
- @Override
- public boolean hasBankRequirementFromAToB(ColorSkeltonScriptable cs, CachedInformation c) {
- return !c.hasItemInInventory(item);
- }
- @Override
- public boolean doBankActionRequiredForAToBAction(ColorSkeltonScriptable cs) throws InterruptedException {
- return cs.theBank.doWithDraw1(item, false);
- }
- public int getDistanceFromAToB(ColorSkeltonScriptable cs, CachedInformation info) throws InterruptedException {
- if (cs.theTabs.Quest.isFinishedWithQuest(Quest.OlafsQuest)) {
- return super.getDistanceFromAToB(cs, info);
- }
- return -1;
- }
- },
- // Cave lines
- new AryanLine(DIG_TILE_EXIT, new AryanTile(2734, 10122, 0)),
- new AryanLine(new AryanTile(2734, 10122, 0),new AryanTile(2735, 10128, 0)),
- new AryanLine(new AryanTile(2735, 10128, 0), new AryanTile(2730, 10129, 0)),
- new AryanLine(new AryanTile(2730, 10129, 0), new AryanTile(2730, 10132, 0)),
- new AryanLine(new AryanTile(2730, 10132, 0), new AryanTile(2704, 10134, 0)),
- new AryanLine(new AryanTile(2730, 10132, 0), new AryanTile(2737, 10134, 0)),
- new AryanLine(new AryanTile(2737, 10134, 0), new AryanTile(2735, 10139, 0)),
- new AryanLine(new AryanTile(2735, 10139, 0), new AryanTile(2707, 10147, 0)),
- // Cave lines
- new AryanLine(DIG_TILE_EXIT, BOULDER_TILE),
- new AryanLine(BOULDER_TILE, EXIT_TILE),
- new AryanLineOneWay(EXIT_TILE, OLAF_TILE) {
- @Override
- public boolean doActionForAToB(ColorSkeltonScriptable cs) throws InterruptedException, AryanWebReCalc, AryanWebChanged {
- cs.log("Attempting boulder");
- NPC[] boulders = UberScriptUtils.findNPC(cs, new int[] { 3708 }, null, null, null, null, null, null, cs.getLocation(), EnumSet.of(UberNPCOptions.RETURN_ONE_MATCH,
- UberNPCOptions.RESTART_IF_REFLECTION_CAN_REACH_CHANGES, UberNPCOptions.SORT_BY_REAL_COST_25_TILES_OTHERWISE_LINEAR_TO_MYPLAYER));
- if(boulders.length > 0) {
- NPC boulder = boulders[0];
- UberScriptUtils.clickWorldObject(cs, boulder, Pattern.compile(".*" + boulder.getName() + ".*", Pattern.CASE_INSENSITIVE), Pattern.compile(".*" + "Roll" + ".*", Pattern.CASE_INSENSITIVE), EnumSet
- .of(UberClickOptions.CLEAR_ANY_ITEM_SELECTION, UberClickOptions.WALK_GAME_ONLY, UberClickOptions.USE_MENU, UberClickOptions.LEFT_CLICK_ON_VALID_TOPTEXT));
- cs.sleep(2500);
- }
- PhysicalObject[] exits = UberScriptUtils.findPhysicalObject(cs, new int[][] { { 23158 } }, null, null, null, null, cs.getLocation(), EnumSet.of(UberPhysicalObjectOptions.TYPE_ANY,
- UberPhysicalObjectOptions.RETURN_ONE_MATCH, UberPhysicalObjectOptions.RESTART_IF_REFLECTION_CAN_REACH_CHANGES,
- UberPhysicalObjectOptions.SORT_BY_REAL_COST_25_TILES_OTHERWISE_LINEAR_TO_MYPLAYER));
- if(exits.length > 0) {
- PhysicalObject exit = exits[0];
- UberScriptUtils.clickWorldObject(cs, exit, Pattern.compile(".*" + "Cave" + ".*", Pattern.CASE_INSENSITIVE), Pattern.compile(".*" + "Exit" + ".*", Pattern.CASE_INSENSITIVE), EnumSet
- .of(UberClickOptions.CLEAR_ANY_ITEM_SELECTION, UberClickOptions.WALK_GAME_ONLY, UberClickOptions.USE_MENU, UberClickOptions.LEFT_CLICK_ON_VALID_TOPTEXT));
- cs.sleep(100);
- return true;
- }
- return true;
- }
- @Override
- public boolean hasActionFromAToB() {
- return true;
- }
- @Override
- public boolean hasBankRequirementFromAToB(ColorSkeltonScriptable cs, CachedInformation c) {
- return false;
- }
- public int getDistanceFromAToB(ColorSkeltonScriptable cs, CachedInformation info) throws InterruptedException {
- if (cs.theTabs.Quest.isFinishedWithQuest(Quest.OlafsQuest)) {
- return super.getDistanceFromAToB(cs, info);
- }
- return -1;
- }
- }
- };
- /*
- new AryanLineOneWayObject(EXIT_TILE, OLAF_TILE, new int[] { 23158, 18, -60, 26, 30, 0, 167, 1, 1, 0 }, "Exit"),
- */
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement