- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCook.java
More file actions
Latest commit
67 lines (55 loc) · 2.04 KB
/
Copy pathCook.java
File metadata and controls
67 lines (55 loc) · 2.04 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
importjava.awt.Point;
importorg.parabot.environment.api.utils.Time;
importorg.parabot.environment.scripts.framework.Strategy;
importorg.rev317.min.api.methods.Inventory;
importorg.rev317.min.api.methods.Menu;
importorg.rev317.min.api.methods.Players;
importorg.rev317.min.api.methods.SceneObjects;
importorg.rev317.min.api.wrappers.SceneObject;
publicclassCookimplementsStrategy {
SceneObjectstove = SceneObjects.getClosest(2728);
Pointp = newPoint(246,409);
/***************************************************************************************************************************************/
@Override
publicbooleanactivate() {
if (stove != null
&& Walking.stoveSpot.distanceTo() <= 3
&& Inventory.isFull()
&& Inventory.getCount(USCooker.rawID) > 0) {
System.out.println("Cooking...");
returntrue;
}
System.out.println("Cook check passed...");
returnfalse;
}
/***************************************************************************************************************************************/
@Override
publicvoidexecute() {
while (Inventory.containts(USCooker.rawID)) {
if (stove != null) {
System.out.println("Range Found...");
//use
Menu.sendAction(447, USCooker.rawID - 1, getInventorySlot(USCooker.rawID), 3214);
Time.sleep(400);
//on range
System.out.println("Using on range");
Menu.sendAction(62,stove.getHash(), stove.getLocalRegionX(), stove.getLocalRegionY(),2728,1);
Time.sleep(400);
//Cook All
Menu.sendAction(315,stove.getHash(), stove.getLocalRegionX(), 13717,2728,1);
Time.sleep(2000);
while (Players.getMyPlayer().getAnimation() != -1 && Log.isLoggedIn()) {
Time.sleep(200);
}
}
}
}
/***************************************************************************************************************************************/
privatestaticintgetInventorySlot(intitem) {
org.rev317.min.api.wrappers.Item[] items = Inventory.getItems(item);
if (items != null) {
returnitems[0].getSlot();
}
return0;
}
}