-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCook.java
More file actions
67 lines (55 loc) · 2.04 KB
/
Cook.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
import java.awt.Point;
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.Menu;
import org.rev317.min.api.methods.Players;
import org.rev317.min.api.methods.SceneObjects;
import org.rev317.min.api.wrappers.SceneObject;
public class Cook implements Strategy {
SceneObject stove = SceneObjects.getClosest(2728);
Point p = new Point(246,409);
/***************************************************************************************************************************************/
@Override
public boolean activate() {
if (stove != null
&& Walking.stoveSpot.distanceTo() <= 3
&& Inventory.isFull()
&& Inventory.getCount(USCooker.rawID) > 0) {
System.out.println("Cooking...");
return true;
}
System.out.println("Cook check passed...");
return false;
}
/***************************************************************************************************************************************/
@Override
public void execute() {
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);
}
}
}
}
/***************************************************************************************************************************************/
private static int getInventorySlot(int item) {
org.rev317.min.api.wrappers.Item[] items = Inventory.getItems(item);
if (items != null) {
return items[0].getSlot();
}
return 0;
}
}