-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBanking.java
More file actions
65 lines (48 loc) · 1.84 KB
/
Banking.java
File metadata and controls
65 lines (48 loc) · 1.84 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
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.wrappers.SceneObject;
import org.rev317.min.api.methods.*;
public class Banking implements Strategy{
private SceneObject[] booth = SceneObjects.getNearest(2213);
/***************************************************************************************************************************************/
@Override
public boolean activate() {
if (booth != null && Inventory.getCount(USCooker.rawID) == 0) {
System.out.println("Banking...");
return true;
}
System.out.println("Bank check passed...");
return false;
}
/***************************************************************************************************************************************/
@Override
public void execute() {
if(booth != null) {
System.out.println("Found booth...");
booth[0].interact(0);
Time.sleep(3000);
//deposit
if (Game.getOpenInterfaceId() == 5292 && Inventory.isFull() && Inventory.containts(USCooker.cookID + 2) || Inventory.containts(USCooker.cookID) && !Inventory.containts(USCooker.rawID)) {
System.out.println("Depositing...");
if (Inventory.containts(USCooker.burnID) || Inventory.containts(USCooker.cookID)) {
USCooker.cookCount += Inventory.getCount(USCooker.cookID);
Bank.depositAllExcept(USCooker.rawID);
}
}
//withdraw
if (Game.getOpenInterfaceId() == 5292 && !Inventory.isFull()) {
System.out.println("Withdrawing...");
Bank.withdraw(USCooker.rawID, 28, 100);
Time.sleep(new SleepCondition() {
@Override
public boolean isValid() {
return Inventory.getCount(USCooker.rawID) > 0;
}
}, 3000);
}
}
//Close bank
Menu.sendAction(200,0,5384,6,5698,1);
}
}