highball Posted September 25, 2013 Posted September 25, 2013 (edited) Whats up y'all finally started to make a script =D as I posted in the tutorials, I needed some help, and I got a bit but most of it was done by myself...(; Just got some questions if any scripter can answer feel free to post/pm me your skype. Thanks! Here is the code I have questions about: package woodcutter; import java.awt.Graphics; import org.osbot.script.Script; import org.osbot.script.ScriptManifest; import org.osbot.script.rs2.model.Entity; import org.osbot.script.rs2.model.Player; import org.osbot.script.rs2.ui.Bank; import org.osbot.script.rs2.ui.Inventory; import org.osbot.script.rs2.utility.Area; @ScriptManifest(author = "Highball", info = "Chops Willow Trees in Drynor", name = "Woodcutter", version = 0) public class WoodCutter extends Script{ final String WILLOW_NAME = "willow"; final Area BANK_AREA = new Area(3092,3240,2097,3246); final Area WILLOW_AREA = new Area(3081,3223,3092,3239); final int BANK_BOOTH_ID = 2196; // code used at start public void onStart(){ } // code to be executed at the end public void onExit(){ } // code in loop public int onLoop() throws InterruptedException { Inventory inven = client.getInventory(); Player player = myPlayer(); Bank bank = client.getBank(); if(!inven.isFull()){ // chop if(WILLOW_AREA.contains(player)){ org.osbot.script.rs2.model.Entity willow = closestObjectForName(WILLOW_NAME); if (willow != null) if (willow.isVisible()) { if (!player.isAnimating()) { if(!player.isMoving()) { willow.interact("chop down"); sleep(random(700,800)); } } }else{ client.moveCameraToEntity(willow); } } }else{ walk(WILLOW_AREA); } // bank if(BANK_AREA.contains(player)){ Entity bankbooth = closestObject(BANK_BOOTH_ID); if(bank.isOpen()) { bank.depositAll(); }else{ if(bankbooth != null){ if(bankbooth.isVisible()) { bankbooth.interact("bank"); sleep(random(700,800)); }else{ client.moveCameraToEntity(bankbooth); } } } } else { walk(BANK_AREA); } return 50; } // paint public void onPaint(Graphics g) { } } Edited September 25, 2013 by highball
Zappa Posted September 25, 2013 Posted September 25, 2013 (edited) try this: http://pastebin.com/4pzTg8hn Edited September 25, 2013 by Zappa
highball Posted September 25, 2013 Author Posted September 25, 2013 (edited) Thanks zappa sent you a pm with my skype Yo zappa, after running it for a min, it still has problems with clicking on the bank booth...any idea why that is? Edited September 26, 2013 by highball