Created
July 1, 2012 20:24
-
-
Save phl0w/3029500 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.itcooker.strategies; | |
| import org.itcooker.constants.Data; | |
| import org.itcooker.functions.AbstractStrategy; | |
| import org.powerbot.game.api.methods.Walking; | |
| import org.powerbot.game.api.methods.interactive.NPCs; | |
| import org.powerbot.game.api.methods.tab.Inventory; | |
| import org.powerbot.game.api.methods.widget.Bank; | |
| import org.powerbot.game.api.util.Time; | |
| import org.powerbot.game.api.wrappers.interactive.NPC; | |
| public class OpenBank extends AbstractStrategy { | |
| private NPC banker; | |
| @Override | |
| protected boolean isValid() { | |
| return Data.guiDone && Inventory.getCount(Data.food) == 0 && !Bank.isOpen(); | |
| } | |
| @Override | |
| protected void process() { | |
| Data.isCooking = false; | |
| switch (Data.loc) { | |
| case COOKING_GUILD: | |
| Bank.open(); | |
| break; | |
| case ROGUES_DEN: | |
| if (banker == null) { | |
| banker = NPCs.getNearest(14707); | |
| } else if (banker != null && banker.isOnScreen() && !Bank.isOpen()) { | |
| if (banker.interact("Bank")) { | |
| Time.sleep(900); | |
| } | |
| } else { | |
| Walking.walk(banker); | |
| } | |
| break; | |
| case AL_KHARID: | |
| Walking.walk(Data.loc.getWalkToBankTile()); | |
| // TODO | |
| break; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment