Repository navigation
Expand file tree
/
Copy pathAbyte0_Sinister.java
More file actions
562 lines (504 loc) · 16.9 KB
/
Copy pathAbyte0_Sinister.java
File metadata and controls
562 lines (504 loc) · 16.9 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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
import javax.swing.*;
import java.awt.*;
//Version 1.0 - Safety Teleport + SafeRun
//Version 1.1 - Drag med added + Run From Bats
//Version 1.2 - Strike to get key
public class Abyte0_Sinister extends Abyte0_Script {
int windBolt = 8;
int waterBolt = 11;
int earthBolt = 14;
int fireBolt = 17;
int FireRune = 31;
int WaterRune = 32;
int AirRune = 33;
int EarthRune = 34;
int deathRunes = 38;
int nature = 40;
int law = 42;
int CosmicRune = 46;
int mindRunes = 35;
int chaosRunes = 41;
int bloodRunes = 619;
//-- Default Settings --
int fMode = 3;
int foodId = 373;
int spellId = 8;
int runesCount = 2500;
int inventoryCount = 15;
boolean useAlternateSpell = true;
int alternateSpellId = 6; //Blood = 37, death = 20;, wind strike = 0, 6 = fire strike (3 fires)
int alternateRunesCount = 100;
int alternateRunesCount2 = 300;
int alternateRunesId = mindRunes;
int alternateRunesId2 = FireRune;
//-----------------------
int cptRunesToBankAt = 100;//zero is too dangerous as you cant hit with 0 str and 0 attack so you fight to death if stuck
int chaosDruids = 270;
int salarinId = 567;
int[] allNpcIds = {chaosDruids, salarinId};
int sinisterKey = 932;
int halfKey1 = 526;
int halfKey2 = 527;
int WhiteBerries = 471;
int HalfDragonSquareShield1 = 1276;
int HalfDragonSquareShield2 = 1277;
int DragonMed = 795;
int superDef1 = 497;
int irit = 439;
int avantoe = 440;
int kwuarm = 441;
int dwarfWeed = 443;
int vial = 465;
String[] itemsName = {"Shield + Keys + Law + Pot", "All Good Items"};
int[] items0 = {DragonMed, HalfDragonSquareShield1, HalfDragonSquareShield2, sinisterKey, halfKey1, halfKey2, law, superDef1};
int[] items1 = {DragonMed, HalfDragonSquareShield1, HalfDragonSquareShield2, sinisterKey, halfKey1, halfKey2, law, deathRunes, mindRunes, CosmicRune, FireRune, AirRune, WhiteBerries, EarthRune, WaterRune, superDef1, 438, irit, avantoe, kwuarm, 442, dwarfWeed, 815, 817, 819, 821, 823, 933};
Object[] itemsList = {items0, items1};
int[] items = items1; //Default Setting
String[] fModeName = {"Attack", "Defence", "Strength", "Controlled"};
int[] fModeIdList = {2, 3, 1, 0};
String[] spellName = {"Wind strike", "Wind bolt"};
int[] spellIdList = {0, 8};
int camelotTeleport = 22;
String[] runesCountName = {"500", "1000", "2500", "5000"};
int[] runesCountList = {500, 1000, 2500, 5000};
String[] foodName = {"Tunas", "Lobs", "Swordfish", "Sharks"};
int[] foodIdList = {367, 373, 370, 546};
String[] foodCountName = {"0", "5", "10", "12", "4"};
int[] foodCountList = {30, 25, 20, 18, 15};
String[] drinkOrNotName = {"Drink", "No Drink"};
int drinkOrNot = 0; //Default Setting
public Abyte0_Sinister(Extension e) {
super(e);
}
public void init(String params) {
print("--");
print("Hosted By: Harry");
print("Hosted By: Harry");
print("Hosted By: Harry");
print("Hosted By: Harry");
print("--");
if (!params.equals("default")) {
Frame frame = new Frame("Select Fighting Mode");
String choiceF = (String) JOptionPane.showInputDialog(frame, "Items:\n", "Fighting Mode Selection", JOptionPane.PLAIN_MESSAGE, null, fModeName, null);
for (int i = 0; i < fModeName.length; i++) {
if (fModeName[i].equals(choiceF)) {
fMode = fModeIdList[i];
break;
}
}
print("fMode = " + choiceF);
print("--");
Frame frameS = new Frame("Select Spell");
String choiceS = (String) JOptionPane.showInputDialog(frameS, "Items:\n", "Spell Selection", JOptionPane.PLAIN_MESSAGE, null, spellName, null);
for (int i = 0; i < spellName.length; i++) {
if (spellName[i].equals(choiceS)) {
spellId = spellIdList[i];
break;
}
}
print("Spell = " + choiceS);
print("--");
Frame frameSpellCount = new Frame("Select how many runes to withdraw from bank");
String choiceRunesCount = (String) JOptionPane.showInputDialog(frameSpellCount, "Items:\n", "Runes Count Selection", JOptionPane.PLAIN_MESSAGE, null, runesCountName, null);
for (int i = 0; i < runesCountName.length; i++) {
if (runesCountName[i].equals(choiceRunesCount)) {
runesCount = runesCountList[i];
break;
}
}
print("Total Runes to withdraw when banking = " + choiceRunesCount);
print("--");
Frame frameFood = new Frame("Select Food");
String choiceFood = (String) JOptionPane.showInputDialog(frameFood, "Items:\n", "Food Selection", JOptionPane.PLAIN_MESSAGE, null, foodName, null);
for (int i = 0; i < foodName.length; i++) {
if (foodName[i].equals(choiceFood)) {
foodId = foodIdList[i];
break;
}
}
print("Food = " + choiceFood);
print("--");
Frame frameFoodCount = new Frame("Select how many rooms to keep in inventory");
String choiceFoodCount = (String) JOptionPane.showInputDialog(frameFoodCount, "Items:\n", "Food Count Selection", JOptionPane.PLAIN_MESSAGE, null, foodCountName, null);
for (int i = 0; i < foodCountName.length; i++) {
if (foodCountName[i].equals(choiceFoodCount)) {
inventoryCount = foodCountList[i];
break;
}
}
print("Total Inventory empty rooms after banking = " + choiceFoodCount);
print("--");
Frame framePickUp = new Frame("Select PickUp");
String choicePickUp = (String) JOptionPane.showInputDialog(framePickUp, "Items:\n", "Pick Up Selection", JOptionPane.PLAIN_MESSAGE, null, itemsName, null);
for (int i = 0; i < itemsName.length; i++) {
if (itemsName[i].equals(choicePickUp)) {
items = (int[]) itemsList[i];
break;
}
}
print("PickUp = " + choicePickUp);
print("--");
Frame frameDrink = new Frame("Select To Drink Super Def or Not");
String choiceDrink = (String) JOptionPane.showInputDialog(frameDrink, "Items:\n", "Drink Selection", JOptionPane.PLAIN_MESSAGE, null, drinkOrNotName, null);
for (int i = 0; i < drinkOrNotName.length; i++) {
if (drinkOrNotName[i].equals(choiceDrink)) {
drinkOrNot = i;
break;
}
}
print("Drink = " + choiceDrink);
print("--");
} else
print("Default settings: Defence, 2500 chaos, 100 fire strike, Lobsters, 15 empty spaces, drink, pick all items");
print("Sinister Key Banker by: Abyte0");
print("Version 1.2 - Strike to get key");
print("--");
print("Hosted By: Harry");
print("--");
}
public int main() {
if (getFightMode() != fMode)
setFightMode(fMode);
//if we want to drink + we have a pot + we are to regular level def or lower we want to drink
if (drinkOrNot == 0 && getInventoryCount(superDef1) > 0 && getLevel(1) + 5 >= getCurrentLevel(1)) {
if (inCombat()) {
RunFromCombat();
return random(200, 400);
}
useItem(getInventoryIndex(superDef1));
return random(1100, 1300);
}
//if we have a empty vial we drop it
if (getInventoryCount(vial) > 0) {
if (inCombat()) {
RunFromCombat();
return random(200, 400);
}
dropItem(getInventoryIndex(vial));
return random(1000, 1200);
}
//if we in the room
if (getX() >= 581 && getX() <= 585 && getY() >= 3551 && getY() <= 3576) {
if (getHpPercent() < 20 && getInventoryCount(foodId) == 0) {
castOnSelf(camelotTeleport);
print("Emergency teleport exit and stop");
setAutoLogin(false);
logout();
stopScript();
return random(5400, 5000);
}
//if we are low life
if (getHpPercent() < 60) {
if (inCombat()) {
RunFromCombat();
return random(200, 400);
}
if (getInventoryCount(foodId) == 0) {
//get the fuck out and hurry
if (getY() < 3564) {
RunSouthOrAttackSouth(allNpcIds);
return 200;
}
int[] pileOfMud = getObjectById(636);
if (pileOfMud[0] != -1) {
atObject(pileOfMud[1], pileOfMud[2]);
return random(200, 600);
}
}
EatFood();
return random(1600, 2000);
}
if (getInventoryCount(foodId) <= 1 || (getInventoryCount(mindRunes) <= cptRunesToBankAt && getInventoryCount(chaosRunes) <= cptRunesToBankAt)) {
//get the fuck out before its too late
if (getY() >= 3570) {
int[] pileOfMud = getObjectById(636);
if (pileOfMud[0] != -1) {
atObject(pileOfMud[1], pileOfMud[2]);
return random(200, 600);
}
} else
RunSouthOrAttackSouth(allNpcIds);
return random(500, 700);
}
//We need to Pick Up the Item if any on floor
for (int h = 0; h < items.length; h++) {
int[] groundItems = getItemById(items[h]);
if (groundItems[0] != -1) {
if (isAtApproxCoords(groundItems[1], groundItems[2], 8)) {
//if in combat we run else we pickup
if (inCombat()) {
RunFromCombat();
return random(300, 500);
}
//if we dont have room to pickup the item we eat a food
if (getInventoryCount() == 30) {
EatFood();
return random(3300, 3500);
}
//we finaly pick the item :D
pickupItem(groundItems[0], groundItems[1], groundItems[2]);
return random(1000, 1500);
}
}
}
//we need ot fight the npc
int[] salarin = getAllNpcById(salarinId);
if (salarin[0] != -1) {
if (!isAtApproxCoords(salarin[1], salarin[2], 5)) {
walkTo(salarin[1], salarin[2]);
return random(1300, 1400);
}
if (useAlternateSpell && getInventoryCount(alternateRunesId) > 0 && (alternateRunesId2 == -1 || getInventoryCount(alternateRunesId2) > 4))
mageNpc(salarin[0], alternateSpellId);
else if (spellId == windBolt && getInventoryCount(WaterRune) >= 2)
mageNpc(salarin[0], waterBolt);
else if (spellId == windBolt && getInventoryCount(EarthRune) >= 3)
mageNpc(salarin[0], earthBolt);
else if (spellId == windBolt && getInventoryCount(FireRune) >= 4)
mageNpc(salarin[0], fireBolt);
else
mageNpc(salarin[0], spellId);
return random(1300, 1400);
}
if (getFatigue() > 20) {
if (inCombat()) {
RunFromCombat();
return random(200, 400);
}
useSleepingBag();
return 3000;
}
int[] druids = getAllNpcById(chaosDruids);
if (druids[0] != -1 && druids[2] <= 3560) {
mageNpc(druids[0], spellId);
return random(1300, 1400);
}
if (getX() != 583 && getY() != 3556) {
//if no monster then we may want to wait away
walkTo(583, 3556);//Center room
print("Nothing to do, walkback");
return random(700, 950);
}
return random(1200, 1400);
}
if (isBanking()) {
for (int h = 0; h < items.length; h++) {
if (items[h] == law) continue;
if (items[h] == mindRunes) continue;
if (items[h] == FireRune) continue;
if (getInventoryCount(items[h]) > 0) {
deposit(items[h], getInventoryCount(items[h]));
return random(1000, 1500);
}
}
if (spellId == 0 && getInventoryCount(mindRunes) < runesCount) {
withdraw(mindRunes, runesCount - getInventoryCount(mindRunes));
return random(1000, 1500);
}
if (getInventoryCount(law) > 60) {
deposit(law, 50);
return random(2000, 3500);
}
if (getInventoryCount(law) < 1) {
withdraw(law, 1);
return random(1000, 1500);
}
if (spellId == 8 && getInventoryCount(chaosRunes) < runesCount) {
withdraw(chaosRunes, runesCount - getInventoryCount(chaosRunes));
return random(1000, 1500);
}
if (useAlternateSpell && getInventoryCount(alternateRunesId) < alternateRunesCount) {
withdraw(alternateRunesId, alternateRunesCount - getInventoryCount(alternateRunesId));
return random(1000, 1500);
}
if (useAlternateSpell && alternateRunesId2 != -1 && getInventoryCount(alternateRunesId2) < alternateRunesCount2) {
withdraw(alternateRunesId2, alternateRunesCount2 - getInventoryCount(alternateRunesId2));
return random(1000, 1500);
}
if (getInventoryCount() < inventoryCount) {
withdraw(foodId, inventoryCount - getInventoryCount());
return random(1000, 1500);
}
closeBank();
}
//If we need to go bank
if (getInventoryCount(foodId) <= 1 || (getInventoryCount(mindRunes) <= cptRunesToBankAt && getInventoryCount(chaosRunes) <= cptRunesToBankAt)) {
print("We must go Bank");
//if we in small house near bank we mmust go outside
if (getX() >= 589 && getX() <= 593 && getY() >= 761 && getY() <= 764) {
//If not next to door we walk to it
if (getX() != 591 && getY() != 764) {
walkTo(591, 764);
return random(100, 400);
}
//Else we open the door if open
int[] doorObj = getWallObjectById(2);
if (doorObj[0] != -1) {
if (isAtApproxCoords(doorObj[1], doorObj[2], 2)) {
atWallObject(doorObj[1], doorObj[2]);
return random(200, 500);
}
}
//Else we walk outside
walkTo(591, 765);
return random(100, 1500);
}
//IF WE NEAR BANK BUT OUTSIDE HOUSE
if (isAtApproxCoords(585, 753, 30)) {
if (!isQuestMenu()) {
int[] banker = getNpcByIdNotTalk(95);
if (banker[0] != -1) {
talkToNpc(banker[0]);
return random(2000, 2700);
}
return 1000;
} else {
answer(0);
return 6000;
}
}
//downstair near bank we want to go upstair
if (getX() >= 591 && getX() <= 596 && getY() >= 3590 && getY() <= 3597) {
int[] stair = getObjectById(43);
if (stair[0] != -1) {
if (inCombat()) {
RunFromCombat();
return random(200, 400);
}
atObject(stair[1], stair[2]);
return random(300, 400);
}
}
//Chaos Druids rooom
if (getX() >= 576 && getX() <= 598 && getY() >= 3580 && getY() <= 3589) {
if (getX() >= 585) {
//door side lest pick lock door
int[] door = getWallObjectById(162);
if (door[0] != -1)
atWallObject2(door[1], door[2]);
return random(300, 400);
} else {
//Stair Side lest walk to center room
walkTo(585, 3585);
return random(300, 400);
}
}
//Chaos Druids JUNK SPOT
if (getX() >= 582 && getX() <= 583 && getY() == 3589) {
//walk to center room
walkTo(585, 3585);
return random(300, 400);
}
//If we down the Pile of Mud
if (getX() >= 570 && getX() <= 585 && getY() >= 3520 && getY() <= 3535) {
int[] stairObj = getObjectById(629);
if (stairObj[0] != -1) {
atObject(stairObj[1], stairObj[2]);
return random(200, 500);
}
}
} else {
//we can go to war
//if we in front of the room door we want to open and enter
if (getX() == 591 && getY() == 765) {
//we open the door
int[] doorObj = getWallObjectById(2);
if (doorObj[0] != -1) {
if (isAtApproxCoords(doorObj[1], doorObj[2], 2)) {
atWallObject(doorObj[1], doorObj[2]);
return random(200, 500);
}
}
//Else we walk inside
walkTo(591, 764);
return random(100, 1500);
}
//if we in small house near bank we mmust go outside
if (getX() >= 589 && getX() <= 593 && getY() >= 761 && getY() <= 764) {
//we in the hosue so we need ot get downstairs
int[] stairObj = getObjectById(42);
if (stairObj[0] != -1) {
atObject(stairObj[1], stairObj[2]);
return random(200, 500);
}
}
//IF WE NEAR BANK BUT OUTSIDE HOUSE
if (isAtApproxCoords(585, 753, 30)) {
//we want to walk to the house
walkTo(591, 765);
return random(400, 500);
}
//downstair near bank we want to get to chaos
if (getX() >= 591 && getX() <= 596 && getY() >= 3590 && getY() <= 3597) {
int[] door = getWallObjectById(162);
if (door[0] != -1) {
if (inCombat()) {
RunFromCombat();
return random(200, 400);
}
atWallObject2(door[1], door[2]);
return random(300, 400);
}
}
//Chaos Druids rooom
if (getX() >= 576 && getX() <= 598 && getY() >= 3580 && getY() <= 3589) {
if (getX() > 585) {
//door side we wnt to walk to center
walkTo(585, 3585);
return random(300, 400);
} else {
//Stair Side we want to use the stairs
int[] stairObj = getObjectById(630);
if (stairObj[0] != -1) {
atObject(stairObj[1], stairObj[2]);
return random(200, 500);
}
}
}
//Chaos Druids JUNK SPOT
if (getX() >= 582 && getX() <= 583 && getY() == 3589) {
//walk to center room
walkTo(585, 3585);
return random(300, 400);
}
//If we down the Pile of Mud
if (getX() >= 570 && getX() <= 585 && getY() >= 3520 && getY() <= 3535) {
int[] stairObj = getObjectById(633);
if (stairObj[0] != -1) {
atObject(stairObj[1], stairObj[2]);
return random(200, 500);
}
}
}
return random(2000, 2500);
}
public final void EatFood() {
int foodIndex = getInventoryIndex(foodId);
useItem(foodIndex);
}
public void RunSouthOrAttackSouth(int[] npcIds) {
boolean npcFound = false;
print("Run or attack V2");
for (int i = 0; i < npcIds.length; i++) {
int[] npcs = getNpcInRadius(npcIds[i], getX(), getY() + 1, 0);
if (npcs[0] == -1) continue;
print("attacking" + npcs[0]);
attackNpc(npcs[0]);
npcFound = true;
break;
}
if (!npcFound) {
if (random(1, 8) == 5) //Try to Bypass invisible block
walkTo(getX() + random(-1, 1), getY() + random(-1, 2));
else if (isReachable(getX(), getY() + 1))
walkTo(getX(), getY() + 1);
else if (isReachable(getX() + 1, getY() + 1))
walkTo(getX() + 1, getY() + 1);
else if (isReachable(getX() - 1, getY() + 1))
walkTo(getX() - 1, getY() + 1);
else
walkTo(getX() + random(-3, 3), getY() + random(0, 3));
print("walking to escape south");
}
}
}