-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathAbyte0_GuildMiner.java
More file actions
304 lines (288 loc) · 7.28 KB
/
Abyte0_GuildMiner.java
File metadata and controls
304 lines (288 loc) · 7.28 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
import java.io.*;
import java.util.Scanner;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.event.*;
import javax.swing.*;
//Version 1.1B = Door fix for new 2023-03-15 change
//Version 2024-05-01 - 1.2 = Fix report word to add extras P to avoid triggering admins warning
public class Abyte0_GuildMiner extends Abyte0_Script
{
int oreIron = 151;// Iron ore
int oreCoal = 155;// Coal ore
int oreMith = 153;// Mith ore
int RockCoal2 = 110;// Coal rock/ EAST
int RockCoal = 111;// Coal rock WEST
int RockMith = 107;// Mith rock
private final String SCRIPT_VERSION = "1.2";
boolean mith = false;
Extension myReference = null;
public Abyte0_GuildMiner ( Extension e )
{
super(e);
myReference = e;
}
@Override
public String[] getRandomQuotes()
{
String[] result = {"73","97","I bet this guy use some sort of autominer, repppport him!","Botter!","What pickaxe are you guy using?","How far are you from level 99?","Coal!!!!","Do you mine the mith?","Mining level?","Smith level?","lvl?","OMG","Got it!","Who throw the first rock?","Did you throw me a rock?","@ran@Booorrriiinngggggg"};
return result;
}
public void init ( String params )
{
print("Started Abyte0 Guild Miner");
print("Version " + SCRIPT_VERSION);
//Version 0
//4 Ways doors opener
//Version 1
//Coal only mining OR Mith then Coal mining
//based on old free guild mining script made in 2009
Frame frame = new Frame("Ores Selection");
Object[] fightModes = {"Coal", "Mith"};
String S_FightMode = (String)JOptionPane.showInputDialog(frame, "Rock/Ore:\n", "Ore Selection", JOptionPane.PLAIN_MESSAGE, null, fightModes, null);
if (S_FightMode.equals("Mith"))
{
mith = true;
print("Mining Mith then Coal...");
}
else
{
mith = false;
print("Mining Only Coal...");
}
Frame frameS = new Frame("Spot Selection");
Object[] spotName = {"Ladder Side First", "Far From Ladder First"};
String choiceSpot = (String)JOptionPane.showInputDialog(frameS, "Spot:\n", "Spot Selection", JOptionPane.PLAIN_MESSAGE, null, spotName, null);
if (choiceSpot.equals(spotName[1]))
{
RockCoal2 = 111;// Coal rock/ EAST
RockCoal = 110;// Coal rock WEST
print("Spot: " + spotName[1]);
}
else
{
RockCoal2 = 110;// Coal rock/ EAST
RockCoal = 111;// Coal rock WEST
print("Spot: " + spotName[0]);
}
print("Script loaded!");
}
public int main( )
{
SayRandomQuote();
int[] doorObj;
int[] stairs;
if(getFightMode() != 2)
{
setFightMode(2);
}
if(getFatigue() > 80)
{
useSleepingBag();
return 1000;
}
if (isQuestMenu())
{
System.out.println("Bank Answer");
answer(0);
return random(2000,2100);
}
if(isBanking())
{
if (!depositGems()) //lol don't judge me
{
return 300;
}
}
if(getInventoryCount() < 30)
{
if(!isAtApproxCoords(274, 3396, 30))
{
if(getX() == 286 && getY() == 571)
{
//Si a coter de la porte a linterieur
print("Step Outside Bank");
//atObject(287,571);
walkTo(287,571);
return random(121, 3500);
}
if(getX() >= 280 && getX() <= 286 && getY() >= 564 && getY() <= 573)
{
//Si dans la banque
//print("Walking to Door");
walkTo(286,571);
return random(240, 2500);
}
if(getX() == 274 && getY() == 562)
{
//Si a lexterieur de la House
doorObj = getWallObjectById(2);
if(doorObj[0] != -1)
{
if (isAtApproxCoords(doorObj[1], doorObj[2], 5));
atWallObject(doorObj[1], doorObj[2]);
}
print("Step Inside House");
walkTo(274,563);
return random(100, 1500);
}
if(getX() >= 272 && getX() <= 277 && getY() >= 563 && getY() <= 567)
{
//print("Step to Ladder");
stairs = getObjectById(223);
if(stairs[0] != -1)
{
atObject(stairs[1], stairs[2]);
return random(800,900);
}
}
walkTo(274,562);
return random(100, 1500);
}
else
{
if(mith)
{
int nombre = mineOre(RockMith);
if(nombre > 0)
return random(300,601);
}
//SINON si aucun mith proche
int nombre = mineOre(RockCoal);
if(nombre > 0)
return random(301,605);
nombre = mineOre(RockCoal2);
if(nombre > 0)
return random(301,605);
return random(800,900);
}
}
else
{
if (isAtApproxCoords(267,3394,9))
{
//Si downstair
stairs = getObjectById(5);
if(stairs[0] != -1)
{
if(isAtApproxCoords(stairs[1], stairs[2], 16))
{
atObject(stairs[1], stairs[2]);
return random(800,900);
}
}
else
{
print("Where the fuck is the ladder lol?");
walkTo(272,3396);
return random(800,900);
}
}
if(getX() == 274 && getY() == 563)
{
//Si a linterieur de la House
print("Step Outside House");
doorObj = getWallObjectById(2);
if(doorObj[0] != -1)
{
if (isAtApproxCoords(doorObj[1], doorObj[2], 5));
atWallObject(doorObj[1], doorObj[2]);
}
walkTo(274,562);
return random(100, 1500);
}
if(getX() >= 272 && getX() <= 277 && getY() >= 563 && getY() <= 567)
{
//Si dans la House
//print("Walk to House Door");
walkTo(274,563);
return random(102, 1500);
}
if(getX() >= 280 && getX() <= 286 && getY() >= 564 && getY() <= 573)
{
//Si dans la banque
print("Talking to Banker");
if (!isBanking())
{
int banker[] = getNpcByIdNotTalk(new int[]{95});
if (banker[0] != -1 && !isBanking())
{
talkToNpc(banker[0]);
return random(2000,3000);
}
}
return random(631, 1500);
}
if(getX() == 287 && getY() == 571)
{
//Si a coter de la porte a exterieur
print("Step Inside Bank");
//atObject(287,571);
walkTo(286,571);
return random(100, 1500);
}
walkTo(287,571);
}
return random(302,400);
}
public final int mineOre(int id)
{
int[] rock = getObjectById(id);
if( rock[0] != -1 )
{
if(rock[1] >= 263 && rock[1] <= 277 && rock[2] >= 3387 && rock[2] <= 3400)
{
//Si le rock est dans la sale...
//print("Mining : " + id);
atObject(rock[1], rock[2]);
return 1;
}
}
return 0;
}
public boolean depositGems( )
{
if ( getInventoryCount(155) > 0 )
{
deposit(155, getInventoryCount(155));
return false;
}
if(getInventoryCount(153) > 0 )
{
deposit(153, getInventoryCount(153));
return false;
}
//Saphire
if ( getInventoryCount(160) > 0 )
{
deposit(160, getInventoryCount(160));
return false;
}
//Ruby
if(getInventoryCount(158) > 0 ){ deposit(158, getInventoryCount(158)); return false;}
//Emerald
if(getInventoryCount(159) > 0 ){ deposit(159, getInventoryCount(159)); return false;}
//Diamond
if(getInventoryCount(157) > 0 ){ deposit(157, getInventoryCount(157)); return false;}
else
{
walkTo(274,562);
return true;
}
}
@Override
public void onChatMessage(String msg, String name, boolean pmod, boolean jmod) {
super.onChatMessage(msg, name, pmod, jmod);
}
@Override
public String getSctiptVersion()
{
return SCRIPT_VERSION;
}
//public final void print(String gameText)
//{
// System.out.println(gameText);
//}
}