-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathAbyte0_GetSnape.java
More file actions
173 lines (157 loc) · 4.42 KB
/
Abyte0_GetSnape.java
File metadata and controls
173 lines (157 loc) · 4.42 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
public class Abyte0_GetSnape extends Abyte0_Script {
int step = 0;
int foodId = 373;
int fmode = 2;
int[] path = null;
int loop = 0;
int halfKey1 = 526;
int halfKey2 = 527;
int HalfDragonSquareShield1 = 1276;
int HalfDragonSquareShield2 = 1277;
int lawRune = 42;
int irit = 439;
int kwuarm = 441;
int dwarfWeed = 443;
int[] herbs = {HalfDragonSquareShield1, HalfDragonSquareShield2, halfKey1, halfKey2, 438, irit, 440, kwuarm, 442, dwarfWeed, 815, 817, 819, 821, 823, 933, lawRune};
//client extension;
public Abyte0_GetSnape(Extension e) {
super(e);
//extension = new client();
}
public void init(String params) {
String[] str = params.split(",");
if (str.length >= 2) {
fmode = Integer.parseInt(str[0]);
foodId = Integer.parseInt(str[1]);
} else {
print("You should use: Abyte0_GetSnape Fmode,FoodId lobs = 373");
print("It does eat at Bank....");
}
print("=-=-=-=-=-=-=-=-=");
print(" ");
print("Snape / Limp Collector - By mofo");
print("Edited by Abyte0 to eat and chose F Mode and FoodId");
print("-");
print("V2");
print("-");
print("Fmode = " + fmode);
print("foodId = " + foodId);
//extension.System.out.println("Lost connection");
}
public int main() {
if (getFightMode() != fmode)
setFightMode(fmode);
if (getFatigue() > 90) {
useSleepingBag();
return 1000;
}
if (isBanking()) {
if (getInventoryCount(220) > 0) {
deposit(220, getInventoryCount(220));
return random(1000, 1500);
}
if (getInventoryCount(469) > 0) {
deposit(469, getInventoryCount(469));
return random(1000, 1500);
}
for (int h = 0; h < herbs.length; h++) {
if (getInventoryCount(herbs[h]) > 0) {
deposit(herbs[h], getInventoryCount(herbs[h]));
return random(1000, 1500);
}
}
if (getHpPercent() < 70) {
if (getInventoryCount(foodId) < 1) {
withdraw(foodId, 1);
return random(1010, 1300);
}
return 400;
}
closeBank();
}
if (isQuestMenu()) {
answer(0);
return random(6000, 6500);
}
if (isAtApproxCoords(364, 608, 20) && getInventoryCount() != 30) {
step = 0;
path = new int[]{351, 621, 336, 620, 320, 607, 307, 594, 294, 584, 282, 569};
//We need to Pick Up the Item if any on floor
for (int h = 0; h < herbs.length; h++) {
int[] groundItems = getItemById(herbs[h]);
if (groundItems[0] != -1) {
if (isAtApproxCoords(groundItems[1], groundItems[2], 8)) {
pickupItem(groundItems[0], groundItems[1], groundItems[2]);
return random(1000, 1500);
}
}
}
int[] limp = getItemById(220);
int[] snape = getItemById(469);
int[] goblin = getNpcById(67);
if (limp[0] != -1) {
pickupItem(limp[0], limp[1], limp[2]);
return random(1000, 1500);
}
if (snape[0] != -1 && goblin[0] == -1 && getInventoryCount(469) < 12) {
pickupItem(snape[0], snape[1], snape[2]);
return random(1000, 1500);
}
if (getHpPercent() > 15 && getInventoryCount(220) < 20) {
if (goblin[0] != -1 && !inCombat())
attackNpc(goblin[0]);
return random(800, 1300);
}
if (snape[0] != -1) {
pickupItem(snape[0], snape[1], snape[2]);
return random(1000, 1500);
}
return 1000;
}
if (isAtApproxCoords(282, 569, 4) && (getInventoryCount(469) > 0 || getInventoryCount(220) > 0)) {
int[] bankdoor = getObjectById(64);
if (bankdoor[0] != -1) {
atObject(bankdoor[1], bankdoor[2]);
return random(1000, 1500);
}
step = 0;
path = new int[]{294, 584, 307, 594, 320, 607, 336, 620, 351, 621, 364, 608};
int[] npc = getNpcById(95);
if (npc[0] != -1) {
if (getHpPercent() < 60) {
EatFood();
return random(400, 1000);
}
talkToNpc(npc[0]);
return random(2000, 2700);
}
}
if ((step + 1) < path.length) {
int[] bankdoor = getObjectById(64);
if (bankdoor[0] != -1) {
atObject(bankdoor[1], bankdoor[2]);
return random(1000, 1500);
}
if (isAtApproxCoords(path[step], path[step + 1], 2))
step = step + 2;
walkTo(path[step] + random(-2, 2), path[step + 1] + random(-2, 2));
return random(2500, 3000);
}
loop++;
if (loop > 10) {
if (isAtApproxCoords(282, 569, 10))
path = new int[]{294, 584, 307, 594, 320, 607, 336, 620, 351, 621, 364, 608};
step = 0;
loop = 0;
}
return random(1000, 1200);
}
//public final void print(String gameText)
//{
// System.out.println(gameText);
//}
public final void EatFood() {
int foodIndex = getInventoryIndex(foodId);
useItem(foodIndex);
}
}