-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathFOGRunner.java
More file actions
8777 lines (8401 loc) · 277 KB
/
FOGRunner.java
File metadata and controls
8777 lines (8401 loc) · 277 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
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import org.rsbot.event.events.MessageEvent;
import org.rsbot.event.listeners.MessageListener;
import org.rsbot.event.listeners.PaintListener;
import org.rsbot.script.Script;
import org.rsbot.script.ScriptManifest;
import org.rsbot.script.methods.Game;
import org.rsbot.script.methods.Magic;
import org.rsbot.script.methods.Skills;
import org.rsbot.script.util.WindowUtil;
import org.rsbot.script.wrappers.*;
import org.rsbot.util.GlobalConfiguration;
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.border.LineBorder;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
@ScriptManifest(authors = {"TerraBubble"}, keywords = "Combat", name = "FOGRunner", version = 1.5, description = "A Fist of Guthix playing script by TerraBubble")
public class FOGRunner extends Script implements PaintListener,
MessageListener, MouseListener, MouseMotionListener {
final ScriptManifest properties = getClass().getAnnotation(
ScriptManifest.class);
// The GUI
private FOGRunner.FOGRunnerGUI gui;
// For Mouse Paint
public BufferedImage normal = null;
public BufferedImage clicked = null;
public BufferedImage upArrow = null;
public BufferedImage downArrow = null;
// For Main Game Stats Paint
public int cornerNum = 5;
public int statsPaint = 2;
public double statsAlpha = 1.0;
public long startTime = System.currentTimeMillis();
public long runTime = 0;
public long seconds = 0;
public long minutes = 0;
public long hours = 0;
public int startTokens = 0;
public int tokensPerHour = 0;
public int tokensGained = 0;
public int currentTokens = 0;
public int bankedTokens = 0;
public int gamesPlayed = 0;
public int gamesPerHour = 0;
public int gamesWon = 0;
public int gamesLost = 0;
public int userMouseX = 0;
public int userMouseY = 0;
public boolean userMousePressed = false;
// Extra Game Stats Paint
public int moreStats = 0;
public int moreStatsOffset = 0;
public double[] textAlpha = {0, 0, 0, 0, 0, 0, 0, 0};
public int gamesWonPerHour = 0;
public int gamesLostPerHour = 0;
public int averageCharges = 0;
public int averageChargesOpponent = 0;
public int totalCharges = 0;
public int totalChargesO = 0;
public int startRating = 0;
public int currentRating = 0;
public int gainedRating = 0;
// Status Paint
public int statusPaint = 2;
public double statusAlpha = 1.0;
public String status = "Starting Up...";
public String overallStatus = "NULL";
// Player Exp/Levels Paint
public int expPaint = 2;
public double expAlpha = 1.0;
public int[] expYs = {345, 358, 371, 384, 397, 410, 423};
public int nextPlace = 0;
public int startAttackExp = 0;
public int startStrengthExp = 0;
public int startDefenceExp = 0;
public int startMagicExp = 0;
public int startRangeExp = 0;
public int startConstitutionExp = 0;
public int startAttackLevel = 0;
public int startStrengthLevel = 0;
public int startDefenceLevel = 0;
public int startMagicLevel = 0;
public int startRangeLevel = 0;
public int startConstitutionLevel = 0;
public Rectangle attackBox = new Rectangle(7, 0, 490, 13);
public Rectangle strengthBox = new Rectangle(attackBox.x, 0,
attackBox.width, attackBox.height);
public Rectangle defenceBox = new Rectangle(attackBox.x, 0,
attackBox.width, attackBox.height);
public Rectangle magicBox = new Rectangle(attackBox.x, 0, attackBox.width,
attackBox.height);
public Rectangle rangeBox = new Rectangle(attackBox.x, 0, attackBox.width,
attackBox.height);
public Rectangle constitutionBox = new Rectangle(attackBox.x, 0,
attackBox.width, attackBox.height);
public Rectangle expGradientBox = new Rectangle(attackBox.x,
expYs[nextPlace], attackBox.width, 30);
// Button Rectangles
public Rectangle statusButtonRec = new Rectangle(560, 443, 51, 15);
public Rectangle expButtonRec = new Rectangle(statusButtonRec.x + 57, 443,
51, 15);
public Rectangle statsButtonRec = new Rectangle(expButtonRec.x + 57, 443,
51, 15);
public Rectangle moreStatsButtonRec = new Rectangle(expButtonRec.x - 10,
443 - 15, 71, 12);
// Tile Paint
public boolean canDrawTheirTile = false;
public boolean canDrawInfo = false;
// For GUI
// Main Things
public boolean dieScript = false;
public BufferedImage banner = null;
public boolean success = false;
public final File scriptFile = new File(new File(
GlobalConfiguration.Paths.getScriptsSourcesDirectory()),
"FOGRunner.java");
public final File settingsFile = new File(new File(
GlobalConfiguration.Paths.getSettingsDirectory()), "FOGRunner.txt");
public final File bannerFile = new File(new File(
GlobalConfiguration.Paths.getScriptsDirectory()), "FOGRunner.png");
public boolean loadBannerFromFile = true;
// Misc Options
public boolean useAntiBan = true;
public boolean useBandages = true;
public boolean usePrayers = false;
public boolean useAttackPrayers = false;
public boolean useSkinPrayers = false;
public boolean useQuickPrayers = false;
public String quickPrayersLong = "When Hunting";
public boolean bankTokens = false;
public boolean search = true;
public boolean screenshots = true;
public int tokensBeforeBank = 9000;
public String tokensBeforeBankS = "9000";
public int mouseSpeed = 7;
// When to use teleorb vars
public String teleorbLong = "When being Hunted";
public String teleorb = "NULL";
// Various vars for setting up the items to wield
public int[] inventoryItemsIDsX = new int[28];
public int inventoryItemsNumP;
public int[] inventoryItemsIDsP = new int[28];
public String[] inventoryItemsNamesP = new String[28];
public int inventoryItemsNum = 0;
public int[] inventoryItemsIDs = new int[39];
public String[] inventoryItemsNames = new String[39];
public int equipmentItemsNum;
public int[] equipmentItemsIDsX = new int[11];
public int[] equipmentItemsIDs = new int[11];
public String[] equipmentItemsNames = new String[11];
// ATTACK
// Arrays containing the inventoryList item index positions for wielding
// items for each combat style
public int[] meleeListIDsAdded = new int[11];
public int[] magicListIDsAdded = new int[11];
public int[] rangeListIDsAdded = new int[11];
// Arrays containing the actual inventory IDs for wielding items for each
// Combat Style
public int[] meleeEquipment;
public int[] rangeEquipment;
public int[] magicEquipment;
// Whether Combat Styles are active
public boolean meleeActive = true;
public boolean magicActive = true;
public boolean rangeActive = false;
// Attack Options for each combat style
public String meleeAttackStyle = "Attack EXP";
public String magicSpell = "Auto Highest (F2P)";
public String rangeAttackStyle = "Accurate";
// First Attack Style to Use
public String firstStyle = "Melee";
// The Current Attack Style
public String currentStyle = "Melee";
// Items to wield vars
public int inventoryListSelectedID;
public String[] startStylesP = new String[3];
public String[] startStyles1 = new String[1];
public String[] startStyles2 = new String[2];
public String[] startStyles3 = new String[3];
// DEFENCE
// Arrays containing the inventoryList item index positions for wielding
// items for each combat style
public int[] meleeListIDsAddedDefence = new int[11];
public int[] magicListIDsAddedDefence = new int[11];
public int[] rangeListIDsAddedDefence = new int[11];
// Arrays containing the actual inventory IDs for wielding items for each
// Combat Style
public int[] meleeEquipmentDefence;
public int[] rangeEquipmentDefence;
public int[] magicEquipmentDefence;
// Whether Combat Styles are active
public boolean meleeActiveDefence = true;
public boolean magicActiveDefence = true;
public boolean rangeActiveDefence = false;
// Whether to unequip other items in defence
public boolean meleeUnequip = false;
public boolean magicUnequip = false;
public boolean rangeUnequip = false;
// Defence Style
public String currentStyleDefence = "Melee";
public boolean FSGame = false;
// Items to wield vars
public int inventoryListSelectedIDDefence;
// For Script
// Spellbook Constants
public final int MODERN_SPELLBOOK = 192;
public final int ANCIENT_SPELLBOOK = 193;
public final int SPELL_WIND_RUSH = 98;
// What triggers the attack style to switch
public boolean prayerSwitch = false;
public boolean meleeSafeSpotSwitch = false;
public boolean randomGameSwitch = true;
public int nextRandomSwitch = 3;
public boolean everyGameSwitch = false;
public boolean hitSwitch = false;
public int hitSwitchMinHits = 3;
public int hitSwitchMaxHits = 5;
public int nextHitSwitch = 4;
public int hits = 0;
public int lastKnownHealth = 100;
public boolean nextRandomSwitchSet = false;
public boolean justStarted = true;
public boolean gotRatingInfo = true;
// Tiles for walking to
public RSTile entranceBefore = new RSTile(1717, 5598);
public RSTile entrance = new RSTile(1719, 5599);
// General bot stuff
public boolean loginWait = false;
public boolean meleeTimerStarted = false; // Whether the timer below has
// started
public org.rsbot.script.util.Timer meleeTimer = new org.rsbot.script.util.Timer(
100); // Timer for if melee attacking (for rock bug)
public boolean initialised = false; // Whether the script has initialised
public boolean justPlayed = false; // Whether just played a game
public boolean walkedOnce = false; // Whether you've already walked to a
// tile in the waiting room
public boolean stoneHovered = false; // Whether the mouse has already
// hovered over the stone while
// waiting
// For Unequipping Items
public final int[] eComps = {8, 11, 14, 17, 20, 23, 26, 29, 32, 35, 38};
// Whether you are hunted or not variables
public int prevHg = -1;
public int prevHd = -1;
public boolean roundOneHunted = false;
public boolean switchingRole = false;
public boolean hunted = true;
public boolean hunted2 = true;
// For doing initial settings at start of a round
public boolean setVarsRound1 = false;
public boolean setVarsRound2 = false;
// booleans for whether the round has started up
public boolean gone = false;
public boolean gone2 = false;
public boolean startedUp = false;
public boolean startedUp2 = false;
public int round = 1;
// Whether antiban should happen
public boolean antiBanTime = true;
// 'Go!' detection
public boolean goReceived = false;
public org.rsbot.script.util.Timer goTimer = new org.rsbot.script.util.Timer(
5000);
public int canGoFailed = 0;
public boolean overrideGoReceived = false;
// Timer for waiting in the centre before searching for other player
public org.rsbot.script.util.Timer t = new org.rsbot.script.util.Timer(8000);
public org.rsbot.script.util.Timer t2 = new org.rsbot.script.util.Timer(
30000);
public org.rsbot.script.util.Timer s = new org.rsbot.script.util.Timer(
10000);
public boolean timerStarted = false;
public int timerToUse = 1;
// For searching for other player
public RSTile lastKnownLoc = new RSTile(-1, -1);
public boolean searching = false;
public int spawnArea = 0;
public RSTile centerTile = new RSTile(1663, 5696);
public final int[] searchTilesXOrig = {1663, 1677, 1688, 1682, 1659, 1644,
1637, 1649};
public final int[] searchTilesYOrig = {5717, 5708, 5692, 5677, 5671, 5681,
5698, 5712};
public int[] searchTilesX = {1663, 1677, 1688, 1682, 1659, 1644, 1637,
1649};
public int[] searchTilesY = {5717, 5708, 5692, 5677, 5671, 5681, 5698,
5712};
public int searchTileOn = 0;
// Debug mode boolean
public boolean dmode = false;
// For setting prayer protection and attack
public int prayerlvl;
public int lastPrayerSet = 0;
public int lastAttackPrayerSet = 0;
public int lastSkinPrayerSet = -1;
// For setting spell
public boolean setCombatSpells = false;
// For random usage of teleorb
public int tRandom = 1;
// For banking items not allowed in the FOG arena (UBI = Unknown Bad Items)
public String UBIString = "";
public boolean bankingUBIs = false;
public final int[] food = {1895, 1893, 1891, 4293, 2142, 291, 2140, 3228,
9980, 7223, 6297, 6293, 6295, 6299, 7521, 9988, 7228, 2878, 7568,
2343, 1861, 13433, 315, 325, 319, 3144, 347, 355, 333, 339, 351,
329, 3381, 361, 10136, 5003, 379, 365, 373, 7946, 385, 397, 391,
3369, 3371, 3373, 2309, 2325, 2333, 2327, 2331, 2323, 2335, 7178,
7180, 7188, 7190, 7198, 7200, 7208, 7210, 7218, 7220, 2003, 2011,
2289, 2291, 2293, 2295, 2297, 2299, 2301, 2303, 1891, 1893, 1895,
1897, 1899, 1901, 7072, 7062, 7078, 7064, 7084, 7082, 7066, 7068,
1942, 6701, 6703, 7054, 6705, 7056, 7060, 2130, 1985, 1993, 1989,
1978, 5763, 5765, 1913, 5747, 1905, 5739, 1909, 5743, 1907, 1911,
5745, 2955, 5749, 5751, 5753, 5755, 5757, 5759, 5761, 2084, 2034,
2048, 2036, 2217, 2213, 2205, 2209, 2054, 2040, 2080, 2277, 2225,
2255, 2221, 2253, 2219, 2281, 2227, 2223, 2191, 2233, 2092, 2032,
2074, 2030, 2281, 2235, 2064, 2028, 2187, 2185, 2229, 6883, 1971,
4608, 1883, 1885, 1973, 15272, 6962, 1969, 403}; // IDs of food
// (not allowed)
public final int[] otherNAIDs = {434, 592}; // IDs of other items not
// allowed (clay, ash)
public final int[] NAIDs = concat(food, otherNAIDs);
// For detecting if you're in waiting room
public final RSTile waitingRoomTile = new RSTile(1653, 5300);
// FOG Items
public int tokenID = 12852;
public int teleorbID = 12855;
public int bandagesID = 12853;
public int[] stoneID = {12845, 12846, 12847, 12848, 12849};
public RSObject stoneObject;
// Fist of Guthix item class, with all info on an item
class FOGItem {
public String name;
public int ID;
public int tokens;
public int price = 0;
public boolean members;
public FOGItem(String tehName, int tehID, int tehTokens,
boolean isMembers) {
name = tehName;
ID = tehID;
tokens = tehTokens;
price = 0;
members = isMembers;
}
public FOGItem(String tehName, int tehID, int tehTokens, int tehPrice,
boolean isMembers) {
name = tehName;
ID = tehID;
tokens = tehTokens;
price = tehPrice;
members = isMembers;
}
public boolean hasGotPrice() {
if (price != 0) {
return true;
}
return false;
}
// Sets the price from the GE database, returns true if successful
public boolean setPrice() {
int prePrice = 0;
try {
prePrice = grandExchange.lookup(ID).getGuidePrice();
if (prePrice > 0) {
price = prePrice;
return true;
}
} catch (NullPointerException e) {
}
price = 0;
return false;
}
// Gets the Coins Per Token ratio
public int getRatio() {
if (price > 0 && tokens > 0) {
return (int) Math.round(((double) (price))
/ ((double) (tokens)));
} else {
return 0;
}
}
}
// FOG Items You Can Purchase & Sell Degraded (IDs at 0 charge)
// F2P
public FOGItem druidic_mage_top = new FOGItem("Druidic Mage Top", 12899,
300, false);
public FOGItem druidic_mage_bottom = new FOGItem("Druidic Mage Bottom",
12906, 200, false);
public FOGItem druidic_mage_hood = new FOGItem("Druidic Mage Hood", 12892,
100, false);
public FOGItem combat_robe_top = new FOGItem("Combat Robe Top", 12976, 150,
false);
public FOGItem combat_robe_bottom = new FOGItem("Combat Robe Bottom",
12983, 100, false);
public FOGItem combat_hood = new FOGItem("Combat Hood", 12969, 50, false);
public FOGItem green_dhide_coif = new FOGItem("Green D'Hide Coif", 12941,
150, false);
public FOGItem bronze_gauntlets = new FOGItem("Bronze Gauntlets", 12986,
15, false);
public FOGItem iron_gauntlets = new FOGItem("Iron Gauntlets", 12989, 30,
false);
public FOGItem steel_gauntlets = new FOGItem("Steel Gauntlets", 12992, 50,
false);
public FOGItem black_gauntlets = new FOGItem("Black Gauntlets", 12995, 75,
false);
public FOGItem mithril_gauntlets = new FOGItem("Mithril Gauntlets", 12998,
100, false);
public FOGItem adamant_gauntlets = new FOGItem("Adamant Gauntlets", 13001,
150, false);
public FOGItem rune_gauntlets = new FOGItem("Rune Gauntlets", 13004, 200,
false);
public FOGItem adamant_spikeshield = new FOGItem("Adamant Spikeshield",
12913, 50, false);
public FOGItem adamant_berserker_shield = new FOGItem(
"Adamant Berserker Shield", 12920, 100, false);
public FOGItem rune_spikeshield = new FOGItem("Rune Spikeshield", 12927,
200, false);
public FOGItem rune_berserker_shield = new FOGItem("Rune Berserker Shield",
12934, 300, false);
// P2P
public FOGItem dragon_gauntlets = new FOGItem("Dragon Gauntlets", 13007,
300, true);
public FOGItem blue_dhide_coif = new FOGItem("Blue D'Hide Coif", 12948,
200, true);
public FOGItem red_dhide_coif = new FOGItem("Red D'Hide Coif", 12955, 300,
true);
public FOGItem black_dhide_coif = new FOGItem("Black D'Hide Coif", 12962,
500, true);
public FOGItem battle_robe_top = new FOGItem("Battle Robe Top", 12878,
1500, true);
public FOGItem battle_robe_bottom = new FOGItem("Battle Robe Bottom",
12885, 1000, true);
public FOGItem battle_hood = new FOGItem("Battle Hood", 12871, 250, true);
public FOGItem[] FOGItemsF2P = {druidic_mage_top, druidic_mage_bottom,
druidic_mage_hood, combat_robe_top, combat_robe_bottom,
combat_hood, green_dhide_coif, bronze_gauntlets, iron_gauntlets,
steel_gauntlets, black_gauntlets, mithril_gauntlets,
adamant_gauntlets, rune_gauntlets, adamant_spikeshield,
adamant_berserker_shield, rune_spikeshield, rune_berserker_shield};
public FOGItem[] FOGItemsP2P = {dragon_gauntlets, blue_dhide_coif,
red_dhide_coif, black_dhide_coif, battle_robe_top,
battle_robe_bottom, battle_hood};
public FOGItem[] FOGItems = concat(FOGItemsF2P, FOGItemsP2P);
public FOGItem f2pItem;
public FOGItem p2pItem;
public int[] v = new int[100];
@SuppressWarnings("serial")
class FOGRunnerGUI extends JFrame implements ListSelectionListener,
ActionListener {
// For Entire GUI:
int screenHeight = (int) Toolkit.getDefaultToolkit().getScreenSize()
.getHeight();
private JPanel jContentPane = null;
private JPanel MainTab = null;
private JPanel OptionsTab = null;
private JPanel PrayersTab = null;
private JPanel CombatStylesTab = null;
private JPanel CombatStylesTabDefence = null;
private JPanel CombatStylesTabScrollable = null;
private JPanel CombatStylesTabScrollableDefence = null;
private JPanel MoneyTab = null;
private JTabbedPane jTabbedPane = null;
private JButton Start = null;
private JButton Cancel = null;
private JButton Save = null;
private JButton Load = null;
private final JLabel statusLabel = new JLabel();
// For Main Tab:
private final JLabel imageLabel = new JLabel();
private final JLabel notesLabel = new JLabel();
private final JLabel note1 = new JLabel();
private final JLabel note2 = new JLabel();
private final JLabel note3 = new JLabel();
private final JLabel continueNote = new JLabel();
private final JLabel authorNote = new JLabel();
private final JLabel versionNote = new JLabel();
// For Options Tab:
private JCheckBox chckbxAntiBan;
private JCheckBox chckbxBandages;
private JCheckBox chckbxDmode;
private JCheckBox chckbxSearch;
private JCheckBox chckbxScreenshots;
private JCheckBox chckbxBankTokens;
private final JLabel teleOrbLabel = new JLabel();
private final JComboBox teleOrbBox = new JComboBox();
private final JTextArea bankTokensNum = new JTextArea();
private final JLabel mouseSpeedLabel = new JLabel();
private final JLabel mouseSpeedLabel2 = new JLabel();
private final JTextArea mouseSpeedBox = new JTextArea();
private final JLabel continueNoteOptions = new JLabel();
// For Prayers Tab
private JCheckBox chckbxPrayers;
private JCheckBox chckbxAttackPrayers;
private JCheckBox chckbxSkinPrayers;
private JCheckBox chckbxQuickPrayers;
private final JLabel prayersLabel = new JLabel();
private final JLabel prayersLabel2 = new JLabel();
private final JLabel prayersAttackLabel = new JLabel();
private final JLabel prayersAttackLabel2 = new JLabel();
private final JLabel prayersSkinLabel = new JLabel();
private final JLabel prayersSkinLabel2 = new JLabel();
private final JComboBox quickPrayersBox = new JComboBox();
private final JLabel continueNotePrayers = new JLabel();
// For Money Tab
private final JLabel moneyLabel1 = new JLabel();
private JPanel itemsList = null;
private JScrollPane itemScrollPane = null;
public JLabel[] itemPrices = new JLabel[100];
public JLabel[] itemRatios = new JLabel[100];
// For Attack Styles Tab && Defence Styles Tab:
private final Color enabledColor = new Color(210, 210, 210);
private final Color disabledColor = new Color(230, 230, 230);
// ATTACK
// For Attack Styles tab:
private final JLabel inventoryNoteText1 = new JLabel();
private final JLabel inventoryNoteText2 = new JLabel();
private final JLabel inventoryNoteText3 = new JLabel();
private final JLabel combatStylesText1 = new JLabel();
private final JLabel combatStylesText2 = new JLabel();
private final JLabel combatStylesText3 = new JLabel();
private final JLabel startCombatStyleText = new JLabel();
private final JComboBox startCombatStyle = new JComboBox();
private JCheckBox chckbxFSGame;
private final JLabel switchTriggersTitle = new JLabel();
private JCheckBox prayerTrigger;
private JCheckBox meleeSafeSpotTrigger;
private JCheckBox everyGameTrigger;
private JCheckBox randomGameTrigger;
private JCheckBox hitTrigger;
private final JTextArea hitTriggerBox1 = new JTextArea();
private final JLabel hitTriggerText1 = new JLabel();
private final JTextArea hitTriggerBox2 = new JTextArea();
private final JLabel hitTriggerText2 = new JLabel();
// For Inventory List:
private DefaultListModel model;
private JLabel inventoryTitleText;
private JScrollPane scrollPane;
private JList invList;
// For Melee Section:
private JCheckBox chckbxMelee;
private JPanel meleePanel = null;
private final Rectangle meleeArea = new Rectangle(285, 87, 430, 117);
private DefaultListModel meleeModel;
private JLabel meleeTitleText; // List Stuff
private JScrollPane meleeScrollPane;
private JList meleeList;
private JButton meleeAdd = null;
private JButton meleeRemove = null;
private JLabel meleeOptionsTitle;
private JLabel meleeAttackStyleTitle; // Options Stuff
private final JComboBox meleeAttackStyleBox = new JComboBox();
private JCheckBox chckbxMagic;
private JPanel magicPanel = null;
private final Rectangle magicArea = new Rectangle(285, 207, 430, 117);
private DefaultListModel magicModel;
private JLabel magicTitleText; // List Stuff
private JScrollPane magicScrollPane;
private JList magicList;
private JButton magicAdd = null;
private JButton magicRemove = null;
private JLabel magicOptionsTitle;
private JLabel magicCastSpellTitle; // Options Stuff
private final JComboBox magicCastSpell = new JComboBox();
private JCheckBox chckbxRange;
private JPanel rangePanel = null;
private final Rectangle rangeArea = new Rectangle(285, 327, 430, 117);
private DefaultListModel rangeModel;
private JLabel rangeTitleText; // List Stuff
private JScrollPane rangeScrollPane;
private JList rangeList;
private JButton rangeAdd = null;
private JButton rangeRemove = null;
private JLabel rangeOptionsTitle;
private JLabel rangeAttackStyleTitle; // Options Stuff
private final JComboBox rangeAttackStyleBox = new JComboBox();
// DEFENCE
// For Defence Styles tab:
private final JLabel inventoryNoteText1Defence = new JLabel();
private final JLabel inventoryNoteText2Defence = new JLabel();
private final JLabel inventoryNoteText3Defence = new JLabel();
private final JLabel combatStylesText1Defence = new JLabel();
private final JLabel combatStylesText2Defence = new JLabel();
private final JLabel combatStylesText3Defence = new JLabel();
private final JLabel stylesNoteDefence1 = new JLabel();
private final JLabel stylesNoteDefence2 = new JLabel();
private final JLabel stylesNoteDefence3 = new JLabel();
// For Inventory List:
private DefaultListModel modelDefence;
private JLabel inventoryTitleTextDefence;
private JScrollPane scrollPaneDefence;
private JList invListDefence;
// For Melee Section:
private JCheckBox chckbxMeleeDefence;
private JPanel meleePanelDefence = null;
private final Rectangle meleeAreaDefence = new Rectangle(285, 87, 430,
117);
private DefaultListModel meleeModelDefence;
private JLabel meleeTitleTextDefence; // List Stuff
private JScrollPane meleeScrollPaneDefence;
private JList meleeListDefence;
private JButton meleeAddDefence = null;
private JButton meleeRemoveDefence = null;
private JCheckBox chckbxMagicDefence;
private JPanel magicPanelDefence = null;
private final Rectangle magicAreaDefence = new Rectangle(285, 207, 430,
117);
private DefaultListModel magicModelDefence;
private JLabel magicTitleTextDefence; // List Stuff
private JScrollPane magicScrollPaneDefence;
private JList magicListDefence;
private JButton magicAddDefence = null;
private JButton magicRemoveDefence = null;
private JCheckBox chckbxRangeDefence;
private JPanel rangePanelDefence = null;
private final Rectangle rangeAreaDefence = new Rectangle(285, 327, 430,
117);
private DefaultListModel rangeModelDefence;
private JLabel rangeTitleTextDefence; // List Stuff
private JScrollPane rangeScrollPaneDefence;
private JList rangeListDefence;
private JButton rangeAddDefence = null;
private JButton rangeRemoveDefence = null;
public FOGRunnerGUI() {
initialize();
setVisible(true);
}
private void initialize() {
for (int i = 0; i < FOGItems.length; i++) {
itemPrices[i] = new JLabel();
itemPrices[i].setFont(new Font("SansSerif", 0, 12));
itemPrices[i].setText("Loading...");
itemRatios[i] = new JLabel();
itemRatios[i].setFont(new Font("SansSerif", 0, 12));
itemRatios[i].setText("Loading...");
}
if (screenHeight < 750) {
this.setSize(810, 570);
} else {
this.setSize(810, 710);
}
this.setContentPane(getJContentPane());
this.setTitle("FOGRunner by TerraBubble");
WindowUtil.position(this);
}
private JPanel getJContentPane() {
if (jContentPane == null) {
jContentPane = new JPanel();
jContentPane.setLayout(null);
jContentPane.add(getJTabbedPane(), null);
jContentPane.add(getStartButton(), null);
jContentPane.add(getCancelButton(), null);
jContentPane.add(getSaveButton(), null);
jContentPane.add(getLoadButton(), null);
jContentPane.add(getStatusLabel(), null);
}
return jContentPane;
}
private JTabbedPane getJTabbedPane() {
if (screenHeight < 750) {
if (jTabbedPane == null) {
jTabbedPane = new JTabbedPane();
jTabbedPane.setBounds(new Rectangle(2, 4, 805, 515));
jTabbedPane.addTab("Main", null, getMainTab(), null);
jTabbedPane.addTab("Options", null, getOptionsTab(), null);
jTabbedPane.addTab("Prayers", null, getPrayersTab(), null);
jTabbedPane.addTab("Attack Styles (Hybridding)", null,
getCombatStylesTabScrollable(), null);
jTabbedPane.addTab("Defence Styles", null,
getCombatStylesTabScrollableDefence(), null);
jTabbedPane.addTab("Money", null, getMoneyTab(), null);
}
} else {
if (jTabbedPane == null) {
jTabbedPane = new JTabbedPane();
jTabbedPane.setBounds(new Rectangle(2, 4, 805, 641));
jTabbedPane.addTab("Main", null, getMainTab(), null);
jTabbedPane.addTab("Options", null, getOptionsTab(), null);
jTabbedPane.addTab("Prayers", null, getPrayersTab(), null);
jTabbedPane.addTab("Attack Styles (Hybridding)", null,
getCombatStylesTab(), null);
jTabbedPane.addTab("Defence Styles", null,
getCombatStylesTabDefence(), null);
jTabbedPane.addTab("Money", null, getMoneyTab(), null);
}
}
return jTabbedPane;
}
private JPanel getMoneyTab() {
if (MoneyTab == null) {
MoneyTab = new JPanel();
MoneyTab.setLayout(null);
if (screenHeight < 750) {
MoneyTab.setBounds(0, 0, 775, 660);
MoneyTab.setPreferredSize(new Dimension(775, 700));
}
{
moneyLabel1.setFont(new Font("SansSerif", 0, 12));
moneyLabel1
.setText("This tab shows prices and tokens for every FOG reward so you can maximise profit from FOG tokens.");
moneyLabel1.setBounds(new Rectangle(new Point(30, 25),
moneyLabel1.getPreferredSize()));
MoneyTab.add(moneyLabel1);
int x = 40;
int y = 82;
JLabel nameText = new JLabel();
nameText.setFont(new Font("SansSerif", Font.BOLD, 12));
nameText.setText("Name");
nameText.setBounds(new Rectangle(new Point(x + 10, y + 3),
nameText.getPreferredSize()));
MoneyTab.add(nameText);
JPanel nameTitle = new JPanel();
nameTitle.setLayout(null);
nameTitle.setBounds(x, y + 1, 181, 18);
nameTitle.setBackground(enabledColor);
nameTitle.setBorder(new LineBorder(Color.BLACK));
MoneyTab.add(nameTitle);
JLabel tokensText = new JLabel();
tokensText.setFont(new Font("SansSerif", Font.BOLD, 12));
tokensText.setText("FOG Tokens");
tokensText.setBounds(new Rectangle(
new Point(x + 190, y + 3), tokensText
.getPreferredSize()));
MoneyTab.add(tokensText);
JPanel tokensTitle = new JPanel();
tokensTitle.setLayout(null);
tokensTitle.setBounds(x + 180, y + 1, 121, 18);
tokensTitle.setBackground(enabledColor);
tokensTitle.setBorder(new LineBorder(Color.BLACK));
MoneyTab.add(tokensTitle);
JLabel priceText = new JLabel();
priceText.setFont(new Font("SansSerif", Font.BOLD, 12));
priceText.setText("GE Market Price");
priceText.setBounds(new Rectangle(
new Point(x + 310, y + 3), priceText
.getPreferredSize()));
MoneyTab.add(priceText);
JPanel priceTitle = new JPanel();
priceTitle.setLayout(null);
priceTitle.setBounds(x + 300, y + 1, 121, 18);
priceTitle.setBackground(enabledColor);
priceTitle.setBorder(new LineBorder(Color.BLACK));
MoneyTab.add(priceTitle);
JLabel ratioText = new JLabel();
ratioText.setFont(new Font("SansSerif", Font.BOLD, 12));
ratioText.setText("GP Per Token");
ratioText.setBounds(new Rectangle(
new Point(x + 430, y + 3), ratioText
.getPreferredSize()));
MoneyTab.add(ratioText);
JPanel ratioTitle = new JPanel();
ratioTitle.setLayout(null);
ratioTitle.setBounds(x + 420, y + 1, 121, 18);
ratioTitle.setBackground(enabledColor);
ratioTitle.setBorder(new LineBorder(Color.BLACK));
MoneyTab.add(ratioTitle);
JLabel membersText = new JLabel();
membersText.setFont(new Font("SansSerif", Font.BOLD, 12));
membersText.setText("Members?");
membersText.setBounds(new Rectangle(new Point(x + 550,
y + 3), membersText.getPreferredSize()));
MoneyTab.add(membersText);
JPanel membersTitle = new JPanel();
membersTitle.setLayout(null);
membersTitle.setBounds(x + 540, y + 1, 155, 18);
membersTitle.setBackground(enabledColor);
membersTitle.setBorder(new LineBorder(Color.BLACK));
MoneyTab.add(membersTitle);
itemScrollPane = new JScrollPane(getItemsList(),
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
if (screenHeight < 750) {
itemScrollPane.setBounds(x, y + 18, 695, 250);
} else {
itemScrollPane.setBounds(x, y + 18, 695, 360);
}
MoneyTab.add(itemScrollPane);
}
}
return MoneyTab;
}
private JPanel getItemsList() {
if (itemsList == null) {
itemsList = new JPanel();
itemsList.setLayout(null);
itemsList.setBounds(40, 100, 695, 404);
itemsList.setPreferredSize(new Dimension(695, 410));
for (int i = 0; i < FOGItems.length; i++) {
JLabel nameLabel = new JLabel();
nameLabel.setFont(new Font("SansSerif", 0, 12));
nameLabel.setText(FOGItems[i].name);
nameLabel.setBounds(new Rectangle(new Point(3, v[i] + 1),
nameLabel.getPreferredSize()));
itemsList.add(nameLabel);
JLabel tokensLabel = new JLabel();
tokensLabel.setFont(new Font("SansSerif", 0, 12));
tokensLabel.setText("" + FOGItems[i].tokens);
tokensLabel.setBounds(new Rectangle(
new Point(195, v[i] + 1), tokensLabel
.getPreferredSize()));
itemsList.add(tokensLabel);
itemPrices[i].setBounds(new Rectangle(new Point(315,
v[i] + 1), itemPrices[i].getPreferredSize()));
itemsList.add(itemPrices[i]);
itemRatios[i].setBounds(new Rectangle(new Point(435,
v[i] + 1), itemRatios[i].getPreferredSize()));
itemsList.add(itemRatios[i]);
JLabel membersLabel = new JLabel();
membersLabel.setFont(new Font("SansSerif", 0, 12));
if (FOGItems[i].members) {
membersLabel.setText("Yes");
} else {
membersLabel.setText("No");
}
membersLabel.setBounds(new Rectangle(new Point(555,
v[i] + 1), membersLabel.getPreferredSize()));
itemsList.add(membersLabel);
JPanel itemPanel = new JPanel();
itemPanel.setBounds(0, v[i], 695, 17);
if ((v[i] + 2) % 2 == 0) { // if v is even
itemPanel.setBackground(disabledColor);
} else {
itemPanel.setBackground(enabledColor);
}
itemsList.add(itemPanel);
}
}
return itemsList;
}
private JPanel getCombatStylesTabScrollable() {
if (CombatStylesTabScrollable == null) {
CombatStylesTabScrollable = new JPanel();
CombatStylesTabScrollable.setLayout(null);
{
JScrollPane theScrollPane = new JScrollPane(
getCombatStylesTab(),
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
theScrollPane.setBounds(0, 0, 775, 465);
CombatStylesTabScrollable.add(theScrollPane);
}
}
return CombatStylesTabScrollable;
}
private JPanel getCombatStylesTabScrollableDefence() {
if (CombatStylesTabScrollableDefence == null) {
CombatStylesTabScrollableDefence = new JPanel();
CombatStylesTabScrollableDefence.setLayout(null);
{
JScrollPane theScrollPane = new JScrollPane(
getCombatStylesTabDefence(),
JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
theScrollPane.setBounds(0, 1, 775, 465);
CombatStylesTabScrollableDefence.add(theScrollPane);
}
}
return CombatStylesTabScrollableDefence;
}
private JButton getStartButton() {
if (Start == null) {
Start = new JButton();
if (screenHeight < 750) {
Start.setBounds(new Rectangle(10, 513, 100, 25));
} else {
Start.setBounds(new Rectangle(10, 648, 100, 25));
}
Start.setText("Start");
Start.addActionListener(this);
}
return Start;
}
private JButton getCancelButton() {
if (Cancel == null) {
Cancel = new JButton();
if (screenHeight < 750) {
Cancel.setBounds(new Rectangle(110, 513, 100, 25));
} else {
Cancel.setBounds(new Rectangle(110, 648, 100, 25));
}
Cancel.setText("Cancel");
Cancel.addActionListener(this);
}
return Cancel;
}
private JButton getSaveButton() {
if (Save == null) {
Save = new JButton();
if (screenHeight < 750) {
Save.setBounds(new Rectangle(550, 513, 120, 25));
} else {
Save.setBounds(new Rectangle(550, 648, 120, 25));
}
Save.setText("Save Settings");
Save.addActionListener(this);
}
return Save;
}
private JButton getLoadButton() {
if (Load == null) {
Load = new JButton();
if (screenHeight < 750) {
Load.setBounds(new Rectangle(670, 513, 120, 25));
} else {
Load.setBounds(new Rectangle(670, 648, 120, 25));
}
Load.setText("Load Settings");
Load.addActionListener(this);
}
return Load;
}
private JLabel getStatusLabel() {
statusLabel.setFont(new Font("SansSerif", 0, 12));
statusLabel.setText("");
setStatusLabelBounds();
return statusLabel;
}
private void setStatusLabelBounds() {
if (screenHeight < 750) {
statusLabel.setBounds(new Rectangle(
new Point(405 - (int) (statusLabel.getPreferredSize()
.getWidth() / 2), 513), statusLabel
.getPreferredSize()));
} else {
statusLabel.setBounds(new Rectangle(