Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package BasicWoodcutter;
- import org.dreambot.api.methods.map.Area;
- 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 java.awt.*;
- @ScriptManifest(category = Category.WOODCUTTING,name = "Basic Woodcutter" ,author = "Maxime Clonen",version = 1.0)
- public class Mainclass extends AbstractScript {
- Area bankArea = new Area(3092, 3241, 3097, 3246, 0);
- @Override
- public void onStart(){
- log("Hi");
- }
- @Override
- public int onLoop() {
- GameObject tree = getGameObjects().closest(gameobject -> gameobject != null && gameobject.getName().equals("Tree"));
- if (!getInventory().isFull() && tree.interact("chop down")){
- int countlogs = getInventory().count("Logs");
- int index = (int)(10 * Math.random() + 4);
- sleepUntil(() -> getInventory().count("Logs") > countlogs, index);
- }
- if (getInventory().isFull()){
- if (bankArea.contains(getLocalPlayer())){
- NPC banker = getNpcs().closest(npc -> npc != null && npc.hasAction("Bank"));
- if(banker.interact("Bank")){
- int index = (int)(10 * Math.random() + 4);
- if(sleepUntil(() -> getBank().isOpen(), index)){
- if(getBank().depositAllExcept(item -> item != null && item.getName().contains("axe"))){
- int index1 = (int)(10 * Math.random() + 4);
- if (sleepUntil(() -> getInventory().isFull(), index1)){
- if(getBank().close()){
- int index2 = (int)(10 * Math.random() + 4);
- sleepUntil(() -> !getBank().isOpen(), index2);
- }
- }
- }
- }
- }
- }
- }
- return 600;
- }
- @Override
- public void onExit() {
- }
- @Override
- public void onPaint(Graphics graphics) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement