-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathZammyWine.java
More file actions
74 lines (60 loc) · 1.87 KB
/
ZammyWine.java
File metadata and controls
74 lines (60 loc) · 1.87 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
import org.rspeer.runetek.adapter.scene.Pickable;
import org.rspeer.runetek.adapter.scene.Player;
import org.rspeer.runetek.api.Game;
import org.rspeer.runetek.api.commons.Time;
import org.rspeer.runetek.api.commons.math.Random;
import org.rspeer.runetek.api.component.tab.*;
import org.rspeer.runetek.api.scene.Pickables;
import org.rspeer.runetek.api.scene.Players;
import org.rspeer.script.Script;
import org.rspeer.script.ScriptMeta;
import org.rspeer.ui.Log;
@ScriptMeta(developer = "Sri", name = "Zammy Wine Grabber", desc = "Telegrabber")
public class ZammyWine extends Script {
Player local;
public int getRand() {
int highRand = Random.high(100, 500);
int lowRand = Random.low(100, 500);
int rand;
if (Random.nextInt(0, 100) < 50) {
rand = lowRand;
}
else {
rand = highRand;
}
return rand;
}
@Override
public void onStart() {
Log.fine("This will be executed once on startup.");
super.onStart();
}
@Override
public int loop() {
local = Players.getLocal();
Player[] allPlayers = Players.getLoaded();
for (Player p: allPlayers) {
if (p.getName() != "sri-1994") {
Time.sleep(Random.low(150, 500));
Game.logout();
return -1;
}
}
if (!Inventory.contains(563)) {
return -1;
}
Pickable zw = Pickables.getNearest(23489);
int rand = getRand();
if (Magic.canCast(Spell.Modern.TELEKINETIC_GRAB) && !local.isAnimating() && !local.isMoving() && zw != null) {
Magic.cast(Spell.Modern.TELEKINETIC_GRAB);
Time.sleep(rand);
zw.interact("Cast");
}
rand = getRand();
return 450 + rand;
}
@Override
public void onStop() {
super.onStop();
}
}