Created
September 7, 2015 18:46
-
-
Save lordgmage/0eb7e91563e82cbab268 to your computer and use it in GitHub Desktop.
just sits at bank clicking tile
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.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