-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathAbyte0_Shaft.java
More file actions
54 lines (43 loc) · 1.12 KB
/
Abyte0_Shaft.java
File metadata and controls
54 lines (43 loc) · 1.12 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
//Based on the Script HARRY provided on forum (fletch)
//Edited by Abyte0
//2012-01-24 - Added WalkBack
public class Abyte0_Shaft extends Abyte0_Script {
int x, y;
public Abyte0_Shaft(Extension e) {
super(e);
}
public void init(String params) {
x = getX();
y = getY();
System.out.println("Shafter Edited By Abyte0 - Version 0");
System.out.println("WalkBack at " + x + "," + y);
}
public int main() {
if (getFatigue() > 90) {
useSleepingBag();
return random(1000, 2000);
}
if (getInventoryIndex(277) > 0) {
dropItem(getInventoryIndex(277));
return random(500, 600);
}
if (isQuestMenu()) {
answer(0);
return random(200, 400);
}
if (getInventoryIndex(14) > 0) {
useItemWithItem(getInventoryIndex(13), getInventoryIndex(14));
return random(500, 600);
}
int[] tree = getObjectById(0, 1);
if (tree[0] != -1 && getInventoryCount(14) <= 0) {
if (getX() < x - 35 || getX() > x + 35 || getY() < y - 35 || getY() > y + 35) {
walkTo(x, y);
return random(500, 3000);
} else
atObject(tree[1], tree[2]);
return random(500, 600);
}
return random(1000, 2000);
}
}