Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Map;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSNPC;
- @ScriptManifest(authors = "NEXBot", name = "NEXBot'sYEWWoodcutter", version = 1.0, description = "Banks YEWS, and cuts them")
- public class NEXBot'sYEWWoodcutter extends Script {
- //declare my variables here to boolean
- int YEWID = 1309;
- int BANKER = 6533;
- int YEWLog = 1515;
- RSTile[] BANKTILE = { new RSTile(3199, 3501), new RSTile(3194, 3489),
- new RSTile(3193, 3492), new RSTile(3180, 3487),
- new RSTile(3177, 3489), new RSTile(3170, 3489)
- };
- RSNPC BANKER = npcs.getNearest("Banker");
- public boolean onStart(){
- log("Hello.");
- return true;
- }
- //private voids:
- private void cutYew() {
- RSObject yew = objects.getNearest(YEWID);
- if (yew != null && getMyPlayer().getAnimation() == -1) {
- yew.doAction("Chop down Yew");
- }
- }
- private boolean BANK() {
- RSTile[] randomizedPath = walking.randomizePath(BANKTILE, 2, 2);
- return walking.walkPathMM(randomizedPath, 15);
- }
- private boolean TOTREES() {
- RSTile[] reversedPath = walking.reversePath(BANKTILE);
- RSTile[] randomizedPath = walking.randomizePath(reversedPath,2, 2);
- return walking.walkPathMM(randomizedPath);
- }
- private boolean TREESAREA(){
- RSArea area = new RSArea(new RSTile(3199, 3502), new RSTile(3225, 3506));
- return area.contains(getMyPlayer().getLocation());
- }
- private boolean BANKAREA() {
- RSArea area = new RSArea(new RSTile(3154,3479), new RSTile (3176,3497));
- return area.contains(gerMyPlayer().getLocation());
- }
- //on finish
- public void onFinish(){
- log("Goodbye.");
- }
- @Override
- public int loop() {
- if (TREESAREA() && inventory.isFull()) {
- BANK();
- log("Going to bank..");
- } else if (BANKAREA() && inventory.isFull()){
- log("Depositing yews.");
- bank.open();
- sleep(random(3000, 5000));
- if(bank.isOpen()){
- bank.deposit(YEWLog, 0);
- sleep(random(1000, 2000));
- bank.close();
- sleep(random(1000, 2000));
- TOTREES();
- }
- } else if (TREESAREA() && !inventory.isFull()) {
- cutYew();
- }
- return (random(300, 950));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement