-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrayAlter.java
More file actions
50 lines (42 loc) · 1.38 KB
/
PrayAlter.java
File metadata and controls
50 lines (42 loc) · 1.38 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
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.Item;
import org.rev317.min.api.wrappers.SceneObject;
public class PrayAlter implements Strategy {
@Override
public boolean activate() {
if(Inventory.getCount(USPrayer.useBone) >= 1)
return true;
return false;
}
@Override
public void execute() {
SceneObject[] altarID = SceneObjects.getNearest(409);
if (altarID.length > 0 && altarID[0] != null
&& Inventory.getCount(USPrayer.useBone) >= 1
&& Players.getMyPlayer().getAnimation() == -1) {
if ( altarID[0].distanceTo() > 3) {
System.out.println("Walking to altar...");
altarID[0].getLocation().walkTo();
Time.sleep(2000);
}
//Use
Menu.sendAction(447, USPrayer.useBone - 1, getInventorySlot(USPrayer.useBone), 3214, 409, 3);
Time.sleep(400);
//On Alter
Menu.sendAction(62, altarID[0].getHash(), altarID[0].getLocalRegionX(), altarID[0].getLocalRegionY(),409,1);
Time.sleep(400);
}
}
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;
}
}