/*
* This is a WoodCutting Version Of Linux_communists RimmingtonAnythingMiner.
* Made to cut Yews In Fallador
*
* 000000000000000000000000000000000 Instructions: Start in Fallador for best
* results Number Of Arguments: 0 Thank you for using my script
* 000000000000000000000000000000000
*/
import com.speljohan.rsbot.script.*;
import com.speljohan.rsbot.script.wrappers.*;
public class YewCutter extends Script {
public static final int WOODCUTTING_STAT = Skills
.getStatIndex("Woodcutting");
int GambleInteger; // ================More antiban version 1.1 update
/*
* The RSTiles Required.
*/
public static final RSTile[] ToYews = new RSTile[] {
new RSTile(3007, 3344), new RSTile(3008, 3326),
new RSTile(3016, 3314), new RSTile(3018, 3315) };
public RSTile[] ToBank = reversePath(ToYews);
public final int[] Bank = new int[] { 11758 };
public final int[] Yews = new int[] { 1309, 1515 };
public final int[] Axes = new int[] { 87, 12, 88, 203, 204, 405, 594 };
public double getVersion() {
return 1.0;
}
public String getName() {
return "Yew Cutter";
}
public String getAuthor() {
return "Linux_Communist and Forever_madness";
}
public boolean onStart(String[] args) {
log("--------------------------------------------------------------");
log("Welcome to YewCutter by Forever_madness");
log("Script is iniating...");
log("Start point = bank");
log("Does not have deathwalk so please have a highleveled character");
log("Runs away from fights though :P");
log("--------------------------------------------------------------");
ToBank = randomizePath(ToBank, 2, 2);
return true;
}
public int loop() {
if (getMyPlayer().isMoving()) {
return Antiban();
}
if (!isInventoryFull() && distanceTo(ToBank[0]) <= 9) {
RSObject Yews = findObject(getWoodCuttingLevel());
if (ToYews != null) {
atObject(Yews, "Chop");
Antiban();
log("Cut one yew...");
return random(500, 1000);
}
}
if (isInventoryFull() && distanceTo(ToBank[0]) <= 9) {
log("Banking....");
walkPathMM(ToBank, 25);
return random(500, 1000);
}
if (isInventoryFull() && distanceTo(ToBank[ToBank.length - 1]) <= 9) {
RSNPC banker = getNearestNPCByName("Banker");
log("Banked");
if (banker != null) {
atNPC(banker, "Bank");
bank.depositAllExcept(Axes);
return random(500, 1000);
}
}
if (!isInventoryFull() && distanceTo(ToBank[ToBank.length - 1]) <= 9) {
setRun(true);
log("Run is set and we are going to cut!");
openTab(TAB_INVENTORY);
walkPathMM(ToBank, 25);
return random(500, 1000);
}
return random(500, 1000);
}
// Method below is by Mx1000/DJARNO
private int Antiban() {
GambleInteger = random(1, 3);
if (GambleInteger == 1) {
wait(random(2000, 2000));
}
if (GambleInteger == 2) {
int intx = random(0, 750);
int inty = random(0, 500);
log("We Move Mouse To : " + intx + " " + inty);
moveMouse(0, 0, intx, inty);
}
return random(1000, 1500);
}
public boolean hasAxe() {
return inventoryContains(Axes);
}
public int[] getWoodCuttingLevel() {
int woodcuttingLevel = skills.getCurrentSkillLevel(WOODCUTTING_STAT);
if (woodcuttingLevel < 60) {
log("WoodCuttingLevel Not High Enough Wont Cut");
log("Null...");
return null;
} else if (woodcuttingLevel > 60) {
log("High Enough Will Cut");
return Yews;
}
return Yews;
}
public void runAway() { // Method by linux Communist :P
RSTile foo, foo2;
foo = getMyPlayer().getLocation();
setRun(true);
foo2 = new RSTile(foo.getX() + 10, foo.getY() + 10);
walkTileMM(foo2);
wait(random(17000, 20000));
walkTileMM(foo);
}
}