Created
September 7, 2015 21:39
-
-
Save lordgmage/f635c5b5001ec9f5ac67 to your computer and use it in GitHub Desktop.
This file contains 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 strategy; | |
import data.Constants; | |
import org.dreambot.api.methods.MethodProvider; | |
import org.dreambot.api.methods.container.impl.bank.BankType; | |
import org.dreambot.api.script.AbstractScript; | |
public class RestockingStrategy extends Strategy{ | |
public RestockingStrategy(AbstractScript script) { | |
super(script); | |
} | |
@Override | |
public boolean validate() { | |
return Constants.CANIFIS_BANK.contains(script.getLocalPlayer()) && !script.getInventory().contains(Constants.TUNA_ID); | |
} | |
@Override | |
public void run() { | |
MethodProvider.log("Restocking"); | |
script.getBank().getClosestBank(BankType.BOOTH); | |
if (!script.getBank().isOpen()) { | |
script.getBank().openClosest(); | |
MethodProvider.sleep(1000); | |
} | |
else { | |
script.getBank().withdrawAll(Constants.TUNA_ID); | |
MethodProvider.sleep(1000); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment