gfxnick Posted January 5 Share Posted January 5 HOW TO USE: if you are already not at varok Grand exchange go there, Make sure you have plenty of chocolate bars and a knife in you bank or inventory (if the knife is in the bank the script will get it out) okay so now you are at the grand exchange start the script and like magic you chocolate will be made to dust with 0 effort CODE: import com.epicbot.api.os.model.game.WidgetID; 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 java.awt.*; @ScriptManifest(name = "Gfxnick's Chocolate Duster", gameType = GameType.OS) public class Main extends LoopScript { private final Area BANK_AREA = new Area(new Tile(3167, 3490, 0), new Tile(3167, 3490, 0)); //private final Area Cut_Area = new Area(new Tile(3167, 3498, 0)); @Override public boolean onStart(String... strings) { return true; } @Override protected int loop() { if(getAPIContext().inventory().contains("Chocolate Bar")) { Cutchoc(); }else if(!getAPIContext().inventory().isFull()) { coinsGet(); Time.sleep(60); }else { getAPIContext().inventory().deselectItem(); bank(); Time.sleep(60); } return 0; } public void bank() { if (!BANK_AREA.contains(getAPIContext().localPlayer().getLocation())) { getAPIContext().walking().walkTo(BANK_AREA.getCentralTile()); System.out.println("Walking to bank"); Time.sleep(1000); } else if (BANK_AREA.contains(getAPIContext().localPlayer().getLocation())) { if (!getAPIContext().bank().isOpen()) { System.out.println("Trying to open bank"); getAPIContext().bank().open(); Time.sleep(400, () -> getAPIContext().bank().isOpen()); } if (getAPIContext().bank().isOpen()) { System.out.println("Bank is open"); getAPIContext().bank().depositAllExcept("Knife", "Chocolate bar"); System.out.println("Closing bank"); getAPIContext().bank().close(); Time.sleep(400); } } } public void coinsGet() { if (!getAPIContext().bank().isOpen()) { getAPIContext().bank().open(); getAPIContext().bank().withdraw(1, "Knife"); } if (!getAPIContext().bank().isOpen()) { getAPIContext().bank().open(); } if (getAPIContext().bank().isOpen() ) { if(getAPIContext().inventory().contains("Knife")) { getAPIContext().bank().withdrawAll("Chocolate bar"); } Time.sleep(60); getAPIContext().bank().close(); } } public void Cutchoc() { if(getAPIContext().inventory().interactItem("Use" , "Knife")) { getAPIContext().inventory().interactItem("Use" , "Chocolate bar"); Time.sleep(500); } } public void bankOpen() { if (BANK_AREA.contains(getAPIContext().localPlayer().getLocation())) { if (!getAPIContext().bank().isOpen()) { System.out.println("Opening bank"); getAPIContext().bank().open(); } } } public void CancelKnife() { if(getAPIContext().inventory().interactItem("Use" , "Knife")) { getAPIContext().inventory().deselectItem(); } } public void Deposit() { if(getAPIContext().inventory().isFull()) { bankOpen(); getAPIContext().bank().depositAll( "Chocolate dust"); } } @Override protected void onPaint(Graphics2D g, APIContext ctx) { PaintFrame frame = new PaintFrame("Gfxnick's Choclate Duster"); frame.addLine("Title", "Value"); frame.draw(g, 0, 170, ctx); } } Quote Link to comment Share on other sites More sharing options...
gfxnick Posted January 5 Author Share Posted January 5 been using it for 2 day and no ban Quote Link to comment Share on other sites More sharing options...
Ghardi Posted January 21 Share Posted January 21 Hey, thanks for the script. I am just getting into this and it was handy, however I ran into a few problems. I've made some changes that I think improve the script, let me know what you think 🙂 import com.epicbot.api.shared.APIContext; import com.epicbot.api.shared.GameType; 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 java.awt.*; @ScriptManifest(name = "Gfxnick's Chocolate Duster", gameType = GameType.OS) public class Main extends LoopScript { //Ids private final int knifeId = 946; private final int chocolateId = 1973; private final int notedChocolateId = 1974; private final int crushedChocolateId = 1975; //Bank location private final Tile BankTile = new Tile(3167, 3490, 0); //Delays private final int minUseDelay = 10; private final int maxUseDelay = 40; //UI Info variables private int actionsPerformed = 0; private int chocolateCut = 0; private long startTime; @Override public boolean onStart(String... strings) { startTime = System.currentTimeMillis(); return true; } @Override protected int loop() { if(!getAPIContext().inventory().contains(chocolateId) || getAPIContext().inventory().contains(notedChocolateId)) { Bank(); } else if(getAPIContext().inventory().getItemAt(27) == null || getAPIContext().inventory().getItemAt(27).getId() != knifeId) { MoveItem(knifeId, 27); } else if(getAPIContext().inventory().getItemAt(26) == null || getAPIContext().inventory().getItemAt(26).getId() != chocolateId) { MoveItem(chocolateId, 26); } else if(getAPIContext().bank().isOpen()) { CloseBank(); } else { CutChocolate(); } return 0; } public void MoveItem(int itemId, int indexToMoveTo) { if(!getAPIContext().inventory().contains(itemId)) { return; } int itemIndex = getAPIContext().inventory().getItem(itemId).getIndex(); getAPIContext().inventory().moveItem(itemIndex, indexToMoveTo); Time.sleep(5_000, ()->getAPIContext().inventory().getItemAt(indexToMoveTo).getId() == itemId); } public boolean IsPlayerAtBank() { return getAPIContext().localPlayer().getLocation().equals(BankTile); } public void Bank() { getAPIContext().inventory().deselectItem(); if (!IsPlayerAtBank()) { getAPIContext().walking().walkTo(BankTile); System.out.println("Walking to bank"); Time.sleep(5_000, this::IsPlayerAtBank); } else { OpenBank(); if (getAPIContext().bank().isOpen()) { chocolateCut += getAPIContext().inventory().getItems(crushedChocolateId).size(); getAPIContext().bank().depositAllExcept(knifeId, chocolateId); if (!getAPIContext().inventory().contains(knifeId)) { getAPIContext().bank().withdraw(1, knifeId); Time.sleep(1_000, ()->getAPIContext().inventory().contains(knifeId)); } getAPIContext().bank().withdrawAll(chocolateId); Time.sleep(1_000, ()->getAPIContext().inventory().contains(chocolateId)); if(getAPIContext().inventory().isFull()) { CloseBank(); } } } } public void CutChocolate() { if(getAPIContext().inventory().interactItem("Use" , knifeId)) { getAPIContext().inventory().getItemAt(26).interact("Use"); Time.sleep(minUseDelay, maxUseDelay); actionsPerformed++; } } public void OpenBank() { if (IsPlayerAtBank()) { if (!getAPIContext().bank().isOpen()) { System.out.println("Trying to open bank"); getAPIContext().bank().open(); Time.sleep(5_000, () -> getAPIContext().bank().isOpen()); } } } public void CloseBank() { if(getAPIContext().bank().isOpen()) { System.out.println("Trying to close bank"); getAPIContext().bank().close(); Time.sleep(5_000, () -> !getAPIContext().bank().isOpen()); } } @Override protected void onPaint(Graphics2D g, APIContext ctx) { long runningTime = System.currentTimeMillis() - startTime; long crushedPerHour = (int) (chocolateCut * 3600000.0D / runningTime); PaintFrame frame = new PaintFrame("Gfxnick's Chocolate Crusher"); frame.addLine("Title", "Value"); frame.addLine("Runtime: ", Time.getFormattedRuntime(startTime)); frame.addLine("Actions: ", actionsPerformed); frame.addLine("Chocolate Crushed: ", chocolateCut); frame.addLine("Crushed/Hr: ", crushedPerHour); frame.draw(g, 0, 170, ctx); } } Quote Link to comment Share on other sites More sharing options...
yes Posted March 14 Share Posted March 14 Meetups without obligations, easy and simple [URL=https://datesnow.life]Real-life Females[/URL] 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.