This repository was archived by the owner on Dec 30, 2025. It is now read-only.
forked from crazyeyes-pb/Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFallenSuperheater.java
More file actions
2643 lines (2501 loc) · 74.3 KB
/
FallenSuperheater.java
File metadata and controls
2643 lines (2501 loc) · 74.3 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 java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.awt.geom.Ellipse2D;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Properties;
import javax.imageio.ImageIO;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFormattedTextField;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JSlider;
import javax.swing.JTabbedPane;
import javax.swing.JTextPane;
import javax.swing.border.LineBorder;
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.Bank;
import org.rsbot.script.methods.Game;
import org.rsbot.script.methods.Magic;
import org.rsbot.script.methods.Methods;
import org.rsbot.script.methods.Skills;
import org.rsbot.script.util.Timer;
import org.rsbot.script.wrappers.RSComponent;
import org.rsbot.script.wrappers.RSInterface;
import org.rsbot.script.wrappers.RSItem;
import org.rsbot.script.wrappers.RSNPC;
import org.rsbot.script.wrappers.RSObject;
import org.rsbot.script.wrappers.RSPlayer;
import org.rsbot.script.wrappers.RSTile;
/* @Updated 2.1.2011.
* * * * * Version 5.99 * * * *
*
* - Final adjustments for the banking method.
*
* The script is currently not the cleanest. I'll clean the code for 6.0.
*
* * * * * * * * * * * * * * * * *
*
*/
@ScriptManifest(authors = { "Fallen" }, keywords = { "Magic" }, name = "Fallen's Superheater", version = 5.99, description = "Superheats any kind of bars.", website = "http://www.powerbot.org/vb/showthread.php?t=474761", requiresVersion = 244)
public class FallenSuperheater extends Script implements PaintListener,
MessageListener, MouseListener, MouseMotionListener {
public class CameraHeightThread extends Thread {
@Override
public void run() {
char UD = KeyEvent.VK_UP;
if (Methods.random(0, 2) == 0) {
UD = KeyEvent.VK_DOWN;
}
keyboard.pressKey(UD);
try {
Thread.sleep(Methods.random(450, 1700));
} catch (final Exception ignored) {
}
keyboard.releaseKey(UD);
}
}
public class CameraRotateThread extends Thread {
@Override
public void run() {
char LR = KeyEvent.VK_RIGHT;
if (Methods.random(0, 2) == 0) {
LR = KeyEvent.VK_LEFT;
}
keyboard.pressKey(LR);
try {
Thread.sleep(Methods.random(450, 2600));
} catch (final Exception ignored) {
}
keyboard.releaseKey(LR);
}
}
/**
* Just a little something to make banking smoother. Probably could've done
* it simpler but who gives a shit.
*/
public class FallenBank extends Thread {
public int BANK_IFACE = 762;
public int[] BANKERS = { 44, 45, 494, 495, 499, 958, 1036, 2271, 2354,
2355, 3824, 5488, 5901, 5912, 5913, 6362, 6532, 6533, 6534,
6535, 7605, 8948, 9710, 14367 };
public int[] BANK_BOOTHS = { 2213, 4483, 6084, 11402, 11758, 12759,
14367, 19230, 24914, 25808, 26972, 27663, 29085, 34752, 35647,
36786 };
public int[] BANK_CHESTS = { 4483, 12308, 21301, 27663, 42192 };
public boolean click(final RSTile t, final int... IDS) {
mouse.move(calc.tileToScreen(t, 0.5, 0.5, 50));
try {
Thread.sleep(Methods.random(0, 100));
} catch (final InterruptedException e) {
e.printStackTrace();
}
for (final int id : IDS) {
if (objects.getTopAt(t).getID() == id) {
mouse.click(true);
return true;
}
}
return false;
}
public RSNPC nearest(final int... ids) {
final RSNPC[] allNPC = npcs.getAll();
int dist = 99;
RSNPC nearest = null;
for (final RSNPC npc : allNPC) {
for (final int id : ids) {
if (npc.getID() == id) {
final int tempDist = calc.distanceTo(npc.getLocation());
if (tempDist < dist) {
nearest = npc;
dist = tempDist;
}
}
}
}
return nearest;
}
public final boolean open() {
final RSObject Chest = objects.getNearest(BANK_CHESTS);
final RSNPC Banker = nearest(BANKERS);
final RSObject Booth = objects.getNearest(BANK_BOOTHS);
if (Chest != null) {
if (Chest.isOnScreen()) {
// if(Chest.doAction("Bank Bank Chest") ||
// Chest.doAction("Use Bank Chest") ||
// Chest.doAction("Bank Chest >")) {
if (click(Chest.getLocation(), BANK_CHESTS)
|| Chest.doAction("Bank Bank Chest")
|| Chest.doAction("Use Bank Chest")
|| Chest.doAction("Bank Chest >")) {
if (waitToOpen()) {
try {
Thread.sleep(Methods.random(200, 300));
} catch (final InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return true;
}
}
} else {
camera.turnTo(Chest.getLocation());
}
} else if (Banker != null) {
if (Banker.isOnScreen()) {
if (Banker.doAction("Bank Banker")) {
if (waitToOpen()) {
try {
Thread.sleep(Methods.random(200, 300));
} catch (final InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return true;
}
}
} else {
camera.turnTo(Banker.getLocation());
}
} else if (Booth != null) {
if (Booth.isOnScreen()) {
if (Booth.doAction("Use-quickly Bank booth")) {
if (waitToOpen()) {
try {
Thread.sleep(Methods.random(200, 300));
} catch (final InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return true;
}
}
} else {
camera.turnTo(Booth.getLocation());
}
} else {
return false;
}
return false;
}
public boolean waitToOpen() {
final int timeOut = Methods.random(2000, 3000);
final long Start = System.currentTimeMillis();
while (System.currentTimeMillis() - Start < timeOut) {
if (interfaces.get(BANK_IFACE).isValid()) {
return true;
}
try {
Thread.sleep(Methods.random(50, 100));
} catch (final InterruptedException e) {
e.printStackTrace();
}
}
return false;
}
}
public class GUI extends JFrame implements WindowListener {
private static final long serialVersionUID = -34342;
private JPanel contentPane;
private JPanel Panel1;
private JPanel Panel2;
private JPanel Panel3;
private JTabbedPane TabbedPanel;
private JButton startButton;
private JButton exitButton;
private JButton save;
private JButton load;
private JButton profitCheck;
private JRadioButton Box1;
private JRadioButton Box2;
private JRadioButton Box3;
private JRadioButton Box5; // Coal-bag
private JComboBox Options;
private JLabel OptionText;
private JLabel BoxText;
private JLabel Slider1Text;
private JLabel Slider2Text;
private JLabel FieldText1;
private JLabel FieldText2;
private JLabel FieldText3;
private JFormattedTextField TextField;
private JFormattedTextField TextField2;
private JFormattedTextField TextField3;
private JTextPane TextPanel;
private JSlider Slider1;
private JSlider Slider2;
FallenSuperheater script;
public GUI(final FallenSuperheater Superheater) {
script = Superheater;
initComponents();
}
private void addComponent(final Container container, final Component c,
final int x, final int y, final int width, final int height) {
c.setBounds(x, y, width, height);
container.add(c);
}
private void Box1ButtonActionPerformed() {
if (!BoxText.isEnabled()) {
BoxText.setEnabled(true);
TextField.setEnabled(true);
} else {
BoxText.setEnabled(false);
TextField.setEnabled(false);
}
}
private void calcProfit() {
int value = 0;
String name;
final Object item = Options.getSelectedItem().toString();
if (item.equals("Bronze")) {
BarID = bronzeBar;
Ore1 = copperOre;
Ore2 = tinOre;
BarType = "Bronze";
Ore2PerSpell = 1;
}
if (item.equals("Iron")) {
BarID = ironBar;
Ore1 = ironOre;
Ore2 = 0;
BarType = "Iron";
Ore2PerSpell = 0;
}
if (item.equals("Steel")) {
BarID = steelBar;
Ore1 = ironOre;
Ore2 = coalOre;
BarType = "Steel";
Ore2PerSpell = 2;
}
if (item.equals("Silver")) {
BarID = silverBar;
Ore1 = silverOre;
Ore2 = 0;
BarType = "Silver";
Ore2PerSpell = 0;
}
if (item.equals("Gold")) {
BarID = goldBar;
Ore1 = goldOre;
Ore2 = 0;
BarType = "Gold";
Ore2PerSpell = 0;
}
if (item.equals("Mithril")) {
BarID = mithrilBar;
Ore1 = mithrilOre;
Ore2 = coalOre;
BarType = "Mithril";
Ore2PerSpell = 4;
}
if (item.equals("Adamantite")) {
BarID = adamantBar;
Ore1 = adamantOre;
Ore2 = coalOre;
BarType = "Adamant";
Ore2PerSpell = 6;
}
if (item.equals("Runite")) {
BarID = runeBar;
Ore1 = runeOre;
Ore2 = coalOre;
BarType = "Runite";
Ore2PerSpell = 8;
}
final int Ore1P = grandExchange.lookup(Ore1).getGuidePrice();
final int Ore2P = grandExchange.lookup(Ore2).getGuidePrice()
* Ore2PerSpell;
final int NatP = grandExchange.lookup(nature).getGuidePrice();
final int BarP = grandExchange.lookup(BarID).getGuidePrice();
value = BarP - NatP - Ore1P - Ore2P;
name = grandExchange.getItemName(BarID);
JOptionPane.showMessageDialog(null, "Profit for each \"" + name
+ "\" is currently " + value + " GP.", "Profit checker", JOptionPane.INFORMATION_MESSAGE, null);
}
private void exitButtonActionPerformed() {
WaitForStart = false;
worked = false;
dispose();
}
private void initComponents() {
addWindowListener(this);
contentPane = (JPanel) getContentPane();
contentPane.setLayout(null);
contentPane.setOpaque(false);
TabbedPanel = new JTabbedPane();
Panel1 = new JPanel();
Panel2 = new JPanel();
Panel3 = new JPanel();
TabbedPanel.setFont(new Font("Verdana", Font.PLAIN, 12));
TabbedPanel.setBorder(null);
TabbedPanel.setFocusable(false);
TabbedPanel.addTab("General", Panel1);
TabbedPanel.addTab("Anti-Ban", Panel2);
TabbedPanel.addTab("Info", Panel3);
Panel1.setFont(new Font("Verdana", Font.PLAIN, 12));
Panel1.setFocusable(false);
Panel1.setLayout(null);
Panel2.setFont(new Font("Verdana", Font.PLAIN, 12));
Panel2.setFocusable(false);
Panel2.setLayout(null);
Panel3.setFont(new Font("Verdana", Font.PLAIN, 12));
Panel3.setFocusable(false);
Panel3.setLayout(null);
startButton = new JButton();
startButton.setFont(new Font("Verdana", Font.PLAIN, 12));
startButton.setText("Start");
startButton.setEnabled(true);
startButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(final java.awt.event.ActionEvent evt) {
startButtonActionPerformed();
}
});
exitButton = new JButton();
exitButton.setText("Cancel");
exitButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(final java.awt.event.ActionEvent evt) {
exitButtonActionPerformed();
}
});
load = new JButton();
load.setText("Load");
load.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(final java.awt.event.ActionEvent evt) {
if (loadOptions(OPTION_FILE)) {
JOptionPane.showMessageDialog(null, "Options successfully loaded!", "Option Loader", JOptionPane.INFORMATION_MESSAGE, null);
}
}
});
save = new JButton();
save.setText("Save");
save.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(final java.awt.event.ActionEvent evt) {
if (saveOptions(OPTION_FILE)) {
JOptionPane.showMessageDialog(null, "Options successfully saved!", "Option Saver", JOptionPane.INFORMATION_MESSAGE, null);
}
}
});
// GENERAL
final String[] types = { "Bronze", "Iron", "Steel", "Silver",
"Gold", "Mithril", "Adamantite", "Runite" };
Options = new JComboBox(types);
OptionText = new JLabel();
Options.setSelectedItem(types[2]);
OptionText.setFont(new Font("Verdana", Font.PLAIN, 14));
OptionText.setText("Which bars to make?");
Options.setBorder(null);
Options.setOpaque(false);
Options.setFocusable(false);
Options.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(final java.awt.event.ActionEvent evt) {
final String item = Options.getSelectedItem().toString();
if (item != null
&& (item == "Steel" || item == "Mithril"
|| item == "Adamantite" || item == "Runite")) {
Box5.setEnabled(true);
} else {
Box5.setEnabled(false);
}
}
});
Box5 = new JRadioButton();
Box5.setText("Use coal bag?");
final String item = Options.getSelectedItem().toString();
if (item != null
&& (item == "Steel" || item == "Mithril"
|| item == "Adamantite" || item == "Runite")) {
Box5.setEnabled(true);
} else {
Box5.setEnabled(false);
}
profitCheck = new JButton();
profitCheck.setText("Check profit");
profitCheck.addMouseListener(new java.awt.event.MouseListener() {
@Override
public void mouseClicked(final MouseEvent e) {
}
@Override
public void mouseEntered(final MouseEvent e) {
}
@Override
public void mouseExited(final MouseEvent e) {
}
@Override
public void mousePressed(final MouseEvent e) {
if (profitCheck.contains(e.getPoint())) {
profitCheck.setText("Loading...");
profitCheck.setEnabled(false);
}
}
@Override
public void mouseReleased(final MouseEvent e) {
calcProfit();
profitCheck.setText("Check profit");
profitCheck.setEnabled(true);
}
});
TextField = new JFormattedTextField();
TextField.setValue("5000");
TextField.setEnabled(false);
BoxText = new JLabel();
BoxText.setText("Casts");
BoxText.setEnabled(false);
Box1 = new JRadioButton();
Box1.setText("Log out after...");
Box1.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(final java.awt.event.ActionEvent evt) {
Box1ButtonActionPerformed();
}
});
Box2 = new JRadioButton();
Box2.setText("Calculate prices?");
Box2.setEnabled(true);
Box2.setSelected(true);
Box3 = new JRadioButton();
Box3.setText("Take a screenshot when finished?");
Box3.setEnabled(true);
Slider1Text = new JLabel();
Slider1Text.setFont(new Font("Verdana", Font.PLAIN, 12));
Slider1Text.setText("Mouse Speed (%)");
Slider1Text.setEnabled(true);
Slider1 = new JSlider();
Slider1.setMaximum(100);
Slider1.setMinimum(10);
Slider1.setBorder(null);
Slider1.setOpaque(false);
Slider1.setPaintTicks(true);
Slider1.setPaintLabels(true);
Slider1.setSnapToTicks(true);
Slider1.setMajorTickSpacing(10);
Slider1.setValue(60);
Slider1.setFocusable(false);
// ANTIBAN
Slider2Text = new JLabel();
Slider2Text.setFont(new Font("Verdana", Font.PLAIN, 12));
Slider2Text.setText("Anti-Ban efficiency (%)");
Slider2Text.setEnabled(true);
Slider2 = new JSlider();
Slider2.setMaximum(100);
Slider2.setMinimum(10);
Slider2.setBorder(null);
Slider2.setOpaque(false);
Slider2.setPaintTicks(true);
Slider2.setPaintLabels(true);
Slider2.setSnapToTicks(true);
Slider2.setMajorTickSpacing(10);
Slider2.setValue(50);
Slider2.setFocusable(false);
FieldText1 = new JLabel();
FieldText1.setFont(new Font("Verdana", Font.PLAIN, 12));
FieldText1.setText("AFK times (seconds): ");
FieldText1.setEnabled(true);
FieldText2 = new JLabel();
FieldText2.setText("Min:");
FieldText2.setEnabled(true);
FieldText3 = new JLabel();
FieldText3.setText("Max:");
FieldText3.setEnabled(true);
TextField2 = new JFormattedTextField();
TextField2.setValue("2");
TextField2.setEnabled(true);
TextField3 = new JFormattedTextField();
TextField3.setValue("10");
TextField3.setEnabled(true);
// INFO
TextPanel = new JTextPane();
TextPanel.setText("Fallen's Superheater AIO - v5.99\n\n Start the script at any bank. Have natures in your inventory and a staff with unlimited fire runes equipped.\n Place the ores in your bank so that they can be seen.");
TextPanel.setEditable(false);
TextPanel.setFont(new Font("Verdana", Font.PLAIN, 12));
TextPanel.setBorder(new LineBorder(Color.black));
// PLACEMENT
setSize(400, 400);
setTitle("Fallen's Superheater v5.99");
addComponent(contentPane, startButton, 5, 270, 375, 55);
addComponent(contentPane, exitButton, 140, 330, 100, 25);
addComponent(contentPane, TabbedPanel, 5, 5, 375, 260);
addComponent(contentPane, save, 5, 333, 60, 20);
addComponent(contentPane, load, 315, 333, 60, 20);
// PANEL 1
addComponent(Panel1, OptionText, 113, 10, 250, 25);
addComponent(Panel1, Options, 130, 42, 90, 26);
addComponent(Panel1, Box5, 25, 45, 95, 20);
addComponent(Panel1, profitCheck, 230, 45, 90, 20);
addComponent(Panel1, Box1, 5, 105, 108, 20);
addComponent(Panel1, TextField, 115, 104, 100, 20);
addComponent(Panel1, BoxText, 225, 105, 150, 20);
addComponent(Panel1, Box2, 5, 130, 200, 20);
addComponent(Panel1, Box3, 5, 155, 220, 20);
// PANEL 2
addComponent(Panel2, Slider2Text, 115, 10, 200, 20);
addComponent(Panel2, Slider2, 85, 25, 200, 50);
addComponent(Panel2, Slider1Text, 128, 155, 200, 20);
addComponent(Panel2, Slider1, 85, 170, 200, 50);
addComponent(Panel2, FieldText1, 20, 85, 150, 50);
addComponent(Panel2, FieldText2, 170, 100, 23, 20);
addComponent(Panel2, TextField2, 196, 100, 30, 20);
addComponent(Panel2, FieldText3, 240, 100, 27, 20);
addComponent(Panel2, TextField3, 268, 100, 30, 20);
// PANEL 3
addComponent(Panel3, TextPanel, 10, 10, 350, 210);
}
private boolean loadOptions(final Properties file) {
try {
file.load(new FileInputStream(new File(getCacheDirectory(), "FallenSuperheater.ini")));
} catch (final FileNotFoundException e) {
return false;
} catch (final IOException e) {
return false;
}
// Assuming we succeeded @ loading.
if (file.getProperty("Type") != null) {
Options.setSelectedItem(file.getProperty("Type"));
}
if (file.getProperty("CoalBag") != null) {
if (file.getProperty("CoalBag").equals("1")) {
Box5.setEnabled(true);
Box5.setSelected(true);
} else {
Box5.setSelected(false);
}
}
if (file.getProperty("LogOut") != null) {
if (file.getProperty("LogOut").equals("1")) {
Box1.setSelected(true);
TextField.setEnabled(true);
BoxText.setEnabled(true);
if (file.getProperty("Casts") != null) {
TextField.setValue(file.getProperty("Casts"));
}
} else {
Box1.setSelected(false);
TextField.setEnabled(false);
BoxText.setEnabled(false);
}
}
if (file.getProperty("Calculate") != null) {
if (file.getProperty("Calculate").equals("1")) {
Box2.setSelected(true);
} else {
Box2.setSelected(false);
}
}
if (file.getProperty("ScreenShot") != null) {
if (file.getProperty("ScreenShot").equals("1")) {
Box3.setSelected(true);
} else {
Box3.setSelected(false);
}
}
if (file.getProperty("AntiBan") != null) {
Slider2.setValue(Integer.parseInt(file.getProperty("AntiBan")));
}
if (file.getProperty("Min") != null) {
TextField2.setValue(file.getProperty("Min"));
}
if (file.getProperty("Max") != null) {
TextField3.setValue(file.getProperty("Max"));
}
if (file.getProperty("Mouse") != null) {
Slider1.setValue(Integer.parseInt(file.getProperty("Mouse")));
}
return true;
}
// Option stuff
private boolean saveOptions(final Properties file) {
// Type [1 = Y| 2 = N]
final String Type = Options.getSelectedItem().toString();
file.setProperty("Type", Type);
// Coal bag?
if (Box5.isSelected()) {
file.setProperty("CoalBag", "1");
} else {
file.setProperty("CoalBag", "2");
}
// Logging out
if (Box1.isSelected()) {
file.setProperty("LogOut", "1");
String Casts;
try {
Casts = TextField.getValue().toString();
} catch (final Exception e) {
Casts = "5000";
}
file.setProperty("Casts", Casts);
} else {
file.setProperty("LogOut", "2");
file.setProperty("Casts", "5000");
}
// Calculate prices?
if (Box2.isSelected()) {
file.setProperty("Calculate", "1");
} else {
file.setProperty("Calculate", "2");
}
// Screenshot?
if (Box3.isSelected()) {
file.setProperty("ScreenShot", "1");
} else {
file.setProperty("ScreenShot", "2");
}
// Anti-Ban -efficiency
final String AntiBan = String.valueOf(Slider2.getValue());
file.setProperty("AntiBan", AntiBan);
// AFK-times
String min = "2";
String max = "10";
try {
min = (String) TextField2.getValue();
max = (String) TextField3.getValue();
} catch (final Exception e) {
min = "2";
max = "10";
}
file.setProperty("Min", min);
file.setProperty("Max", max);
// MouseSpeed
final String Mouse = String.valueOf(Slider1.getValue());
file.setProperty("Mouse", Mouse);
// Saving the file.
try {
file.store(new FileWriter(new File(getCacheDirectory(), "FallenSuperheater.ini")), "Options for FallenSuperheater.");
return true;
} catch (final IOException e) {
return false;
}
}
private void startButtonActionPerformed() {
FallenSuperheater.Mouse1 = Slider1.getValue();
FallenSuperheater.Percentage = Slider2.getValue();
GUIString = Options.getSelectedItem().toString();
GUIString2 = TextField.getValue();
GUIString3 = TextField2.getValue();
GUIString4 = TextField3.getValue();
FallenSuperheater.AFK1 = Integer.parseInt((String) GUIString3);
FallenSuperheater.AFK2 = Integer.parseInt((String) GUIString4);
if (GUIString.equals("Bronze")) {
BarID = bronzeBar;
Ore1 = copperOre;
Ore2 = tinOre;
Ore1WD = 13;
Ore2WD = 13;
bankTwice = true;
BarType = "Bronze";
BarEXP = 6.25;
Ore2PerSpell = 1;
Ore1InvAm = 13;
Ore2InvAm = 13;
} else if (GUIString.equals("Iron")) {
BarID = ironBar;
Ore1 = ironOre;
// Ore2 = ironOre;
Ore1WD = 0;
// Ore2WD = 0;
bankTwice = false;
BarType = "Iron";
BarEXP = 12.5;
Ore2PerSpell = 0;
Ore1InvAm = 27;
Ore2InvAm = 0;
} else if (GUIString.equals("Steel")) {
BarID = steelBar;
Ore1 = ironOre;
Ore2 = coalOre;
if (Box5.isSelected()) {
Ore1WD = 17;
Ore1InvAm = 17;
Ore2InvAm = 9;
} else {
Ore1WD = 9;
Ore1InvAm = 9;
Ore2InvAm = 18;
}
Ore2WD = 0;
bankTwice = true;
BarType = "Steel";
BarEXP = 17.5;
Ore2PerSpell = 2;
} else if (GUIString.equals("Silver")) {
BarID = silverBar;
Ore1 = silverOre;
// Ore2 = silverOre;
Ore1WD = 0;
// Ore2WD = 0;
bankTwice = false;
BarType = "Silver";
BarEXP = 13.7;
Ore2PerSpell = 0;
Ore1InvAm = 27;
Ore2InvAm = 0;
} else if (GUIString.equals("Gold")) {
BarID = goldBar;
Ore1 = goldOre;
// Ore2 = goldOre;
Ore1WD = 0;
// Ore2WD = 0;
bankTwice = false;
BarType = "Gold";
BarEXP = 56.2;
Ore2PerSpell = 0;
Ore1InvAm = 27;
Ore2InvAm = 0;
} else if (GUIString.equals("Mithril")) {
BarID = mithrilBar;
Ore1 = mithrilOre;
Ore2 = coalOre;
if (Box5.isSelected()) {
Ore1WD = 10;
Ore1InvAm = 10;
Ore2InvAm = 16;
} else {
Ore1WD = 5;
Ore1InvAm = 5;
Ore2InvAm = 22;
}
Ore2WD = 0;
bankTwice = true;
BarType = "Mithril";
BarEXP = 30;
Ore2PerSpell = 4;
} else if (GUIString.equals("Adamantite")) {
BarID = adamantBar;
Ore1 = adamantOre;
Ore2 = coalOre;
if (Box5.isSelected()) {
Ore1WD = 7;
Ore1InvAm = 7;
Ore2InvAm = 19;
} else {
Ore1WD = 9;
Ore1InvAm = 9;
Ore2InvAm = 18;
}
Ore2WD = 0;
bankTwice = true;
BarType = "Adamant";
BarEXP = 37.5;
Ore2PerSpell = 6;
} else if (GUIString.equals("Runite")) {
BarID = runeBar;
Ore1 = runeOre;
Ore2 = coalOre;
if (Box5.isSelected()) {
Ore1WD = 5;
Ore1InvAm = 5;
Ore2InvAm = 21;
} else {
Ore1WD = 3;
Ore1InvAm = 3;
Ore2InvAm = 24;
}
Ore2WD = 0;
bankTwice = true;
BarType = "Runite";
BarEXP = 50;
Ore2PerSpell = 8;
}
// MOUSESPEED
if (FallenSuperheater.Mouse1 == 100) {
Mouse2 = 3;
} else if (FallenSuperheater.Mouse1 == 90) {
Mouse2 = 4;
} else if (FallenSuperheater.Mouse1 == 80) {
Mouse2 = 5;
} else if (FallenSuperheater.Mouse1 == 70) {
Mouse2 = 6;
} else if (FallenSuperheater.Mouse1 == 60) {
Mouse2 = 7;
} else if (FallenSuperheater.Mouse1 == 50) {
Mouse2 = 8;
} else if (FallenSuperheater.Mouse1 == 40) {
Mouse2 = 9;
} else if (FallenSuperheater.Mouse1 == 30) {
Mouse2 = 10;
} else if (FallenSuperheater.Mouse1 == 20) {
Mouse2 = 11;
} else if (FallenSuperheater.Mouse1 == 10) {
Mouse2 = 12;
}
if (Box2.isSelected()) {
DoTheMath = true;
}
if (Box1.isSelected()) {
FallenSuperheater.AmountOfCasts = Integer.parseInt((String) GUIString2);
}
if (Box3.isSelected()) {
TakeAShot = true;
}
if (Box5.isEnabled()) {
if (Box5.isSelected()) {
coalBag = true;
}
}
script.WaitForStart = false;
worked = true;
dispose();
}
@Override
public void windowActivated(final WindowEvent e) {
toFront();
}
@Override
public void windowClosed(final WindowEvent arg0) {
}
@Override
public void windowClosing(final WindowEvent arg0) {
WaitForStart = false;
worked = false;
dispose();
}
@Override
public void windowDeactivated(final WindowEvent arg0) {
}
@Override
public void windowDeiconified(final WindowEvent arg0) {
}
@Override
public void windowIconified(final WindowEvent arg0) {
}
@Override
public void windowOpened(final WindowEvent arg0) {
}
}
private enum State {
OPENBANK, SUPERHEAT,
DefaultBank, AdamantBank, CoalBagBank
}
// Mostly paint int's
private boolean renew = true;
private long startTime = 0;
private final long scriptStartTime = 0;
private long runTime = 0;
private long millis = 0;
private long seconds = 0;
private long minutes = 0;
private long hours = 0;
private int BarCounter = 0;
private int XPGained = 0, XPGainedSmithing = 0, XPGainedMagic = 0;
private int startXPM;
private int startXPS;
private int startLevelM;
private int levelsGainedM;
private int startLevelS;
private int levelsGainedS;
private int currentLevelM;
private int currentLevelS;
private Image BKG;
private int toNextLvlS;
private int nextLvlS;
private int XPToLevelS;
private int toNextLvlM;
private int nextLvlM;
private int XPToLevelM;
private long timerStart = 0;
private long pauseTimer = 0;
private long tempTimer = 0;
private long tempTimer2 = 0;
private boolean gathered = false;
private boolean MTTNL = false;
private boolean STTNL = false;
private Point mouseSpot;
private Timer expTimeOut = new Timer(1000 * 60 * 5);
private int tempExp = 0;
private int browser = 0;
private boolean readyToCast = true;
private int EXP1, EXP2;