-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFish.java
More file actions
42 lines (35 loc) · 1.12 KB
/
Fish.java
File metadata and controls
42 lines (35 loc) · 1.12 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
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.Npcs;
import org.rev317.min.api.methods.Players;
import org.rev317.min.api.wrappers.Npc;
public class Fish implements Strategy {
@Override
public boolean activate() {
return (!Inventory.isFull());
}
@Override
public void execute() {
final Npc fishSpot[] = Npcs.getNearest(USFisher.spotID);
final Npc fish = fishSpot[0];
//Checks then fishes
System.out.println("Waiting...");
if (fish != null && Players.getMyPlayer().getAnimation() == -1 && !Inventory.isFull() && Relog.isLoggedIn()) {
USFisher.getExpCount();
System.out.println("Fishing...");
try {
Npcs.getNearest(USFisher.spotID)[0].interact(USFisher.spotInteractCode);
} catch (Exception e) {
e.printStackTrace();
}
Time.sleep(2000);
}
//Track EXP and caught fish as fishing animation loops
while (Players.getMyPlayer().getAnimation() != -1 && Relog.isLoggedIn()) {
USFisher.caughtCounter();
USFisher.getExpCount();
Time.sleep(200);
}
}
}