Global Moderators MansNoThot Posted January 17, 2021 Global Moderators Share Posted January 17, 2021 import com.epicbot.api.shared.APIContext; import com.epicbot.api.shared.GameType; import com.epicbot.api.shared.entity.Player; 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.util.List; import java.awt.*; @ScriptManifest(name = "Thieving test", gameType = GameType.OS) public class mTeas extends LoopScript { private int stage = 0, teas = 0, startEXP, startingLevel; private SceneObject start; private long startTime; private Player localPlayer; private Area bankArea = new Area(3257, 3419, 3250, 3422); private Tile stallTile = new Tile(3268,3410,0); private SceneObject stall; private int getGainedLevels() { return getAPIContext().skills().thieving().getCurrentLevel() - startingLevel; } @Override protected void onPaint(Graphics2D g, APIContext ctx){ PaintFrame pf = new PaintFrame(); pf.setTitle("mTeaStealer"); pf.addLine("Runtime: ", Time.getFormattedRuntime(startTime)); pf.addLine("Theiving level: ", getAPIContext().skills().thieving().getCurrentLevel() + " (+" + (getGainedLevels()) + ")"); pf.draw(g, 0, 90, ctx); } private void walkToStall() { stallTile = new Tile(3268,3410,0); localPlayer = getAPIContext().localPlayer().get(); if (bankArea.contains(localPlayer) || stallTile != (localPlayer.getLocation())&& getAPIContext().inventory().isEmpty()) { getAPIContext().webWalking().walkTo(stallTile); } } private void bank() { localPlayer = getAPIContext().localPlayer().get(); getAPIContext().webWalking().walkTo(RSBank.VARROCK_EAST.getTile()); if (bankArea.contains(localPlayer)) { if (!getAPIContext().bank().isOpen()) { getAPIContext().bank().open(); Time.sleep(3000, () -> getAPIContext().bank().isOpen()); } } if ( getAPIContext().bank().isOpen()) { getAPIContext().bank().depositInventory(); } if (getAPIContext().bank().isOpen() && !getAPIContext().inventory().contains("Cup of tea")) { getAPIContext().bank().close(); } if (!getAPIContext().bank().isOpen() && getAPIContext().inventory().isEmpty()) { walkToStall(); } } private SceneObject getStall() { return getAPIContext().objects().query().nameMatches("Tea stall").visible().results().nearest(); } @Override protected int loop() { if (!getAPIContext().client().isLoggedIn()) { return 500; } if(getAPIContext().inventory().isFull()) { bank(); Time.sleep(3000,() -> getAPIContext().inventory().isEmpty()); }else { if (stallTile != getAPIContext().localPlayer().getLocation()) { walkToStall(); } stall = getStall(); if (stall != null && stall.interact("Steal-from")) { Time.sleep(9000, () -> getAPIContext().objects().query().actions("Steal-from").results().isEmpty()); Time.sleep(9000, () -> !getAPIContext().objects().query().actions("Steal-from").results().isEmpty()); } if(!stallTile.equals(getAPIContext().localPlayer().getLocation())) { getAPIContext().webWalking().walkTo(stallTile); } } return 1000; } @Override public boolean onStart(String... strings) { startingLevel = getAPIContext().skills().thieving().getCurrentLevel(); startTime = System.currentTimeMillis(); return true; } } Enjoy! Lmk If you have any problems 🙂 2 Quote Link to comment Share on other sites More sharing options...
Sellout Posted January 17, 2021 Share Posted January 17, 2021 huge PP 1 Quote Link to comment Share on other sites More sharing options...
Pseudo Posted January 18, 2021 Share Posted January 18, 2021 Nice one my man! 1 Quote Link to comment Share on other sites More sharing options...
Mint Posted January 21, 2021 Share Posted January 21, 2021 You rock, thanks for sharing 🙂 1 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.