Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSTilePath;
- @ScriptManifest(authors = { "snotboy808" }, version = 0.01, keywords = { "Varrock west tree chopper" }, description = "Chops trees near varrock west bank & banks the logs", name = "Varrockchopper")
- public class Varrockchopper extends Script {
- int boothID = 11402;
- int treeID[] = { 1278, 1276 };
- int chopAnimation = 867;
- int Axes[] = { 666, 666 };
- RSObject tree;
- RSTile[] TilesToTrees = { new RSTile(3182, 3444), new RSTile(3178, 3451),
- new RSTile(3168, 3454), new RSTile(3157, 3453) };
- RSTilePath PathToTrees;
- RSTilePath PathToBank;
- // path 1 void
- public void PathToTrees() {
- PathToTrees.traverse();
- }
- // path 2 void
- public void PathToBank() {
- PathToBank.traverse();
- }
- RSArea oakArea = new RSArea(new RSTile(3151, 3449), new RSTile(3159, 3457));
- RSArea bankArea = new RSArea(new RSTile(3182, 3434), new RSTile(3189, 3445));
- public boolean onstart() {
- PathToTrees = walking.newTilePath(TilesToTrees);
- PathToBank = walking.newTilePath(TilesToTrees).reverse();
- log("W00T IT WORKS?!");
- return true;
- }
- @Override
- public int loop() {
- if(inventory.isFull() && !bankArea.contains(getMyPlayer().getLocation())) {
- PathToBank();
- }
- if(inventory.isFull() && bankArea.contains(getMyPlayer().getLocation())) {
- doBank();
- }
- if(!inventory.isFull() && !oakArea.contains(getMyPlayer().getLocation())) {
- PathToTrees();
- }
- if(!inventory.isFull() && oakArea.contains(getMyPlayer().getLocation()) && getMyPlayer().getAnimation() == -1) {
- chop();
- }
- return random(300, 500);
- }
- private void chop() {
- tree = objects.getNearest(treeID);
- if (tree != null && tree.isOnScreen()) {
- tree.doAction("Chop down");
- sleep(400, 600);
- }
- }
- public void onFinish() {
- log("Thank you for using GEchopper!");
- }
- private void bankFailSafe() {
- if (!inventory.isFull()) {
- bank.close();
- sleep(600, 800);
- }
- return;
- }
- private void doBank() {
- if (bank.isOpen()) {
- bank.depositAllExcept(Axes);
- sleep(600, 800);
- bank.close();
- sleep(600, 800);
- } else {
- bank.open();
- sleep(800, 1200);
- }
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement