Boosted Posted December 22, 2017 Posted December 22, 2017 (edited) This is a script I made to get the 53 Thieving requirement for Desert Treasure. It was made for personal use so it's not very dynamic but it's stable so I thought others might find it helpful. I also included the source for people who want to learn or change anything. - Supports lobsters. - Eats at less than 4 HP. Progress picture Download http://www.filedropper.com/boostedthiever Code Spoiler package scripts; import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; @ScriptManifest(author = "Boosted", info = "Master Farmer Thiever", logo = "", name = "Boosted Thiever", version = 1) public class MasterFarmer extends Script { /* * Fields */ private long startTime; public static final Area THIEVING_AREA = new Area(3087, 3245, 3074, 3257); public static final Area BANKING_AREA = new Area(3097, 3240, 3092, 3245); /* * Store starting time. * Start tracking Thieving experience. */ @Override public void onStart() throws InterruptedException { startTime = System.currentTimeMillis(); getExperienceTracker().start(Skill.THIEVING); } /* * Main loop. */ @Override public int onLoop() throws InterruptedException { if (!getInventory().isFull() && getInventory().contains("Lobster")) { if (getSkills().getDynamic(Skill.HITPOINTS) > 3) { pickpocket(); } else { eat(); } } else { bank(); } return random(350, 750); } /* * Display runtime. * Display experience gained. */ @Override public void onPaint(Graphics2D g) { long runTime = System.currentTimeMillis() - startTime; g.setColor(Color.WHITE); g.setFont(new Font("Arial", Font.BOLD, 18)); g.drawString("Boosted Thiever", 15, 255); g.setFont(new Font("Arial", Font.BOLD, 16)); g.drawString("Running: " + displayTime(runTime), 15, 290); g.drawString("EXP Gained: " + getExperienceTracker().getGainedXP(Skill.THIEVING), 15, 325); } /* * Pickpocketing method. */ public void pickpocket() { NPC farmer = getNpcs().closest("Master Farmer"); if (farmer != null) { farmer.interact("Pickpocket"); try { sleep(random(125, 250)); } catch (InterruptedException e) { e.printStackTrace(); } new ConditionalSleep(random(4500, 7500)) { @Override public boolean condition() throws InterruptedException { return myPlayer().getHeight() < 200; } }.sleep(); } else { getWalking().webWalk(THIEVING_AREA.getRandomPosition()); } } /* * Banking method. */ public void bank() { RS2Object bank = getObjects().closest("Bank booth"); if (bank != null && bank.hasAction("Bank")) { if (getBank().isOpen()) { if (getInventory().isFull()) { getBank().depositAll(); try { sleep(random(350, 750)); } catch (InterruptedException e) { e.printStackTrace(); } new ConditionalSleep(random(3500, 6500)) { @Override public boolean condition() throws InterruptedException { return !getInventory().isFull(); } }.sleep(); } else { getBank().depositAll(); try { sleep(random(350, 750)); } catch (InterruptedException e) { e.printStackTrace(); } new ConditionalSleep(random(3500, 6500)) { @Override public boolean condition() throws InterruptedException { return getInventory().isEmpty(); } }.sleep(); getBank().withdraw("Lobster", 6); try { sleep(random(350, 750)); } catch (InterruptedException e) { e.printStackTrace(); } new ConditionalSleep(random(3500, 6500)) { @Override public boolean condition() throws InterruptedException { return getInventory().contains("Lobster"); } }.sleep(); } } else { bank.interact("Bank"); try { sleep(random(350, 750)); } catch (InterruptedException e) { e.printStackTrace(); } new ConditionalSleep(random(3500, 6500)) { @Override public boolean condition() throws InterruptedException { return getBank().isOpen(); } }.sleep(); } } else { getWalking().webWalk(BANKING_AREA.getRandomPosition()); } } /* * Eating method. */ public void eat() { getInventory().getItem("Lobster").interact("Eat"); try { sleep(random(550, 900)); } catch (InterruptedException e) { e.printStackTrace(); } new ConditionalSleep(random(3500, 6500)) { @Override public boolean condition() throws InterruptedException { return getSkills().getDynamic(Skill.HITPOINTS) > 3; } }.sleep(); } /* * Format runtime in hh:mm:ss format. */ public final String displayTime(final long ms) { long s = ms / 1000, m = s / 60, h = m / 60; s %= 60; m %= 60; h %= 24; return String.format("%02d:%02d:%02d", h, m, s); } } Edited December 22, 2017 by Boosted
spectre007 Posted January 1, 2018 Posted January 1, 2018 can someone confirm if it is working flawles atm ?
scriptersteve Posted January 23, 2018 Posted January 23, 2018 On 1/4/2018 at 10:53 PM, spectre007 said: download link not available please help just compile the code into a .jar
spectre007 Posted January 23, 2018 Posted January 23, 2018 3 hours ago, scriptersteve said: just compile the code into a .jar how
scriptersteve Posted January 23, 2018 Posted January 23, 2018 3 hours ago, spectre007 said: how https://www.youtube.com/watch?v=Prqcu5jH9AQ&feature=youtu.be