ashgg83 Posted February 28, 2021 Share Posted February 28, 2021 Basic Potato picking script, should help with simple tasks. import com.epicbot.api.shared.APIContext; import com.epicbot.api.shared.GameType; import com.epicbot.api.shared.entity.SceneObject; import com.epicbot.api.shared.model.Area; import com.epicbot.api.shared.model.Tile; import com.epicbot.api.shared.script.LoopScript; import com.epicbot.api.shared.script.ScriptManifest; import com.epicbot.api.shared.util.paint.frame.PaintFrame; import com.epicbot.api.shared.util.time.Time; import com.epicbot.api.shared.webwalking.model.RSBank; import java.awt.*; @ScriptManifest(name = "Private Potato Picker", gameType = GameType.OS) public class main extends LoopScript { private Area BANK_AREA = new Area(new Tile(3087, 3247, 0), new Tile(3098, 3239, 0)); private Area POTATO_AREA = new Area(new Tile(3137, 3291, 0), new Tile(3158, 3267, 0)); private long startTime; private int counter = 0; @Override public boolean onStart(String... strings) { startTime = System.currentTimeMillis(); return true; } @Override protected int loop() { if (getAPIContext().inventory().isFull()) { bank(); } else { mine(); } return 100; } private void bank() { if (!BANK_AREA.contains(getAPIContext().localPlayer().getLocation())) { getAPIContext().webWalking().walkTo(RSBank.DRAYNOR.getTile()); } else { if (BANK_AREA.contains(getAPIContext().localPlayer().getLocation())) { if (!getAPIContext().bank().isOpen()) { getAPIContext().bank().open(); Time.sleep(5_000, () -> getAPIContext().bank().isOpen()); } } if (getAPIContext().bank().isOpen()) { getAPIContext().bank().depositInventory(); } } } private void mine() { if (!POTATO_AREA.contains(getAPIContext().localPlayer().getLocation())) { getAPIContext().webWalking().walkTo(POTATO_AREA.getCentralTile()); } else if (!isActioning()) { final SceneObject potato = getAPIContext().objects().query().nameContains("Potato").results().nearest(); if (potato != null) { if (potato.interact("Pick")) { counter++; Time.sleep(5_000, () -> getAPIContext().localPlayer().isAnimating()); } } } } @Override protected void onPaint(Graphics2D g, APIContext ctx){ PaintFrame pf = new PaintFrame(); pf.setTitle(">>>Private Potato Picker<<< "); pf.addLine("Runtime: ", Time.getFormattedRuntime(startTime)); //pf.addLine("Mining Level: ", getAPIContext().skills().mining().getCurrentLevel()); pf.addLine("Potatoes Picked: ", counter); pf.draw(g, 0, 90, ctx); } private boolean isActioning() { return getAPIContext().localPlayer().isAnimating() || getAPIContext().localPlayer().isMoving(); } private int getGainedLevels() { return getAPIContext().skills().thieving().getCurrentLevel(); } } 2 Quote Link to comment Share on other sites More sharing options...
Koala Posted February 28, 2021 Share Posted February 28, 2021 Nice and clean! Quote Link to comment Share on other sites More sharing options...
Sellout Posted February 28, 2021 Share Posted February 28, 2021 i dint knew you could mine potatoes 😮 for the rest, nice script! Quote Link to comment Share on other sites More sharing options...
ashgg83 Posted March 1, 2021 Author Share Posted March 1, 2021 This was originally a tin miner, lol. Quote Link to comment Share on other sites More sharing options...
Global Moderators MansNoThot Posted March 17, 2021 Global Moderators Share Posted March 17, 2021 I have mined a few potatoes! Gz on release! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.