RangaLord243 2 Share Posted January 18, 2019 This Is My 1st Script! It's A Simple But Efficient Woodcutting Script That Chops Trees At Varrock West. I've Moved Over From OSBot To DreamBot So You Can Expect Me To Port Over Some Amazing Scripts For You Guys! 1. Start Script Near Varrock West Bank 2. $ Profit $ ► I Would Highly Recommend Enabling Breaks ◄ ● Ultra Sexy Paint/Rainbow Mouse ● Log/GP Per Hour ● Human-Like Mouse/Camera Movement ● Random Conditional Sleeps Implemented ● Automatically Banks ► 1.0 - Initial Release - 18/01/2019 https://mega.nz/#!Km5jCQBb!C078cwbLgOpil2FAghQ0UbzCTxflWvUbIxrDGrV2MWM Link to comment Share on other sites More sharing options...
sr24 25 Share Posted January 18, 2019 if it's local, why not show the source code? IF you want to keep the code private, why not just submit to the SDN? Link to comment Share on other sites More sharing options...
RangaLord243 2 Author Share Posted January 19, 2019 13 hours ago, sr24 said: if it's local, why not show the source code? IF you want to keep the code private, why not just submit to the SDN? You Can Decompile It Using This Tool http://www.javadecompilers.com/ Link to comment Share on other sites More sharing options...
sr24 25 Share Posted January 19, 2019 yes i'm sure i can download it and decompile it in a sandbox .. however why.. when you can just post it here.. https://github.com/ weird i know. anyways goodluck Link to comment Share on other sites More sharing options...
RangaLord243 2 Author Share Posted January 19, 2019 @sr24 package DBOakChopper; import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.map.Area; import org.dreambot.api.methods.skills.Skill; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.wrappers.interactive.GameObject; import org.dreambot.api.wrappers.interactive.NPC; import org.dreambot.api.wrappers.widgets.message.Message; import java.awt.*; @ScriptManifest(category = Category.WOODCUTTING, name = "DBOakChopper", author = "RangaLord243", version = 1.0) public class Main extends AbstractScript { private long startTime; private int logsCut; private MouseTrail trail = new MouseTrail(0, 255, 255, 1000, this); private MouseCursor cursor = new MouseCursor(52, 2, Color.WHITE, this); Area bankArea = new Area(3185, 3444, 3180, 3443, 0); Area treeArea = new Area(3170, 3422, 3162, 3412, 0); @Override public void onStart() { startTime = System.currentTimeMillis(); log("Report Any Bugs On The Forum Thread."); getSkillTracker().start(); } public final String formatTime(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); } @Override public void onMessage(Message message) { if (message.getMessage().contains("You get some oak logs")) { logsCut++; } } @Override public int onLoop() { if (!getInventory().isFull()) { if (treeArea.contains(getLocalPlayer())) { chopTree("Oak"); } else { if (getWalking().walk(treeArea.getRandomTile())) { sleep(Calculations.random(3000, 5500)); } } } if (getInventory().isFull()) { if (bankArea.contains(getLocalPlayer())) { bank(); } else { if (getWalking().walk(bankArea.getRandomTile())) { sleep(Calculations.random(3000, 6000)); } } } return 600; } @Override public void onExit() { log("Thankyou For Using DBOakChopper"); } @Override public void onPaint(Graphics2D g) { g.setColor(Color.WHITE); trail.paint(g); cursor.paint(g); long runTime = System.currentTimeMillis() - startTime; g.drawString("Runtime: " + formatTime(runTime), 10, 30); g.drawString("Current level: " + getSkills().getRealLevel(Skill.WOODCUTTING), 10, 50); g.drawString("XP To Level: " + getSkills().getExperienceToLevel(Skill.WOODCUTTING), 10, 65); g.drawString("Logs Cut: " + (logsCut), 10, 85); g.drawString("Logs To Level: " + getSkills().getExperienceToLevel(Skill.WOODCUTTING) / 38, 10, 100); g.drawString("GP Earned: " + (logsCut) * 34, 10, 115); } private void chopTree(String nameOfTree) { GameObject tree = getGameObjects().closest(gameObject -> gameObject != null && gameObject.getName().equals(nameOfTree)); if (tree != null && tree.interact("Chop down")) { int countLog = getInventory().count("Oak logs"); sleepUntil(() -> getInventory().count("Oak logs") > countLog, 12000); } } private void bank() { NPC banker = getNpcs().closest(npc -> npc != null && npc.hasAction("Bank")); if (banker != null && banker.interact("Bank")) { if (sleepUntil(() -> getBank().isOpen(), 9000)) { if (getBank().depositAllExcept(item -> item != null && item.getName().contains("axe"))) { if (sleepUntil(() -> !getInventory().isFull(), 8000)) { if (getBank().close()) { sleepUntil(() -> !getBank().isOpen(), 8000); } } } } } } } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.