Jump to content

ashgg83

Members
  • Posts

    4
  • Joined

  • Last visited

  • Days Won

    4

Other groups

Beta Tester

Recent Profile Visitors

762 profile views

ashgg83's Achievements

Bronze Member

Bronze Member (1/10)

  1. This bot will mine Tin & Copper in Rimmington then navigate to Falador smelter, create bronze bars, bank. Start script with empty inventory and desired pickaxe in equipment slot, only start the script in either Rimmington or Falador East Bank. import com.epicbot.api.shared.APIContext; import com.epicbot.api.shared.GameType; import com.epicbot.api.shared.entity.SceneObject; import com.epicbot.api.shared.entity.WidgetGroup; 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 javax.imageio.ImageIO; import java.awt.*; import java.awt.image.BufferedImage; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; @ScriptManifest(name = "Private Miner & Smither", gameType = GameType.OS) public class main extends LoopScript { private Area BANK_AREA = new Area(new Tile(3008, 3359, 0), new Tile(3019, 3352, 0)); private Area TIN_AREA = new Area(new Tile(2983, 3238, 0), new Tile(2987, 3234, 0)); private Area COPPER_AREA = new Area(new Tile(2975, 3248, 0), new Tile(2980, 3244, 0)); private Area FURNACE_AREA = new Area(new Tile(2969, 3371, 0), new Tile(2978, 3367, 0)); private long startTime; private int counter = 0; @Override public boolean onStart(String... strings) { startTime = System.currentTimeMillis(); return true; } @Override protected int loop() { WidgetGroup LevelUpInterface = getAPIContext().widgets().get(233); if (LevelUpInterface.isVisible()) { levelup(); } else { if (getAPIContext().inventory().getCount("Uncut sapphire", "Uncut emerald", "Uncut ruby", "Uncut diamond", "Clue geode (beginner)") > 0) { drop(); } else if (getAPIContext().inventory().getCount("Bronze bar") == 14) { bank(); } else if (FURNACE_AREA.contains(getAPIContext().localPlayer().getLocation())) { smelt(); } else if (getAPIContext().inventory().getCount("Tin ore") == 14 && (getAPIContext().inventory().getCount("Copper ore") == 14)) { smelt(); } else if (getAPIContext().inventory().getCount("Tin ore") != 14) { mine_tin(); } else if (getAPIContext().inventory().getCount("Copper ore") != 14) { mine_copper(); } } return 100; } private boolean isActioning() { return getAPIContext().localPlayer().isAnimating() || getAPIContext().localPlayer().isMoving(); } private void bank() { if (!BANK_AREA.contains(getAPIContext().localPlayer().getLocation())) { getAPIContext().webWalking().walkTo(RSBank.FALADOR_EAST.getTile()); } else { if (BANK_AREA.contains(getAPIContext().localPlayer().getLocation())) { if (!getAPIContext().bank().isOpen()) { getAPIContext().bank().open(); Time.sleep(1_000, () -> getAPIContext().bank().isOpen()); }else if (getAPIContext().bank().isOpen()) { getAPIContext().bank().depositInventory(); counter = counter + 14; Time.sleep(1_000, () -> !getAPIContext().bank().isOpen()); } } } } private void mine_tin() { final SceneObject Rocks = getAPIContext().objects().query().id(11361, 11360).results().nearest(); if (!TIN_AREA.contains(getAPIContext().localPlayer().getLocation())) { getAPIContext().webWalking().walkTo(TIN_AREA.getCentralTile()); } else if (!isActioning()) { if (Rocks != null) { Rocks.interact("Mine"); Time.sleep(2_000, () -> getAPIContext().localPlayer().isAnimating()); } } } private void mine_copper() { final SceneObject Rocks = getAPIContext().objects().query().id(11161, 10943).results().nearest(); if (!COPPER_AREA.contains(getAPIContext().localPlayer().getLocation())) { getAPIContext().webWalking().walkTo(COPPER_AREA.getCentralTile()); } else if (!isActioning()) { if (Rocks != null) { Rocks.interact("Mine"); Time.sleep(2_000, () -> getAPIContext().localPlayer().isAnimating()); } } } private void smelt() { final SceneObject FURNACE = getAPIContext().objects().query().nameContains("Furnace").results().nearest(); WidgetGroup SmeltInterface = getAPIContext().widgets().get(270); if (!FURNACE_AREA.contains(getAPIContext().localPlayer().getLocation())) { getAPIContext().webWalking().walkTo(FURNACE_AREA.getCentralTile()); } else if (isActioning()) { Time.sleep(2_000, () -> !getAPIContext().localPlayer().isAnimating()); Time.sleep(2_000, () -> getAPIContext().localPlayer().isAnimating() && getAPIContext().inventory().getCount("Bronze bar") != 14); } else if (SmeltInterface.isVisible()) { getAPIContext().keyboard().sendKey(49); Time.sleep(2_000, () -> getAPIContext().localPlayer().isAnimating()); } else if (FURNACE != null) { FURNACE.interact("Smelt"); Time.sleep(1000,2000); } } private void levelup() { WidgetGroup LevelUpInterface = getAPIContext().widgets().get(233); Time.sleep(500, 1000); if (LevelUpInterface.isVisible()) { getAPIContext().keyboard().sendKey(32); } } private void drop() { if (getAPIContext().inventory().getCount("Uncut sapphire") > 0) { getAPIContext().inventory().dropAll("Uncut sapphire"); }else if (getAPIContext().inventory().getCount("Uncut emerald") > 0) { getAPIContext().inventory().dropAll("Uncut emerald"); }else if (getAPIContext().inventory().getCount("Uncut ruby") > 0) { getAPIContext().inventory().dropAll("Uncut ruby"); }else if (getAPIContext().inventory().getCount("Uncut diamond") > 0) { getAPIContext().inventory().dropAll("Uncut diamond"); }else if (getAPIContext().inventory().getCount("Clue geode (beginner)") > 0) { getAPIContext().inventory().dropAll("Clue geode (beginner)"); Time.sleep(500,1000); } } //define image to display on screen private BufferedImage image = downloadImage("https://i.imgur.com/6rfxOOp.jpg"); @Override protected void onPaint(Graphics2D g, APIContext ctx){ PaintFrame pf = new PaintFrame(); g.drawImage(image, 0, getAPIContext().game().getViewportHeight() - -5, null); pf.addLine("Private Miner/Smither",""); pf.addLine("",""); pf.addLine("Runtime: ", Time.getFormattedRuntime(startTime)); pf.addLine("",""); pf.addLine("Mining Level: ", getAPIContext().skills().mining().getCurrentLevel()); pf.addLine("",""); pf.addLine("Smithing Level: ", getAPIContext().skills().smithing().getCurrentLevel()); pf.addLine("",""); pf.addLine("Bronze Bars: ", counter); pf.addLine("",""); pf.addLine("",""); pf.addLine("",""); pf.addLine("",""); pf.draw(g, 195, 339, ctx); } //download the image to display on screen public BufferedImage downloadImage(String url) { try { HttpURLConnection conn; conn = (HttpURLConnection)(new URL(url.replaceAll(" ", "%20")).openConnection()); conn.setInstanceFollowRedirects(false); conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8"); conn.setRequestProperty("Accept", "ttext/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"); conn.setRequestProperty("Accept-Language", "en-us,en;q=0.5"); conn.setRequestProperty("Accept-Encoding", "gzip, deflate"); conn.setRequestProperty("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"); conn.setRequestProperty("Keep-Alive", "300"); conn.setRequestProperty("Connection", "keep-alive"); conn.setRequestMethod("GET"); return ImageIO.read(conn.getInputStream()); } catch(IOException e1) { return null; } } }
  2. This was originally a tin miner, lol.
  3. 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(); } }
×
×
  • Create New...