Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@lordgmage
Created September 7, 2015 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lordgmage/0eb7e91563e82cbab268 to your computer and use it in GitHub Desktop.
Save lordgmage/0eb7e91563e82cbab268 to your computer and use it in GitHub Desktop.
just sits at bank clicking tile
package strategy;
import data.Constants;
import org.dreambot.api.methods.MethodProvider;
import org.dreambot.api.methods.map.Tile;
import org.dreambot.api.script.AbstractScript;
import org.dreambot.api.utilities.impl.Condition;
/**
* Created by George on 07/09/2015.
*/
public class BankingStrategy extends Strategy {
public BankingStrategy(AbstractScript script) {
super(script);
}
Tile finalDestination = new Tile(3510, 3478, 0);
Tile ghoulDestination = new Tile(3415, 3510, 0);
@Override
public boolean validate() {
return script.getLocalPlayer().getAnimation() == -1;
}
@Override
public void run() {
MethodProvider.log("Banking");
MethodProvider.sleep(750);
script.getWalking().walk(finalDestination);
MethodProvider.sleepUntil(new Condition() {
@Override
public boolean verify() {
return script.getWalking().walkExact(finalDestination);
}
}, 1000);
script.getBank().getClosestBankLocation();
script.getBank().open();
MethodProvider.sleepUntil(new Condition() {
@Override
public boolean verify() {
return script.getBank().isOpen();
}
}, 2000);
script.getBank().withdrawAll(Constants.TUNA_ID);
MethodProvider.sleepUntil(new Condition() {
@Override
public boolean verify() {
return script.getInventory().isFull();
}
}, 1000);
script.getBank().close();
MethodProvider.sleepUntil(new Condition() {
@Override
public boolean verify() {
return !script.getBank().isOpen();
}
}, 1000);
if (script.getInventory().isFull()){
if (!script.getWalking().isRunEnabled()){
script.getWalking().toggleRun();
}
script.getWalking().walk(ghoulDestination);
MethodProvider.sleepWhile(new Condition() {
@Override
public boolean verify() {
return script.getLocalPlayer().getAnimation() == -1;
}
},2000);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment