Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.scripts;
- import com.kbot2.scriptable.*;
- import com.kbot2.scriptable.methods.data.*;
- import com.kbot2.scriptable.methods.wrappers.*;
- public class mytoscript extends Script {
- public final int[] hatchetIDS = { 1351, 1349, 1353, 1361, 1355, 1357, 1359,
- 6739 };
- int[] Oak_ID = { 1281, 3037, 8462, 8463, 8464, 8465, 8466, 8467 };
- int BANK_BOOTH_ID = 11402;
- Obj oak;
- Obj bankBooth;
- int Oak_Logs = 1521;
- int status;
- long antibanTimer = 0;
- Tile[] BANK_TO_oak = { new Tile(3253, 3420), new Tile(3253, 3425),
- new Tile(3257, 3428), new Tile(3262, 3428), new Tile(3267, 3428),
- new Tile(3272, 3428), new Tile(3276, 3428) };
- Tile[] oak_TO_BANK = Walking.reversePath(BANK_TO_oak);
- @Override
- public boolean active() {
- return true;
- }
- @Override
- public boolean onStart() {
- log("Starting the Script...");
- return true;
- }
- public String getName() {
- return "mytoscript";
- }
- public String getAuthor() {
- return "Tomaso88";
- }
- public String getDescription() {
- return "cuts oaks and drops them";
- }
- public int loop() {
- if (walking.getEnergy() > 40)
- walking.setRunning(true);
- if (getMyPlayer().getAnimation() != -1 || getMyPlayer().isMoving()) {
- return random(100, 150);
- }
- switch (status) {
- case 0:
- walking.walkPath(BANK_TO_oak);
- status = 1;
- case 1:
- oak = getClosestObject(7, Oak_ID);
- if (oak == null) {
- log("Couldnt find oak spot.");
- } else {
- oak.doAction("Chop down");
- if (!inventory.isFull() && !inventory.contains(1521)
- && getMyPlayer().getAnimation() == -1) {
- return 500;
- } else {
- if (inventory.isFull() && inventory.contains(1521)
- && getMyPlayer().getAnimation() == -1) {
- status = 2;
- }
- }
- }
- break;
- case 2:
- walking.walkPath(oak_TO_BANK);
- bankBooth = getClosestObject(7, BANK_BOOTH_ID);
- if (bankBooth == null) {
- return 400;
- } else {
- bankBooth.doAction("Use-quickly");
- bank.depositAllExcept(1351, 1349, 1353, 1361, 1355, 1357, 1359,
- 6739);
- }
- break;
- }
- return random(300, 500);
- }
- }
Add Comment
Please, Sign In to add comment