-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRatzFalconry.java
More file actions
82 lines (69 loc) · 2.16 KB
/
Copy pathRatzFalconry.java
File metadata and controls
82 lines (69 loc) · 2.16 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package hunter;
import java.awt.AWTException;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.awt.Robot;
import java.awt.event.KeyEvent;
import org.dreambot.api.methods.Calculations;
import org.dreambot.api.methods.filter.Filter;
import org.dreambot.api.methods.interactive.GameObjects;
import org.dreambot.api.methods.map.Area;
import org.dreambot.api.methods.map.Tile;
import org.dreambot.api.script.AbstractScript;
import org.dreambot.api.script.Category;
import org.dreambot.api.script.ScriptManifest;
import org.dreambot.api.wrappers.interactive.GameObject;
import org.dreambot.api.wrappers.interactive.NPC;
import org.dreambot.api.wrappers.items.Item;
@ScriptManifest(category = Category.MINING, name = "Ratz Falconry", author = "skengrat",
version = 1.26)
public class RatzFalconry extends AbstractScript {
private final static String KEBBIT_43 = "Spotted kebbit";
private final static String KEBBIT_57 = "Dark kebbit";
public static final int[] dropOrder = {0,1,2,3,7,6,5,4,8,9,10,11,15,14,13,12,16,17,18,19,23,22,21,20,24,25,26,27};
public Filter<NPC>kebbit = new Filter<NPC>() {
public boolean match(NPC k) {
if(k == null || !k.exists()) {
return false;
}
return k.getName().equals(KEBBIT_43);
}
};
public int onLoop() {
if(getNpcs().closest(kebbit).interact("Catch")) {
int bones = getInventory().count("Bones");
if(sleepUntil(() -> getInventory().count("Bones") > bones, 29999)) {
drop();
}
}
return Calculations.random(1130, 1900);
}
public boolean drop() {
for(int i:dropOrder) {
if(getInventory().slotContains(i, fur -> fur != null && fur.getName().contains("fur"))) {
getInventory().drop(i);
} else if(getInventory().slotContains(i, "Bones")) {
getInventory().interact(i, "Bury");
}
int random = (int)(Math.random() * 4);
switch(random) {
case 0:
sleep(Calculations.random(44,115));
break;
case 1:
sleep(Calculations.random(44,115));
break;
case 2:
sleep(Calculations.random(114,270));
break;
default:
break;
}
}
return true;
}
}