-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBank.java
More file actions
63 lines (51 loc) · 1.47 KB
/
Bank.java
File metadata and controls
63 lines (51 loc) · 1.47 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
import org.parabot.environment.api.utils.Time;
import org.parabot.environment.scripts.framework.SleepCondition;
import org.parabot.environment.scripts.framework.Strategy;
import org.rev317.min.api.methods.Game;
import org.rev317.min.api.methods.Inventory;
import org.rev317.min.api.methods.Menu;
import org.rev317.min.api.methods.Npcs;
import org.rev317.min.api.wrappers.Npc;
import org.rev317.min.api.wrappers.Tile;
public class Bank implements Strategy{
private static final int[] ITEM_IDS = {437,439,441,443,454,445,448,450,452};
@Override
public boolean activate() {
if(Inventory.isFull()) {
return true;
}
return false;
}
@Override
public void execute() {
Npc[] banker = Npcs.getNearest(953);
Tile bankLoc = new Tile(2397,4716);
if (bankLoc.distanceTo() > 10) {
bankLoc.walkTo();
}
if (Game.getOpenInterfaceId() != 5292 && Inventory.isFull()) {
if (banker != null) {
Menu.sendAction(20,536,0,0,541,3);
Time.sleep(new SleepCondition() {
@Override
public boolean isValid() {
return Game.getOpenInterfaceId() == 5292;
}
}, 2000);
}
}
if (Game.getOpenInterfaceId() == 5292 && Inventory.isFull()) {
if(ITEM_IDS != null) {
for (final int item : ITEM_IDS) {
try {
Menu.sendAction(431, item - 1, 1, 5064, 542, 3);
Time.sleep(200);
} catch(Exception e) {
System.out.println(e.getMessage());
}
}
Menu.sendAction(200,0,5384,6,5698,1);
}
}
}
}