Repository navigation
Expand file tree
/
Copy pathAbyte0_PowerWc.java
More file actions
84 lines (72 loc) · 1.58 KB
/
Copy pathAbyte0_PowerWc.java
File metadata and controls
84 lines (72 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//Abyte0
//2012-04-14
//2021-07-19 Fixed normal tree id
/*
To Cut tree
abyte0_powerwc normal
abyte0_powerwc oak
abyte0_powerwc willow
abyte0_powerwc yew
abyte0_powerwc magic
*/
public class Abyte0_PowerWc extends Abyte0_Script {
int[] normalTree = {0, 1};
int[] oakTree = {306};
int[] willowTree = {307};
int[] yewTree = {309};
int[] magicTree = {310};
int xSpot, ySpot;
int[] treeId;
int fmode = 1;
public Abyte0_PowerWc(Extension e) {
super(e);
}
public void init(String param) {
print("Power Woodcutter by Abyte0");
print("Commands to cut: oak willow yew magic");
print("Version 1");
xSpot = getX();
ySpot = getY();
treeId = yewTree;
if (param.equals("yew")) {
print("Doing Yew");
} else if (param.equals("normal")) {
print("Doing Normal");
treeId = normalTree;
} else if (param.equals("oak")) {
print("Doing Oak");
treeId = oakTree;
} else if (param.equals("willow")) {
print("Doing Willow");
treeId = willowTree;
} else if (param.equals("magic")) {
print("Doing Magic");
treeId = magicTree;
} else {
print("Default = Yew LongBow");
}
}
public int main() {
if (getFightMode() != fmode) {
setFightMode(fmode);
return 500;
}
if (getFatigue() > 85) {
useSleepingBag();
return random(800, 1000);
} else {
if (isAtApproxCoords(xSpot, ySpot, 25)) {
//si on est au spot
int[] tree = getObjectById(treeId);
if (tree[0] != -1) {
atObject(tree[1], tree[2]);
return random(500, 600);
}
} else {
walkTo(xSpot, ySpot);
return random(1000, 3000);
}
}
return random(800, 1000);
}
}