Jump to content

zakynaughtyboy

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by zakynaughtyboy

  1. Hey man, Had a quick go at this for you. Ran it a couple times and it seems to all be working. Only hops to a select few P2P worlds. I did this as the low level account I was doing it on was getting into a mess when trying to hop to total level worlds. import com.epicbot.api.shared.APIContext; import com.epicbot.api.shared.GameType; import com.epicbot.api.shared.entity.NPC; 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.webwalking.model.RSBank; import com.epicbot.api.shared.model.Area; import java.awt.*; import java.util.Random; @ScriptManifest(name = "Wine Pax", gameType = GameType.OS) public class WinePax extends LoopScript { /*** BEGIN VARS ***/ public Area SELLER_AREA = new Area(3082, 3248, 3086, 3253); public int[] worlds = {302, 303, 304, 305, 306, 307, 309, 310, 311, 312, 313, 314, 315, 317, 320, 321, 322, 323, 324, 325, 327, 328, 329, 331, 332, 333, 334, 336, 337, 338, 339, 340}; public String status = ""; @Override public boolean onStart(String... strings) { setStatus("Starting Script"); return true; } @Override protected int loop() { if(!isInventFull() && !(SELLER_AREA.contains(getPlayerLocation()))) { walkToSeller(); } else if(!isInventFull() && (SELLER_AREA.contains(getPlayerLocation()))){ if(!isShopOpen()){ tradeSeller(); } else { if(checkWineStock() != 0){ buyWine(); } else if (checkWineStock() == 0){ hop(); } } } else if (isInventFull()) { walkToBank(); if(isInventFull() && getAPIContext().bank().isOpen()){ bankItems(); } } return 1200; } private void setStatus(String status){ this.status = status; } private boolean isInventFull(){ return getAPIContext().inventory().isFull(); } private Tile getPlayerLocation(){ return getAPIContext().localPlayer().getLocation(); } private void walkToBank(){ setStatus("Walking to Bank"); getAPIContext().webWalking().walkTo(RSBank.DRAYNOR.getTile()); getAPIContext().bank().open(); } private void bankItems(){ getAPIContext().bank().depositAllExcept(995); getAPIContext().bank().close(); } private void walkToSeller(){ setStatus("Walking to Seller"); getAPIContext().webWalking().walkTo(SELLER_AREA.getRandomTile()); } private void tradeSeller(){ setStatus("Trading seller"); NPC seller = getAPIContext().npcs().query().nameMatches("Fortunato").actions("Trade").results().nearest(); seller.interact("Trade"); } private boolean isShopOpen(){ return getAPIContext().widgets().isInterfaceOpen(); } private int checkWineStock(){ setStatus("Checking wine stock"); return getAPIContext().store().getCount("Empty jug pack"); } private void buyWine(){ setStatus("Buying wine"); getAPIContext().store().buyFifty("Empty jug pack"); } private void hop(){ setStatus("Hopping worlds"); java.util.Random random = new Random(); int world = random.nextInt(32); getAPIContext().world().hop(worlds[world]); } @Override protected void onPaint(Graphics2D g, APIContext ctx) { PaintFrame frame = new PaintFrame("Wine Pax"); frame.addLine("Status", status); frame.draw(g, 0, 170, ctx); } }
  2. What exactly are you trying to do? You can hop to a specific world using; getAPIContext().world().hop(world); If this is not suitable you can create an array of worlds you want to randomly hop to and hop to them by generating a random number based on the size of your worlds array; private int[] worlds = {301, 308, 576}; private void hopWorld(){ Random randomWorld = new Random(); int worldIndex = randomWorld.nextInt(worlds.length - ;int worlds; ifout"Hopping to world: " ; ; else return;
  3. Hey man, I'm newly trying to learn Java and taking up writing little scripts like this to help me learn. I assume you meant Mind Runes in Lumbridge Castle? As I don't know where the Body Runes spawn is (if you I'm wrong let me know and I can change this). Anyway wrote a very basic script that will loot the Mind Rune at the bottom of the stairs then hop to another world to loot another. It will only hop to F2P worlds that don't have restrictions (E.g. 750 total etc) or PVP. There are probably better ways to do this but it's working as expected. Here is the code; import com.epicbot.api.shared.APIContext; import com.epicbot.api.shared.GameType; import com.epicbot.api.shared.entity.GroundItem; import com.epicbot.api.shared.script.LoopScript; import com.epicbot.api.shared.script.ScriptManifest; import com.epicbot.api.shared.util.paint.frame.PaintFrame; import java.awt.*; import java.util.Random; @ScriptManifest(name = "Lumbridge Rune Looter", gameType = GameType.OS) public class LumbridgeRuneLooter extends LoopScript { @Override public boolean onStart(String... strings) { return true; } private int[] worlds = {301, 308, 316, 326, 335, 371, 379, 380, 382, 383, 384, 394, 397, 398, 399, 417, 418, 425, 426, 430, 431, 433, 434, 435, 436, 437, 451, 452, 453, 454, 455, 456, 469, 470, 471, 472, 473, 475, 476, 483, 497, 498, 499, 500, 501, 536, 537, 542, 543, 544, 545, 546, 547, 552, 553, 554, 555, 556, 557, 562, 563, 564, 565, 566, 567, 571, 573, 574, 575, 576}; private int rollDice(int maxRoll){ Random diceRoll = new Random(); int roll = diceRoll.nextInt(maxRoll); return roll; } private void hopWorld(){ int newWorld = worlds[rollDice(69)]; if(newWorld != getAPIContext().world().getCurrent()){ System.out.println("Hopping to world: " + newWorld); getAPIContext().world().hop(newWorld); } else { return; } } @Override protected int loop() { GroundItem mindRune = getAPIContext().groundItems().query().id(558).results().nearest(); if(mindRune == null){ hopWorld(); } else { System.out.println("Looting.."); mindRune.interact("Take"); } return 600; } @Override protected void onPaint(Graphics2D g, APIContext ctx) { PaintFrame frame = new PaintFrame("Lumbridge Rune Looter"); frame.addLine("idk how to make", "GUI"); frame.draw(g, 0, 170, ctx); } }
×
×
  • Create New...