Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • ikespiv

    Members
    • Posts

      5
    • Joined

    • Last visited

    ikespiv's Achievements

    1. woops, forgot to change limpwurt root in the bank case lol
    2. Hello! I think I'm really close to getting this script to work, but it keeps getting stuck on "HOP". This is my first script that uses world hopping so I'm a little lost. Sometimes it'll hop once and that's it. Also I tried making it wait for a couple conditions before using up run energy, but didn't seem to work. Oops, forgot to change limpwurt root to runite ore in the bank case lol. edit: I think fixed it! Just had to the world definition in the onloop import org.dreambot.api.Client; import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.container.impl.Inventory; import org.dreambot.api.methods.container.impl.bank.Bank; import org.dreambot.api.methods.container.impl.bank.BankLocation; import org.dreambot.api.methods.interactive.GameObjects; import org.dreambot.api.methods.interactive.Players; import org.dreambot.api.methods.map.Tile; import org.dreambot.api.methods.walking.impl.Walking; import org.dreambot.api.methods.world.World; import org.dreambot.api.methods.world.Worlds; import org.dreambot.api.methods.worldhopper.WorldHopper; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.utilities.Sleep; import org.dreambot.api.wrappers.interactive.GameObject; import java.awt.*; @ScriptManifest(name = "F2P runite miner", author = "ike", description = "Mines Runite in Wildy", version = 1, category = Category.MINING) public class runite extends AbstractScript { World world = Worlds.getRandomWorld(w -> w.isF2P() && w.getMinimumLevel() == 0); private final Tile runeTile = new Tile(3057, 3883, 0); private final Tile safeTile = new Tile(3069, 3880, 0); private boolean isMining() { return Players.getLocal().isAnimating(); } public boolean playersNearby() { return Players.all(player -> player != null && !Players.getLocal().equals(player) && player.distance() < 40).size() > 0; } private enum State { MINE, HOP, BANK, RUN } private State getState() { GameObject rock = GameObjects.closest("Runite rocks"); if (Inventory.isFull()) { return State.BANK; } if (Players.getLocal().isInCombat()) { return State.RUN; } if ((playersNearby() && runeTile.getArea(30).contains(Players.getLocal())) || (runeTile.getArea(30).contains(Players.getLocal()) && !runeTile.getArea(30).contains(rock))) { return State.HOP; } else { return State.MINE; } } private State state = null; @Override public int onLoop() { if (!Client.isLoggedIn()) { return 600; } if (!Walking.isRunEnabled() && Walking.getRunEnergy() > Calculations.random(30, 70) && Inventory.isFull() && runeTile.getArea(40).contains(Players.getLocal())) { Walking.toggleRun(); } GameObject rock = GameObjects.closest("Runite rocks"); state = getState(); switch (state) { case MINE: if(playersNearby()){ state = State.HOP; } if (!runeTile.getArea(3).contains(Players.getLocal())) { Walking.walk(runeTile); } else if (runeTile.getArea(3).contains(Players.getLocal()) && runeTile.getArea(3).contains(rock)) { rock.interact("Mine"); Sleep.sleepUntil(this::isMining, 3000); Sleep.sleepUntil(() -> playersNearby() || !Players.getLocal().isAnimating(), 7000); } return Calculations.random(500, 1000); case BANK: if (Bank.isOpen() && Inventory.contains("Limpwurt root")) { Bank.depositAll("Limpwurt root"); sleep(1000); Bank.withdraw(373, 10); sleep(1000); Bank.close(); } else if (BankLocation.FEROX_ENCLAVE.getArea(2).contains(Players.getLocal())) { Bank.open(); Sleep.sleepUntil(Bank::isOpen, 2000); } else while (!BankLocation.FEROX_ENCLAVE.getArea(2).contains(Players.getLocal())) { Walking.walk(BankLocation.FEROX_ENCLAVE.getCenter()); Sleep.sleepUntil(() -> BankLocation.FEROX_ENCLAVE.getArea(2).contains(Players.getLocal()), 5000); } break; case RUN: if (playersNearby()) { Walking.walk(BankLocation.FEROX_ENCLAVE.getCenter()); Sleep.sleepUntil(() -> BankLocation.FEROX_ENCLAVE.getArea(2).contains(Players.getLocal()) || !playersNearby(), 5000); state = State.HOP; } else { Walking.walk(safeTile); } break; case HOP: if (!runeTile.getArea(30).contains(rock)) { WorldHopper.hopWorld(world); } } return Calculations.random(1000,2000); } public void onPaint(Graphics g) { g.setColor(Color.WHITE); g.setFont(new Font("Arial", Font.BOLD, 11)); if (state != null) g.drawString("State: " + state, 25, 95); } }
    3. @Diggington Hell yeah, this is great. Thanks for your help!
    4. Hey, thanks for the response, I'm a big fan of your cow killer script! It would probably help if i just made a basic firemaking script seperately, but I have been seeing a lot of scripts with packages containing multiple files that work together too. Not sure exactly how that works since I'm a noob, but would love to find out if you know what I'm talking about. Other than that, the main issue was that it would get stuck trying to make fire when standing on top of an already lit fire. Now I've deleted the MOVE state and just used this for the FIREMAKING state, and it walks to a random tile in my area, but immediately goes to light a fire while running around. So it stops randomly in it's path and scatters fires about. Looks like this: (also i tried adding !PLAYER.isMoving() to the animating condition but doesn't seem to be working, since it's still deciding to light fire in the middle of running around. if(GameObjects.getTopObjectOnTile(playerTile) != null) { Walking.walk(GE.getRandomTile()); sleepUntil(animatingCondition, 60000L, 1000L); Inventory.get("Tinderbox").useOn(logsName); sleep(1000); sleepUntil(animatingCondition, 60000L, 1000L); sleep(2000); I'm also wondering, does isReadyToCollect only work if the transaction went through while you're logged in? And does it have to be open for getOpenSlots to work? My BANK state sort of works, but I want to add more functionality incase there's no order already placed to buy more items.
    5. Tried to make a script that combines alching, chopping and burning wood, but can't figure out how to do firemaking right. Also I need to add automatic price checking/adjusting for buying new items to alch. I'm very new to scripting, so sorry if this is stupid lol public static final Area GE = new Area(3162, 3487, 3167, 3485); private final Timer t = new Timer(); private final Player PLAYER = Players.getLocal(); Tile playerTile = Players.getLocal().getTile(); String treeName = "Tree"; String logsName = "Logs"; Condition animatingCondition = () -> !PLAYER.isAnimating(); public enum State { WOODCUTTING, FIREMAKING, BANK, ALCH, RETURN, MOVE } private State getState() { if (Inventory.contains(logsName) && (GameObjects.getTopObjectOnTile(playerTile) != null)) { return State.MOVE; } if(Inventory.contains(logsName) && (GameObjects.getTopObjectOnTile(playerTile) == null)) { return State.FIREMAKING; } else if (Inventory.contains("Green d'hide body") || Inventory.contains("Adamant platebody") && Inventory.contains("Nature rune")) { return State.ALCH; } else if (GrandExchange.isReadyToCollect() && !GE.contains(Players.getLocal())) { return State.RETURN; } else if (GrandExchange.isReadyToCollect() && GE.contains(Players.getLocal())) { return State.BANK; } else { return State.WOODCUTTING; } } private State state = null; @Override public int onLoop() { if (!Client.isLoggedIn()) { return 600; } if (!Walking.isRunEnabled() && Walking.getRunEnergy() > Calculations.random(30, 70)) { Walking.toggleRun(); } state = getState(); switch (state) { case RETURN: { Walking.walk(GE.getRandomTile()); } break; case WOODCUTTING: if (PLAYER.isAnimating()) { sleepUntil(animatingCondition, 60000L, 1000L); } else while (!PLAYER.isMoving() && !PLAYER.isAnimating() && !Inventory.isFull()) { GameObject tree = GameObjects.closest(treeName); tree.interact("Chop down"); sleepUntil(animatingCondition, 60000L, 1000L); } if (Inventory.isFull()) { state = State.FIREMAKING; } break; case MOVE: int playerX = Players.getLocal().getLocalX(); int playerY = Players.getLocal().getLocalY(); Tile nextTileRight = new Tile(playerX + 1, playerY); Tile nextTileLeft = new Tile(playerX - 1, playerY); Tile nextTileTop = new Tile(playerX, playerY + 1); Tile nextTileBottom = new Tile(playerX, playerY - 1); Tile nextTileRightTop = new Tile(playerX + 1, playerY + 1); Tile nextTileRightBottom = new Tile(playerX + 1, playerY - 1); Tile nextTileLeftTop = new Tile(playerX - 1, playerY + 1); Tile nextTileLeftBottom = new Tile(playerX - 1, playerY - 1); if ((Walking.canWalk(nextTileRight)) && (GameObjects.getTopObjectOnTile(nextTileRight) == null)) { Walking.walk(nextTileRight); } else if ((Walking.canWalk(nextTileLeft)) && (GameObjects.getTopObjectOnTile(nextTileLeft) == null)) { Walking.walk(nextTileLeft); } else if ((Walking.canWalk(nextTileTop)) && (GameObjects.getTopObjectOnTile(nextTileTop) == null)) { Walking.walk(nextTileTop); } else if ((Walking.canWalk(nextTileBottom)) && (GameObjects.getTopObjectOnTile(nextTileBottom) == null)) { Walking.walk(nextTileBottom); } else if ((Walking.canWalk(nextTileRightTop)) && (GameObjects.getTopObjectOnTile(nextTileRightTop) == null)) { Walking.walk(nextTileRightTop); } else if ((Walking.canWalk(nextTileRightBottom)) && (GameObjects.getTopObjectOnTile(nextTileRightBottom) == null)) { Walking.walk(nextTileRightBottom); } else if ((Walking.canWalk(nextTileLeftTop)) && (GameObjects.getTopObjectOnTile(nextTileLeftTop) == null)) { Walking.walk(nextTileLeftTop); } else if ((Walking.canWalk(nextTileLeftBottom)) && (GameObjects.getTopObjectOnTile(nextTileLeftBottom) == null)) { Walking.walk(nextTileLeftBottom); } sleep(3000); state = State.FIREMAKING; break; case FIREMAKING: { Inventory.get("Tinderbox").useOn(logsName); sleepUntil(animatingCondition, 60000L, 3000L); } if(GameObjects.getTopObjectOnTile(playerTile) != null) state = State.MOVE; break; case BANK: if (GrandExchange.isReadyToCollect() || !Inventory.contains("Nature rune")) { GrandExchange.open(); sleep(1000); } if (GrandExchange.isOpen()) { GrandExchange.collect(); sleep(500L, 1223L); } if (!Inventory.contains("Nature rune")) { GrandExchange.buyItem("Nature rune", 1000, 93); sleep(2000); GrandExchange.confirm(); sleep(4000); } if (Inventory.contains("Nature rune") && !Inventory.contains("Green d'hide body")) { GrandExchange.buyItem("Green d'hide body", 300, 4340); sleep(2000); GrandExchange.confirm(); sleep(4000); } if (Inventory.contains("Nature rune") && !Inventory.contains("Adamant platebody")) { GrandExchange.buyItem("Adamant platebody", 300, 9550); GrandExchange.confirm(); sleep(4000); GrandExchange.collect(); sleep(2000); } GrandExchange.close(); sleep(200); break; case ALCH: while (Inventory.contains("Green d'hide body")) { Inventory.getRandom("Green d'hide body"); sleep(1000); Magic.castSpellOn(Normal.HIGH_LEVEL_ALCHEMY, Inventory.getRandom("Green d'hide body")); sleep(2000); } while (Inventory.contains("Adamant platebody")) { Inventory.getRandom("Adamant platebody"); sleep(1000); Magic.castSpellOn(Normal.HIGH_LEVEL_ALCHEMY, Inventory.getRandom("Adamant platebody")); sleep(2000); } break; } return Calculations.random(300, 600); } public void onPaint(Graphics g) { g.setColor(Color.WHITE); g.setFont(new Font("Arial", Font.BOLD, 11)); g.drawString("Time Running: " + t.formatTime(), 25, 50); if (state != null) g.drawString("State: " + state, 25, 95); } }
    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.