Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import org.osbot.rs07.api.map.Area;
- import org.osbot.rs07.api.model.RS2Object;
- import org.osbot.rs07.script.Script;
- import org.osbot.rs07.script.ScriptManifest;
- @ScriptManifest(name = "BANKERminer", author = "Obiwan", version = 1.0, info = "", logo = "")
- public class BankMiner extends Script {
- final Area BANK_AREA = new Area (3185, 3433, 3181, 3443);
- final Area MINE_AREA = new Area (3185, 3369, 3181, 3380);
- final int BANK_BOOTH = 7478;
- private enum State {
- MINE, BANK, WALK, WAIT
- };
- private State getState() {
- if (inventory.isFull())
- return State.BANK;
- if (!myPlayer().isAnimating() && !myPlayer().isMoving())
- return State.MINE;
- if (!inventory.isFull() && !MINE_AREA.contains(myPlayer()))
- return State.WALK;
- return State.WAIT;
- }
- @Override
- public void onStart() {
- //Code here will execute before the loop is started
- }
- @Override
- public void onExit() {
- //Code here will execute after the script ends
- }
- @Override
- public int onLoop() throws InterruptedException {
- switch (getState()) {
- case MINE:
- RS2Object clayRock = objects.closest("Rocks");
- {
- if (clayRock !=null)
- clayRock.interact("Mine");
- sleep(random(350,750));
- break;}
- case WALK:
- if (!MINE_AREA.contains(myPlayer()))
- getWalking().webWalk(MINE_AREA);
- case BANK:
- if (inventory.isFull()) {
- if (BANK_AREA.contains(myPlayer())){
- RS2Object booth = objects.closest(BANK_BOOTH);
- if (bank.isOpen())
- bank.depositAll();
- else {
- if (booth !=null);
- if (booth.isVisible());
- booth.interact("Bank");
- sleep(random(350,750));
- }
- }
- else getWalking().webWalk(BANK_AREA);
- break;
- }
- case WAIT:
- sleep(random(500,800));
- break;
- }
- return (random(500,800)); //The amount of time in milliseconds before the loop starts over
- }
- @Override
- public void onPaint(Graphics2D g) {
- //This is where you will put your code for paint(s)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement