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 pathUFletch.java
More file actions
3697 lines (3449 loc) · 113 KB
/
UFletch.java
File metadata and controls
3697 lines (3449 loc) · 113 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.Container;
import java.awt.Desktop;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Insets;
import java.awt.MenuItem;
import java.awt.Point;
import java.awt.PopupMenu;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.SystemTray;
import java.awt.TrayIcon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.image.RenderedImage;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLConnection;
import java.util.LinkedList;
import java.util.Properties;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JSlider;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
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.Environment;
import org.rsbot.script.methods.Game.Tab;
import org.rsbot.script.methods.GrandExchange.GEItem;
import org.rsbot.script.methods.Skills;
import org.rsbot.script.wrappers.RSInterface;
import org.rsbot.script.wrappers.RSItem;
@ScriptManifest(authors = { "Fletch To 99" }, keywords = "Fletching", name = "UFletch", website = "http://www.universalscripts.org/", version = 2.28, description = "The best fletcher!", requiresVersion = 245)
/**
* All-in-One Fletching script for RSBot 2.XX
* @author Fletch To 99
*/
public class UFletch extends Script implements PaintListener, MouseListener,
MouseMotionListener, MessageListener {
public class beeper implements Runnable {
private String firstMessage = "";
public void beep() {
try {
for (int i = 0; i < 3; i++) {
java.awt.Toolkit.getDefaultToolkit().beep();
Thread.sleep(250);
}
Thread.sleep(random(100, 500));
} catch (final Exception e) {
}
return;
}
public String m() {
final RSInterface chatBox = interfaces.get(137);
for (int i = 281; i >= 180; i--) {// Valid text is from 180 to 281
final String text = chatBox.getComponent(i).getText();
if (!text.isEmpty() && text.contains("<")) {
return text;
}
}
return "";
}
@Override
public void run() {
while (!b.isInterrupted()) {
text();
try {
Thread.sleep(random(50, 150));
} catch (final InterruptedException e) {
}
}
}
public void text() {
if (!m().toLowerCase().isEmpty()
&& !m().toLowerCase().equals(firstMessage)) {
beep();
firstMessage = m().toLowerCase();
}
}
}
private static interface constants {
final String[] optionMethod = { "Fletching Bow", "Stringing Bow",
"Fletch then String", "Add Stocks to limbs",
"Stringing Crossbow", "Chop, Fletch, Drop or Shaft", "Arrows",
"Bolts", "Darts" };
final String[] optionLog = { "Normal", "Oak", "Willow", "Maple", "Yew",
"Magic", "N/A" };
final String[] optionBow = { "Short", "Long", "Shafts", "Stocks",
"C'Bow (u)", "N/A" };
final String[] optionKnife = { "Normal", "clay", "N/A" };
final String[] optionAxe = { "Bronze", "Iron", "Steel", "Mith",
"Adamant", "Rune", "Dragon", "N/A" };
final String[] optionColor = { "Black", "Red", "Orange", "Blue",
"Green", "Yellow", "Pink", "White", "Tan" };
final Color TAN = new Color(220, 202, 169);
final int BOW_STRING_ID = 1777, CBOW_STRING_ID = 943, FEATHER_ID = 314,
FEATHER_SHAFT_ID = 53, SHAFT_ID = 52, xpIsClose = 13020000;
final MenuItem item1 = new MenuItem("Stop");
final MenuItem item2 = new MenuItem("Pause");
final MenuItem item3 = new MenuItem("Resume");
final MenuItem item4 = new MenuItem("Open Gui");
final MenuItem item5 = new MenuItem("Help");
final Font titleFont = new Font("Allerta", Font.PLAIN, 25);
final Font textFont = new Font("Allerta", Font.PLAIN, 11);
final Rectangle BUTTON = new Rectangle(450, 316, 65, 21);
final Rectangle RECT_ONE = new Rectangle(5, 4, 129, 36);
final Rectangle RECT_TWO = new Rectangle(136, 4, 129, 21);
final Rectangle RECT_THREE = new Rectangle(266, 4, 129, 21);
final Rectangle HIDE = new Rectangle(5, 316, 65, 21);
final Rectangle PAUSE = new Rectangle(449, 292, 66, 22);
final Rectangle STOP = new Rectangle(4, 292, 66, 22);
}
public class gui extends JFrame {
private static final long serialVersionUID = 1L;
// JFormDesigner - Variables declaration - DO NOT MODIFY
// //GEN-BEGIN:variables
private JTabbedPane tabbedPane1;
private JPanel panel4;
private JLabel label24;
private JLabel label25;
private JLabel label2;
private JComboBox comboBox2;
private JLabel label3;
private JComboBox comboBox3;
private JLabel label4;
private JLabel label5;
private JComboBox comboBox4;
private JComboBox comboBox5;
private JLabel label6;
private JLabel label7;
private JComboBox comboBox1;
private JLabel label8;
private JLabel label9;
private JLabel label10;
private JLabel label11;
private JLabel label14;
private JLabel label12;
private JTextField textField1;
private JLabel label13;
private JPanel panel2;
private JLabel label31;
private JLabel label35;
private JLabel label36;
private JLabel label37;
private JLabel label38;
private JButton button3;
private JLabel label39;
private JLabel label40;
private JCheckBox checkBox4;
private JCheckBox checkBox8;
private JCheckBox checkBox9;
private JCheckBox checkBox10;
private JCheckBox checkBox11;
private JCheckBox checkBox12;
private JCheckBox checkBox13;
private JCheckBox checkBox14;
private JLabel label21;
private JComboBox comboBox8;
private JComboBox comboBox9;
private JLabel label43;
private JLabel label44;
private JLabel label45;
private JLabel label46;
private JComboBox comboBox10;
private JComboBox comboBox11;
private JComboBox comboBox12;
private JComboBox comboBox13;
private JComboBox comboBox14;
private JComboBox comboBox15;
private JLabel label47;
private JLabel label64;
private JCheckBox checkBox17;
private JLabel label65;
private JCheckBox checkBox18;
private JPanel panel1;
private JLabel label17;
private JTextField textField2;
private JLabel label18;
private JLabel label1;
private JButton button4;
private JPanel panel3;
private JSlider slider1;
private JLabel label15;
private JLabel label16;
private JCheckBox checkBox6;
private JLabel label23;
private JCheckBox checkBox5;
private JLabel label27;
private JCheckBox checkBox1;
private JCheckBox checkBox2;
private JLabel label28;
private JCheckBox checkBox3;
private JLabel label29;
private JLabel label30;
private JLabel label48;
private JCheckBox checkBox15;
private JLabel label49;
private JCheckBox checkBox16;
private JLabel label19;
private JCheckBox checkBox7;
private JProgressBar progressBar1;
private JLabel label20;
private JButton button2;
private JButton button1;
// JFormDesigner - End of variables declaration //GEN-END:variables
public gui() {
initComponents();
}
private void button1ActionPerformed(final ActionEvent e) {
setVisible(false);
log("Task: "
+ constants.optionLog[gui.comboBox2.getSelectedIndex()]
+ " "
+ constants.optionBow[gui.comboBox3.getSelectedIndex()]
+ " "
+ constants.optionMethod[gui.comboBox1.getSelectedIndex()]);
Mouse1 = (int) slider1.getValue();
if (Mouse1 == 100) {
Mouse2 = random(1, 2);
} else if (Mouse1 == 90) {
Mouse2 = random(2, 4);
} else if (Mouse1 == 80) {
Mouse2 = random(3, 5);
} else if (Mouse1 == 70) {
Mouse2 = random(4, 6);
} else if (Mouse1 == 60) {
Mouse2 = random(5, 7);
} else if (Mouse1 == 50) {
Mouse2 = random(6, 8);
} else if (Mouse1 == 40) {
Mouse2 = random(7, 9);
} else if (Mouse1 == 30) {
Mouse2 = random(8, 10);
} else if (Mouse1 == 20) {
Mouse2 = random(10, 12);
} else if (Mouse1 == 10) {
Mouse2 = random(12, 14);
}
mouse.setSpeed(Mouse2);
button4.setEnabled(false);
textField2.setEnabled(false);
saveSettings();
}
private void button2ActionPerformed(final ActionEvent e) {
try {
Desktop.getDesktop().browse(new URL("http://www.universalscripts.org/ufletch/highscores.php").toURI());
} catch (final MalformedURLException e1) {
} catch (final IOException e1) {
} catch (final URISyntaxException e1) {
}
}
private void button3ActionPerformed(final ActionEvent e) {
try {
Desktop.getDesktop().browse(new URL("http://www.universalscripts.org/ufletch/ufletch").toURI());
} catch (final MalformedURLException e1) {
} catch (final IOException e1) {
} catch (final URISyntaxException e1) {
}
}
private void button4ActionPerformed(final ActionEvent e) {
createSignature();
name = textField2.getText();
siggy = getImage("", false, "http://www.universalscripts.org/ufletch/UFletch_generate.php?user="
+ name);
label1 = new JLabel(new ImageIcon(siggy));
}
private String getMessage() {
URLConnection url = null;
BufferedReader in = null;
if (connection) {
try {
url = new URL("http://www.universalscripts.org/ufletch/Images/message.txt").openConnection();
in = new BufferedReader(new InputStreamReader(url.getInputStream()));
return in.readLine();
} catch (final MalformedURLException e) {
} catch (final IOException e) {
}
}
return "Error getting message.";
}
private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY
// //GEN-BEGIN:initComponents
tabbedPane1 = new JTabbedPane();
panel4 = new JPanel();
label24 = new JLabel();
label25 = new JLabel();
label2 = new JLabel(new ImageIcon(logsImage));
comboBox2 = new JComboBox(constants.optionLog);
label3 = new JLabel(new ImageIcon(bow));
comboBox3 = new JComboBox(constants.optionBow);
label4 = new JLabel(new ImageIcon(knife));
label5 = new JLabel(new ImageIcon(axe));
comboBox4 = new JComboBox(constants.optionKnife);
comboBox5 = new JComboBox(constants.optionAxe);
label6 = new JLabel(new ImageIcon(settings));
label7 = new JLabel(new ImageIcon(settings));
comboBox1 = new JComboBox(constants.optionMethod);
label8 = new JLabel();
label9 = new JLabel();
label10 = new JLabel();
label11 = new JLabel();
label14 = new JLabel();
label12 = new JLabel();
textField1 = new JTextField();
label13 = new JLabel();
panel2 = new JPanel();
label31 = new JLabel();
label35 = new JLabel();
label36 = new JLabel();
label37 = new JLabel();
label38 = new JLabel();
label21 = new JLabel();
button3 = new JButton();
label39 = new JLabel();
label40 = new JLabel();
checkBox4 = new JCheckBox();
checkBox8 = new JCheckBox();
checkBox9 = new JCheckBox();
checkBox10 = new JCheckBox();
checkBox11 = new JCheckBox();
checkBox12 = new JCheckBox();
checkBox13 = new JCheckBox();
checkBox14 = new JCheckBox();
comboBox8 = new JComboBox(constants.optionColor);
comboBox9 = new JComboBox(constants.optionColor);
label43 = new JLabel();
label44 = new JLabel();
label45 = new JLabel();
label46 = new JLabel();
comboBox10 = new JComboBox(constants.optionColor);
comboBox11 = new JComboBox(constants.optionColor);
comboBox12 = new JComboBox(constants.optionColor);
comboBox13 = new JComboBox(constants.optionColor);
comboBox14 = new JComboBox(constants.optionColor);
comboBox15 = new JComboBox(constants.optionColor);
label47 = new JLabel(new ImageIcon(brush));
label64 = new JLabel();
checkBox17 = new JCheckBox();
label65 = new JLabel();
checkBox18 = new JCheckBox();
panel1 = new JPanel();
label17 = new JLabel();
textField2 = new JTextField();
label18 = new JLabel();
label1 = new JLabel(new ImageIcon(siggy));
button4 = new JButton();
panel3 = new JPanel();
slider1 = new JSlider();
label15 = new JLabel();
label16 = new JLabel();
checkBox6 = new JCheckBox();
label23 = new JLabel();
checkBox5 = new JCheckBox();
label27 = new JLabel();
checkBox1 = new JCheckBox();
checkBox2 = new JCheckBox();
label28 = new JLabel(new ImageIcon(pic));
checkBox3 = new JCheckBox();
label29 = new JLabel();
label30 = new JLabel();
label48 = new JLabel();
checkBox15 = new JCheckBox();
label49 = new JLabel();
checkBox16 = new JCheckBox();
label19 = new JLabel();
checkBox7 = new JCheckBox();
progressBar1 = new JProgressBar();
label20 = new JLabel();
button2 = new JButton();
button1 = new JButton();
// ======== this ========
final Container contentPane = getContentPane();
contentPane.setLayout(null);
// ======== tabbedPane1 ========
{
tabbedPane1.setTabPlacement(SwingConstants.LEFT);
// ======== panel4 ========
{
panel4.setLayout(null);
// ---- label24 ----
label24.setText("Message:");
label24.setFont(new Font("Tahoma", Font.PLAIN, 17));
label24.setForeground(Color.red);
panel4.add(label24);
label24.setBounds(0, 265, 75, 25);
// ---- label25 ----
label25.setText(getMessage());
label25.setFont(new Font("Tahoma", Font.PLAIN, 17));
label25.setForeground(Color.blue);
panel4.add(label25);
label25.setBounds(80, 265, 340, 25);
// ---- label2 ----
panel4.add(label2);
label2.setBounds(new Rectangle(new Point(5, 35), label2.getPreferredSize()));
// ---- comboBox2 ----
comboBox2.setForeground(Color.cyan);
panel4.add(comboBox2);
comboBox2.setBounds(50, 35, 160, 30);
// ---- label3 ----
panel4.add(label3);
label3.setBounds(new Rectangle(new Point(5, 110), label3.getPreferredSize()));
// ---- comboBox3 ----
comboBox3.setForeground(Color.blue);
panel4.add(comboBox3);
comboBox3.setBounds(50, 110, 160, 30);
// ---- label4 ----
panel4.add(label4);
label4.setBounds(220, 110, 25, label4.getPreferredSize().height);
// ---- label5 ----
panel4.add(label5);
label5.setBounds(220, 35, label5.getPreferredSize().width, 30);
// ---- comboBox4 ----
comboBox4.setForeground(Color.green);
panel4.add(comboBox4);
comboBox4.setBounds(255, 110, 170, 30);
// ---- comboBox5 ----
comboBox5.setForeground(Color.red);
panel4.add(comboBox5);
comboBox5.setBounds(255, 35, 170, 30);
// ---- label6 ----
panel4.add(label6);
label6.setBounds(new Rectangle(new Point(5, 180), label6.getPreferredSize()));
// ---- label7 ----
panel4.add(label7);
label7.setBounds(375, 180, 47, 50);
// ---- comboBox1 ----
comboBox1.setForeground(Color.magenta);
panel4.add(comboBox1);
comboBox1.setBounds(60, 180, 310, 50);
// ---- label8 ----
label8.setText("Method To Perform");
label8.setFont(label8.getFont().deriveFont(Font.PLAIN, label8.getFont().getSize() + 17f));
panel4.add(label8);
label8.setBounds(95, 145, 240, 40);
// ---- label9 ----
label9.setText("Bow Type");
label9.setFont(label9.getFont().deriveFont(label9.getFont().getSize() + 17f));
panel4.add(label9);
label9.setBounds(65, 75, 125, 35);
// ---- label10 ----
label10.setText("Wood Type");
label10.setFont(label10.getFont().deriveFont(label10.getFont().getSize() + 17f));
panel4.add(label10);
label10.setBounds(new Rectangle(new Point(60, 0), label10.getPreferredSize()));
// ---- label11 ----
label11.setText("Object Type");
label11.setFont(label11.getFont().deriveFont(label11.getFont().getSize() + 17f));
panel4.add(label11);
label11.setBounds(new Rectangle(new Point(265, 0), label11.getPreferredSize()));
// ---- label14 ----
label14.setText("Knife Type");
label14.setFont(label14.getFont().deriveFont(label14.getFont().getSize() + 17f));
panel4.add(label14);
label14.setBounds(new Rectangle(new Point(275, 75), label14.getPreferredSize()));
// ---- label12 ----
label12.setText("Amount to Fletch:");
label12.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel4.add(label12);
label12.setBounds(0, 235, 135, 25);
// ---- textField1 ----
textField1.setText("0");
panel4.add(textField1);
textField1.setBounds(135, 235, 90, 25);
// ---- label13 ----
label13.setText("0 for Unilimted Fletching!");
label13.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel4.add(label13);
label13.setBounds(230, 235, 190, 25);
}
tabbedPane1.addTab("Main Settings", panel4);
// ======== panel2 ========
{
panel2.setLayout(null);
// ---- label31 ----
label31.setText("Enable Paint:");
label31.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel2.add(label31);
label31.setBounds(5, 55, label31.getPreferredSize().width, 25);
// ---- label35 ----
label35.setText("RSBot Mouse Lines:");
label35.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel2.add(label35);
label35.setBounds(new Rectangle(new Point(5, 125), label35.getPreferredSize()));
// ---- label36 ----
label36.setText("RSBot Mouse Crosshair:");
label36.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel2.add(label36);
label36.setBounds(new Rectangle(new Point(5, 145), label36.getPreferredSize()));
// ---- label37 ----
label37.setText("Your Mouse Lines:");
label37.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel2.add(label37);
label37.setBounds(new Rectangle(new Point(5, 165), label37.getPreferredSize()));
// ---- label38 ----
label38.setText("Your Mouse Crosshair:");
label38.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel2.add(label38);
label38.setBounds(5, 185, 165, label38.getPreferredSize().height);
// ---- button3 ----
button3.setText("Visit Universalscripts.org! :D");
button3.setFont(button3.getFont().deriveFont(button3.getFont().getSize() + 19f));
button3.setForeground(Color.red);
button3.setBackground(new Color(255, 0, 51));
button3.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
button3ActionPerformed(e);
}
});
panel2.add(button3);
button3.setBounds(0, 210, 425, 80);
// ---- label39 ----
label39.setText("Text Color:");
label39.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel2.add(label39);
label39.setBounds(new Rectangle(new Point(5, 80), label39.getPreferredSize()));
// ---- label40 ----
label40.setText("Paint Main Color:");
label40.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel2.add(label40);
label40.setBounds(new Rectangle(new Point(5, 105), label40.getPreferredSize()));
// ---- checkBox4 ----
checkBox4.setFont(new Font("Tahoma", Font.PLAIN, 16));
checkBox4.setSelected(true);
panel2.add(checkBox4);
checkBox4.setBounds(95, 55, checkBox4.getPreferredSize().width, 25);
// ---- checkBox11 ----
checkBox11.setFont(new Font("Tahoma", Font.PLAIN, 16));
checkBox11.setSelected(true);
panel2.add(checkBox11);
checkBox11.setBounds(new Rectangle(new Point(145, 125), checkBox11.getPreferredSize()));
// ---- checkBox12 ----
checkBox12.setFont(new Font("Tahoma", Font.PLAIN, 16));
checkBox12.setSelected(true);
panel2.add(checkBox12);
checkBox12.setBounds(new Rectangle(new Point(175, 145), checkBox12.getPreferredSize()));
// ---- checkBox13 ----
checkBox13.setFont(new Font("Tahoma", Font.PLAIN, 16));
checkBox13.setSelected(true);
panel2.add(checkBox13);
checkBox13.setBounds(new Rectangle(new Point(135, 165), checkBox13.getPreferredSize()));
// ---- checkBox14 ----
checkBox14.setFont(new Font("Tahoma", Font.PLAIN, 16));
checkBox14.setSelected(true);
panel2.add(checkBox14);
checkBox14.setBounds(new Rectangle(new Point(165, 185), checkBox14.getPreferredSize()));
// ---- label43 ----
label43.setText("Color:");
label43.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel2.add(label43);
label43.setBounds(new Rectangle(new Point(240, 125), label43.getPreferredSize()));
// ---- label44 ----
label44.setText("Color:");
label44.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel2.add(label44);
label44.setBounds(new Rectangle(new Point(195, 145), label44.getPreferredSize()));
// ---- label45 ----
label45.setText("Color:");
label45.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel2.add(label45);
label45.setBounds(235, 165, 45, label45.getPreferredSize().height);
// ---- label46 ----
label46.setText("Color:");
label46.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel2.add(label46);
label46.setBounds(new Rectangle(new Point(185, 185), label46.getPreferredSize()));
panel2.add(comboBox10);
comboBox10.setBounds(285, 125, 70, comboBox10.getPreferredSize().height);
panel2.add(comboBox11);
comboBox11.setBounds(240, 145, 70, comboBox11.getPreferredSize().height);
panel2.add(comboBox12);
comboBox12.setBounds(95, 80, 70, comboBox12.getPreferredSize().height);
panel2.add(comboBox13);
comboBox13.setBounds(130, 105, 70, comboBox13.getPreferredSize().height);
panel2.add(comboBox14);
comboBox14.setBounds(280, 165, 70, comboBox14.getPreferredSize().height);
panel2.add(comboBox15);
comboBox15.setBounds(230, 185, 65, comboBox15.getPreferredSize().height);
// ---- label47 ----
panel2.add(label47);
label47.setBounds(250, 5, 135, 115);
// ---- label64 ----
label64.setText("Circles:");
label64.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel2.add(label64);
label64.setBounds(new Rectangle(new Point(165, 125), label64.getPreferredSize()));
// ---- checkBox17 ----
checkBox17.setFont(new Font("Tahoma", Font.PLAIN, 16));
checkBox17.setSelected(true);
panel2.add(checkBox17);
checkBox17.setBounds(new Rectangle(new Point(220, 125), checkBox17.getPreferredSize()));
// ---- label65 ----
label65.setText("Cricles:");
label65.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel2.add(label65);
label65.setBounds(new Rectangle(new Point(155, 165), label65.getPreferredSize()));
// ---- checkBox18 ----
checkBox18.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel2.add(checkBox18);
checkBox18.setBounds(new Rectangle(new Point(210, 165), checkBox18.getPreferredSize()));
// ---- label21 ----
label21.setText("Paint Settings");
label21.setFont(label21.getFont().deriveFont(label21.getFont().getSize() + 30f));
label21.setForeground(Color.blue);
panel2.add(label21);
label21.setBounds(new Rectangle(new Point(0, 5), label21.getPreferredSize()));
}
tabbedPane1.addTab("Paint Settings", panel2);
// ======== panel1 ========
{
panel1.setLayout(null);
// ---- label17 ----
label17.setText("Signature name:");
label17.setFont(label17.getFont().deriveFont(label17.getFont().getStyle()
& ~Font.BOLD));
panel1.add(label17);
label17.setBounds(0, 5, 80, 25);
// ---- textField2 ----
textField2.setText("All");
panel1.add(textField2);
textField2.setBounds(80, 5, 95, 25);
// ---- label18 ----
label18.setText("No Spaces Please!");
panel1.add(label18);
label18.setBounds(180, 5, 88, 25);
// ---- label1 ----
label1.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(final MouseEvent e) {
label1MouseClicked(e);
}
});
panel1.add(label1);
label1.setBounds(0, 25, 500, 275);
// ---- button4 ----
button4.setText("Generate Signature");
button4.setForeground(new Color(0, 204, 0));
button4.setBackground(Color.green);
button4.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
button4ActionPerformed(e);
}
});
panel1.add(button4);
button4.setBounds(275, 5, 145, 25);
}
tabbedPane1.addTab("Signature", panel1);
// ======== panel3 ========
{
panel3.setLayout(null);
// ---- slider1 ----
slider1.setSnapToTicks(true);
slider1.setPaintTicks(true);
slider1.setMajorTickSpacing(10);
panel3.add(slider1);
slider1.setBounds(105, 130, 315, 30);
// ---- label15 ----
label15.setText("Mousespeed:");
label15.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel3.add(label15);
label15.setBounds(5, 130, 100, 30);
// ---- label16 ----
label16.setText("Save Settings for this account:");
label16.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel3.add(label16);
label16.setBounds(0, 195, 215, 25);
// ---- checkBox6 ----
checkBox6.setSelected(true);
checkBox6.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel3.add(checkBox6);
checkBox6.setBounds(215, 200, 21, 16);
// ---- label23 ----
label23.setText("logout 20k experince before 99 fletching:");
label23.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel3.add(label23);
label23.setBounds(5, 85, 300, 20);
// ---- checkBox5 ----
checkBox5.setSelected(true);
panel3.add(checkBox5);
checkBox5.setBounds(300, 85, 21, 21);
// ---- label27 ----
label27.setText("when done:");
label27.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel3.add(label27);
label27.setBounds(35, 165, 90, 25);
// ---- checkBox1 ----
checkBox1.setText(" Upon Level:");
checkBox1.setSelected(true);
checkBox1.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel3.add(checkBox1);
checkBox1.setBounds(125, 165, 115, 25);
// ---- checkBox2 ----
checkBox2.setSelected(true);
checkBox2.setFont(new Font("Tahoma", Font.PLAIN, 16));
checkBox2.setText("Getting 99:");
panel3.add(checkBox2);
checkBox2.setBounds(240, 165, 110, 25);
// ---- label28 ----
panel3.add(label28);
label28.setBounds(new Rectangle(new Point(0, 165), label28.getPreferredSize()));
// ---- checkBox3 ----
checkBox3.setFont(new Font("Tahoma", Font.PLAIN, 16));
checkBox3.setSelected(true);
panel3.add(checkBox3);
checkBox3.setBounds(350, 165, checkBox3.getPreferredSize().width, 26);
// ---- label29 ----
label29.setText("Developed by: Fletch to 99");
label29.setForeground(Color.blue);
label29.setFont(label29.getFont().deriveFont(Font.BOLD, label29.getFont().getSize() + 20f));
panel3.add(label29);
label29.setBounds(5, 35, 415, 50);
// ---- label30 ----
label30.setText("UFletch: FREE, AIO, FLAWLESS!");
label30.setForeground(Color.green);
label30.setFont(label30.getFont().deriveFont(label30.getFont().getStyle()
| Font.BOLD, label30.getFont().getSize() + 15f));
panel3.add(label30);
label30.setBounds(new Rectangle(new Point(5, 5), label30.getPreferredSize()));
// ---- label48 ----
label48.setText("Message Notification:");
label48.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel3.add(label48);
label48.setBounds(new Rectangle(new Point(5, 105), label48.getPreferredSize()));
// ---- checkBox15 ----
checkBox15.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel3.add(checkBox15);
checkBox15.setBounds(new Rectangle(new Point(160, 105), checkBox15.getPreferredSize()));
// ---- label49 ----
label49.setText("Message Beep:");
label49.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel3.add(label49);
label49.setBounds(new Rectangle(new Point(185, 105), label49.getPreferredSize()));
// ---- checkBox16 ----
checkBox16.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel3.add(checkBox16);
checkBox16.setBounds(new Rectangle(new Point(290, 105), checkBox16.getPreferredSize()));
// ---- label19 ----
label19.setText("Load Settings:");
label19.setFont(new Font("Tahoma", Font.PLAIN, 16));
panel3.add(label19);
label19.setBounds(245, 195, label19.getPreferredSize().width, 25);
// ---- checkBox7 ----
checkBox7.setFont(new Font("Tahoma", Font.PLAIN, 16));
checkBox7.setSelected(true);
panel3.add(checkBox7);
checkBox7.setBounds(350, 200, checkBox7.getPreferredSize().width, 15);
// ---- progressBar1 ----
progressBar1.setStringPainted(true);
panel3.add(progressBar1);
progressBar1.setBounds(0, 240, 210, 50);
// ---- label20 ----
label20.setText("Percentage to next level");
label20.setFont(new Font("Tahoma", Font.PLAIN, 16));
label20.setForeground(Color.red);
panel3.add(label20);
label20.setBounds(new Rectangle(new Point(20, 220), label20.getPreferredSize()));
// ---- button2 ----
button2.setText("Highscores");
button2.setFont(new Font("Tahoma", Font.PLAIN, 16));
button2.setForeground(Color.red);
button2.setBackground(new Color(255, 0, 51));
panel3.add(button2);
button2.setBounds(210, 225, 215, 65);
button2.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
button2ActionPerformed(e);
}
});
{ // compute preferred size
final Dimension preferredSize = new Dimension();
for (int i = 0; i < panel3.getComponentCount(); i++) {
final Rectangle bounds = panel3.getComponent(i).getBounds();
preferredSize.width = Math.max(bounds.x
+ bounds.width, preferredSize.width);
preferredSize.height = Math.max(bounds.y
+ bounds.height, preferredSize.height);
}
final Insets insets = panel3.getInsets();
preferredSize.width += insets.right;
preferredSize.height += insets.bottom;
panel3.setMinimumSize(preferredSize);
panel3.setPreferredSize(preferredSize);
}
}
tabbedPane1.addTab("Other Settings", panel3);
}
contentPane.add(tabbedPane1);
tabbedPane1.setBounds(5, 0, 515, 295);
// ---- button1 ----
button1.setText("Start UFletch!");
button1.setForeground(Color.blue);
button1.setFont(new Font("Tahoma", Font.PLAIN, 26));
button1.setBackground(new Color(51, 51, 255));
button1.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
button1ActionPerformed(e);
}
});
contentPane.add(button1);
button1.setBounds(0, 295, 520, 45);
comboBox12.setSelectedIndex(0);
comboBox13.setSelectedIndex(8);
comboBox8.setSelectedIndex(1);
comboBox9.setSelectedIndex(3);
comboBox10.setSelectedIndex(7);
comboBox11.setSelectedIndex(6);
comboBox14.setSelectedIndex(5);
comboBox15.setSelectedIndex(2);
{ // compute preferred size
final Dimension preferredSize = new Dimension();
for (int i = 0; i < contentPane.getComponentCount(); i++) {
final Rectangle bounds = contentPane.getComponent(i).getBounds();
preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
}
final Insets insets = contentPane.getInsets();
preferredSize.width += insets.right;
preferredSize.height += insets.bottom;
contentPane.setMinimumSize(preferredSize);
contentPane.setPreferredSize(preferredSize);
}
pack();
setLocationRelativeTo(getOwner());
setVisible(true);
// JFormDesigner - End of component initialization
// //GEN-END:initComponents
}
private void label1MouseClicked(final MouseEvent e) {
try {
Desktop.getDesktop().browse(new URL("http://www.universalscripts.org/ufletch/UFletch_generate.php?user="
+ gui.textField2.getText()).toURI());
} catch (final MalformedURLException e1) {
} catch (final IOException e1) {
} catch (final URISyntaxException e1) {
}
}
}
private class MouseCirclePathPoint extends Point {
private static final long serialVersionUID = 1L;
private final long finishTime;
private final double lastingTime;
public MouseCirclePathPoint(final int x, final int y,
final int lastingTime) {
super(x, y);
this.lastingTime = lastingTime;
finishTime = System.currentTimeMillis() + lastingTime;
}
public boolean isUp() {
return System.currentTimeMillis() > finishTime;
}
private int toColor(final double d) {
return Math.min(255, Math.max(0, (int) d));
}