-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWalk.java
More file actions
84 lines (74 loc) · 2.08 KB
/
Walk.java
File metadata and controls
84 lines (74 loc) · 2.08 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
import org.parabot.environment.api.utils.Time;
import org.parabot.environment.scripts.framework.Strategy;
import org.rev317.min.api.methods.Inventory;
import org.rev317.min.api.methods.Npcs;
import org.rev317.min.api.methods.SceneObjects;
import org.rev317.min.api.wrappers.Npc;
import org.rev317.min.api.wrappers.SceneObject;
import org.rev317.min.api.wrappers.TilePath;
public class Walk implements Strategy {
@Override
public boolean activate() {
SceneObject booth = null;
if (USFisher.useDock == 3) {
booth = SceneObjects.getClosest(5276);
} else {
booth = SceneObjects.getClosest(2213);
}
Npc spot = null;
spot = Npcs.getClosest(USFisher.spotID);
if (!Inventory.isFull() && (spot == null || spot.distanceTo() > 6)) {
System.out.println("Walking...");
return true;
} else if (Inventory.isFull() && (booth == null || booth.distanceTo() > 4)) {
System.out.println("Walking...");
return true;
} else {
return false;
}
}
@Override
public void execute() {
if (Inventory.isFull()) {
if (USFisher.useDock == 1) {
TilePath path = new TilePath(USFisher.NORTH_WALK);
if (path != null) {
path.traverse();
Time.sleep(1000);
}
} else if (USFisher.useDock == 2) {
TilePath path = new TilePath(USFisher.SOUTH_WALK);
if (path != null) {
path.traverse();
Time.sleep(1000);
}
} else if (USFisher.useDock == 3) {
TilePath path = new TilePath(USFisher.DONOR_WALK);
if (path != null) {
path.traverse();
Time.sleep(1000);
}
}
} else if (!Inventory.isFull()) {
if (USFisher.useDock == 1) {
TilePath path = new TilePath(USFisher.NORTH_WALK).reverse();
if (path != null) {
path.traverse();
Time.sleep(1000);
}
} else if (USFisher.useDock == 2) {
TilePath path = new TilePath(USFisher.SOUTH_WALK).reverse();
if (path != null) {
path.traverse();
Time.sleep(1000);
}
} else if (USFisher.useDock == 3) {
TilePath path = new TilePath(USFisher.DONOR_WALK).reverse();
if (path != null) {
path.traverse();
Time.sleep(1000);
}
}
}
}
}