Koschei 147 Posted July 19, 2016 I've had this script for quite a while now and I have no use for it anymore, hopefully someone will. Also its my first script so don't be too harsh *Just tested it for about a half an hour and it gets 35-40k Gp per hour. package Villagelooter; import org.dreambot.api.methods.Calculations; import org.dreambot.api.methods.map.Area; import org.dreambot.api.methods.map.Tile; import org.dreambot.api.methods.tabs.Tab; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.utilities.Timer; import org.dreambot.api.wrappers.items.GroundItem; import java.awt.*; /** * Created by Steve on 4/30/2016. */ @ScriptManifest(author = "Yoloscape", category = Category.MONEYMAKING, description = "Loots Fish in Barb village", name = "Barb looter", version = 1.0) public class Main extends AbstractScript { Timer t = new Timer(); private final Area Bank_Area = new Area(3092, 3493, 3094, 3489, 0); private final Area Looting_Area = new Area(3100, 3422, 3109, 3434, 0); private int itemsMade; private int getRandomPitch() { return Calculations.random(getClient().getLowestPitch(), 383); } private void antiBanWalking() { int random = Calculations.random(0, 20); if (random <= 3) { getCamera().rotateTo(Calculations.random(0, 2048), getRandomPitch()); } else if (random <= 5) { if (getMouse().isMouseInScreen()) { if (getMouse().moveMouseOutsideScreen()) { sleep(Calculations.random(250, 750)); } } } else if (random <= 6) { if (getTabs().isOpen(Tab.FRIENDS)) { if (getTabs().openWithFKey(Tab.FRIENDS)) { sleep(Calculations.random(400, 1000)); if (getTabs().openWithFKey(Tab.INVENTORY)) { sleep(Calculations.random(100, 400)); } } } } } private void antiBan() { int random = Calculations.random(1, 10); if (random <= 3) { getCamera().rotateTo(Calculations.random(0, 2048), getRandomPitch()); } else if (random <= 4) { if (getMouse().isMouseInScreen()) { if (getMouse().moveMouseOutsideScreen()) { sleep(Calculations.random(1500, 2500)); } } } } private enum State { Bank, Wtb, Wtl, Loot } private State getState() { if (getInventory().isFull()) { if (Bank_Area.contains(getLocalPlayer())) { return State.Bank; } else { return State.Wtb; } } else { if (Looting_Area.contains(getLocalPlayer())) { return State.Loot; } else { return State.Wtl; } } } public void onStart() { log("Welcome to my Barbarian Village salmon looter."); log("Report bugs on forums."); log("Have a great day!"); } @Override public int onLoop() { if (getLocalPlayer().isMoving()) { Tile dest = getClient().getDestination(); if (dest != null && getLocalPlayer().getTile().distance(dest) > 5) { return Calculations.random(350, 1000); } } if (!getWalking().isRunEnabled() && getWalking().getRunEnergy() >= Calculations.random(50, 100)) { getWalking().toggleRun(); } State state = getState(); switch (state) { case Bank: log("Banking."); if (getBank().isOpen()) { itemsMade += getInventory().count(331); getBank().depositAllItems(); sleepUntil(() -> getInventory().isEmpty(), Calculations.random(950, 1300)); break; } else { antiBan(); getBank().open(); sleepUntil(() -> getInventory().isEmpty(), Calculations.random(600, 1400)); } break; case Wtb: log("Walking to Edge Bank."); if (getWalking().walk(Bank_Area.getNearestTile(getLocalPlayer()))) { antiBanWalking(); sleep(Calculations.random(2000, 3000)); } break; case Wtl: log("Walking to Barbarian fishing area."); if (getWalking().walk(Looting_Area.getNearestTile(getLocalPlayer()))) { antiBanWalking(); sleep(Calculations.random(2000,3000)); } break; case Loot: final GroundItem Salmon = getGroundItems().closest(gi -> { if (!(gi == null || gi.getName() == null)) if (gi.getName().equals("Raw salmon")) if (Looting_Area.contains(gi)){ return true; } else { antiBan(); sleep(Calculations.random(3000, 8000)); return false; } return false; }); if (!Salmon.getTile().equals(getLocalPlayer().getTile())){ getWalking().walkExact(Salmon.getTile()); sleep(Calculations.random(1500, 2000)); } else { if (Salmon.interact("Take")) sleepUntil(Salmon::exists, Calculations.random(65, 115)); } break; } return Calculations.random(200, 400); } public void onPaint(Graphics g) { int costOfItem = 47; int gpGained = itemsMade * costOfItem; int gpPerHour = t.getHourlyRate(gpGained); g.drawString("Salmon Looted:" + itemsMade,8, 275); g.drawString("Coins per hour: " + gpPerHour + " Coins", 8, 315); g.drawString("Time ran: " + t.formatTime(), 8, 335); g.drawString("Total coins: " + gpGained + " Coins", 8, 295); } }
plsineed99s 0 Posted September 29, 2016 This could be great for the SDN as an f2p moneymaking script if you get it tossed in there.
Koschei 147 Author Posted September 29, 2016 This could be great for the SDN as an f2p moneymaking script if you get it tossed in there. Its not really something that can be used by a lot of people though because of only so many fish being dropped, but I guess I could put it on sdn.
plsineed99s 0 Posted September 30, 2016 Its not really something that can be used by a lot of people though because of only so many fish being dropped, but I guess I could put it on sdn. There is a cowhide looter on the SDN, same concept.
marcosmoura 0 Posted September 30, 2016 I tried this and it just picks all the items on the floor.. not just salmon..
Recommended Posts
Archived
This topic is now archived and is closed to further replies.