Advertisement
Guest User

UFletch.java

a guest
Jun 11th, 2011
434
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 133.77 KB | None | 0 0
  1. import java.awt.Color;
  2. import java.awt.Container;
  3. import java.awt.Desktop;
  4. import java.awt.Dimension;
  5. import java.awt.Font;
  6. import java.awt.GradientPaint;
  7. import java.awt.Graphics;
  8. import java.awt.Graphics2D;
  9. import java.awt.Image;
  10. import java.awt.Insets;
  11. import java.awt.MenuItem;
  12. import java.awt.Point;
  13. import java.awt.PopupMenu;
  14. import java.awt.Rectangle;
  15. import java.awt.RenderingHints;
  16. import java.awt.SystemTray;
  17. import java.awt.TrayIcon;
  18. import java.awt.event.ActionEvent;
  19. import java.awt.event.ActionListener;
  20. import java.awt.event.MouseAdapter;
  21. import java.awt.event.MouseEvent;
  22. import java.awt.event.MouseListener;
  23. import java.awt.event.MouseMotionListener;
  24. import java.awt.image.RenderedImage;
  25. import java.io.BufferedReader;
  26. import java.io.File;
  27. import java.io.FileInputStream;
  28. import java.io.FileOutputStream;
  29. import java.io.IOException;
  30. import java.io.InputStreamReader;
  31. import java.io.OutputStreamWriter;
  32. import java.net.InetAddress;
  33. import java.net.MalformedURLException;
  34. import java.net.URISyntaxException;
  35. import java.net.URL;
  36. import java.net.URLConnection;
  37. import java.net.UnknownHostException;
  38. import java.util.LinkedList;
  39. import java.util.Properties;
  40. import java.util.logging.Logger;
  41.  
  42. import javax.imageio.ImageIO;
  43. import javax.swing.ImageIcon;
  44. import javax.swing.JButton;
  45. import javax.swing.JCheckBox;
  46. import javax.swing.JComboBox;
  47. import javax.swing.JFrame;
  48. import javax.swing.JLabel;
  49. import javax.swing.JOptionPane;
  50. import javax.swing.JPanel;
  51. import javax.swing.JProgressBar;
  52. import javax.swing.JSlider;
  53. import javax.swing.JTabbedPane;
  54. import javax.swing.JTextArea;
  55. import javax.swing.JTextField;
  56. import javax.swing.JToggleButton;
  57. import javax.swing.SwingConstants;
  58. import javax.swing.UIManager;
  59. import org.rsbot.event.events.MessageEvent;
  60. import org.rsbot.event.listeners.MessageListener;
  61. import org.rsbot.event.listeners.PaintListener;
  62. import org.rsbot.script.Script;
  63. import org.rsbot.script.ScriptManifest;
  64. import org.rsbot.script.methods.Environment;
  65. import org.rsbot.script.methods.Game.Tab;
  66. import org.rsbot.script.methods.GrandExchange.GEItem;
  67. import org.rsbot.script.methods.Skills;
  68. import org.rsbot.script.wrappers.RSInterface;
  69. import org.rsbot.script.wrappers.RSItem;
  70.  
  71. @ScriptManifest(authors = { "Fletch To 99" }, keywords = { "fletching", "a", "afletch", "fletch", "99", "aprofletcher" }, name = "UFletch", website = "http://www.universalscripts.org/ufletch", version = 2.30, description = "The best fletcher!", requiresVersion = 248)
  72. /**
  73.  * All-in-One Fletching script for RSBot 2.XX
  74.  * @author Fletch To 99
  75.  */
  76. public class UFletch extends Script implements PaintListener, MouseListener,
  77.         MouseMotionListener, MessageListener {
  78.  
  79.     private static interface constants {
  80.         final String[] optionMethod = { "Fletching Bow", "Stringing Bow",
  81.                 "Fletch then String", "Add Stocks to limbs",
  82.                 "Stringing Crossbow", "Chop, Fletch, Drop or Shaft", "Arrows",
  83.                 "Bolts", "Darts" };
  84.         final String[] optionLog = { "Normal", "Oak", "Willow", "Maple", "Yew",
  85.                 "Magic", "N/A" };
  86.         final String[] optionBow = { "Short", "Long", "Shafts", "Stocks",
  87.                 "C'Bow (u)", "N/A" };
  88.         final String[] optionKnife = { "Normal", "clay", "N/A" };
  89.         final String[] optionAxe = { "Bronze", "Iron", "Steel", "Mith",
  90.                 "Adamant", "Rune", "Dragon", "N/A" };
  91.         final String[] optionColor = { "Black", "Red", "Orange", "Blue",
  92.                 "Green", "Yellow", "Pink", "White", "Tan" };
  93.         final String[] optionAntiban = { "High", "Medium", "Low" };
  94.         final Color TAN = new Color(220, 202, 169);
  95.         final int BOW_STRING_ID = 1777, CBOW_STRING_ID = 943, FEATHER_ID = 314,
  96.                 FEATHER_SHAFT_ID = 53, SHAFT_ID = 52, xpIsClose = 13020000;
  97.         final MenuItem item1 = new MenuItem("Stop");
  98.         final MenuItem item2 = new MenuItem("Pause");
  99.         final MenuItem item3 = new MenuItem("Resume");
  100.         final MenuItem item4 = new MenuItem("Open Gui");
  101.         final MenuItem item5 = new MenuItem("Help");
  102.         final Font titleFont = new Font("Allerta", Font.PLAIN, 25);
  103.         final Font textFont = new Font("Allerta", Font.PLAIN, 11);
  104.         final Rectangle BUTTON = new Rectangle(450, 316, 65, 21);
  105.         final Rectangle RECT_ONE = new Rectangle(5, 4, 129, 36);
  106.         final Rectangle RECT_TWO = new Rectangle(136, 4, 129, 21);
  107.         final Rectangle RECT_THREE = new Rectangle(266, 4, 129, 21);
  108.         final Rectangle HIDE = new Rectangle(5, 316, 65, 21);
  109.         final Rectangle PAUSE = new Rectangle(449, 292, 66, 22);
  110.         final Rectangle STOP = new Rectangle(4, 292, 66, 22);
  111.     }
  112.  
  113.     private int amount = 0, startXP = 0, startLevel = 0, fletched = 0,
  114.             strung = 0, currentexp = 0, Mouse1 = 50, Mouse2 = 8, xpGained = 0,
  115.             xpToLevel = 0, daysTNL = 0, hoursTNL = 0, minsTNL = 0, secTNL = 0,
  116.             fail = 0, full = 0, logprice = 0, ubowprice = 0, stringprice = 0,
  117.             objectprice = 0, bowprice = 0, featherprice = 0, arrowprice = 0,
  118.             headlessarrowprice = 0;
  119.  
  120.     private long startTime = System.currentTimeMillis(), timeOut = 0;
  121.  
  122.     private boolean has99 = false, tray = false, pause = false,
  123.             fletchAndString = false, fullPaint = false, tabOne = false,
  124.             tabTwo = false, tabThree = false, connection = true, wait = true;
  125.  
  126.     private String status = null, name = "All", buttonOption = "Unhide",
  127.             paused = "Pause";
  128.  
  129.     private Point p = new Point();
  130.  
  131.     private Image icon = null, fletchIcon = null, logsImage = null,
  132.             settings = null, bow = null, axe = null, knife = null,
  133.             brush = null, siggy = null, pic = null;
  134.  
  135.     private gui gui = null;
  136.     private trayInfo trayInfo = null;
  137.     private beeper beep = null;
  138.     private AntiBan ab = new AntiBan();
  139.  
  140.     private final LinkedList<MousePathPoint> mousePath = new LinkedList<MousePathPoint>();
  141.     private final LinkedList<MousePathPoint2> mousePath2 = new LinkedList<MousePathPoint2>();
  142.     private final LinkedList<MouseCirclePathPoint> mouseCirclePath = new LinkedList<MouseCirclePathPoint>();
  143.     private final LinkedList<MouseCirclePathPoint2> mouseCirclePath2 = new LinkedList<MouseCirclePathPoint2>();
  144.  
  145.     private Color getPaintColors(JComboBox box) {
  146.         if (box.getSelectedIndex() == 0) {
  147.             return Color.BLACK;
  148.         } else if (box.getSelectedIndex() == 1) {
  149.             return Color.RED.brighter();
  150.         } else if (box.getSelectedIndex() == 2) {
  151.             return Color.ORANGE;
  152.         } else if (box.getSelectedIndex() == 3) {
  153.             return Color.CYAN.brighter();
  154.         } else if (box.getSelectedIndex() == 4) {
  155.             return Color.GREEN.brighter();
  156.         } else if (box.getSelectedIndex() == 5) {
  157.             return Color.YELLOW;
  158.         } else if (box.getSelectedIndex() == 6) {
  159.             return Color.PINK;
  160.         } else if (box.getSelectedIndex() == 7) {
  161.             return Color.WHITE;
  162.         } else if (box.getSelectedIndex() == 8) {
  163.             return constants.TAN;
  164.         }
  165.         return Color.BLACK;
  166.     }
  167.  
  168.     private int getLogPrice() {
  169.         if (getLogId() == -1) {
  170.             return 0;
  171.         }
  172.         return grandExchange.lookup(getLogId()).getGuidePrice();
  173.     }
  174.  
  175.     private int getBowPrice() {
  176.         if (getBowId() == -1) {
  177.             return 0;
  178.         }
  179.         return grandExchange.lookup(getBowId()).getGuidePrice();
  180.     }
  181.  
  182.     private int getArrowPrice() {
  183.         if (getArrowId() == -1) {
  184.             return 0;
  185.         }
  186.         return grandExchange.lookup(getArrowId()).getGuidePrice();
  187.     }
  188.  
  189.     private int getFeatherPrice() {
  190.         return grandExchange.lookup(constants.FEATHER_ID).getGuidePrice();
  191.     }
  192.  
  193.     private int getHeadlessArrowPrice() {
  194.         return grandExchange.lookup(constants.FEATHER_SHAFT_ID).getGuidePrice();
  195.     }
  196.  
  197.     private int getStringPrice() {
  198.         if (getBSId() == -1) {
  199.             return 0;
  200.         }
  201.         return grandExchange.lookup(getBSId()).getGuidePrice();
  202.     }
  203.  
  204.     private int getUnStrungPrice() {
  205.         if (getUnstrungId() == -1) {
  206.             return 0;
  207.         }
  208.         return grandExchange.lookup(getUnstrungId()).getGuidePrice();
  209.     }
  210.  
  211.     private int getObjectPrice() {
  212.         if (getObjectId() == -1) {
  213.             return 0;
  214.         }
  215.         return grandExchange.lookup(getObjectId()).getGuidePrice();
  216.     }
  217.  
  218.     private int getMethod() {
  219.         if (gui.comboBox1.getSelectedIndex() == 0) {
  220.             return 1;
  221.         } else if (gui.comboBox1.getSelectedIndex() == 1) {
  222.             return 2;
  223.         } else if (gui.comboBox1.getSelectedIndex() == 2) {
  224.             return 3;
  225.         } else if (gui.comboBox1.getSelectedIndex() == 3) {
  226.             return 4;
  227.         } else if (gui.comboBox1.getSelectedIndex() == 4) {
  228.             return 5;
  229.         } else if (gui.comboBox1.getSelectedIndex() == 5) {
  230.             return 6;
  231.         } else if (gui.comboBox1.getSelectedIndex() == 6) {
  232.             return 7;
  233.         } else if (gui.comboBox1.getSelectedIndex() == 7) {
  234.             return 8;
  235.         } else if (gui.comboBox1.getSelectedIndex() == 8) {
  236.             return 9;
  237.         }
  238.         return -1;
  239.     }
  240.  
  241.     private int getBSId() {
  242.         if (getMethod() == 5) {
  243.             return constants.CBOW_STRING_ID;
  244.         } else {
  245.             return constants.BOW_STRING_ID;
  246.         }
  247.     }
  248.  
  249.     private int getLogId() {
  250.         if (gui.comboBox2.getSelectedIndex() == 0) {
  251.             return 1511;
  252.         } else if (gui.comboBox2.getSelectedIndex() == 1) {
  253.             return 1521;
  254.         } else if (gui.comboBox2.getSelectedIndex() == 2) {
  255.             return 1519;
  256.         } else if (gui.comboBox2.getSelectedIndex() == 3) {
  257.             return 1517;
  258.         } else if (gui.comboBox2.getSelectedIndex() == 4) {
  259.             return 1515;
  260.         } else if (gui.comboBox2.getSelectedIndex() == 5) {
  261.             return 1513;
  262.         }
  263.         return -1;
  264.     }
  265.  
  266.     private int[] getTreeId() {
  267.         if (gui.comboBox2.getSelectedIndex() == 0) {
  268.             return new int[] { 1278, 1276, 38787, 38760, 38788, 38784, 38783,
  269.                     38782 };
  270.         } else if (gui.comboBox2.getSelectedIndex() == 1) {
  271.             return new int[] { 1281, 38731 };
  272.         } else if (gui.comboBox2.getSelectedIndex() == 2) {
  273.             return new int[] { 5551, 5552, 5553, 1308, 38616, 38617, 38627 };
  274.         } else if (gui.comboBox2.getSelectedIndex() == 3) {
  275.             return new int[] { 1307 };
  276.         } else if (gui.comboBox2.getSelectedIndex() == 4) {
  277.             return new int[] { 1309, 38755 };
  278.         } else if (gui.comboBox2.getSelectedIndex() == 5) {
  279.             return new int[] { 1306 };
  280.         }
  281.         return null;
  282.     }
  283.  
  284.     private int getUnstrungId() {
  285.         if (getBowType() == 1) { // 1=Shortbows 2=Longbows 3=Shafts 4=Stocks
  286.                                     // 5=c'bow
  287.             if (gui.comboBox2.getSelectedIndex() == 0) {
  288.                 return 50;
  289.             } else if (gui.comboBox2.getSelectedIndex() == 1) {
  290.                 return 54;
  291.             } else if (gui.comboBox2.getSelectedIndex() == 2) {
  292.                 return 60;
  293.             } else if (gui.comboBox2.getSelectedIndex() == 3) {
  294.                 return 64;
  295.             } else if (gui.comboBox2.getSelectedIndex() == 4) {
  296.                 return 68;
  297.             } else if (gui.comboBox2.getSelectedIndex() == 5) {
  298.                 return 72;
  299.             }
  300.         } else if (getBowType() == 2) {
  301.             if (gui.comboBox2.getSelectedIndex() == 0) {
  302.                 return 48;
  303.             } else if (gui.comboBox2.getSelectedIndex() == 1) {
  304.                 return 56;
  305.             } else if (gui.comboBox2.getSelectedIndex() == 2) {
  306.                 return 58;
  307.             } else if (gui.comboBox2.getSelectedIndex() == 3) {
  308.                 return 62;
  309.             } else if (gui.comboBox2.getSelectedIndex() == 4) {
  310.                 return 66;
  311.             } else if (gui.comboBox2.getSelectedIndex() == 5) {
  312.                 return 70;
  313.             }
  314.         } else if (getBowType() == 3) {
  315.             if (gui.comboBox2.getSelectedIndex() == 0) {
  316.                 return 52;
  317.             } else {
  318.                 return -1;
  319.             }
  320.         } else if (getBowType() == 4) {
  321.             if (gui.comboBox2.getSelectedIndex() == 0) {
  322.                 return 9440;
  323.             } else if (gui.comboBox2.getSelectedIndex() == 1) {
  324.                 return 9442;
  325.             } else if (gui.comboBox2.getSelectedIndex() == 2) {
  326.                 return 9444;
  327.             } else if (gui.comboBox2.getSelectedIndex() == 3) {
  328.                 return 9448;
  329.             } else if (gui.comboBox2.getSelectedIndex() == 4) {
  330.                 return 9452;
  331.             }
  332.         } else if (getBowType() == 5) {
  333.             if (gui.comboBox5.getSelectedIndex() == 0) {
  334.                 return 9454;
  335.             } else if (gui.comboBox5.getSelectedIndex() == 1) {
  336.                 return 9457;
  337.             } else if (gui.comboBox5.getSelectedIndex() == 2) {
  338.                 return 9459;
  339.             } else if (gui.comboBox5.getSelectedIndex() == 3) {
  340.                 return 9461;
  341.             } else if (gui.comboBox5.getSelectedIndex() == 4) {
  342.                 return 9463;
  343.             } else if (gui.comboBox5.getSelectedIndex() == 5) {
  344.                 return 9465;
  345.             }
  346.         }
  347.         return -1;
  348.     }
  349.  
  350.     private int getBowId() {
  351.         if (getBowType() == 1) { // 1=Shortbows 2=Longbows 3=Shafts 4=Stocks
  352.                                     // 5=c'bow
  353.             if (gui.comboBox2.getSelectedIndex() == 0) {
  354.                 return 841;
  355.             } else if (gui.comboBox2.getSelectedIndex() == 1) {
  356.                 return 843;
  357.             } else if (gui.comboBox2.getSelectedIndex() == 2) {
  358.                 return 849;
  359.             } else if (gui.comboBox2.getSelectedIndex() == 3) {
  360.                 return 853;
  361.             } else if (gui.comboBox2.getSelectedIndex() == 4) {
  362.                 return 857;
  363.             } else if (gui.comboBox2.getSelectedIndex() == 5) {
  364.                 return 861;
  365.             }
  366.         } else if (getBowType() == 2) {
  367.             if (gui.comboBox2.getSelectedIndex() == 0) {
  368.                 return 839;
  369.             } else if (gui.comboBox2.getSelectedIndex() == 1) {
  370.                 return 845;
  371.             } else if (gui.comboBox2.getSelectedIndex() == 2) {
  372.                 return 847;
  373.             } else if (gui.comboBox2.getSelectedIndex() == 3) {
  374.                 return 851;
  375.             } else if (gui.comboBox2.getSelectedIndex() == 4) {
  376.                 return 855;
  377.             } else if (gui.comboBox2.getSelectedIndex() == 5) {
  378.                 return 859;
  379.             }
  380.         } else if (getBowType() == 4) {
  381.             if (gui.comboBox5.getSelectedIndex() == 0) {
  382.                 return 9454;
  383.             } else if (gui.comboBox5.getSelectedIndex() == 1) {
  384.                 return 9457;
  385.             } else if (gui.comboBox5.getSelectedIndex() == 2) {
  386.                 return 9459;
  387.             } else if (gui.comboBox5.getSelectedIndex() == 3) {
  388.                 return 9461;
  389.             } else if (gui.comboBox5.getSelectedIndex() == 4) {
  390.                 return 9463;
  391.             } else if (gui.comboBox5.getSelectedIndex() == 5) {
  392.                 return 9465;
  393.             }
  394.         } else if (getBowType() == 5) {
  395.             if (gui.comboBox5.getSelectedIndex() == 0) {
  396.                 return 9174;
  397.             } else if (gui.comboBox5.getSelectedIndex() == 1) {
  398.                 return 9177;
  399.             } else if (gui.comboBox5.getSelectedIndex() == 2) {
  400.                 return 9179;
  401.             } else if (gui.comboBox5.getSelectedIndex() == 3) {
  402.                 return 9181;
  403.             } else if (gui.comboBox5.getSelectedIndex() == 4) {
  404.                 return 9183;
  405.             } else if (gui.comboBox5.getSelectedIndex() == 5) {
  406.                 return 9185;
  407.             }
  408.         }
  409.         return -1;
  410.     }
  411.  
  412.     private int getArrowId() {
  413.         if (getMethod() == 7) {
  414.             if (gui.comboBox5.getSelectedIndex() == 0) {
  415.                 return 882;
  416.             } else if (gui.comboBox5.getSelectedIndex() == 1) {
  417.                 return 884;
  418.             } else if (gui.comboBox5.getSelectedIndex() == 2) {
  419.                 return 886;
  420.             } else if (gui.comboBox5.getSelectedIndex() == 3) {
  421.                 return 888;
  422.             } else if (gui.comboBox5.getSelectedIndex() == 4) {
  423.                 return 890;
  424.             } else if (gui.comboBox5.getSelectedIndex() == 5) {
  425.                 return 892;
  426.             }
  427.         } else if (getMethod() == 8) {
  428.             if (gui.comboBox5.getSelectedIndex() == 0) {
  429.                 return 877;
  430.             } else if (gui.comboBox5.getSelectedIndex() == 1) {
  431.                 return 9140;
  432.             } else if (gui.comboBox5.getSelectedIndex() == 2) {
  433.                 return 9141;
  434.             } else if (gui.comboBox5.getSelectedIndex() == 3) {
  435.                 return 9142;
  436.             } else if (gui.comboBox5.getSelectedIndex() == 4) {
  437.                 return 9143;
  438.             } else if (gui.comboBox5.getSelectedIndex() == 5) {
  439.                 return 9144;
  440.             }
  441.         } else if (getMethod() == 9) {
  442.             if (gui.comboBox5.getSelectedIndex() == 0) {
  443.                 return 806;
  444.             } else if (gui.comboBox5.getSelectedIndex() == 1) {
  445.                 return 807;
  446.             } else if (gui.comboBox5.getSelectedIndex() == 2) {
  447.                 return 808;
  448.             } else if (gui.comboBox5.getSelectedIndex() == 3) {
  449.                 return 809;
  450.             } else if (gui.comboBox5.getSelectedIndex() == 4) {
  451.                 return 810;
  452.             } else if (gui.comboBox5.getSelectedIndex() == 5) {
  453.                 return 811;
  454.             } else if (gui.comboBox5.getSelectedIndex() == 6) {
  455.                 return 11230;
  456.             }
  457.         }
  458.         return -1;
  459.     }
  460.  
  461.     private int getBowType() {
  462.         if (gui.comboBox3.getSelectedIndex() == 0) {
  463.             return 1;
  464.         } else if (gui.comboBox3.getSelectedIndex() == 1) {
  465.             return 2;
  466.         } else if (gui.comboBox3.getSelectedIndex() == 2) {
  467.             return 3;
  468.         } else if (gui.comboBox3.getSelectedIndex() == 3) {
  469.             return 4;
  470.         } else if (gui.comboBox3.getSelectedIndex() == 4) {
  471.             return 5;
  472.         }
  473.         return -1;
  474.     }
  475.  
  476.     private int getKnifeId() {
  477.         if (gui.comboBox4.getSelectedIndex() == 0) {
  478.             return 946;
  479.         } else if (gui.comboBox4.getSelectedIndex() == 1) {
  480.             return 14111;
  481.         }
  482.         return -1;
  483.     }
  484.  
  485.     private int getAxeId() {
  486.         if (gui.comboBox5.getSelectedIndex() == 0) {
  487.             return 1351;
  488.         } else if (gui.comboBox5.getSelectedIndex() == 1) {
  489.             return 1349;
  490.         } else if (gui.comboBox5.getSelectedIndex() == 2) {
  491.             return 1361;
  492.         } else if (gui.comboBox5.getSelectedIndex() == 3) {
  493.             return 1355;
  494.         } else if (gui.comboBox5.getSelectedIndex() == 4) {
  495.             return 1357;
  496.         } else if (gui.comboBox5.getSelectedIndex() == 5) {
  497.             return 1359;
  498.         } else if (gui.comboBox5.getSelectedIndex() == 6) {
  499.             return 6739;
  500.         }
  501.         return -1;
  502.     }
  503.  
  504.     private int getObjectId() {
  505.         if (getMethod() == 4) {
  506.             if (gui.comboBox5.getSelectedIndex() == 0) {
  507.                 return 9420;
  508.             } else if (gui.comboBox5.getSelectedIndex() == 1) {
  509.                 return 9423;
  510.             } else if (gui.comboBox5.getSelectedIndex() == 2) {
  511.                 return 9425;
  512.             } else if (gui.comboBox5.getSelectedIndex() == 3) {
  513.                 return 9427;
  514.             } else if (gui.comboBox5.getSelectedIndex() == 4) {
  515.                 return 9429;
  516.             } else if (gui.comboBox5.getSelectedIndex() == 5) {
  517.                 return 9431;
  518.             }
  519.         } else if (getMethod() == 7) {
  520.             if (gui.comboBox5.getSelectedIndex() == 0) {
  521.                 return 39;
  522.             } else if (gui.comboBox5.getSelectedIndex() == 1) {
  523.                 return 40;
  524.             } else if (gui.comboBox5.getSelectedIndex() == 2) {
  525.                 return 41;
  526.             } else if (gui.comboBox5.getSelectedIndex() == 3) {
  527.                 return 42;
  528.             } else if (gui.comboBox5.getSelectedIndex() == 4) {
  529.                 return 43;
  530.             } else if (gui.comboBox5.getSelectedIndex() == 5) {
  531.                 return 44;
  532.             }
  533.         } else if (getMethod() == 8) {
  534.             if (gui.comboBox5.getSelectedIndex() == 0) {
  535.                 return 9375;
  536.             } else if (gui.comboBox5.getSelectedIndex() == 1) {
  537.                 return 9377;
  538.             } else if (gui.comboBox5.getSelectedIndex() == 2) {
  539.                 return 9378;
  540.             } else if (gui.comboBox5.getSelectedIndex() == 3) {
  541.                 return 9379;
  542.             } else if (gui.comboBox5.getSelectedIndex() == 4) {
  543.                 return 9380;
  544.             } else if (gui.comboBox5.getSelectedIndex() == 5) {
  545.                 return 9381;
  546.             }
  547.         } else if (getMethod() == 9) {
  548.             if (gui.comboBox5.getSelectedIndex() == 0) {
  549.                 return 819;
  550.             } else if (gui.comboBox5.getSelectedIndex() == 1) {
  551.                 return 820;
  552.             } else if (gui.comboBox5.getSelectedIndex() == 2) {
  553.                 return 821;
  554.             } else if (gui.comboBox5.getSelectedIndex() == 3) {
  555.                 return 822;
  556.             } else if (gui.comboBox5.getSelectedIndex() == 4) {
  557.                 return 823;
  558.             } else if (gui.comboBox5.getSelectedIndex() == 5) {
  559.                 return 824;
  560.             } else if (gui.comboBox5.getSelectedIndex() == 6) {
  561.                 return 11232;
  562.             }
  563.         }
  564.         return -1;
  565.     }
  566.  
  567.     private boolean isBusy() {
  568.         if (getMethod() == 2 || getMethod() == 4 || getMethod() == 5) {
  569.             if (getMyPlayer().getAnimation() == -1) {
  570.                 for (int i = 0; i < 50; i++) {
  571.                     sleep(50);
  572.                     if (getMyPlayer().getAnimation() != -1
  573.                             || inventory.getCount() == 28
  574.                             || inventory.getCount() == 0) {
  575.                         break;
  576.                     }
  577.                 }
  578.             }
  579.         }
  580.         if (getMethod() == 7 || getMethod() == 8 || getMethod() == 9) {
  581.             return System.currentTimeMillis() < timeOut;
  582.         }
  583.         sleep(25);
  584.         return (getMyPlayer().getAnimation() != -1 && !getMyPlayer().isMoving());
  585.     }
  586.  
  587.     private boolean openBank() {
  588.         return bank.open();
  589.     }
  590.  
  591.     private boolean closeSWIFace() {
  592.         if (interfaces.get(276).isValid()) {
  593.             sleep(random(100, 200));
  594.             interfaces.get(276).getComponent(76).doClick(true);
  595.             sleep(random(300, 400));
  596.         }
  597.         return !interfaces.get(276).isValid();
  598.     }
  599.  
  600.     public int loop() {
  601.         try {
  602.             if (getMethod() == 1) {
  603.                 fletch();
  604.                 closeSWIFace();
  605.                 pauseScript();
  606.                 return random(200, 250);
  607.             } else if (getMethod() == 2) {
  608.                 string();
  609.                 closeSWIFace();
  610.                 pauseScript();
  611.                 return random(200, 250);
  612.             } else if (getMethod() == 3) {
  613.                 fletchAndString();
  614.                 closeSWIFace();
  615.                 pauseScript();
  616.                 return random(200, 250);
  617.             } else if (getMethod() == 4) {
  618.                 stocksWithLimbs();
  619.                 closeSWIFace();
  620.                 pauseScript();
  621.                 return random(200, 250);
  622.             } else if (getMethod() == 5) {
  623.                 stringCBow();
  624.                 closeSWIFace();
  625.                 pauseScript();
  626.                 return random(200, 250);
  627.             } else if (getMethod() == 6) {
  628.                 cfd();
  629.                 closeSWIFace();
  630.                 pauseScript();
  631.                 return random(200, 250);
  632.             } else if (getMethod() == 7) {
  633.                 makeArrows();
  634.                 closeSWIFace();
  635.                 pauseScript();
  636.                 return random(200, 250);
  637.             } else if (getMethod() == 8) {
  638.                 makeBolts();
  639.                 closeSWIFace();
  640.                 pauseScript();
  641.                 return random(200, 250);
  642.             } else if (getMethod() == 9) {
  643.                 makeDarts();
  644.                 closeSWIFace();
  645.                 pauseScript();
  646.                 return random(200, 250);
  647.             }
  648.         } catch (Exception e) {
  649.             log(Color.BLUE,
  650.                     "If you see this message please report the following");
  651.             log(Color.BLUE, "Error to fletch to 99!");
  652.             e.printStackTrace();
  653.         }
  654.         return -1;
  655.     }
  656.  
  657.     private void fletch() {
  658.         amount = Integer.parseInt(gui.textField1.getText());
  659.         if (!inventory.contains(getKnifeId()) && amount == 0 && !isBusy()
  660.                 && !interfaces.get(905).isValid()) {
  661.             withdrawKnife();
  662.             sleep(random(200, 250));
  663.         }
  664.         if (!inventory.contains(getKnifeId()) && fletched <= amount
  665.                 && !isBusy() && !interfaces.get(905).isValid()) {
  666.             withdrawKnife();
  667.             sleep(random(200, 250));
  668.         }
  669.         if (!inventory.contains(getLogId()) && amount == 0 && !isBusy()
  670.                 && !interfaces.get(905).isValid()) {
  671.             if (getBowType() == 1 || getBowType() == 2) {
  672.                 withdrawLogs();
  673.             } else if (getBowType() == 3) {
  674.                 withdrawShafts();
  675.             } else if (getBowType() == 4) {
  676.                 withdrawStocks();
  677.             }
  678.             sleep(random(200, 250));
  679.         } else if (!inventory.contains(getLogId()) && fletched <= amount
  680.                 && !isBusy() && !interfaces.get(905).isValid()) {
  681.             if (getBowType() == 1 || getBowType() == 2) {
  682.                 withdrawLogs();
  683.             } else if (getBowType() == 3) {
  684.                 withdrawShafts();
  685.             } else if (getBowType() == 4) {
  686.                 withdrawStocks();
  687.             }
  688.             sleep(random(200, 250));
  689.         } else if (fletchAndString && !isBusy() && fletched >= amount
  690.                 && amount > 0) {
  691.             gui.comboBox1.setSelectedItem("String");
  692.         } else if (fletchAndString && !isBusy() && amount == 0
  693.                 && bank.getItem(getLogId()) == null
  694.                 && !interfaces.get(905).isValid()) {
  695.             sleep(random(50, 100));
  696.             if (fletchAndString && !isBusy() && amount == 0
  697.                     && bank.getItem(getLogId()) == null
  698.                     && !interfaces.get(905).isValid()
  699.                     && inventory.getCount() < 1) {
  700.                 gui.comboBox1.setSelectedItem("String");
  701.             }
  702.         } else if (fletched >= amount && amount != 0 && !fletchAndString) {
  703.             log("Fletched amount logging out!");
  704.             stopScript();
  705.         }
  706.         if (inventory.contains(getLogId())
  707.                 && inventory.containsOneOf(getKnifeId()) && amount == 0
  708.                 && !isBusy()) {
  709.             if (getBowType() == 1 || getBowType() == 2) {
  710.                 fletchLogs();
  711.             } else if (getBowType() == 3) {
  712.                 fletchShafts();
  713.             } else if (getBowType() == 4) {
  714.                 fletchStocks();
  715.             }
  716.             sleep(random(200, 250));
  717.         } else if (inventory.contains(getLogId())
  718.                 && inventory.containsOneOf(getKnifeId()) && fletched <= amount
  719.                 && !isBusy()) {
  720.             if (getBowType() == 1 || getBowType() == 2) {
  721.                 fletchLogs();
  722.             } else if (getBowType() == 3) {
  723.                 fletchShafts();
  724.             } else if (getBowType() == 4) {
  725.                 fletchStocks();
  726.             }
  727.             sleep(random(100, 250));
  728.         } else if (fletchAndString && !isBusy() && fletched >= amount
  729.                 && amount > 0) {
  730.             gui.comboBox1.setSelectedItem("String");
  731.         } else if (fletchAndString && !isBusy() && amount == 0
  732.                 && bank.getItem(getLogId()) == null
  733.                 && !interfaces.get(905).isValid()) {
  734.             sleep(random(50, 100));
  735.             if (fletchAndString && !isBusy() && amount == 0
  736.                     && bank.getItem(getLogId()) == null
  737.                     && !interfaces.get(905).isValid()
  738.                     && inventory.getCount() < 1) {
  739.                 gui.comboBox1.setSelectedItem("String");
  740.             }
  741.         } else if (fletched >= amount && amount != 0 && !isBusy()
  742.                 && !fletchAndString) {
  743.             log("Fletched amount logging out!");
  744.             stopScript();
  745.         }
  746.         if (isBusy() && !interfaces.get(740).isValid()) {
  747.             antiban();
  748.             sleep(random(200, 250));
  749.         }
  750.         clickContinue();
  751.         if (gui.checkBox5.isSelected()) {
  752.             checkfor99();
  753.         }
  754.     }
  755.  
  756.     private void string() {
  757.         amount = Integer.parseInt(gui.textField1.getText());
  758.         if (!inventory.contains(getUnstrungId())
  759.                 || !inventory.contains(getBSId()) && amount == 0 && !isBusy()
  760.                 && !interfaces.get(905).isValid()) {
  761.             withdrawStrings();
  762.             sleep(random(200, 250));
  763.         } else if (!inventory.contains(getUnstrungId())
  764.                 || !inventory.contains(getBSId()) && strung <= amount
  765.                 && !isBusy() && !interfaces.get(905).isValid()) {
  766.             withdrawStrings();
  767.             sleep(random(200, 250));
  768.         } else if (strung >= amount && amount != 0) {
  769.             log("strung the chosen amount of bows!");
  770.             stopScript();
  771.         }
  772.         if (inventory.contains(getUnstrungId())
  773.                 && inventory.contains(getBSId()) && amount == 0 && !isBusy()) {
  774.             stringBows();
  775.             sleep(random(200, 250));
  776.         } else if (inventory.contains(getUnstrungId())
  777.                 && inventory.contains(getBSId()) && strung <= amount
  778.                 && !isBusy()) {
  779.             stringBows();
  780.             sleep(random(200, 250));
  781.         } else if (strung >= amount && amount != 0) {
  782.             log("strung the chosen amount of bows!");
  783.             stopScript();
  784.         }
  785.  
  786.         if (isBusy() && !interfaces.get(740).isValid()
  787.                 && inventory.contains(getBSId())
  788.                 && inventory.contains(getUnstrungId())) {
  789.             antiban();
  790.             sleep(random(400, 500));
  791.         }
  792.         clickContinue();
  793.         if (gui.checkBox5.isSelected()) {
  794.             checkfor99();
  795.         }
  796.     }
  797.  
  798.     private void fletchAndString() {
  799.         fletchAndString = true;
  800.         gui.comboBox1.setSelectedItem("Fletching Bow");
  801.     }
  802.  
  803.     private void cfd() {
  804.         amount = Integer.parseInt(gui.textField1.getText());
  805.         if (!inventory.contains(getAxeId())
  806.                 || !inventory.contains(getKnifeId())) {
  807.             log("Get a axe and knife before starting");
  808.             log("If you have the supplys...");
  809.             log("select the right item in the gui!");
  810.             log("Script stopping");
  811.             sleep(2000);
  812.             stopScript(false);
  813.             sleep(500);
  814.         }
  815.         if (amount == 0 && !isBusy() && !interfaces.get(905).isValid()) {
  816.             chopLogs();
  817.         } else if (fletched <= amount && !isBusy()
  818.                 && !interfaces.get(905).isValid()) {
  819.             chopLogs();
  820.         } else if (fletched >= amount && amount != 0) {
  821.             log("Done the amount required!");
  822.             stopScript();
  823.         }
  824.  
  825.         if (inventory.contains(getLogId())
  826.                 && inventory.containsOneOf(getKnifeId()) && amount == 0
  827.                 && !isBusy() && inventory.isFull()) {
  828.             if (getBowType() == 1 || getBowType() == 2) {
  829.                 fletchLogs();
  830.                 full = 0;
  831.             } else if (getBowType() == 3) {
  832.                 fletchShafts();
  833.                 full = 0;
  834.             } else if (getBowType() == 4) {
  835.                 fletchStocks();
  836.                 full = 0;
  837.             }
  838.         } else if (inventory.contains(getLogId()) && fletched <= amount
  839.                 && !isBusy() && inventory.isFull()) {
  840.             if (getBowType() == 1 || getBowType() == 2) {
  841.                 fletchLogs();
  842.                 full = 0;
  843.             } else if (getBowType() == 3) {
  844.                 fletchShafts();
  845.                 full = 0;
  846.             } else if (getBowType() == 4) {
  847.                 fletchStocks();
  848.                 full = 0;
  849.             }
  850.         } else if (fletched >= amount && amount != 0) {
  851.             log("Done the amount required!");
  852.             stopScript();
  853.         }
  854.  
  855.         if (inventory.contains(getUnstrungId())
  856.                 && inventory.containsOneOf(getKnifeId()) && amount == 0
  857.                 && !isBusy() && inventory.isFull() && getBowType() != 3) {
  858.             drop();
  859.         } else if (inventory.contains(getUnstrungId()) && fletched <= amount
  860.                 && !isBusy() && inventory.isFull()) {
  861.             drop();
  862.         } else if (fletched >= amount && amount != 0 && getBowType() != 3) {
  863.             log("Done the amount required!");
  864.             stopScript();
  865.         }
  866.         while (isBusy() && !interfaces.get(740).isValid()) {
  867.             antiban();
  868.             sleep(random(200, 250));
  869.         }
  870.         clickContinue();
  871.         if (gui.checkBox5.isSelected()) {
  872.             checkfor99();
  873.         }
  874.     }
  875.  
  876.     private void stocksWithLimbs() {
  877.         amount = Integer.parseInt(gui.textField1.getText());
  878.         if (!inventory.contains(getUnstrungId())
  879.                 || !inventory.contains(getObjectId()) && amount == 0
  880.                 && !isBusy() && !interfaces.get(905).isValid()) {
  881.             withdrawCBowU();
  882.             sleep(random(200, 250));
  883.         } else if (!inventory.contains(getUnstrungId())
  884.                 || !inventory.contains(getObjectId()) && fletched <= amount
  885.                 && !isBusy() && !interfaces.get(905).isValid()) {
  886.             withdrawCBowU();
  887.             sleep(random(200, 250));
  888.         } else if (fletched >= amount && amount != 0) {
  889.             log("Made the chosen amount of c'bows");
  890.             stopScript();
  891.         }
  892.         if (inventory.contains(getUnstrungId())
  893.                 && inventory.contains(getObjectId()) && amount == 0
  894.                 && !isBusy()) {
  895.             createCBowU();
  896.             sleep(random(200, 250));
  897.         } else if (inventory.contains(getUnstrungId())
  898.                 && inventory.contains(getObjectId()) && fletched <= amount
  899.                 && !isBusy()) {
  900.             createCBowU();
  901.             sleep(random(200, 250));
  902.         } else if (fletched >= amount && amount != 0) {
  903.             log("Made the chosen amount of c'bows");
  904.             stopScript();
  905.         }
  906.  
  907.         if (isBusy() && !interfaces.get(740).isValid()
  908.                 && inventory.contains(getBSId())
  909.                 && inventory.contains(getUnstrungId())) {
  910.             antiban();
  911.             sleep(random(400, 500));
  912.         }
  913.         clickContinue();
  914.         if (gui.checkBox5.isSelected()) {
  915.             checkfor99();
  916.         }
  917.     }
  918.  
  919.     private void stringCBow() {
  920.         amount = Integer.parseInt(gui.textField1.getText());
  921.         if (!inventory.contains(getUnstrungId())
  922.                 || !inventory.contains(getBSId()) && amount == 0 && !isBusy()
  923.                 && !interfaces.get(905).isValid()) {
  924.             withdrawCBowStrings();
  925.             sleep(random(200, 250));
  926.         } else if (!inventory.contains(getUnstrungId())
  927.                 || !inventory.contains(getBSId()) && strung <= amount
  928.                 && !isBusy() && !interfaces.get(905).isValid()) {
  929.             withdrawCBowStrings();
  930.             sleep(random(200, 250));
  931.         } else if (strung >= amount && amount != 0) {
  932.             log("strung the chosen amount of bows!");
  933.             stopScript();
  934.         }
  935.         if (inventory.contains(getUnstrungId())
  936.                 && inventory.contains(getBSId()) && amount == 0 && !isBusy()) {
  937.             stringBows();
  938.             sleep(random(200, 250));
  939.         } else if (inventory.contains(getUnstrungId())
  940.                 && inventory.contains(getBSId()) && strung <= amount
  941.                 && !isBusy()) {
  942.             stringBows();
  943.             sleep(random(200, 250));
  944.         } else if (strung >= amount && amount != 0) {
  945.             log("strung the chosen amount of bows!");
  946.             stopScript();
  947.         }
  948.  
  949.         if (isBusy() && !interfaces.get(740).isValid()
  950.                 && inventory.contains(getBSId())
  951.                 && inventory.contains(getUnstrungId())) {
  952.             antiban();
  953.             sleep(random(400, 500));
  954.         }
  955.         clickContinue();
  956.         if (gui.checkBox5.isSelected()) {
  957.             checkfor99();
  958.         }
  959.     }
  960.  
  961.     public void makeArrows() {
  962.         amount = Integer.parseInt(gui.textField1.getText());
  963.  
  964.         if (inventory.contains(constants.SHAFT_ID)
  965.                 && inventory.contains(constants.FEATHER_ID)
  966.                 && inventory.contains(getObjectId()) && amount == 0
  967.                 && !isBusy()) {
  968.             featherArrows();
  969.             sleep(random(200, 250));
  970.         } else if (inventory.contains(constants.SHAFT_ID)
  971.                 && inventory.contains(constants.FEATHER_ID)
  972.                 && inventory.contains(getObjectId()) && fletched <= amount
  973.                 && !isBusy()) {
  974.             featherArrows();
  975.             sleep(random(200, 250));
  976.         } else if (!inventory.contains(constants.SHAFT_ID)
  977.                 && !inventory.contains(constants.FEATHER_ID)
  978.                 && inventory.contains(getObjectId()) && amount == 0
  979.                 && !isBusy()) {
  980.             tipArrows();
  981.             sleep(random(200, 250));
  982.         } else if (!inventory.contains(constants.SHAFT_ID)
  983.                 && !inventory.contains(constants.FEATHER_ID)
  984.                 && inventory.contains(getObjectId()) && fletched <= amount
  985.                 && !isBusy()) {
  986.             tipArrows();
  987.             sleep(random(200, 250));
  988.         } else if (!isBusy()
  989.                 && (!inventory.contains(constants.SHAFT_ID)
  990.                         || !inventory.contains(constants.FEATHER_ID)
  991.                         || !inventory.contains(getObjectId()) || !inventory
  992.                         .contains(constants.FEATHER_SHAFT_ID))) {
  993.             log.severe("Out of supplys");
  994.             stopScript();
  995.         } else if (fletched >= amount && amount != 0) {
  996.             log("strung the chosen amount of bows!");
  997.             stopScript();
  998.         }
  999.  
  1000.         if (isBusy()) {
  1001.             antiban();
  1002.             sleep(random(400, 500));
  1003.         }
  1004.         clickContinue();
  1005.         if (gui.checkBox5.isSelected()) {
  1006.             checkfor99();
  1007.         }
  1008.     }
  1009.  
  1010.     private void makeDarts() {
  1011.         amount = Integer.parseInt(gui.textField1.getText());
  1012.         if (inventory.contains(getObjectId())
  1013.                 && inventory.contains(constants.FEATHER_ID) && amount == 0
  1014.                 && !isBusy()) {
  1015.             featherDarts();
  1016.             sleep(random(200, 250));
  1017.         } else if (inventory.contains(getObjectId())
  1018.                 && inventory.contains(constants.FEATHER_ID)
  1019.                 && fletched <= amount && !isBusy()) {
  1020.             featherDarts();
  1021.             sleep(random(200, 250));
  1022.         } else if (!isBusy()
  1023.                 && (!inventory.contains(constants.FEATHER_ID) || !inventory
  1024.                         .contains(getObjectId()))) {
  1025.             log.severe("Out of supplys");
  1026.             stopScript();
  1027.         } else if (fletched >= amount && amount != 0) {
  1028.             log("strung the chosen amount of bows!");
  1029.             stopScript();
  1030.         }
  1031.  
  1032.         if (isBusy()) {
  1033.             antiban();
  1034.             sleep(random(400, 500));
  1035.         }
  1036.         clickContinue();
  1037.         if (gui.checkBox5.isSelected()) {
  1038.             checkfor99();
  1039.         }
  1040.     }
  1041.  
  1042.     private void makeBolts() {
  1043.         amount = Integer.parseInt(gui.textField1.getText());
  1044.         if (inventory.contains(getObjectId())
  1045.                 && inventory.contains(constants.FEATHER_ID) && amount == 0
  1046.                 && !isBusy()) {
  1047.             featherBolts();
  1048.             sleep(random(200, 250));
  1049.         } else if (inventory.contains(getObjectId())
  1050.                 && inventory.contains(constants.FEATHER_ID)
  1051.                 && fletched <= amount && !isBusy()) {
  1052.             featherBolts();
  1053.             sleep(random(200, 250));
  1054.         } else if (!isBusy()
  1055.                 && (!inventory.contains(constants.FEATHER_ID) || !inventory
  1056.                         .contains(getObjectId()))) {
  1057.             log.severe("Out of supplys");
  1058.             stopScript();
  1059.         } else if (fletched >= amount && amount != 0) {
  1060.             log("strung the chosen amount of bows!");
  1061.             stopScript();
  1062.         }
  1063.         if (isBusy()) {
  1064.             antiban();
  1065.             sleep(random(400, 500));
  1066.         }
  1067.         clickContinue();
  1068.         if (gui.checkBox5.isSelected()) {
  1069.             checkfor99();
  1070.         }
  1071.     }
  1072.  
  1073.     private void clickContinue() {
  1074.         if (interfaces.get(740).isValid()) {
  1075.             status = "Level up: Clicking Continue";
  1076.             sleep(50, 75);
  1077.             if (gui.checkBox2.isSelected()) {
  1078.                 env.saveScreenshot(true);
  1079.             }
  1080.             if (gui.checkBox3.isSelected()
  1081.                     && skills.getRealLevel(Skills.FLETCHING) == 99 && !has99) {
  1082.                 log("If you have 99 already, Disable at 99 for screenshots!");
  1083.                 env.saveScreenshot(true);
  1084.                 has99 = true;
  1085.             }
  1086.             if (tray) {
  1087.                 trayInfo.systray.displayMessage(
  1088.                         "Level UP",
  1089.                         "You are now level: "
  1090.                                 + skills.getCurrentLevel(Skills.FLETCHING),
  1091.                         TrayIcon.MessageType.INFO);
  1092.             }
  1093.             sleep(150, 1500);
  1094.             interfaces.get(740).getComponent(3).doClick(true);
  1095.             sleep(150, 400);
  1096.         }
  1097.     }
  1098.  
  1099.     private void checkfor99() {
  1100.         currentexp = skills.getCurrentExp(Skills.FLETCHING);
  1101.         if (currentexp >= constants.xpIsClose) {
  1102.             status = "Check 99: Logging out";
  1103.             if (bank.isOpen()) {
  1104.                 bank.close();
  1105.             }
  1106.             stopScript(true);
  1107.         }
  1108.     }
  1109.  
  1110.     private void withdrawKnife() {
  1111.         status = "Banking: Knife";
  1112.         try {
  1113.             sleep(10, 20);
  1114.             openBank();
  1115.             sleep(200, 400);
  1116.             if (bank.isOpen()) {
  1117.                 sleep(100, 250);
  1118.                 if (!inventory.contains(getKnifeId())) {
  1119.                     if (inventory.getCount() > 0)
  1120.                         bank.depositAll();
  1121.                     sleep(100, 150);
  1122.                     if (getMethod() != 3) {
  1123.                         if (bank.getItem(getKnifeId()) == null) {
  1124.                             log("could not find a knife, logging out!");
  1125.                             stopScript();
  1126.                         }
  1127.                     }
  1128.                     bank.withdraw(getKnifeId(), 1);
  1129.                     for (int i = 0; i < 50; i++) {
  1130.                         sleep(40);
  1131.                         if (inventory.contains(getKnifeId())) {
  1132.                             break;
  1133.                         }
  1134.                     }
  1135.                 }
  1136.             }
  1137.         } catch (Exception e) {
  1138.         }
  1139.     }
  1140.  
  1141.     private void withdrawLogs() {
  1142.         status = "Banking: Logs";
  1143.         try {
  1144.             sleep(10, 20);
  1145.             if (openBank()) {
  1146.                 if (bank.isOpen()) {
  1147.                     sleep(200, 400);
  1148.                     if (bank.depositAllExcept(getKnifeId())) {
  1149.                         for (int i = 0; i < 10; i++) {
  1150.                             sleep(30);
  1151.                             if (inventory.getCount() == 0) {
  1152.                                 break;
  1153.                             }
  1154.                         }
  1155.                     }
  1156.                     if (bank.getItem(getLogId()) == null) {
  1157.                         if (fletchAndString) {
  1158.                             gui.comboBox1.setSelectedItem("String");
  1159.                         } else {
  1160.                             log("could not find any Logs, logging out!");
  1161.                             stopScript();
  1162.                         }
  1163.                     }
  1164.                     bank.withdraw(getLogId(), 0);
  1165.                     sleep(50, 100);
  1166.                     for (int i = 0; i < 25; i++) {
  1167.                         sleep(50);
  1168.                         if (inventory.contains(getLogId())) {
  1169.                             break;
  1170.                         }
  1171.                     }
  1172.                 }
  1173.             }
  1174.         } catch (Exception e) {
  1175.         }
  1176.     }
  1177.  
  1178.     private void withdrawStrings() {
  1179.         status = "Banking: Stringing";
  1180.         try {
  1181.             if (!inventory.contains(getBSId())
  1182.                     || !inventory.contains(getUnstrungId())) {
  1183.                 openBank();
  1184.                 if (bank.isOpen()) {
  1185.                     if (inventory.getCount() > 0) {
  1186.                         bank.depositAll();
  1187.                         sleep(50);
  1188.                         for (int i = 0; i < 20; i++) {
  1189.                             sleep(25);
  1190.                             if (inventory.getCount() == 0) {
  1191.                                 break;
  1192.                             }
  1193.                         }
  1194.                     }
  1195.                     if (inventory.getCount(getUnstrungId()) != 14) {
  1196.                         if (inventory.getCount(getUnstrungId()) > 0) {
  1197.                             bank.deposit(getUnstrungId(), 0);
  1198.                         }
  1199.                         if (bank.getCount(getUnstrungId()) > 0) {
  1200.                             bank.withdraw(getUnstrungId(), 14);
  1201.                             sleep(100);
  1202.                             for (int i = 0; i < 25; i++) {
  1203.                                 sleep(75);
  1204.                                 if (inventory.contains(getUnstrungId())) {
  1205.                                     break;
  1206.                                 }
  1207.                             }
  1208.                         } else if (bank.isOpen()) {
  1209.                             if (bank.getCount(getUnstrungId()) == 0) {
  1210.                                 log("No more bows (u) in bank.");
  1211.                                 stopScript(true);
  1212.                             }
  1213.                         }
  1214.                     }
  1215.                     sleep(100);
  1216.                     if (inventory.getCount(getBSId()) != 14) {
  1217.                         if (inventory.getCount(getBSId()) > 0) {
  1218.                             bank.deposit(getUnstrungId(), 0);
  1219.                         }
  1220.                         if (bank.getCount(getBSId()) > 0) {
  1221.                             bank.withdraw(getBSId(), 14);
  1222.                             sleep(100);
  1223.                             for (int i = 0; i < 25; i++) {
  1224.                                 sleep(75);
  1225.                                 if (inventory.contains(getBSId())) {
  1226.                                     break;
  1227.                                 }
  1228.                             }
  1229.                         } else if (bank.isOpen()) {
  1230.                             if (bank.getCount(getBSId()) == 0) {
  1231.                                 log("No more bows (u) in bank.");
  1232.                                 stopScript(true);
  1233.                             }
  1234.                         }
  1235.                     }
  1236.                 }
  1237.             }
  1238.         } catch (Exception e) {
  1239.         }
  1240.     }
  1241.  
  1242.     private void withdrawShafts() {
  1243.         status = "Banking: Shafts";
  1244.         try {
  1245.             sleep(10, 20);
  1246.             if (openBank()) {
  1247.                 if (getLogId() != 1511) {
  1248.                     log("Please select normal logs!");
  1249.                     stopScript();
  1250.                 } else if (getLogId() == 1511 && bank.isOpen()) {
  1251.                     sleep(200, 400);
  1252.                     bank.depositAllExcept(getKnifeId());
  1253.                     sleep(100, 150);
  1254.                     if (bank.getItem(getLogId()) == null) {
  1255.                         log("Out of logs, Logging out!");
  1256.                         stopScript();
  1257.                     }
  1258.                     bank.withdraw(getLogId(), 0);
  1259.                     for (int i = 0; i < 200; i++) {
  1260.                         sleep(50);
  1261.                         if (inventory.contains(getLogId())) {
  1262.                             bank.close();
  1263.                             break;
  1264.                         }
  1265.                     }
  1266.                     sleep(30, 50);
  1267.                 }
  1268.             }
  1269.         } catch (Exception e) {
  1270.         }
  1271.     }
  1272.  
  1273.     private void withdrawStocks() {
  1274.         status = "Banking: Stocks";
  1275.         try {
  1276.             sleep(10, 20);
  1277.             if (openBank()) {
  1278.                 if (getLogId() == 1513) {
  1279.                     log("Please select a different log!");
  1280.                     stopScript();
  1281.                 } else if (getLogId() != 1513 && bank.isOpen()) {
  1282.                     sleep(200, 400);
  1283.                     bank.depositAllExcept(getKnifeId());
  1284.                     sleep(100, 150);
  1285.                     if (bank.getItem(getLogId()) == null) {
  1286.                         log("Out of logs, Logging out!");
  1287.                         stopScript();
  1288.                     }
  1289.                     bank.withdraw(getLogId(), 0);
  1290.                     for (int i = 0; i < 200; i++) {
  1291.                         sleep(50);
  1292.                         if (inventory.contains(getLogId())) {
  1293.                             bank.close();
  1294.                             break;
  1295.                         }
  1296.                     }
  1297.                     sleep(30, 50);
  1298.                 }
  1299.             }
  1300.         } catch (Exception e) {
  1301.         }
  1302.     }
  1303.  
  1304.     private void withdrawCBowU() {
  1305.         status = "Banking: C'bows";
  1306.         try {
  1307.             if (!inventory.contains(getObjectId())
  1308.                     || !inventory.contains(getUnstrungId())) {
  1309.                 openBank();
  1310.                 if (bank.isOpen()) {
  1311.                     if (inventory.getCount() > 0) {
  1312.                         bank.depositAll();
  1313.                         sleep(50);
  1314.                         for (int i = 0; i < 20; i++) {
  1315.                             sleep(25);
  1316.                             if (inventory.getCount() == 0) {
  1317.                                 break;
  1318.                             }
  1319.                         }
  1320.                     }
  1321.                     if (inventory.getCount(getUnstrungId()) != 14) {
  1322.                         if (inventory.getCount(getUnstrungId()) > 0) {
  1323.                             bank.deposit(getUnstrungId(), 0);
  1324.                         }
  1325.                         if (bank.getCount(getUnstrungId()) > 0) {
  1326.                             bank.withdraw(getUnstrungId(), 14);
  1327.                             sleep(100);
  1328.                             for (int i = 0; i < 25; i++) {
  1329.                                 sleep(200);
  1330.                                 if (inventory.contains(getUnstrungId())) {
  1331.                                     break;
  1332.                                 }
  1333.                             }
  1334.                         } else if (bank.isOpen()) {
  1335.                             if (bank.getCount(getUnstrungId()) == 0) {
  1336.                                 log("No more bows (u) in bank.");
  1337.                                 stopScript(true);
  1338.                             }
  1339.                         }
  1340.                     }
  1341.                     sleep(100);
  1342.                     if (inventory.getCount(getObjectId()) != 14) {
  1343.                         if (inventory.getCount(getObjectId()) > 0) {
  1344.                             bank.deposit(getUnstrungId(), 0);
  1345.                         }
  1346.                         if (bank.getCount(getObjectId()) > 0) {
  1347.                             bank.withdraw(getObjectId(), 14);
  1348.                             sleep(100);
  1349.                             for (int i = 0; i < 25; i++) {
  1350.                                 sleep(200);
  1351.                                 if (inventory.contains(getObjectId())) {
  1352.                                     break;
  1353.                                 }
  1354.                             }
  1355.                         } else if (bank.isOpen()) {
  1356.                             if (bank.getCount(getObjectId()) == 0) {
  1357.                                 log("No more bows (u) in bank.");
  1358.                                 stopScript(true);
  1359.                             }
  1360.                         }
  1361.                     }
  1362.                 }
  1363.             }
  1364.         } catch (Exception e) {
  1365.         }
  1366.     }
  1367.  
  1368.     private void withdrawCBowStrings() {
  1369.         status = "Banking: C'Bows";
  1370.         try {
  1371.             if (!inventory.contains(getBSId())
  1372.                     || !inventory.contains(getUnstrungId())) {
  1373.                 openBank();
  1374.                 if (bank.isOpen()) {
  1375.                     if (inventory.getCount() > 0) {
  1376.                         bank.depositAll();
  1377.                         sleep(50);
  1378.                         for (int i = 0; i < 20; i++) {
  1379.                             sleep(25);
  1380.                             if (inventory.getCount() == 0) {
  1381.                                 break;
  1382.                             }
  1383.                         }
  1384.                     }
  1385.                     if (inventory.getCount(getUnstrungId()) != 14) {
  1386.                         if (inventory.getCount(getUnstrungId()) > 0) {
  1387.                             bank.deposit(getUnstrungId(), 0);
  1388.                         }
  1389.                         if (bank.getCount(getUnstrungId()) > 0) {
  1390.                             bank.withdraw(getUnstrungId(), 14);
  1391.                             sleep(100);
  1392.                             for (int i = 0; i < 25; i++) {
  1393.                                 sleep(200);
  1394.                                 if (inventory.contains(getUnstrungId())) {
  1395.                                     break;
  1396.                                 }
  1397.                             }
  1398.                         } else if (bank.isOpen()) {
  1399.                             if (bank.getCount(getUnstrungId()) == 0) {
  1400.                                 log("No more c'bows (u) in bank.");
  1401.                                 stopScript(true);
  1402.                             }
  1403.                         }
  1404.                     }
  1405.                     sleep(100);
  1406.                     if (inventory.getCount(getBSId()) != 14) {
  1407.                         if (inventory.getCount(getBSId()) > 0) {
  1408.                             bank.deposit(getUnstrungId(), 0);
  1409.                         }
  1410.                         if (bank.getCount(getBSId()) > 0) {
  1411.                             bank.withdraw(getBSId(), 14);
  1412.                             sleep(100);
  1413.                             for (int i = 0; i < 25; i++) {
  1414.                                 sleep(200);
  1415.                                 if (inventory.contains(getBSId())) {
  1416.                                     break;
  1417.                                 }
  1418.                             }
  1419.                         } else if (bank.isOpen()) {
  1420.                             if (bank.getCount(getBSId()) == 0) {
  1421.                                 log("No more Bow String in bank.");
  1422.                                 stopScript(true);
  1423.                             }
  1424.                         }
  1425.                     }
  1426.                 }
  1427.             }
  1428.         } catch (Exception e) {
  1429.         }
  1430.     }
  1431.  
  1432.     private void fletchLogs() {
  1433.         status = "Fletching: UBows";
  1434.         try {
  1435.             if (bank.isOpen()) {
  1436.                 bank.close();
  1437.             }
  1438.             sleep(50, 100);
  1439.             if (!interfaces.get(905).isValid() && !isBusy()
  1440.                     && inventory.containsOneOf(getKnifeId())) {
  1441.                 if (random(1, 2) == 1) {
  1442.                     inventory.getItem(getLogId()).doClick(true);
  1443.                     sleep(200, 400);
  1444.                     inventory.getItem(getKnifeId()).doClick(true);
  1445.                 } else {
  1446.                     inventory.getItem(getKnifeId()).doClick(true);
  1447.                     sleep(200, 400);
  1448.                     inventory.getItem(getLogId()).doClick(true);
  1449.                 }
  1450.             }
  1451.             sleep(50, 100);
  1452.             mouse.move(random(35, 448), random(500, 355));
  1453.             sleep(400, 450);
  1454.             if (interfaces.get(905).isValid()) {
  1455.                 if (getBowType() == 1) {
  1456.                     status = "Fletching: short";
  1457.                     if (getLogId() == 1511) {
  1458.                         sleep(200, 250);
  1459.                         interfaces.get(905).getComponent(15)
  1460.                                 .interact("Make All");
  1461.                     } else {
  1462.                         sleep(200, 250);
  1463.                         interfaces.get(905).getComponent(14)
  1464.                                 .interact("Make All");
  1465.                     }
  1466.                 }
  1467.                 if (getBowType() == 2) {
  1468.                     status = "Fletching: long";
  1469.                     if (getLogId() == 1511) {
  1470.                         sleep(200, 250);
  1471.                         interfaces.get(905).getComponent(16)
  1472.                                 .interact("Make All");
  1473.                     } else {
  1474.                         sleep(200, 250);
  1475.                         interfaces.get(905).getComponent(15)
  1476.                                 .interact("Make All");
  1477.                     }
  1478.                 }
  1479.             }
  1480.             sleep(50, 200);
  1481.         } catch (Exception e) {
  1482.         }
  1483.     }
  1484.  
  1485.     private void stringBows() {
  1486.         status = "Stringing: Bows";
  1487.         try {
  1488.             if (bank.isOpen()) {
  1489.                 bank.close();
  1490.             }
  1491.             if (!interfaces.get(905).isValid() && !isBusy()
  1492.                     && inventory.contains(getBSId())
  1493.                     && inventory.contains(getUnstrungId())) {
  1494.                 if (random(1, 2) == 1) {
  1495.                     inventory.getItem(getUnstrungId()).doClick(true);
  1496.                     sleep(200, 400);
  1497.                     inventory.getItem(getBSId()).doClick(true);
  1498.                     sleep(random(200, 400));
  1499.                 } else {
  1500.                     inventory.getItem(getBSId()).doClick(true);
  1501.                     sleep(200, 400);
  1502.                     inventory.getItem(getUnstrungId()).doClick(true);
  1503.                     sleep(random(200, 400));
  1504.                 }
  1505.             }
  1506.             sleep(50, 100);
  1507.             mouse.moveRandomly(150, 500);
  1508.             sleep(400, 450);
  1509.             if (interfaces.get(905).isValid()) {
  1510.                 sleep(200, 250);
  1511.                 interfaces.get(905).getComponent(14).interact("Make All");
  1512.                 sleep(50, 200);
  1513.             }
  1514.         } catch (Exception e) {
  1515.         }
  1516.     }
  1517.  
  1518.     private void fletchShafts() {
  1519.         status = "Fletching: Shafts";
  1520.         try {
  1521.             if (bank.isOpen())
  1522.                 bank.close();
  1523.             sleep(50, 100);
  1524.             if (!interfaces.get(905).isValid() && !isBusy()) {
  1525.                 if (random(1, 2) == 1) {
  1526.                     inventory.getItem(getLogId()).doClick(true);
  1527.                     sleep(200, 400);
  1528.                     inventory.getItem(getKnifeId()).doClick(true);
  1529.                 } else {
  1530.                     inventory.getItem(getKnifeId()).doClick(true);
  1531.                     sleep(200, 400);
  1532.                     inventory.getItem(getLogId()).doClick(true);
  1533.                 }
  1534.             }
  1535.             sleep(50, 100);
  1536.             mouse.moveRandomly(150, 500);
  1537.             sleep(400, 450);
  1538.             if (interfaces.get(905).isValid()) {
  1539.                 if (getLogId() == 1511) {
  1540.                     sleep(200, 250);
  1541.                     interfaces.get(905).getComponent(14).doClick(true);
  1542.                 } else if (getLogId() != 1511) {
  1543.                     log("Please select normal logs!");
  1544.                     stopScript();
  1545.                 }
  1546.             }
  1547.             sleep(50, 200);
  1548.         } catch (Exception e) {
  1549.         }
  1550.     }
  1551.  
  1552.     private void fletchStocks() {
  1553.         status = "Fletching: Stocks";
  1554.         try {
  1555.             if (bank.isOpen())
  1556.                 bank.close();
  1557.             sleep(50, 100);
  1558.             if (!interfaces.get(905).isValid() && !isBusy()) {
  1559.                 if (random(1, 2) == 1) {
  1560.                     inventory.getItem(getLogId()).doClick(true);
  1561.                     sleep(200, 400);
  1562.                     inventory.getItem(getKnifeId()).doClick(true);
  1563.                 } else {
  1564.                     inventory.getItem(getKnifeId()).doClick(true);
  1565.                     sleep(200, 400);
  1566.                     inventory.getItem(getLogId()).doClick(true);
  1567.                 }
  1568.             }
  1569.             sleep(50, 100);
  1570.             mouse.moveRandomly(150, 500);
  1571.             sleep(400, 450);
  1572.             if (interfaces.get(905).isValid()) {
  1573.                 if (getLogId() == 1513) {
  1574.                     log("Please slect a different log!");
  1575.                     stopScript();
  1576.                 } else if (getLogId() != 1513) {
  1577.                     if (getLogId() == 1511) {
  1578.                         sleep(200, 250);
  1579.                         interfaces.get(905).getComponent(17).doClick(true);
  1580.                     } else {
  1581.                         sleep(200, 250);
  1582.                         interfaces.get(905).getComponent(17).doClick(true);
  1583.                     }
  1584.                 }
  1585.             }
  1586.             sleep(50, 200);
  1587.         } catch (Exception e) {
  1588.         }
  1589.     }
  1590.  
  1591.     private void createCBowU() {
  1592.         status = "Creating: Stocks with limbs";
  1593.         try {
  1594.             if (bank.isOpen())
  1595.                 bank.close();
  1596.             sleep(50, 100);
  1597.             if (!interfaces.get(905).isValid() && !isBusy()) {
  1598.                 if (random(1, 2) == 1) {
  1599.                     inventory.getItem(getUnstrungId()).doClick(true);
  1600.                     sleep(200, 400);
  1601.                     inventory.getItem(getObjectId()).doClick(true);
  1602.                 } else {
  1603.                     inventory.getItem(getUnstrungId()).doClick(true);
  1604.                     sleep(200, 400);
  1605.                     inventory.getItem(getObjectId()).doClick(true);
  1606.                 }
  1607.             }
  1608.             sleep(50, 100);
  1609.             mouse.moveRandomly(150, 500);
  1610.             sleep(400, 450);
  1611.             if (interfaces.get(905).isValid()) {
  1612.                 interfaces.getComponent(905, 14).doClick();
  1613.             }
  1614.             sleep(50, 200);
  1615.         } catch (Exception e) {
  1616.         }
  1617.     }
  1618.  
  1619.     private void featherDarts() {
  1620.         status = "Making: Darts";
  1621.         try {
  1622.             if (bank.isOpen())
  1623.                 bank.close();
  1624.             sleep(50, 100);
  1625.             if (!interfaces.get(905).isValid() && !isBusy()) {
  1626.                 if (random(1, 2) == 1) {
  1627.                     inventory.getItem(constants.FEATHER_ID).doClick(true);
  1628.                     sleep(200, 400);
  1629.                     inventory.getItem(getObjectId()).doClick(true);
  1630.                 } else {
  1631.                     inventory.getItem(constants.FEATHER_ID).doClick(true);
  1632.                     sleep(200, 400);
  1633.                     inventory.getItem(getObjectId()).doClick(true);
  1634.                 }
  1635.             }
  1636.             sleep(50, 100);
  1637.             mouse.moveRandomly(150, 500);
  1638.             sleep(400, 450);
  1639.             if (interfaces.get(905).isValid()) {
  1640.                 interfaces.getComponent(905, 14).doClick();
  1641.             }
  1642.             sleep(50, 200);
  1643.         } catch (Exception e) {
  1644.         }
  1645.     }
  1646.  
  1647.     private void featherBolts() {
  1648.         status = "Making: Bolts";
  1649.         try {
  1650.             if (bank.isOpen())
  1651.                 bank.close();
  1652.             if (!interfaces.get(905).isValid() && !isBusy()) {
  1653.                 if (random(1, 2) == 1) {
  1654.                     inventory.getItem(constants.FEATHER_ID).doClick(true);
  1655.                     sleep(100, 200);
  1656.                     inventory.getItem(getObjectId()).doClick(true);
  1657.                 } else {
  1658.                     inventory.getItem(constants.FEATHER_ID).doClick(true);
  1659.                     sleep(100, 200);
  1660.                     inventory.getItem(getObjectId()).doClick(true);
  1661.                 }
  1662.             }
  1663.             sleep(50, 100);
  1664.             mouse.moveRandomly(150, 500);
  1665.             sleep(400, 450);
  1666.             if (interfaces.get(905).isValid()) {
  1667.                 interfaces.getComponent(905, 14).doClick();
  1668.             }
  1669.             sleep(300, 500);
  1670.         } catch (Exception e) {
  1671.         }
  1672.     }
  1673.  
  1674.     private void featherArrows() {
  1675.         status = "Making: Arrows";
  1676.         try {
  1677.             if (bank.isOpen())
  1678.                 bank.close();
  1679.             sleep(50, 100);
  1680.             if (!interfaces.get(905).isValid() && !isBusy()) {
  1681.                 if (random(1, 2) == 1) {
  1682.                     inventory.getItem(constants.SHAFT_ID).doClick(true);
  1683.                     sleep(200, 400);
  1684.                     inventory.getItem(constants.FEATHER_ID).doClick(true);
  1685.                 } else {
  1686.                     inventory.getItem(constants.SHAFT_ID).doClick(true);
  1687.                     sleep(200, 400);
  1688.                     inventory.getItem(constants.FEATHER_ID).doClick(true);
  1689.                 }
  1690.             }
  1691.             sleep(50, 100);
  1692.             mouse.moveRandomly(150, 500);
  1693.             sleep(400, 450);
  1694.             if (interfaces.get(905).isValid()) {
  1695.                 interfaces.getComponent(905, 14).doClick();
  1696.             }
  1697.             sleep(50, 200);
  1698.         } catch (Exception e) {
  1699.         }
  1700.     }
  1701.  
  1702.     private void tipArrows() {
  1703.         status = "Making: Arrows";
  1704.         try {
  1705.             if (bank.isOpen())
  1706.                 bank.close();
  1707.             sleep(50, 100);
  1708.             if (!interfaces.get(905).isValid() && !isBusy()) {
  1709.                 if (random(1, 2) == 1) {
  1710.                     inventory.getItem(constants.FEATHER_SHAFT_ID).doClick(true);
  1711.                     sleep(200, 400);
  1712.                     inventory.getItem(getObjectId()).doClick(true);
  1713.                 } else {
  1714.                     inventory.getItem(getObjectId()).doClick(true);
  1715.                     sleep(200, 400);
  1716.                     inventory.getItem(constants.FEATHER_SHAFT_ID).doClick(true);
  1717.                 }
  1718.             }
  1719.             sleep(50, 100);
  1720.             mouse.moveRandomly(150, 500);
  1721.             sleep(400, 450);
  1722.             if (interfaces.get(905).isValid()) {
  1723.                 interfaces.getComponent(905, 14).doClick();
  1724.             }
  1725.             sleep(50, 200);
  1726.         } catch (Exception e) {
  1727.         }
  1728.     }
  1729.  
  1730.     private void chopLogs() {
  1731.         walk();
  1732.         status = "Chop: Logs";
  1733.         if (objects.getNearest(getTreeId()) != null
  1734.                 && getMyPlayer().getAnimation() == -1
  1735.                 && !getMyPlayer().isMoving()) {
  1736.             if (objects.getNearest(getTreeId()) != null
  1737.                     && !isBusy()
  1738.                     && calc.tileOnScreen(objects.getNearest(getTreeId())
  1739.                             .getLocation())) {
  1740.                 objects.getNearest(getTreeId()).interact("Chop");
  1741.                 camera.turnTo(objects.getNearest(getTreeId()));
  1742.                 sleep(random(1000, 1250));
  1743.                 if (full > 5) {
  1744.                     log("Inventory was to full, error!");
  1745.                     log("Clearing out inventory!");
  1746.                     full = 0;
  1747.                     drop();
  1748.                 }
  1749.                 if (fail > 3) {
  1750.                     status = "Fail: getting new tree.";
  1751.                     walking.walkTileMM(getMyPlayer().getLocation().randomize(
  1752.                             10, 10));
  1753.                     sleep(800);
  1754.                     while (getMyPlayer().isMoving() || isBusy()) {
  1755.                         sleep(250);
  1756.                     }
  1757.                     fail = 0;
  1758.                     walk();
  1759.                 }
  1760.                 drop();
  1761.             }
  1762.         }
  1763.     }
  1764.  
  1765.     private void drop() {
  1766.         status = "Drop: Fletched items";
  1767.         for (RSItem i : inventory.getItems()) {
  1768.             if (i.getID() != 15545 && i.getID() != 15544) {
  1769.                 GEItem item = grandExchange.lookup(i.getID());
  1770.                 if (item.getGuidePrice() < 3000) {
  1771.                     if (item.getID() != getAxeId()
  1772.                             && item.getID() != getKnifeId()
  1773.                             && item.getID() != 15544 && item.getID() != 15545
  1774.                             && item.getID() != 52) {
  1775.                         i.interact("drop");
  1776.                     }
  1777.                 }
  1778.             }
  1779.         }
  1780.     }
  1781.  
  1782.     public void walk() {
  1783.         status = "Walking";
  1784.         if (objects.getNearest(getTreeId()) != null
  1785.                 && getMyPlayer().getAnimation() == -1
  1786.                 && !getMyPlayer().isMoving()) {
  1787.             if (objects.getNearest(getTreeId()) != null && !isBusy()) {
  1788.                 camera.setPitch(random(90, 100));
  1789.                 walking.walkTileMM(objects.getNearest(getTreeId())
  1790.                         .getLocation());
  1791.             }
  1792.             sleep(500);
  1793.             while (getMyPlayer().isMoving() || isBusy()) {
  1794.                 sleep(250);
  1795.             }
  1796.         } else if (objects.getNearest(getTreeId()) == null) {
  1797.             log("Tree out of reach, please start closer to the tree!");
  1798.             stopScript();
  1799.         }
  1800.     }
  1801.  
  1802.     public void messageReceived(MessageEvent message) {
  1803.         try {
  1804.             String m = message.getMessage().toLowerCase();
  1805.             int person = message.getID();
  1806.             if (m.contains("you carefully cut")
  1807.                     && person == MessageEvent.MESSAGE_ACTION) {
  1808.                 fletched++;
  1809.             }
  1810.             if (m.contains("you carefully cut the wood into 15")
  1811.                     && person == MessageEvent.MESSAGE_ACTION) {
  1812.                 fletched--;
  1813.                 fletched += 15;
  1814.             }
  1815.             if (m.contains("you attach the stock")
  1816.                     && person == MessageEvent.MESSAGE_ACTION) {
  1817.                 fletched++;
  1818.             }
  1819.             if (m.contains("you add a string")
  1820.                     && person == MessageEvent.MESSAGE_ACTION) {
  1821.                 strung++;
  1822.             }
  1823.             if (m.contains("you attach arrow")
  1824.                     && person == MessageEvent.MESSAGE_ACTION) {
  1825.                 fletched += 15;
  1826.             }
  1827.             if (m.contains("you attach feathers to 10 bolts.")
  1828.                     && person == MessageEvent.MESSAGE_ACTION) {
  1829.                 timeOut = System.currentTimeMillis() + 2000;
  1830.                 fletched += 10;
  1831.             }
  1832.             if (m.contains("you finish making")
  1833.                     && person == MessageEvent.MESSAGE_ACTION) {
  1834.                 timeOut = System.currentTimeMillis() + 2000;
  1835.                 fletched += 10;
  1836.             }
  1837.             if (m.contains("you fletch 10")
  1838.                     && person == MessageEvent.MESSAGE_ACTION) {
  1839.                 fletched += 10;
  1840.             }
  1841.             if (m.contains("you can't reach that")
  1842.                     && person == MessageEvent.MESSAGE_ACTION) {
  1843.                 fail++;
  1844.             }
  1845.             if (m.contains("your inventory is too full")
  1846.                     && person == MessageEvent.MESSAGE_ACTION) {
  1847.                 fail++;
  1848.                 full++;
  1849.             }
  1850.             if (m.contains("you need a")
  1851.                     && person == MessageEvent.MESSAGE_ACTION) {
  1852.                 log("not high enough level! Stopping!");
  1853.                 stopScript(true);
  1854.             }
  1855.             if (gui.checkBox15.isSelected()) {
  1856.                 if (person == MessageEvent.MESSAGE_CHAT
  1857.                         || person == MessageEvent.MESSAGE_CLAN_CHAT
  1858.                         || person == MessageEvent.MESSAGE_PRIVATE_IN) {
  1859.                     if (tray) {
  1860.                         trayInfo.systray.displayMessage(message.getSender()
  1861.                                 + ":", message.getMessage(),
  1862.                                 TrayIcon.MessageType.WARNING);
  1863.                     }
  1864.                 }
  1865.             }
  1866.         } catch (Exception e) {
  1867.         }
  1868.     }
  1869.  
  1870.     private void antiban() {
  1871.         status = "Antiban:";
  1872.         pauseScript();
  1873.         if (!gui.button5.isSelected()) {
  1874.             ab.antiBan();
  1875.         }
  1876.     }
  1877.  
  1878.     private void pauseScript() {
  1879.         if (pause) {
  1880.             log("Pausing...");
  1881.             status = "Paused";
  1882.             while (pause) {
  1883.                 sleep(400, 600);
  1884.             }
  1885.         }
  1886.     }
  1887.  
  1888.     public boolean onStart() {
  1889.         if (!manageLogin()) {
  1890.             JOptionPane.showMessageDialog(null, "Please completely login!");
  1891.             return false;
  1892.         }
  1893.         getImages();
  1894.         createGui();
  1895.         getExtraInfo();
  1896.         return game.isLoggedIn();
  1897.     }
  1898.  
  1899.     private boolean manageLogin() {
  1900.         for (int i = 0; i < 80; i++) {
  1901.             sleep(80);
  1902.             if (game.isLoggedIn()) {
  1903.                 break;
  1904.             }
  1905.         }
  1906.         return game.isLoggedIn();
  1907.     }
  1908.  
  1909.     private void createGui() {
  1910.         gui = new gui();
  1911.         loadSettings();
  1912.         gui.progressBar1.setValue(skills
  1913.                 .getPercentToNextLevel(Skills.FLETCHING));
  1914.         gui.checkBox16.setSelected(false);
  1915.         if (gui.textField2.getText().equals("All")) {
  1916.             gui.textField2.setEnabled(true);
  1917.             gui.button4.setEnabled(true);
  1918.         } else {
  1919.             gui.textField2.setEnabled(false);
  1920.             gui.button4.setEnabled(false);
  1921.         }
  1922.         name = gui.textField2.getText();
  1923.         if (name != "All") {
  1924.             if (connection) {
  1925.                 siggy = getImage("", false,
  1926.                         "http://www.universalscripts.org/ufletch/UFletch_generate.php?user="
  1927.                                 + name);
  1928.             }
  1929.             gui.label1 = new JLabel(new ImageIcon(siggy));
  1930.         }
  1931.         while (wait) {
  1932.             if (!wait) {
  1933.                 break;
  1934.             }
  1935.         }
  1936.     }
  1937.  
  1938.     private void getExtraInfo() {
  1939.         if (gui.checkBox16.isSelected()) {
  1940.             beep = new beeper();
  1941.             beep.start();
  1942.         }
  1943.         trayInfo = new trayInfo();
  1944.         if (tray) {
  1945.             trayInfo.systray.displayMessage("Welcome!",
  1946.                     "Thanks for using UFletch!", TrayIcon.MessageType.INFO);
  1947.         }
  1948.         gui.checkBox16.setEnabled(false);
  1949.         startXP = skills.getCurrentExp(Skills.FLETCHING);
  1950.         startLevel = skills.getCurrentLevel(Skills.FLETCHING);
  1951.     }
  1952.  
  1953.     private void getImages() {
  1954.         log(Color.GREEN.darker(),
  1955.                 "Please wait while we check the connection to universalscipts.org");
  1956.         try {
  1957.             connection = InetAddress.getByName("96.44.189.229").isReachable(
  1958.                     3000);// universalscripts.org
  1959.         } catch (UnknownHostException e) {
  1960.             connection = false;
  1961.         } catch (IOException e) {
  1962.             connection = false;
  1963.         }
  1964.         if (connection) {
  1965.             icon = getImage("fav.png", true,
  1966.                     "http://www.universalscripts.org/ufletch/Images/fav.png");
  1967.             fletchIcon = getImage("fletchIcon.png", true,
  1968.                     "http://www.universalscripts.org/ufletch/Images/fletchIcon.png");
  1969.  
  1970.             settings = getImage("settings.png", true,
  1971.                     "http://www.universalscripts.org/ufletch/Images/settings.png");
  1972.             bow = getImage("bow.png", true,
  1973.                     "http://www.universalscripts.org/ufletch/Images/bow.png");
  1974.             logsImage = getImage("logs.png", true,
  1975.                     "http://www.universalscripts.org/ufletch/Images/logs.png");
  1976.             axe = getImage("axe.png", true,
  1977.                     "http://www.universalscripts.org/ufletch/Images/axe.png");
  1978.             knife = getImage("knife.png", true,
  1979.                     "http://www.universalscripts.org/ufletch/Images/knife.png");
  1980.             brush = getImage("paint.png", true,
  1981.                     "http://www.universalscripts.org/ufletch/Images/paint.png");
  1982.             siggy = getImage("", false,
  1983.                     "http://www.universalscripts.org/ufletch/UFletch_generate.php?user="
  1984.                             + name);
  1985.             pic = getImage("camera.png", true,
  1986.                     "http://www.universalscripts.org/ufletch/Images/camera.png");
  1987.         } else {
  1988.             log.severe("Error Connecting to universalscripts.org");
  1989.             log.severe("Using backup or cached images!");
  1990.             icon = getCachedImage("fav.png");
  1991.             fletchIcon = getCachedImage("fletchIcon.png");
  1992.             settings = getCachedImage("settings.png");
  1993.             bow = getCachedImage("bow.png");
  1994.             logsImage = getCachedImage("logs.png");
  1995.             axe = getCachedImage("axe.png");
  1996.             knife = getCachedImage("knife.png");
  1997.             brush = getCachedImage("paint.png");
  1998.             siggy = pic();
  1999.             pic = getCachedImage("camera.png");
  2000.         }
  2001.     }
  2002.  
  2003.     private void createSignature() {
  2004.         if (!connection) {
  2005.             try {
  2006.                 URL url;
  2007.                 URLConnection urlConn;
  2008.                 url = new URL(
  2009.                         "http://www.universalscripts.org/ufletch/UFletch_submit.php");
  2010.                 urlConn = url.openConnection();
  2011.                 urlConn.setRequestProperty("User-Agent", "UFletchAgent");
  2012.                 urlConn.setDoInput(true);
  2013.                 urlConn.setDoOutput(true);
  2014.                 urlConn.setUseCaches(false);
  2015.                 urlConn.setRequestProperty("Content-Type",
  2016.                         "application/x-www-form-urlencoded");
  2017.                 String content = "";
  2018.                 String[] stats = { "auth", "secs", "mins", "hours", "days",
  2019.                         "fletched", "strung", "expgained" };
  2020.                 Object[] data = { gui.textField2.getText(), 0, 0, 0, 0, 0, 0, 0 };
  2021.                 for (int i = 0; i < stats.length; i++) {
  2022.                     content += stats[i] + "=" + data[i] + "&";
  2023.                 }
  2024.                 content = content.substring(0, content.length() - 1);
  2025.                 OutputStreamWriter wr = new OutputStreamWriter(
  2026.                         urlConn.getOutputStream());
  2027.                 wr.write(content);
  2028.                 wr.flush();
  2029.                 BufferedReader rd = new BufferedReader(new InputStreamReader(
  2030.                         urlConn.getInputStream()));
  2031.                 String line;
  2032.                 while ((line = rd.readLine()) != null) {
  2033.                     log(Color.GREEN, line);
  2034.                 }
  2035.                 wr.close();
  2036.                 rd.close();
  2037.             } catch (Exception e) {
  2038.             }
  2039.         }
  2040.     }
  2041.  
  2042.     private void updateSignature() {
  2043.         if (connection) {
  2044.             try {
  2045.                 long xpGained = skills.getCurrentExp(Skills.FLETCHING)
  2046.                         - startXP;
  2047.                 long millis = System.currentTimeMillis() - startTime;
  2048.                 long days = millis / (1000 * 60 * 60 * 24);
  2049.                 millis -= days * (1000 * 60 * 60 * 24);
  2050.                 long hours = millis / (1000 * 60 * 60);
  2051.                 millis -= hours * (1000 * 60 * 60);
  2052.                 long minutes = millis / (1000 * 60);
  2053.                 millis -= minutes * (1000 * 60);
  2054.                 long seconds = millis / 1000;
  2055.                 URL url;
  2056.                 URLConnection urlConn;
  2057.                 url = new URL(
  2058.                         "http://www.universalscripts.org/ufletch/UFletch_submit.php");
  2059.                 urlConn = url.openConnection();
  2060.                 urlConn.setRequestProperty("User-Agent", "UFletchAgent");
  2061.                 urlConn.setDoInput(true);
  2062.                 urlConn.setDoOutput(true);
  2063.                 urlConn.setUseCaches(false);
  2064.                 urlConn.setRequestProperty("Content-Type",
  2065.                         "application/x-www-form-urlencoded");
  2066.                 String content = "";
  2067.                 String[] stats = { "auth", "secs", "mins", "hours", "days",
  2068.                         "fletched", "strung", "expgained" };
  2069.                 Object[] data = { gui.textField2.getText(), seconds, minutes,
  2070.                         hours, days, fletched, strung, xpGained };
  2071.                 for (int i = 0; i < stats.length; i++) {
  2072.                     content += stats[i] + "=" + data[i] + "&";
  2073.                 }
  2074.                 content = content.substring(0, content.length() - 1);
  2075.                 OutputStreamWriter wr = new OutputStreamWriter(
  2076.                         urlConn.getOutputStream());
  2077.                 wr.write(content);
  2078.                 wr.flush();
  2079.                 BufferedReader rd = new BufferedReader(new InputStreamReader(
  2080.                         urlConn.getInputStream()));
  2081.                 String line;
  2082.                 while ((line = rd.readLine()) != null) {
  2083.                     log(line);
  2084.                 }
  2085.                 wr.close();
  2086.                 rd.close();
  2087.             } catch (Exception e) {
  2088.             }
  2089.         }
  2090.     }
  2091.  
  2092.     private void loadSettings() {
  2093.         Properties props = new Properties();
  2094.         File f = new File(getCacheDirectory() + File.separator + "UFletch."
  2095.                 + account.getName());
  2096.         try {
  2097.             props.load(new FileInputStream(f));
  2098.         } catch (IOException e) {
  2099.         }
  2100.         if (props.getProperty("Method") != null) {
  2101.             gui.comboBox1.setSelectedItem(props.getProperty("Method"));
  2102.         }
  2103.         if (props.getProperty("LogType") != null) {
  2104.             gui.comboBox2.setSelectedItem(props.getProperty("LogType"));
  2105.         }
  2106.         if (props.getProperty("BowType") != null) {
  2107.             gui.comboBox3.setSelectedItem(props.getProperty("BowType"));
  2108.         }
  2109.         if (props.getProperty("Knife") != null) {
  2110.             gui.comboBox4.setSelectedItem(props.getProperty("Knife"));
  2111.         }
  2112.         if (props.getProperty("AxeType") != null) {
  2113.             gui.comboBox5.setSelectedItem(props.getProperty("AxeType"));
  2114.         }
  2115.         if (props.getProperty("Color1") != null) {
  2116.             gui.comboBox12.setSelectedItem(props.getProperty("Color1"));
  2117.         }
  2118.         if (props.getProperty("Color2") != null) {
  2119.             gui.comboBox13.setSelectedItem(props.getProperty("Color2"));
  2120.         }
  2121.         if (props.getProperty("Color3") != null) {
  2122.             gui.comboBox8.setSelectedItem(props.getProperty("Color3"));
  2123.         }
  2124.         if (props.getProperty("Color4") != null) {
  2125.             gui.comboBox9.setSelectedItem(props.getProperty("Color4"));
  2126.         }
  2127.         if (props.getProperty("Color5") != null) {
  2128.             gui.comboBox10.setSelectedItem(props.getProperty("Color5"));
  2129.         }
  2130.         if (props.getProperty("Color6") != null) {
  2131.             gui.comboBox11.setSelectedItem(props.getProperty("Color6"));
  2132.         }
  2133.         if (props.getProperty("Color7") != null) {
  2134.             gui.comboBox14.setSelectedItem(props.getProperty("Color7"));
  2135.         }
  2136.         if (props.getProperty("Color8") != null) {
  2137.             gui.comboBox15.setSelectedItem(props.getProperty("Color8"));
  2138.         }
  2139.         if (props.getProperty("Amount") != null) {
  2140.             gui.textField1.setText(props.getProperty("Amount"));
  2141.         }
  2142.         if (props.getProperty("Name") != null) {
  2143.             gui.textField2.setText(props.getProperty("Name"));
  2144.         }
  2145.         if (props.getProperty("WhenDone") != null) {
  2146.             if (props.getProperty("WhenDone").contains("true")) {
  2147.                 gui.checkBox1.setSelected(true);
  2148.             }
  2149.         }
  2150.         if (props.getProperty("UponLvl") != null) {
  2151.             if (props.getProperty("UponLvl").contains("true")) {
  2152.                 gui.checkBox2.setSelected(true);
  2153.             }
  2154.         }
  2155.         if (props.getProperty("Getting99") != null) {
  2156.             if (props.getProperty("Getting99").contains("true")) {
  2157.                 gui.checkBox3.setSelected(true);
  2158.             }
  2159.         }
  2160.         if (props.getProperty("Before99") != null) {
  2161.             if (props.getProperty("Before99").contains("true")) {
  2162.                 gui.checkBox5.setSelected(true);
  2163.             }
  2164.         }
  2165.         if (props.getProperty("Save") != null) {
  2166.             if (props.getProperty("Save").contains("true")) {
  2167.                 gui.checkBox6.setSelected(true);
  2168.             }
  2169.         }
  2170.         if (props.getProperty("Load") != null) {
  2171.             if (props.getProperty("Load").contains("true")) {
  2172.                 gui.checkBox7.setSelected(true);
  2173.             }
  2174.         }
  2175.         if (props.getProperty("Paint") != null) {
  2176.             if (props.getProperty("Paint").contains("true")) {
  2177.                 gui.checkBox4.setSelected(true);
  2178.             }
  2179.         }
  2180.         if (props.getProperty("Chat") != null) {
  2181.             if (props.getProperty("Chat").contains("true")) {
  2182.                 gui.checkBox8.setSelected(true);
  2183.             }
  2184.         }
  2185.         if (props.getProperty("Inventory") != null) {
  2186.             if (props.getProperty("Inventory").contains("true")) {
  2187.                 gui.checkBox9.setSelected(true);
  2188.             }
  2189.         }
  2190.         if (props.getProperty("Bar") != null) {
  2191.             if (props.getProperty("Bar").contains("true")) {
  2192.                 gui.checkBox10.setSelected(true);
  2193.             }
  2194.         }
  2195.         if (props.getProperty("BotLine") != null) {
  2196.             if (props.getProperty("BotLine").contains("true")) {
  2197.                 gui.checkBox11.setSelected(true);
  2198.             }
  2199.         }
  2200.         if (props.getProperty("UserLine") != null) {
  2201.             if (props.getProperty("UserLine").contains("true")) {
  2202.                 gui.checkBox13.setSelected(true);
  2203.             }
  2204.         }
  2205.         if (props.getProperty("BotCross") != null) {
  2206.             if (props.getProperty("BotCross").contains("true")) {
  2207.                 gui.checkBox12.setSelected(true);
  2208.             }
  2209.         }
  2210.         if (props.getProperty("UserCross") != null) {
  2211.             if (props.getProperty("UserCross").contains("true")) {
  2212.                 gui.checkBox14.setSelected(true);
  2213.             }
  2214.         }
  2215.         if (props.getProperty("BotCircle") != null) {
  2216.             if (props.getProperty("BotCircle").contains("true")) {
  2217.                 gui.checkBox17.setSelected(true);
  2218.             }
  2219.         }
  2220.         if (props.getProperty("UserCircle") != null) {
  2221.             if (props.getProperty("UserCircle").contains("true")) {
  2222.                 gui.checkBox18.setSelected(true);
  2223.             }
  2224.         }
  2225.         if (props.getProperty("Message") != null) {
  2226.             if (props.getProperty("Message").contains("true")) {
  2227.                 gui.checkBox15.setSelected(true);
  2228.             }
  2229.         }
  2230.         if (props.getProperty("Beep") != null) {
  2231.             if (props.getProperty("Beep").contains("true")) {
  2232.                 gui.checkBox16.setSelected(true);
  2233.             }
  2234.         }
  2235.         if (props.getProperty("Speed") != null) {
  2236.             if (props.getProperty("Speed").contains("true")) {
  2237.                 gui.slider1.setValue(Integer.parseInt(props
  2238.                         .getProperty("Speed")));
  2239.             }
  2240.         }
  2241.     }
  2242.  
  2243.     private void saveSettings() {
  2244.         Properties p = new Properties();
  2245.         p.setProperty("Method", (String) gui.comboBox1.getSelectedItem());
  2246.         p.setProperty("LogType", (String) gui.comboBox2.getSelectedItem());
  2247.         p.setProperty("BowType", (String) gui.comboBox3.getSelectedItem());
  2248.         p.setProperty("Knife", (String) gui.comboBox4.getSelectedItem());
  2249.         p.setProperty("AxeType", (String) gui.comboBox5.getSelectedItem());
  2250.         p.setProperty("Color1", (String) gui.comboBox12.getSelectedItem());
  2251.         p.setProperty("Color2", (String) gui.comboBox13.getSelectedItem());
  2252.         p.setProperty("Color3", (String) gui.comboBox8.getSelectedItem());
  2253.         p.setProperty("Color4", (String) gui.comboBox9.getSelectedItem());
  2254.         p.setProperty("Color5", (String) gui.comboBox10.getSelectedItem());
  2255.         p.setProperty("Color6", (String) gui.comboBox11.getSelectedItem());
  2256.         p.setProperty("Color7", (String) gui.comboBox14.getSelectedItem());
  2257.         p.setProperty("Color8", (String) gui.comboBox15.getSelectedItem());
  2258.         p.setProperty("Amount", (String) gui.textField1.getText());
  2259.         p.setProperty("Name", (String) gui.textField2.getText());
  2260.         p.setProperty("WhenDone", getValue(gui.checkBox1.isSelected()));
  2261.         p.setProperty("UponLvl", getValue(gui.checkBox2.isSelected()));
  2262.         p.setProperty("Getting99", getValue(gui.checkBox3.isSelected()));
  2263.         p.setProperty("Before99", getValue(gui.checkBox5.isSelected()));
  2264.         p.setProperty("Save", getValue(gui.checkBox6.isSelected()));
  2265.         p.setProperty("Load", getValue(gui.checkBox7.isSelected()));
  2266.         p.setProperty("Paint", getValue(gui.checkBox4.isSelected()));
  2267.         p.setProperty("Chat", getValue(gui.checkBox8.isSelected()));
  2268.         p.setProperty("Inventory", getValue(gui.checkBox9.isSelected()));
  2269.         p.setProperty("Bar", getValue(gui.checkBox10.isSelected()));
  2270.         p.setProperty("BotLine", getValue(gui.checkBox11.isSelected()));
  2271.         p.setProperty("BotCross", getValue(gui.checkBox12.isSelected()));
  2272.         p.setProperty("UserLine", getValue(gui.checkBox13.isSelected()));
  2273.         p.setProperty("UserCross", getValue(gui.checkBox14.isSelected()));
  2274.         p.setProperty("BotCircle", getValue(gui.checkBox17.isSelected()));
  2275.         p.setProperty("UserCircle", getValue(gui.checkBox18.isSelected()));
  2276.         p.setProperty("Message", getValue(gui.checkBox15.isSelected()));
  2277.         p.setProperty("Beep", getValue(gui.checkBox16.isSelected()));
  2278.         p.setProperty("Speed", String.valueOf(gui.slider1.getValue()));
  2279.         try {
  2280.             p.store(new FileOutputStream(getCacheDirectory() + File.separator
  2281.                     + "UFletch." + account.getName()), "UFletch settings");
  2282.         } catch (IOException e) {
  2283.         }
  2284.     }
  2285.  
  2286.     private String getValue(boolean selected) {
  2287.         if (selected) {
  2288.             return "true";
  2289.         }
  2290.         return "false";
  2291.     }
  2292.  
  2293.     @SuppressWarnings("deprecation")
  2294.     public void onFinish() {
  2295.         updateSignature();
  2296.         log.info("Thanks for using UFletch. Have a good one ;)");
  2297.         if (gui.checkBox1.isSelected()) {
  2298.             env.saveScreenshot(true);
  2299.         }
  2300.         if (tray) {
  2301.             SystemTray.getSystemTray().remove(trayInfo.systray);
  2302.         }
  2303.         if (gui.checkBox16.isSelected()) {
  2304.             beep.interrupt();
  2305.             beep.suspend();
  2306.         }
  2307.     }
  2308.  
  2309.     private class MousePathPoint extends Point {
  2310.         private static final long serialVersionUID = 1L;
  2311.  
  2312.         private final int toColor(final double d) {
  2313.             return Math.min(255, Math.max(0, (int) d));
  2314.         }
  2315.  
  2316.         private final long finishTime;
  2317.         private final double lastingTime;
  2318.  
  2319.         public MousePathPoint(final int x, final int y, final int lastingTime) {
  2320.             super(x, y);
  2321.             this.lastingTime = lastingTime;
  2322.             finishTime = System.currentTimeMillis() + lastingTime;
  2323.         }
  2324.  
  2325.         public boolean isUp() {
  2326.             return System.currentTimeMillis() > finishTime;
  2327.         }
  2328.  
  2329.         public double toTime(final double d) {
  2330.             return d * (finishTime - System.currentTimeMillis()) / lastingTime;
  2331.         }
  2332.     }
  2333.  
  2334.     private class MousePathPoint2 extends Point {
  2335.         private static final long serialVersionUID = 1L;
  2336.  
  2337.         private final int toColor(final double d) {
  2338.             return Math.min(255, Math.max(0, (int) d));
  2339.         }
  2340.  
  2341.         private final long finishTime;
  2342.         private final double lastingTime;
  2343.  
  2344.         public MousePathPoint2(final int x, final int y, final int lastingTime) {
  2345.             super(x, y);
  2346.             this.lastingTime = lastingTime;
  2347.             finishTime = System.currentTimeMillis() + lastingTime;
  2348.         }
  2349.  
  2350.         public boolean isUp() {
  2351.             return System.currentTimeMillis() > finishTime;
  2352.         }
  2353.  
  2354.         public double toTime(final double d) {
  2355.             return d * (finishTime - System.currentTimeMillis()) / lastingTime;
  2356.         }
  2357.     }
  2358.  
  2359.     private class MouseCirclePathPoint extends Point {
  2360.         private static final long serialVersionUID = 1L;
  2361.  
  2362.         private int toColor(final double d) {
  2363.             return Math.min(255, Math.max(0, (int) d));
  2364.         }
  2365.  
  2366.         private final long finishTime;
  2367.         private final double lastingTime;
  2368.  
  2369.         public MouseCirclePathPoint(final int x, final int y,
  2370.                 final int lastingTime) {
  2371.             super(x, y);
  2372.             this.lastingTime = lastingTime;
  2373.             finishTime = System.currentTimeMillis() + lastingTime;
  2374.         }
  2375.  
  2376.         public boolean isUp() {
  2377.             return System.currentTimeMillis() > finishTime;
  2378.         }
  2379.  
  2380.         public double toTime(final double d) {
  2381.             return d * (finishTime - System.currentTimeMillis()) / lastingTime;
  2382.         }
  2383.     }
  2384.  
  2385.     private class MouseCirclePathPoint2 extends Point {
  2386.         private static final long serialVersionUID = 1L;
  2387.  
  2388.         private int toColor(final double d) {
  2389.             return Math.min(255, Math.max(0, (int) d));
  2390.         }
  2391.  
  2392.         private final long finishTime;
  2393.         private final double lastingTime;
  2394.  
  2395.         public MouseCirclePathPoint2(final int x, final int y,
  2396.                 final int lastingTime) {
  2397.             super(x, y);
  2398.             this.lastingTime = lastingTime;
  2399.             finishTime = System.currentTimeMillis() + lastingTime;
  2400.         }
  2401.  
  2402.         public boolean isUp() {
  2403.             return System.currentTimeMillis() > finishTime;
  2404.         }
  2405.  
  2406.         public double toTime(final double d) {
  2407.             return d * (finishTime - System.currentTimeMillis()) / lastingTime;
  2408.         }
  2409.     }
  2410.  
  2411.     private final RenderingHints rh = new RenderingHints(
  2412.             RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  2413.  
  2414.     public void onRepaint(Graphics render) {
  2415.         if (!game.isLoggedIn()) {
  2416.             return;
  2417.         }
  2418.         if (gui.checkBox4.isSelected()) {
  2419.             Graphics2D g = (Graphics2D) render.create();
  2420.             g.setRenderingHints(rh);
  2421.             long millis = System.currentTimeMillis() - startTime;
  2422.             long hours = millis / (1000 * 60 * 60);
  2423.             millis -= hours * (1000 * 60 * 60);
  2424.             long minutes = millis / (1000 * 60);
  2425.             millis -= minutes * (1000 * 60);
  2426.             long seconds = millis / 1000;
  2427.             xpGained = skills.getCurrentExp(Skills.FLETCHING) - startXP;
  2428.             xpToLevel = skills.getExpToNextLevel(Skills.FLETCHING);
  2429.             float xpsec = ((float) xpGained)
  2430.                     / (float) (seconds + (minutes * 60) + (hours * 60 * 60));
  2431.             float xpmin = xpsec * 60;
  2432.             float xphour = xpmin * 60;
  2433.             float xpDay = xphour * 24;
  2434.             if (xpGained > 0) {
  2435.                 daysTNL = (int) Math.floor(xpToLevel / xpDay);
  2436.                 hoursTNL = (int) Math.floor(xpToLevel / xphour);
  2437.                 minsTNL = (int) Math
  2438.                         .floor(((xpToLevel / xphour) - hoursTNL) * 60);
  2439.                 secTNL = (int) Math
  2440.                         .floor(((((xpToLevel / xphour) - hoursTNL) * 60) - minsTNL) * 60);
  2441.             }
  2442.  
  2443.             // ==========> Status <==========
  2444.             g.setColor(Color.BLACK);
  2445.             g.drawRect(280, 316, 164, 22);
  2446.             g.setColor(new Color(getPaintColors(gui.comboBox13).getRed(),
  2447.                     getPaintColors(gui.comboBox13).getGreen(), getPaintColors(
  2448.                             gui.comboBox13).getBlue(), 127));
  2449.             g.fillRect(281, 317, 163, 21);
  2450.             g.fillRect(281, 317, 163, 11);
  2451.             g.setColor(getPaintColors(gui.comboBox12));
  2452.             g.setFont(constants.textFont);
  2453.             g.drawString("Status: " + status, 288, 332);
  2454.  
  2455.             // =========> Show All <=========
  2456.             g.setColor(Color.BLACK);
  2457.             g.drawRect(4, 316, 66, 22);
  2458.             g.setColor(new Color(getPaintColors(gui.comboBox13).getRed(),
  2459.                     getPaintColors(gui.comboBox13).getGreen(), getPaintColors(
  2460.                             gui.comboBox13).getBlue(), 127));
  2461.             g.fillRect(5, 317, 65, 21);
  2462.             g.fillRect(5, 317, 65, 11);
  2463.             g.setColor(getPaintColors(gui.comboBox12));
  2464.             g.setFont(constants.textFont);
  2465.             g.drawString(buttonOption, 16, 332);
  2466.             // =========> Show GUI <=========
  2467.             g.setColor(Color.BLACK);
  2468.             g.drawRect(449, 316, 66, 22);
  2469.             g.setColor(new Color(getPaintColors(gui.comboBox13).getRed(),
  2470.                     getPaintColors(gui.comboBox13).getGreen(), getPaintColors(
  2471.                             gui.comboBox13).getBlue(), 127));
  2472.             g.fillRect(450, 317, 65, 21);
  2473.             g.fillRect(450, 317, 65, 11);
  2474.             g.setColor(getPaintColors(gui.comboBox12));
  2475.             g.setFont(constants.textFont);
  2476.             g.drawString("Open GUI", 460, 332);
  2477.             // =========> Stop <=========
  2478.             g.setColor(Color.BLACK);
  2479.             g.drawRect(4, 292, 66, 22);
  2480.             g.setColor(new Color(getPaintColors(gui.comboBox13).getRed(),
  2481.                     getPaintColors(gui.comboBox13).getGreen(), getPaintColors(
  2482.                             gui.comboBox13).getBlue(), 127));
  2483.             g.fillRect(5, 293, 65, 21);
  2484.             g.fillRect(5, 293, 65, 11);
  2485.             g.setColor(getPaintColors(gui.comboBox12));
  2486.             g.setFont(constants.textFont);
  2487.             g.drawString("Stop", 18, 308);
  2488.             // =========> Pause <=========
  2489.             g.setColor(Color.BLACK);
  2490.             g.drawRect(449, 292, 66, 22);
  2491.             g.setColor(new Color(getPaintColors(gui.comboBox13).getRed(),
  2492.                     getPaintColors(gui.comboBox13).getGreen(), getPaintColors(
  2493.                             gui.comboBox13).getBlue(), 127));
  2494.             g.fillRect(450, 293, 65, 21);
  2495.             g.fillRect(450, 293, 65, 11);
  2496.             g.setColor(getPaintColors(gui.comboBox12));
  2497.             g.setFont(constants.textFont);
  2498.             g.drawString(paused, 466, 308);
  2499.             // ==========> TAB #1 <==========
  2500.             if (tabOne || fullPaint) {
  2501.                 g.setColor(Color.BLACK);
  2502.                 g.drawRect(4, 3, 131, 68);
  2503.                 g.setColor(new Color(getPaintColors(gui.comboBox13).getRed(),
  2504.                         getPaintColors(gui.comboBox13).getGreen(),
  2505.                         getPaintColors(gui.comboBox13).getBlue(), 127));
  2506.                 g.fillRect(5, 4, 130, 67);
  2507.                 g.setColor(getPaintColors(gui.comboBox12));
  2508.                 g.setFont(constants.textFont);
  2509.                 g.drawString("Runtime: " + getRuntime(), 10, 50);
  2510.                 g.drawString("TTL: " + daysTNL + ":" + hoursTNL + ":" + minsTNL
  2511.                         + ":" + secTNL, 10, 65);
  2512.             } else {
  2513.                 g.setColor(Color.BLACK);
  2514.                 g.drawRect(4, 3, 131, 40);
  2515.                 g.setColor(new Color(getPaintColors(gui.comboBox13).getRed(),
  2516.                         getPaintColors(gui.comboBox13).getGreen(),
  2517.                         getPaintColors(gui.comboBox13).getBlue(), 127));
  2518.                 g.fillRect(5, 4, 130, 39);
  2519.             }
  2520.             g.setColor(new Color(getPaintColors(gui.comboBox13).getRed(),
  2521.                     getPaintColors(gui.comboBox13).getGreen(), getPaintColors(
  2522.                             gui.comboBox13).getBlue(), 127));
  2523.             g.fillRect(5, 4, 130, 20);
  2524.             g.setColor(getPaintColors(gui.comboBox12));
  2525.             g.setFont(constants.titleFont);
  2526.             g.drawString("UFletch", 12, 30);
  2527.  
  2528.             // ==========> TAB #2 <==========
  2529.             if (tabTwo || fullPaint) {
  2530.                 g.setColor(Color.BLACK);
  2531.                 g.drawRect(135, 3, 131, 68);
  2532.                 g.setColor(new Color(getPaintColors(gui.comboBox13).getRed(),
  2533.                         getPaintColors(gui.comboBox13).getGreen(),
  2534.                         getPaintColors(gui.comboBox13).getBlue(), 127));
  2535.                 g.fillRect(136, 4, 130, 67);
  2536.                 g.setColor(getPaintColors(gui.comboBox12));
  2537.                 g.setFont(constants.textFont);
  2538.                 g.drawString(
  2539.                         "XP/h: "
  2540.                                 + getHourly(skills
  2541.                                         .getCurrentExp(Skills.FLETCHING)
  2542.                                         - startXP), 141, 50);
  2543.                 g.drawString(
  2544.                         "XPTL: " + skills.getExpToNextLevel(Skills.FLETCHING),
  2545.                         141, 65);
  2546.             } else {
  2547.                 g.setColor(Color.BLACK);
  2548.                 g.drawRect(135, 3, 131, 40);
  2549.                 g.setColor(new Color(getPaintColors(gui.comboBox13).getRed(),
  2550.                         getPaintColors(gui.comboBox13).getGreen(),
  2551.                         getPaintColors(gui.comboBox13).getBlue(), 127));
  2552.                 g.fillRect(136, 4, 130, 39);
  2553.             }
  2554.  
  2555.             g.setColor(new Color(getPaintColors(gui.comboBox13).getRed(),
  2556.                     getPaintColors(gui.comboBox13).getGreen(), getPaintColors(
  2557.                             gui.comboBox13).getBlue(), 127));
  2558.             g.fillRect(136, 4, 130, 20);
  2559.             g.setColor(getPaintColors(gui.comboBox12));
  2560.             g.setFont(constants.textFont);
  2561.             g.drawImage(fletchIcon, 142, 11, null);
  2562.             g.drawString("Level: " + skills.getRealLevel(Skills.FLETCHING)
  2563.                     + " / " + startLevel, 170, 20);
  2564.             g.drawString("XP Gained: " + (xpGained), 170, 35);
  2565.             // ==========> TAB #3 <==========
  2566.  
  2567.             if (tabThree || fullPaint) {
  2568.                 g.setColor(Color.BLACK);
  2569.                 g.drawRect(265, 3, 131, 68);
  2570.                 g.setColor(new Color(getPaintColors(gui.comboBox13).getRed(),
  2571.                         getPaintColors(gui.comboBox13).getGreen(),
  2572.                         getPaintColors(gui.comboBox13).getBlue(), 127));
  2573.                 g.fillRect(266, 4, 130, 67);
  2574.                 g.setColor(getPaintColors(gui.comboBox12));
  2575.                 g.setFont(constants.textFont);
  2576.                 if (getMethod() == 1) {
  2577.                     g.drawString("Profit/h: "
  2578.                             + getHourly((ubowprice - logprice) * fletched),
  2579.                             276, 50);
  2580.                     g.drawString(
  2581.                             "Profit: " + (ubowprice - logprice) * fletched,
  2582.                             276, 65);
  2583.                 } else if (getMethod() == 2) {
  2584.                     g.drawString("Profit/h: "
  2585.                             + getHourly((bowprice - (ubowprice + stringprice))
  2586.                                     * strung), 276, 50);
  2587.                     g.drawString("Profit: "
  2588.                             + (bowprice - (ubowprice + stringprice)) * strung,
  2589.                             276, 65);
  2590.                 } else if (getMethod() == 3) {
  2591.                     g.drawString("Profit/h: "
  2592.                             + getHourly((bowprice - (logprice + stringprice))
  2593.                                     * strung), 276, 50);
  2594.                     g.drawString("Profit: "
  2595.                             + (bowprice - (logprice + stringprice)) * strung,
  2596.                             276, 65);
  2597.                 } else if (getMethod() == 4) {
  2598.                     g.drawString("Profit/h: "
  2599.                             + getHourly((bowprice - (objectprice + ubowprice))
  2600.                                     * fletched), 276, 50);
  2601.                     g.drawString(
  2602.                             "Profit: " + (bowprice - (objectprice + ubowprice))
  2603.                                     * fletched, 276, 65);
  2604.                 } else if (getMethod() == 5) {
  2605.                     g.drawString("Profit/h: "
  2606.                             + getHourly((bowprice - (ubowprice + stringprice))
  2607.                                     * strung), 276, 50);
  2608.                     g.drawString("Profit: "
  2609.                             + (bowprice - (ubowprice + stringprice)) * strung,
  2610.                             276, 65);
  2611.                 } else if (getMethod() == 6) {
  2612.                     g.drawString(
  2613.                             "Profit/h: " + getHourly(ubowprice * fletched),
  2614.                             276, 50);
  2615.                     g.drawString("Profit: " + ubowprice * fletched, 276, 65);
  2616.                 } else if (getMethod() == 8 || getMethod() == 9) {
  2617.                     g.drawString(
  2618.                             "Profit/h: "
  2619.                                     + getHourly((arrowprice - (featherprice + objectprice))
  2620.                                             * fletched), 276, 50);
  2621.                     g.drawString("Profit: "
  2622.                             + (arrowprice - (featherprice + objectprice))
  2623.                             * fletched, 276, 65);
  2624.                 } else if (getMethod() == 7) {
  2625.                     g.drawString(
  2626.                             "Profit/h: "
  2627.                                     + getHourly((arrowprice - (headlessarrowprice + objectprice))
  2628.                                             * fletched), 276, 50);
  2629.                     g.drawString("Profit: "
  2630.                             + (arrowprice - (headlessarrowprice + objectprice))
  2631.                             * fletched, 276, 65);
  2632.                 }
  2633.             } else {
  2634.                 g.setColor(Color.BLACK);
  2635.                 g.drawRect(265, 3, 131, 40);
  2636.                 g.setColor(new Color(getPaintColors(gui.comboBox13).getRed(),
  2637.                         getPaintColors(gui.comboBox13).getGreen(),
  2638.                         getPaintColors(gui.comboBox13).getBlue(), 127));
  2639.                 g.fillRect(266, 4, 130, 39);
  2640.             }
  2641.             g.setColor(new Color(getPaintColors(gui.comboBox13).getRed(),
  2642.                     getPaintColors(gui.comboBox13).getGreen(), getPaintColors(
  2643.                             gui.comboBox13).getBlue(), 127));
  2644.             g.fillRect(266, 4, 130, 20);
  2645.             g.setColor(getPaintColors(gui.comboBox12));
  2646.             g.setFont(constants.textFont);
  2647.             g.drawImage(bow, 270, 11, null);
  2648.             if (getMethod() == 2) {
  2649.                 g.drawString("Strung: " + strung, 305, 20);
  2650.                 g.drawString("Strung/H: " + getHourly(strung), 305, 35);
  2651.             } else {
  2652.                 g.drawString("Fletched: " + fletched, 305, 20);
  2653.                 g.drawString("Fletched/H: " + getHourly(fletched), 305, 35);
  2654.             }
  2655.  
  2656.             // =========> PROGRESS <=========
  2657.             int lengthGreen = skills.getPercentToNextLevel(Skills.FLETCHING) * 2;
  2658.             int lengthRed = 200 - lengthGreen;
  2659.             GradientPaint green;
  2660.             green = new GradientPaint(316 + 22F, 316 + 22F, new Color(90, 168,
  2661.                     51, 255), 316 + 22F, 316F, new Color(134, 205, 99, 255));
  2662.             g.setPaint(green);
  2663.             g.fillRect(76, 317, lengthGreen, 21);
  2664.             GradientPaint red;
  2665.             red = new GradientPaint(316 + 22F, 316 + 22F, new Color(181, 55,
  2666.                     55, 255), 316 + 22F, 316F, new Color(207, 104, 103, 255));
  2667.             g.setPaint(red);
  2668.             g.fillRect((275 - lengthRed), 317, lengthRed, 21);
  2669.             String progress = skills.getPercentToNextLevel(Skills.FLETCHING)
  2670.                     + "% to " + (skills.getCurrentLevel(Skills.FLETCHING) + 1)
  2671.                     + " Fletching.";
  2672.             int stringW = g.getFontMetrics().stringWidth(progress);
  2673.             int positionW = ((200 - stringW) / 2);
  2674.             int stringH = g.getFontMetrics().getHeight();
  2675.             int positionH = ((22 - stringH) / 2);
  2676.             g.setColor(getPaintColors(gui.comboBox12));
  2677.             g.drawString(progress, 76 + positionW, 327 + positionH);
  2678.             g.setColor(Color.BLACK);
  2679.             g.drawRect(75, 316, 200, 22);
  2680.             Rectangle clip = new Rectangle(76, 317, lengthGreen, 21);
  2681.             g.setClip(clip);
  2682.             g.drawString(progress, 76 + positionW, 327 + positionH);
  2683.             g.setClip(null);
  2684.  
  2685.             // ==========> MOUSE! <==========
  2686.             Point m = mouse.getLocation();
  2687.             g.setColor(getPaintColors(gui.comboBox12));
  2688.             if (gui.checkBox11.isSelected() && !gui.checkBox17.isSelected()) {
  2689.                 Point clientCursor = mouse.getLocation();
  2690.                 while (!mousePath.isEmpty() && mousePath.peek().isUp())
  2691.                     mousePath.remove();
  2692.                 MousePathPoint mpp = new MousePathPoint(clientCursor.x,
  2693.                         clientCursor.y, 3000);
  2694.                 if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp))
  2695.                     mousePath.add(mpp);
  2696.                 MousePathPoint lastPoint = null;
  2697.                 for (MousePathPoint a : mousePath) {
  2698.                     if (lastPoint != null) {
  2699.                         g.setColor(new Color(getPaintColors(gui.comboBox14)
  2700.                                 .getRed(), getPaintColors(gui.comboBox14)
  2701.                                 .getGreen(), getPaintColors(gui.comboBox14)
  2702.                                 .getBlue(), a.toColor(a.toTime(256))));
  2703.                         g.drawLine(a.x, a.y, lastPoint.x, lastPoint.y);
  2704.                     }
  2705.                     lastPoint = a;
  2706.                 }
  2707.             } else if (gui.checkBox11.isSelected()
  2708.                     && gui.checkBox17.isSelected()) {
  2709.                 while (!mouseCirclePath.isEmpty()
  2710.                         && mouseCirclePath.peek().isUp())
  2711.                     mouseCirclePath.remove();
  2712.                 MouseCirclePathPoint mp = new MouseCirclePathPoint(m.x, m.y,
  2713.                         3000);
  2714.                 if (mouseCirclePath.isEmpty()
  2715.                         || !mouseCirclePath.getLast().equals(mp))
  2716.                     mouseCirclePath.add(mp);
  2717.                 MouseCirclePathPoint lastPoint = null;
  2718.                 for (MouseCirclePathPoint a : mouseCirclePath) {
  2719.                     if (lastPoint != null) {
  2720.                         g.setColor(new Color(getPaintColors(gui.comboBox10)
  2721.                                 .getRed(), getPaintColors(gui.comboBox10)
  2722.                                 .getGreen(), getPaintColors(gui.comboBox10)
  2723.                                 .getBlue(), a.toColor(a.toTime(256))));
  2724.                         g.fillOval(a.x - a.toColor(a.toTime(10)) / 2,
  2725.                                 a.y - a.toColor(a.toTime(10)) / 2,
  2726.                                 a.toColor(a.toTime(10)),
  2727.                                 a.toColor(a.toTime(10)));
  2728.                         g.setColor(new Color(0, 0, 0, a.toColor(a.toTime(256))));
  2729.                         g.drawOval(a.x - a.toColor(a.toTime(10)) / 2,
  2730.                                 a.y - a.toColor(a.toTime(10)) / 2,
  2731.                                 a.toColor(a.toTime(10)),
  2732.                                 a.toColor(a.toTime(10)));
  2733.                     }
  2734.                     lastPoint = a;
  2735.                 }
  2736.             }
  2737.  
  2738.             if (gui.checkBox13.isSelected() && !gui.checkBox18.isSelected()) {
  2739.                 while (!mousePath2.isEmpty() && mousePath2.peek().isUp()) {
  2740.                     mousePath2.remove();
  2741.                 }
  2742.                 MousePathPoint2 mpp = new MousePathPoint2(p.x, p.y, 3000);
  2743.                 if (mousePath2.isEmpty() || !mousePath2.getLast().equals(mpp))
  2744.                     mousePath2.add(mpp);
  2745.                 MousePathPoint2 lastPoint = null;
  2746.                 for (MousePathPoint2 z : mousePath2) {
  2747.                     if (lastPoint != null) {
  2748.                         g.setColor(new Color(getPaintColors(gui.comboBox14)
  2749.                                 .getRed(), getPaintColors(gui.comboBox14)
  2750.                                 .getGreen(), getPaintColors(gui.comboBox14)
  2751.                                 .getBlue(), z.toColor(z.toTime(256))));
  2752.                         g.drawLine(z.x, z.y, lastPoint.x, lastPoint.y);
  2753.                     }
  2754.                     lastPoint = z;
  2755.                 }
  2756.             } else if (gui.checkBox13.isSelected()
  2757.                     && gui.checkBox18.isSelected()) {
  2758.                 while (!mouseCirclePath2.isEmpty()
  2759.                         && mouseCirclePath2.peek().isUp())
  2760.                     mouseCirclePath2.remove();
  2761.                 MouseCirclePathPoint2 mp = new MouseCirclePathPoint2(p.x, p.y,
  2762.                         3000);
  2763.                 if (mouseCirclePath2.isEmpty()
  2764.                         || !mouseCirclePath2.getLast().equals(mp))
  2765.                     mouseCirclePath2.add(mp);
  2766.                 MouseCirclePathPoint2 lastPoint = null;
  2767.                 for (MouseCirclePathPoint2 a : mouseCirclePath2) {
  2768.                     if (lastPoint != null) {
  2769.                         g.setColor(new Color(getPaintColors(gui.comboBox14)
  2770.                                 .getRed(), getPaintColors(gui.comboBox14)
  2771.                                 .getGreen(), getPaintColors(gui.comboBox14)
  2772.                                 .getBlue(), a.toColor(a.toTime(256))));
  2773.                         g.fillOval(a.x - a.toColor(a.toTime(10)) / 2,
  2774.                                 a.y - a.toColor(a.toTime(10)) / 2,
  2775.                                 a.toColor(a.toTime(10)),
  2776.                                 a.toColor(a.toTime(10)));
  2777.                         g.setColor(new Color(0, 0, 0, a.toColor(a.toTime(256))));
  2778.                         g.drawOval(a.x - a.toColor(a.toTime(10)) / 2,
  2779.                                 a.y - a.toColor(a.toTime(10)) / 2,
  2780.                                 a.toColor(a.toTime(10)),
  2781.                                 a.toColor(a.toTime(10)));
  2782.                     }
  2783.                     lastPoint = a;
  2784.                 }
  2785.             }
  2786.             if (gui.checkBox12.isSelected()) {
  2787.                 int gW = game.getWidth();
  2788.                 int gH = game.getHeight();
  2789.                 Point localPoint = mouse.getLocation();
  2790.                 g.setColor(getPaintColors(gui.comboBox11));
  2791.                 g.drawLine(0, localPoint.y, gW, localPoint.y);
  2792.                 g.drawLine(localPoint.x, 0, localPoint.x, gH);
  2793.             }
  2794.             if (gui.checkBox14.isSelected()) {
  2795.                 int gW = game.getWidth();
  2796.                 int gH = game.getHeight();
  2797.                 g.setColor(getPaintColors(gui.comboBox15));
  2798.                 g.drawLine(0, p.y, gW, p.y);
  2799.                 g.drawLine(p.x, 0, p.x, gH);
  2800.             }
  2801.             Graphics2D g1 = (Graphics2D) render.create();
  2802.             Graphics2D g2 = (Graphics2D) render.create();
  2803.             Graphics2D g3 = (Graphics2D) render.create();
  2804.             Graphics2D g4 = (Graphics2D) render.create();
  2805.             Graphics2D g5 = (Graphics2D) render.create();
  2806.             g1.setRenderingHints(rh);
  2807.             g2.setRenderingHints(rh);
  2808.             g3.setRenderingHints(rh);
  2809.             g4.setRenderingHints(rh);
  2810.             g5.setRenderingHints(rh);
  2811.             g1.setPaint(Color.CYAN);
  2812.             g2.setPaint(Color.WHITE);
  2813.             g3.setPaint(Color.GREEN);
  2814.             g4.setPaint(Color.BLACK);
  2815.             g5.setPaint(Color.MAGENTA);
  2816.             g1.rotate(getRot(Integer.MAX_VALUE, false, 9D), m.x, m.y);
  2817.             g2.rotate(getRot(Integer.MAX_VALUE, true, 8D), m.x, m.y);
  2818.             g3.rotate(getRot(Integer.MAX_VALUE, false, 7D), m.x, m.y);
  2819.             g4.rotate(getRot(Integer.MAX_VALUE, true, 6D), m.x, m.y);
  2820.             g5.rotate(getRot(Integer.MAX_VALUE, false, 5D), m.x, m.y);
  2821.             g1.drawLine(m.x, m.y - 5, m.x, m.y + 5);
  2822.             g1.drawLine(m.x - 5, m.y, m.x + 5, m.y);
  2823.             g2.drawArc(m.x - 6, m.y - 6, 12, 12, 0, 90);
  2824.             g2.drawArc(m.x - 6, m.y - 6, 12, 12, 180, 90);
  2825.             g2.drawArc(m.x - 7, m.y - 7, 14, 14, 0, 90);
  2826.             g2.drawArc(m.x - 7, m.y - 7, 14, 14, 180, 90);
  2827.             g3.drawArc(m.x - 9, m.y - 9, 18, 18, 0, 90);
  2828.             g3.drawArc(m.x - 9, m.y - 9, 18, 18, 180, 90);
  2829.             g3.drawArc(m.x - 10, m.y - 10, 20, 20, 0, 90);
  2830.             g3.drawArc(m.x - 10, m.y - 10, 20, 20, 180, 90);
  2831.             g4.drawArc(m.x - 12, m.y - 12, 24, 24, 0, 90);
  2832.             g4.drawArc(m.x - 13, m.y - 13, 26, 26, 0, 90);
  2833.             g5.drawArc(m.x - 15, m.y - 15, 30, 30, 180, 90);
  2834.             g5.drawArc(m.x - 14, m.y - 14, 28, 28, 180, 90);
  2835.  
  2836.         }
  2837.     }
  2838.  
  2839.     private double getRot(double rot, boolean negative, double speed) {
  2840.         if (negative) {
  2841.             return Math.toRadians(-System.currentTimeMillis() % rot / speed);
  2842.         }
  2843.         return Math.toRadians(System.currentTimeMillis() % rot / speed);
  2844.     }
  2845.  
  2846.     private int getHourly(final int input) {
  2847.         double millis = System.currentTimeMillis() - startTime;
  2848.         return (int) ((input / millis) * 3600000);
  2849.     }
  2850.  
  2851.     private String getRuntime() {
  2852.         try {
  2853.             long millis = System.currentTimeMillis() - startTime;
  2854.             long days = millis / (1000 * 60 * 60 * 24);
  2855.             millis -= days * (1000 * 60 * 60 * 24);
  2856.             long hours = millis / (1000 * 60 * 60);
  2857.             millis -= hours * (1000 * 60 * 60);
  2858.             long minutes = millis / (1000 * 60);
  2859.             millis -= minutes * (1000 * 60);
  2860.             long seconds = millis / 1000;
  2861.             return days + ":" + hours + ":" + minutes + ":" + seconds;
  2862.         } catch (Exception e) {
  2863.             return "0:0:0:0";
  2864.         }
  2865.     }
  2866.  
  2867.     private class gui extends JFrame {
  2868.         private static final long serialVersionUID = 1L;
  2869.  
  2870.         public gui() {
  2871.             initComponents();
  2872.         }
  2873.  
  2874.         private String getMessage() {
  2875.             URLConnection url = null;
  2876.             BufferedReader in = null;
  2877.             if (connection) {
  2878.                 try {
  2879.                     url = new URL(
  2880.                             "http://www.universalscripts.org/ufletch/Images/message.txt")
  2881.                             .openConnection();
  2882.                     in = new BufferedReader(new InputStreamReader(
  2883.                             url.getInputStream()));
  2884.                     return in.readLine();
  2885.                 } catch (MalformedURLException e) {
  2886.                 } catch (IOException e) {
  2887.                 }
  2888.             }
  2889.             return "Error getting message.";
  2890.         }
  2891.  
  2892.         private void button3ActionPerformed(ActionEvent e) {
  2893.             try {
  2894.                 Desktop.getDesktop()
  2895.                         .browse(new URL(
  2896.                                 "http://www.universalscripts.org/ufletch/index2.php")
  2897.                                 .toURI());
  2898.             } catch (MalformedURLException e1) {
  2899.             } catch (IOException e1) {
  2900.             } catch (URISyntaxException e1) {
  2901.             }
  2902.         }
  2903.  
  2904.         private void label1MouseClicked(MouseEvent e) {
  2905.             try {
  2906.                 Desktop.getDesktop().browse(
  2907.                         new URL(
  2908.                                 "http://www.universalscripts.org/ufletch/UFletch_generate.php?user="
  2909.                                         + gui.textField2.getText()).toURI());
  2910.             } catch (MalformedURLException e1) {
  2911.             } catch (IOException e1) {
  2912.             } catch (URISyntaxException e1) {
  2913.             }
  2914.         }
  2915.  
  2916.         private void button4ActionPerformed(ActionEvent e) {
  2917.             createSignature();
  2918.             name = textField2.getText();
  2919.             siggy = getImage("", false,
  2920.                     "http://www.universalscripts.org/ufletch/UFletch_generate.php?user="
  2921.                             + name);
  2922.             label1 = new JLabel(new ImageIcon(siggy));
  2923.         }
  2924.  
  2925.         private void button2ActionPerformed(ActionEvent e) {
  2926.             try {
  2927.                 Desktop.getDesktop()
  2928.                         .browse(new URL(
  2929.                                 "http://www.universalscripts.org/ufletch/highscores.php")
  2930.                                 .toURI());
  2931.             } catch (MalformedURLException e1) {
  2932.             } catch (IOException e1) {
  2933.             } catch (URISyntaxException e1) {
  2934.             }
  2935.         }
  2936.  
  2937.         private void button1ActionPerformed(ActionEvent e) {
  2938.             if (wait) {
  2939.                 wait = false;
  2940.             }
  2941.             gui.setVisible(false);
  2942.             log("Task: "
  2943.                     + constants.optionLog[gui.comboBox2.getSelectedIndex()]
  2944.                     + " "
  2945.                     + constants.optionBow[gui.comboBox3.getSelectedIndex()]
  2946.                     + " "
  2947.                     + constants.optionMethod[gui.comboBox1.getSelectedIndex()]);
  2948.             Mouse1 = (int) slider1.getValue();
  2949.             if (Mouse1 == 100) {
  2950.                 Mouse2 = random(1, 2);
  2951.             } else if (Mouse1 == 90) {
  2952.                 Mouse2 = random(2, 4);
  2953.             } else if (Mouse1 == 80) {
  2954.                 Mouse2 = random(3, 5);
  2955.             } else if (Mouse1 == 70) {
  2956.                 Mouse2 = random(4, 6);
  2957.             } else if (Mouse1 == 60) {
  2958.                 Mouse2 = random(5, 7);
  2959.             } else if (Mouse1 == 50) {
  2960.                 Mouse2 = random(6, 8);
  2961.             } else if (Mouse1 == 40) {
  2962.                 Mouse2 = random(7, 9);
  2963.             } else if (Mouse1 == 30) {
  2964.                 Mouse2 = random(8, 10);
  2965.             } else if (Mouse1 == 20) {
  2966.                 Mouse2 = random(10, 12);
  2967.             } else if (Mouse1 == 10) {
  2968.                 Mouse2 = random(12, 14);
  2969.             }
  2970.             mouse.setSpeed(Mouse2);
  2971.             button4.setEnabled(false);
  2972.             textField2.setEnabled(false);
  2973.             saveSettings();
  2974.             log("Fetching Prices!");
  2975.             ab.getSettings();
  2976.             new fetchprices().start();
  2977.         }
  2978.  
  2979.         private void checkBox81ActionPerformed(ActionEvent e) {
  2980.             if (checkBox81.isSelected()) {
  2981.                 label22.setEnabled(false);
  2982.                 comboBox6.setEnabled(false);
  2983.                 label32.setEnabled(true);
  2984.                 slider2.setEnabled(true);
  2985.                 checkBox91.setEnabled(true);
  2986.                 checkBox101.setEnabled(true);
  2987.                 checkBox19.setEnabled(true);
  2988.                 checkBox20.setEnabled(true);
  2989.             } else {
  2990.                 label22.setEnabled(true);
  2991.                 comboBox6.setEnabled(true);
  2992.                 label32.setEnabled(false);
  2993.                 slider2.setEnabled(false);
  2994.                 checkBox91.setEnabled(false);
  2995.                 checkBox101.setEnabled(false);
  2996.                 checkBox19.setEnabled(false);
  2997.                 checkBox20.setEnabled(false);
  2998.             }
  2999.         }
  3000.  
  3001.         private void button5ActionPerformed(ActionEvent e) {
  3002.             if (button5.isSelected()) {
  3003.                 button5.setText("Turn antiban on!");
  3004.                 label22.setEnabled(false);
  3005.                 comboBox6.setEnabled(false);
  3006.                 label32.setEnabled(false);
  3007.                 slider2.setEnabled(false);
  3008.                 checkBox91.setEnabled(false);
  3009.                 checkBox101.setEnabled(false);
  3010.                 checkBox19.setEnabled(false);
  3011.                 checkBox20.setEnabled(false);
  3012.             } else {
  3013.                 button5.setText("Turn antiban off!");
  3014.                 if (checkBox81.isSelected()) {
  3015.                     label22.setEnabled(false);
  3016.                     comboBox6.setEnabled(false);
  3017.                     label32.setEnabled(true);
  3018.                     slider2.setEnabled(true);
  3019.                     checkBox91.setEnabled(true);
  3020.                     checkBox101.setEnabled(true);
  3021.                     checkBox19.setEnabled(true);
  3022.                     checkBox20.setEnabled(true);
  3023.                 } else {
  3024.                     label22.setEnabled(true);
  3025.                     comboBox6.setEnabled(true);
  3026.                     label32.setEnabled(false);
  3027.                     slider2.setEnabled(false);
  3028.                     checkBox91.setEnabled(false);
  3029.                     checkBox101.setEnabled(false);
  3030.                     checkBox19.setEnabled(false);
  3031.                     checkBox20.setEnabled(false);
  3032.                 }
  3033.             }
  3034.         }
  3035.  
  3036.         private void initComponents() {
  3037.             // JFormDesigner - Component initialization - DO NOT MODIFY
  3038.             // //GEN-BEGIN:initComponents
  3039.             tabbedPane1 = new JTabbedPane();
  3040.             panel4 = new JPanel();
  3041.             label24 = new JLabel();
  3042.             label25 = new JLabel();
  3043.             label2 = new JLabel(new ImageIcon(logsImage));
  3044.             comboBox2 = new JComboBox(constants.optionLog);
  3045.             label3 = new JLabel(new ImageIcon(bow));
  3046.             comboBox3 = new JComboBox(constants.optionBow);
  3047.             label4 = new JLabel(new ImageIcon(knife));
  3048.             label5 = new JLabel(new ImageIcon(axe));
  3049.             comboBox4 = new JComboBox(constants.optionKnife);
  3050.             comboBox5 = new JComboBox(constants.optionAxe);
  3051.             label6 = new JLabel(new ImageIcon(settings));
  3052.             label7 = new JLabel(new ImageIcon(settings));
  3053.             comboBox1 = new JComboBox(constants.optionMethod);
  3054.             label8 = new JLabel();
  3055.             label9 = new JLabel();
  3056.             label10 = new JLabel();
  3057.             label11 = new JLabel();
  3058.             label14 = new JLabel();
  3059.             label12 = new JLabel();
  3060.             textField1 = new JTextField();
  3061.             label13 = new JLabel();
  3062.             panel2 = new JPanel();
  3063.             label31 = new JLabel();
  3064.             label35 = new JLabel();
  3065.             label36 = new JLabel();
  3066.             label37 = new JLabel();
  3067.             label38 = new JLabel();
  3068.             label21 = new JLabel();
  3069.             button3 = new JButton();
  3070.             label39 = new JLabel();
  3071.             label40 = new JLabel();
  3072.             checkBox4 = new JCheckBox();
  3073.             checkBox8 = new JCheckBox();
  3074.             checkBox9 = new JCheckBox();
  3075.             checkBox10 = new JCheckBox();
  3076.             checkBox11 = new JCheckBox();
  3077.             checkBox12 = new JCheckBox();
  3078.             checkBox13 = new JCheckBox();
  3079.             checkBox14 = new JCheckBox();
  3080.             comboBox8 = new JComboBox(constants.optionColor);
  3081.             comboBox9 = new JComboBox(constants.optionColor);
  3082.             label43 = new JLabel();
  3083.             label44 = new JLabel();
  3084.             label45 = new JLabel();
  3085.             label46 = new JLabel();
  3086.             comboBox10 = new JComboBox(constants.optionColor);
  3087.             comboBox11 = new JComboBox(constants.optionColor);
  3088.             comboBox12 = new JComboBox(constants.optionColor);
  3089.             comboBox13 = new JComboBox(constants.optionColor);
  3090.             comboBox14 = new JComboBox(constants.optionColor);
  3091.             comboBox15 = new JComboBox(constants.optionColor);
  3092.             label47 = new JLabel(new ImageIcon(brush));
  3093.             label64 = new JLabel();
  3094.             checkBox17 = new JCheckBox();
  3095.             label65 = new JLabel();
  3096.             checkBox18 = new JCheckBox();
  3097.             panel1 = new JPanel();
  3098.             label17 = new JLabel();
  3099.             textField2 = new JTextField();
  3100.             label18 = new JLabel();
  3101.             label1 = new JLabel(new ImageIcon(siggy));
  3102.             button4 = new JButton();
  3103.             panel3 = new JPanel();
  3104.             slider1 = new JSlider();
  3105.             label15 = new JLabel();
  3106.             label16 = new JLabel();
  3107.             checkBox6 = new JCheckBox();
  3108.             label23 = new JLabel();
  3109.             checkBox5 = new JCheckBox();
  3110.             label27 = new JLabel();
  3111.             checkBox1 = new JCheckBox();
  3112.             checkBox2 = new JCheckBox();
  3113.             label28 = new JLabel(new ImageIcon(pic));
  3114.             checkBox3 = new JCheckBox();
  3115.             label29 = new JLabel();
  3116.             label30 = new JLabel();
  3117.             label48 = new JLabel();
  3118.             checkBox15 = new JCheckBox();
  3119.             label49 = new JLabel();
  3120.             checkBox16 = new JCheckBox();
  3121.             label19 = new JLabel();
  3122.             checkBox7 = new JCheckBox();
  3123.             progressBar1 = new JProgressBar();
  3124.             label20 = new JLabel();
  3125.             button2 = new JButton();
  3126.             panel5 = new JPanel();
  3127.             button5 = new JToggleButton();
  3128.             comboBox6 = new JComboBox(constants.optionAntiban);
  3129.             label22 = new JLabel();
  3130.             checkBox81 = new JCheckBox();
  3131.             label26 = new JLabel();
  3132.             label32 = new JLabel();
  3133.             slider2 = new JSlider();
  3134.             checkBox91 = new JCheckBox();
  3135.             checkBox101 = new JCheckBox();
  3136.             checkBox19 = new JCheckBox();
  3137.             checkBox20 = new JCheckBox();
  3138.             textArea1 = new JTextArea();
  3139.             button1 = new JButton();
  3140.  
  3141.             // ======== this ========
  3142.             try {
  3143.                 UIManager.setLookAndFeel(UIManager
  3144.                         .getSystemLookAndFeelClassName());
  3145.             } catch (final Exception ignored) {
  3146.             }
  3147.             Container contentPane = getContentPane();
  3148.             contentPane.setLayout(null);
  3149.  
  3150.             // ======== tabbedPane1 ========
  3151.             {
  3152.                 tabbedPane1.setTabPlacement(SwingConstants.LEFT);
  3153.  
  3154.                 // ======== panel4 ========
  3155.                 {
  3156.                     panel4.setLayout(null);
  3157.                     // ---- label24 ----
  3158.                     label24.setText("Message:");
  3159.                     label24.setFont(new Font("Tahoma", Font.PLAIN, 17));
  3160.                     label24.setForeground(Color.red);
  3161.                     panel4.add(label24);
  3162.                     label24.setBounds(0, 265, 75, 25);
  3163.  
  3164.                     // ---- label25 ----
  3165.                     label25.setText(getMessage());
  3166.                     label25.setFont(new Font("Tahoma", Font.PLAIN, 17));
  3167.                     label25.setForeground(Color.blue);
  3168.                     panel4.add(label25);
  3169.                     label25.setBounds(80, 265, 340, 25);
  3170.  
  3171.                     // ---- label2 ----
  3172.                     panel4.add(label2);
  3173.                     label2.setBounds(new Rectangle(new Point(5, 35), label2
  3174.                             .getPreferredSize()));
  3175.  
  3176.                     // ---- comboBox2 ----
  3177.                     comboBox2.setForeground(Color.cyan);
  3178.                     panel4.add(comboBox2);
  3179.                     comboBox2.setBounds(50, 35, 160, 30);
  3180.  
  3181.                     // ---- label3 ----
  3182.                     panel4.add(label3);
  3183.                     label3.setBounds(new Rectangle(new Point(5, 110), label3
  3184.                             .getPreferredSize()));
  3185.  
  3186.                     // ---- comboBox3 ----
  3187.                     comboBox3.setForeground(Color.blue);
  3188.                     panel4.add(comboBox3);
  3189.                     comboBox3.setBounds(50, 110, 160, 30);
  3190.  
  3191.                     // ---- label4 ----
  3192.                     panel4.add(label4);
  3193.                     label4.setBounds(220, 110, 25,
  3194.                             label4.getPreferredSize().height);
  3195.  
  3196.                     // ---- label5 ----
  3197.                     panel4.add(label5);
  3198.                     label5.setBounds(220, 35, label5.getPreferredSize().width,
  3199.                             30);
  3200.  
  3201.                     // ---- comboBox4 ----
  3202.                     comboBox4.setForeground(Color.green);
  3203.                     panel4.add(comboBox4);
  3204.                     comboBox4.setBounds(255, 110, 170, 30);
  3205.  
  3206.                     // ---- comboBox5 ----
  3207.                     comboBox5.setForeground(Color.red);
  3208.                     panel4.add(comboBox5);
  3209.                     comboBox5.setBounds(255, 35, 170, 30);
  3210.  
  3211.                     // ---- label6 ----
  3212.                     panel4.add(label6);
  3213.                     label6.setBounds(new Rectangle(new Point(5, 180), label6
  3214.                             .getPreferredSize()));
  3215.  
  3216.                     // ---- label7 ----
  3217.                     panel4.add(label7);
  3218.                     label7.setBounds(375, 180, 47, 50);
  3219.  
  3220.                     // ---- comboBox1 ----
  3221.                     comboBox1.setForeground(Color.magenta);
  3222.                     panel4.add(comboBox1);
  3223.                     comboBox1.setBounds(60, 180, 310, 50);
  3224.  
  3225.                     // ---- label8 ----
  3226.                     label8.setText("Method To Perform");
  3227.                     label8.setFont(label8.getFont().deriveFont(Font.PLAIN,
  3228.                             label8.getFont().getSize() + 17f));
  3229.                     panel4.add(label8);
  3230.                     label8.setBounds(95, 145, 240, 40);
  3231.  
  3232.                     // ---- label9 ----
  3233.                     label9.setText("Bow Type");
  3234.                     label9.setFont(label9.getFont().deriveFont(
  3235.                             label9.getFont().getSize() + 17f));
  3236.                     panel4.add(label9);
  3237.                     label9.setBounds(65, 75, 125, 35);
  3238.  
  3239.                     // ---- label10 ----
  3240.                     label10.setText("Wood Type");
  3241.                     label10.setFont(label10.getFont().deriveFont(
  3242.                             label10.getFont().getSize() + 17f));
  3243.                     panel4.add(label10);
  3244.                     label10.setBounds(new Rectangle(new Point(60, 0), label10
  3245.                             .getPreferredSize()));
  3246.  
  3247.                     // ---- label11 ----
  3248.                     label11.setText("Object Type");
  3249.                     label11.setFont(label11.getFont().deriveFont(
  3250.                             label11.getFont().getSize() + 17f));
  3251.                     panel4.add(label11);
  3252.                     label11.setBounds(new Rectangle(new Point(265, 0), label11
  3253.                             .getPreferredSize()));
  3254.  
  3255.                     // ---- label14 ----
  3256.                     label14.setText("Knife Type");
  3257.                     label14.setFont(label14.getFont().deriveFont(
  3258.                             label14.getFont().getSize() + 17f));
  3259.                     panel4.add(label14);
  3260.                     label14.setBounds(new Rectangle(new Point(275, 75), label14
  3261.                             .getPreferredSize()));
  3262.  
  3263.                     // ---- label12 ----
  3264.                     label12.setText("Amount to Fletch:");
  3265.                     label12.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3266.                     panel4.add(label12);
  3267.                     label12.setBounds(0, 235, 135, 25);
  3268.  
  3269.                     // ---- textField1 ----
  3270.                     textField1.setText("0");
  3271.                     panel4.add(textField1);
  3272.                     textField1.setBounds(135, 235, 90, 25);
  3273.  
  3274.                     // ---- label13 ----
  3275.                     label13.setText("0 for Unilimted Fletching!");
  3276.                     label13.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3277.                     panel4.add(label13);
  3278.                     label13.setBounds(230, 235, 190, 25);
  3279.                 }
  3280.                 tabbedPane1.addTab("Main Settings", panel4);
  3281.                 // ======== panel2 ========
  3282.                 {
  3283.                     panel2.setLayout(null);
  3284.  
  3285.                     // ---- label31 ----
  3286.                     label31.setText("Enable Paint:");
  3287.                     label31.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3288.                     panel2.add(label31);
  3289.                     label31.setBounds(5, 55, label31.getPreferredSize().width,
  3290.                             25);
  3291.  
  3292.                     // ---- label35 ----
  3293.                     label35.setText("RSBot Mouse Lines:");
  3294.                     label35.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3295.                     panel2.add(label35);
  3296.                     label35.setBounds(new Rectangle(new Point(5, 125), label35
  3297.                             .getPreferredSize()));
  3298.  
  3299.                     // ---- label36 ----
  3300.                     label36.setText("RSBot Mouse Crosshair:");
  3301.                     label36.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3302.                     panel2.add(label36);
  3303.                     label36.setBounds(new Rectangle(new Point(5, 145), label36
  3304.                             .getPreferredSize()));
  3305.  
  3306.                     // ---- label37 ----
  3307.                     label37.setText("Your Mouse Lines:");
  3308.                     label37.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3309.                     panel2.add(label37);
  3310.                     label37.setBounds(new Rectangle(new Point(5, 165), label37
  3311.                             .getPreferredSize()));
  3312.  
  3313.                     // ---- label38 ----
  3314.                     label38.setText("Your Mouse Crosshair:");
  3315.                     label38.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3316.                     panel2.add(label38);
  3317.                     label38.setBounds(5, 185, 165,
  3318.                             label38.getPreferredSize().height);
  3319.  
  3320.                     // ---- button3 ----
  3321.                     button3.setText("Visit Universalscripts.org! :D");
  3322.                     button3.setFont(button3.getFont().deriveFont(
  3323.                             button3.getFont().getSize() + 19f));
  3324.                     button3.setForeground(Color.red);
  3325.                     button3.setBackground(new Color(255, 0, 51));
  3326.                     button3.addActionListener(new ActionListener() {
  3327.                         public void actionPerformed(ActionEvent e) {
  3328.                             button3ActionPerformed(e);
  3329.                         }
  3330.                     });
  3331.                     panel2.add(button3);
  3332.                     button3.setBounds(0, 210, 425, 80);
  3333.  
  3334.                     // ---- label39 ----
  3335.                     label39.setText("Text Color:");
  3336.                     label39.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3337.                     panel2.add(label39);
  3338.                     label39.setBounds(new Rectangle(new Point(5, 80), label39
  3339.                             .getPreferredSize()));
  3340.  
  3341.                     // ---- label40 ----
  3342.                     label40.setText("Paint Main Color:");
  3343.                     label40.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3344.                     panel2.add(label40);
  3345.                     label40.setBounds(new Rectangle(new Point(5, 105), label40
  3346.                             .getPreferredSize()));
  3347.  
  3348.                     // ---- checkBox4 ----
  3349.                     checkBox4.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3350.                     checkBox4.setSelected(true);
  3351.                     panel2.add(checkBox4);
  3352.                     checkBox4.setBounds(95, 55,
  3353.                             checkBox4.getPreferredSize().width, 25);
  3354.  
  3355.                     // ---- checkBox11 ----
  3356.                     checkBox11.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3357.                     checkBox11.setSelected(true);
  3358.                     panel2.add(checkBox11);
  3359.                     checkBox11.setBounds(new Rectangle(new Point(145, 125),
  3360.                             checkBox11.getPreferredSize()));
  3361.  
  3362.                     // ---- checkBox12 ----
  3363.                     checkBox12.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3364.                     checkBox12.setSelected(true);
  3365.                     panel2.add(checkBox12);
  3366.                     checkBox12.setBounds(new Rectangle(new Point(175, 145),
  3367.                             checkBox12.getPreferredSize()));
  3368.  
  3369.                     // ---- checkBox13 ----
  3370.                     checkBox13.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3371.                     checkBox13.setSelected(true);
  3372.                     panel2.add(checkBox13);
  3373.                     checkBox13.setBounds(new Rectangle(new Point(135, 165),
  3374.                             checkBox13.getPreferredSize()));
  3375.  
  3376.                     // ---- checkBox14 ----
  3377.                     checkBox14.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3378.                     checkBox14.setSelected(true);
  3379.                     panel2.add(checkBox14);
  3380.                     checkBox14.setBounds(new Rectangle(new Point(165, 185),
  3381.                             checkBox14.getPreferredSize()));
  3382.  
  3383.                     // ---- label43 ----
  3384.                     label43.setText("Color:");
  3385.                     label43.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3386.                     panel2.add(label43);
  3387.                     label43.setBounds(new Rectangle(new Point(240, 125),
  3388.                             label43.getPreferredSize()));
  3389.  
  3390.                     // ---- label44 ----
  3391.                     label44.setText("Color:");
  3392.                     label44.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3393.                     panel2.add(label44);
  3394.                     label44.setBounds(new Rectangle(new Point(195, 145),
  3395.                             label44.getPreferredSize()));
  3396.  
  3397.                     // ---- label45 ----
  3398.                     label45.setText("Color:");
  3399.                     label45.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3400.                     panel2.add(label45);
  3401.                     label45.setBounds(235, 165, 45,
  3402.                             label45.getPreferredSize().height);
  3403.  
  3404.                     // ---- label46 ----
  3405.                     label46.setText("Color:");
  3406.                     label46.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3407.                     panel2.add(label46);
  3408.                     label46.setBounds(new Rectangle(new Point(185, 185),
  3409.                             label46.getPreferredSize()));
  3410.                     panel2.add(comboBox10);
  3411.                     comboBox10.setBounds(285, 125, 70,
  3412.                             comboBox10.getPreferredSize().height);
  3413.                     panel2.add(comboBox11);
  3414.                     comboBox11.setBounds(240, 145, 70,
  3415.                             comboBox11.getPreferredSize().height);
  3416.                     panel2.add(comboBox12);
  3417.                     comboBox12.setBounds(95, 80, 70,
  3418.                             comboBox12.getPreferredSize().height);
  3419.                     panel2.add(comboBox13);
  3420.                     comboBox13.setBounds(130, 105, 70,
  3421.                             comboBox13.getPreferredSize().height);
  3422.                     panel2.add(comboBox14);
  3423.                     comboBox14.setBounds(280, 165, 70,
  3424.                             comboBox14.getPreferredSize().height);
  3425.                     panel2.add(comboBox15);
  3426.                     comboBox15.setBounds(230, 185, 65,
  3427.                             comboBox15.getPreferredSize().height);
  3428.  
  3429.                     // ---- label47 ----
  3430.                     panel2.add(label47);
  3431.                     label47.setBounds(250, 5, 135, 115);
  3432.  
  3433.                     // ---- label64 ----
  3434.                     label64.setText("Circles:");
  3435.                     label64.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3436.                     panel2.add(label64);
  3437.                     label64.setBounds(new Rectangle(new Point(165, 125),
  3438.                             label64.getPreferredSize()));
  3439.  
  3440.                     // ---- checkBox17 ----
  3441.                     checkBox17.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3442.                     checkBox17.setSelected(true);
  3443.                     panel2.add(checkBox17);
  3444.                     checkBox17.setBounds(new Rectangle(new Point(220, 125),
  3445.                             checkBox17.getPreferredSize()));
  3446.  
  3447.                     // ---- label65 ----
  3448.                     label65.setText("Cricles:");
  3449.                     label65.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3450.                     panel2.add(label65);
  3451.                     label65.setBounds(new Rectangle(new Point(155, 165),
  3452.                             label65.getPreferredSize()));
  3453.  
  3454.                     // ---- checkBox18 ----
  3455.                     checkBox18.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3456.                     panel2.add(checkBox18);
  3457.                     checkBox18.setBounds(new Rectangle(new Point(210, 165),
  3458.                             checkBox18.getPreferredSize()));
  3459.  
  3460.                     // ---- label21 ----
  3461.                     label21.setText("Paint Settings");
  3462.                     label21.setFont(label21.getFont().deriveFont(
  3463.                             label21.getFont().getSize() + 30f));
  3464.                     label21.setForeground(Color.blue);
  3465.                     panel2.add(label21);
  3466.                     label21.setBounds(new Rectangle(new Point(0, 5), label21
  3467.                             .getPreferredSize()));
  3468.                 }
  3469.                 tabbedPane1.addTab("Paint Settings", panel2);
  3470.  
  3471.                 // ======== panel1 ========
  3472.                 {
  3473.                     panel1.setLayout(null);
  3474.  
  3475.                     // ---- label17 ----
  3476.                     label17.setText("Signature name:");
  3477.                     label17.setFont(label17.getFont().deriveFont(
  3478.                             label17.getFont().getStyle() & ~Font.BOLD));
  3479.                     panel1.add(label17);
  3480.                     label17.setBounds(0, 5, 80, 25);
  3481.  
  3482.                     // ---- textField2 ----
  3483.                     textField2.setText("All");
  3484.                     panel1.add(textField2);
  3485.                     textField2.setBounds(80, 5, 95, 25);
  3486.  
  3487.                     // ---- label18 ----
  3488.                     label18.setText("No Spaces Please!");
  3489.                     panel1.add(label18);
  3490.                     label18.setBounds(180, 5, 88, 25);
  3491.  
  3492.                     // ---- label1 ----
  3493.                     label1.addMouseListener(new MouseAdapter() {
  3494.                         @Override
  3495.                         public void mouseClicked(MouseEvent e) {
  3496.                             label1MouseClicked(e);
  3497.                         }
  3498.                     });
  3499.                     panel1.add(label1);
  3500.                     label1.setBounds(0, 25, 500, 275);
  3501.  
  3502.                     // ---- button4 ----
  3503.                     button4.setText("Generate Signature");
  3504.                     button4.setForeground(new Color(0, 204, 0));
  3505.                     button4.setBackground(Color.green);
  3506.                     button4.addActionListener(new ActionListener() {
  3507.                         public void actionPerformed(ActionEvent e) {
  3508.                             button4ActionPerformed(e);
  3509.                         }
  3510.                     });
  3511.                     panel1.add(button4);
  3512.                     button4.setBounds(275, 5, 145, 25);
  3513.                 }
  3514.                 tabbedPane1.addTab("Signature", panel1);
  3515.  
  3516.                 // ======== panel3 ========
  3517.                 {
  3518.                     panel3.setLayout(null);
  3519.  
  3520.                     // ---- slider1 ----
  3521.                     slider1.setSnapToTicks(true);
  3522.                     slider1.setPaintTicks(true);
  3523.                     slider1.setMajorTickSpacing(10);
  3524.                     panel3.add(slider1);
  3525.                     slider1.setBounds(105, 130, 315, 30);
  3526.  
  3527.                     // ---- label15 ----
  3528.                     label15.setText("Mousespeed:");
  3529.                     label15.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3530.                     panel3.add(label15);
  3531.                     label15.setBounds(5, 130, 100, 30);
  3532.  
  3533.                     // ---- label16 ----
  3534.                     label16.setText("Save Settings for this account:");
  3535.                     label16.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3536.                     panel3.add(label16);
  3537.                     label16.setBounds(0, 195, 215, 25);
  3538.  
  3539.                     // ---- checkBox6 ----
  3540.                     checkBox6.setSelected(true);
  3541.                     checkBox6.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3542.                     panel3.add(checkBox6);
  3543.                     checkBox6.setBounds(215, 200, 21, 16);
  3544.  
  3545.                     // ---- label23 ----
  3546.                     label23.setText("logout 20k experince before 99 fletching:");
  3547.                     label23.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3548.                     panel3.add(label23);
  3549.                     label23.setBounds(5, 85, 300, 20);
  3550.  
  3551.                     // ---- checkBox5 ----
  3552.                     checkBox5.setSelected(true);
  3553.                     panel3.add(checkBox5);
  3554.                     checkBox5.setBounds(300, 85, 21, 21);
  3555.  
  3556.                     // ---- label27 ----
  3557.                     label27.setText("when done:");
  3558.                     label27.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3559.                     panel3.add(label27);
  3560.                     label27.setBounds(35, 165, 90, 25);
  3561.  
  3562.                     // ---- checkBox1 ----
  3563.                     checkBox1.setText(" Upon Level:");
  3564.                     checkBox1.setSelected(true);
  3565.                     checkBox1.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3566.                     panel3.add(checkBox1);
  3567.                     checkBox1.setBounds(125, 165, 115, 25);
  3568.  
  3569.                     // ---- checkBox2 ----
  3570.                     checkBox2.setSelected(true);
  3571.                     checkBox2.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3572.                     checkBox2.setText("Getting 99:");
  3573.                     panel3.add(checkBox2);
  3574.                     checkBox2.setBounds(240, 165, 110, 25);
  3575.  
  3576.                     // ---- label28 ----
  3577.                     panel3.add(label28);
  3578.                     label28.setBounds(new Rectangle(new Point(0, 165), label28
  3579.                             .getPreferredSize()));
  3580.  
  3581.                     // ---- checkBox3 ----
  3582.                     checkBox3.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3583.                     checkBox3.setSelected(true);
  3584.                     panel3.add(checkBox3);
  3585.                     checkBox3.setBounds(350, 165,
  3586.                             checkBox3.getPreferredSize().width, 26);
  3587.  
  3588.                     // ---- label29 ----
  3589.                     label29.setText("Developed by: Fletch to 99");
  3590.                     label29.setForeground(Color.blue);
  3591.                     label29.setFont(label29.getFont().deriveFont(Font.BOLD,
  3592.                             label29.getFont().getSize() + 20f));
  3593.                     panel3.add(label29);
  3594.                     label29.setBounds(5, 35, 415, 50);
  3595.  
  3596.                     // ---- label30 ----
  3597.                     label30.setText("UFletch: FREE, AIO, FLAWLESS!");
  3598.                     label30.setForeground(Color.green);
  3599.                     label30.setFont(label30.getFont().deriveFont(
  3600.                             label30.getFont().getStyle() | Font.BOLD,
  3601.                             label30.getFont().getSize() + 15f));
  3602.                     panel3.add(label30);
  3603.                     label30.setBounds(new Rectangle(new Point(5, 5), label30
  3604.                             .getPreferredSize()));
  3605.  
  3606.                     // ---- label48 ----
  3607.                     label48.setText("Message Notification:");
  3608.                     label48.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3609.                     panel3.add(label48);
  3610.                     label48.setBounds(new Rectangle(new Point(5, 105), label48
  3611.                             .getPreferredSize()));
  3612.  
  3613.                     // ---- checkBox15 ----
  3614.                     checkBox15.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3615.                     panel3.add(checkBox15);
  3616.                     checkBox15.setBounds(new Rectangle(new Point(160, 105),
  3617.                             checkBox15.getPreferredSize()));
  3618.  
  3619.                     // ---- label49 ----
  3620.                     label49.setText("Message Beep:");
  3621.                     label49.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3622.                     panel3.add(label49);
  3623.                     label49.setBounds(new Rectangle(new Point(185, 105),
  3624.                             label49.getPreferredSize()));
  3625.  
  3626.                     // ---- checkBox16 ----
  3627.                     checkBox16.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3628.                     panel3.add(checkBox16);
  3629.                     checkBox16.setBounds(new Rectangle(new Point(290, 105),
  3630.                             checkBox16.getPreferredSize()));
  3631.  
  3632.                     // ---- label19 ----
  3633.                     label19.setText("Load Settings:");
  3634.                     label19.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3635.                     panel3.add(label19);
  3636.                     label19.setBounds(245, 195,
  3637.                             label19.getPreferredSize().width, 25);
  3638.  
  3639.                     // ---- checkBox7 ----
  3640.                     checkBox7.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3641.                     checkBox7.setSelected(true);
  3642.                     panel3.add(checkBox7);
  3643.                     checkBox7.setBounds(350, 200,
  3644.                             checkBox7.getPreferredSize().width, 15);
  3645.  
  3646.                     // ---- progressBar1 ----
  3647.                     progressBar1.setStringPainted(true);
  3648.                     panel3.add(progressBar1);
  3649.                     progressBar1.setBounds(0, 240, 210, 50);
  3650.  
  3651.                     // ---- label20 ----
  3652.                     label20.setText("Percentage to next level");
  3653.                     label20.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3654.                     label20.setForeground(Color.red);
  3655.                     panel3.add(label20);
  3656.                     label20.setBounds(new Rectangle(new Point(20, 220), label20
  3657.                             .getPreferredSize()));
  3658.  
  3659.                     // ---- button2 ----
  3660.                     button2.setText("Highscores");
  3661.                     button2.setFont(new Font("Tahoma", Font.PLAIN, 16));
  3662.                     button2.setForeground(Color.red);
  3663.                     button2.setBackground(new Color(255, 0, 51));
  3664.                     panel3.add(button2);
  3665.                     button2.setBounds(210, 225, 215, 65);
  3666.                     button2.addActionListener(new ActionListener() {
  3667.                         public void actionPerformed(ActionEvent e) {
  3668.                             button2ActionPerformed(e);
  3669.                         }
  3670.                     });
  3671.  
  3672.                     { // compute preferred size
  3673.                         Dimension preferredSize = new Dimension();
  3674.                         for (int i = 0; i < panel3.getComponentCount(); i++) {
  3675.                             Rectangle bounds = panel3.getComponent(i)
  3676.                                     .getBounds();
  3677.                             preferredSize.width = Math.max(bounds.x
  3678.                                     + bounds.width, preferredSize.width);
  3679.                             preferredSize.height = Math.max(bounds.y
  3680.                                     + bounds.height, preferredSize.height);
  3681.                         }
  3682.                         Insets insets = panel3.getInsets();
  3683.                         preferredSize.width += insets.right;
  3684.                         preferredSize.height += insets.bottom;
  3685.                         panel3.setMinimumSize(preferredSize);
  3686.                         panel3.setPreferredSize(preferredSize);
  3687.                     }
  3688.                 }
  3689.                 tabbedPane1.addTab("Other Settings", panel3);
  3690.  
  3691.                 // ======== panel5 ========
  3692.                 {
  3693.                     panel5.setLayout(null);
  3694.  
  3695.                     // ---- button5 ----
  3696.                     button5.setText("Turn antiban off!");
  3697.                     button5.setFont(button5.getFont().deriveFont(
  3698.                             button5.getFont().getSize() + 12f));
  3699.                     button5.addActionListener(new ActionListener() {
  3700.                         public void actionPerformed(ActionEvent e) {
  3701.                             button5ActionPerformed(e);
  3702.                         }
  3703.                     });
  3704.                     panel5.add(button5);
  3705.                     button5.setBounds(0, 0, 425, 60);
  3706.                     panel5.add(comboBox6);
  3707.                     comboBox6.setBounds(135, 65, 240, 25);
  3708.  
  3709.                     // ---- label22 ----
  3710.                     label22.setText("Antiban Level:");
  3711.                     label22.setFont(label22.getFont().deriveFont(
  3712.                             label22.getFont().getSize() + 5f));
  3713.                     panel5.add(label22);
  3714.                     label22.setBounds(15, 65, 110, 20);
  3715.  
  3716.                     // ---- checkBox8 ----
  3717.                     checkBox81.setText("Customized Antiban");
  3718.                     checkBox81.addActionListener(new ActionListener() {
  3719.                         public void actionPerformed(ActionEvent e) {
  3720.                             checkBox81ActionPerformed(e);
  3721.                         }
  3722.                     });
  3723.                     panel5.add(checkBox81);
  3724.                     checkBox81.setBounds(new Rectangle(new Point(5, 90),
  3725.                             checkBox81.getPreferredSize()));
  3726.  
  3727.                     // ---- label26 ----
  3728.                     label26.setText("______________________________________________");
  3729.                     panel5.add(label26);
  3730.                     label26.setBounds(new Rectangle(new Point(135, 90), label26
  3731.                             .getPreferredSize()));
  3732.  
  3733.                     // ---- label32 ----
  3734.                     label32.setText("Frequency");
  3735.                     label32.setEnabled(false);
  3736.                     panel5.add(label32);
  3737.                     label32.setBounds(new Rectangle(new Point(15, 120), label32
  3738.                             .getPreferredSize()));
  3739.  
  3740.                     // ---- slider2 ----
  3741.                     slider2.setPaintTicks(true);
  3742.                     slider2.setPaintLabels(true);
  3743.                     slider2.setMaximum(240);
  3744.                     slider2.setSnapToTicks(true);
  3745.                     slider2.setMajorTickSpacing(40);
  3746.                     slider2.setMinorTickSpacing(8);
  3747.                     slider2.setValue(60);
  3748.                     slider2.setEnabled(false);
  3749.                     panel5.add(slider2);
  3750.                     slider2.setBounds(105, 115, 310, 35);
  3751.  
  3752.                     // ---- checkBox9 ----
  3753.                     checkBox91.setText("Open Tabs");
  3754.                     checkBox91.setEnabled(false);
  3755.                     panel5.add(checkBox91);
  3756.                     checkBox91.setBounds(new Rectangle(new Point(10, 155),
  3757.                             checkBox91.getPreferredSize()));
  3758.  
  3759.                     // ---- checkBox10 ----
  3760.                     checkBox101.setText("View Stats");
  3761.                     checkBox101.setEnabled(false);
  3762.                     panel5.add(checkBox101);
  3763.                     checkBox101.setBounds(new Rectangle(new Point(90, 155),
  3764.                             checkBox101.getPreferredSize()));
  3765.  
  3766.                     // ---- checkBox19 ----
  3767.                     checkBox19.setText("Camera Movements");
  3768.                     checkBox19.setEnabled(false);
  3769.                     panel5.add(checkBox19);
  3770.                     checkBox19.setBounds(new Rectangle(new Point(165, 155),
  3771.                             checkBox19.getPreferredSize()));
  3772.  
  3773.                     // ---- checkBox20 ----
  3774.                     checkBox20.setText("Mouse Movements");
  3775.                     checkBox20.setEnabled(false);
  3776.                     panel5.add(checkBox20);
  3777.                     checkBox20.setBounds(new Rectangle(new Point(285, 155),
  3778.                             checkBox20.getPreferredSize()));
  3779.  
  3780.                     // ---- textArea1 ----
  3781.                     textArea1.setWrapStyleWord(true);
  3782.                     textArea1.setLineWrap(true);
  3783.                     textArea1.setText("Add notes here:");
  3784.                     panel5.add(textArea1);
  3785.                     textArea1.setBounds(10, 180, 405, 110);
  3786.                 }
  3787.                 tabbedPane1.addTab("Antiban", panel5);
  3788.  
  3789.             }
  3790.             contentPane.add(tabbedPane1);
  3791.             tabbedPane1.setBounds(5, 0, 515, 295);
  3792.  
  3793.             // ---- button1 ----
  3794.             button1.setText("Start UFletch!");
  3795.             button1.setForeground(Color.blue);
  3796.             button1.setFont(new Font("Tahoma", Font.PLAIN, 26));
  3797.             button1.setBackground(new Color(51, 51, 255));
  3798.             button1.addActionListener(new ActionListener() {
  3799.                 public void actionPerformed(ActionEvent e) {
  3800.                     button1ActionPerformed(e);
  3801.                 }
  3802.             });
  3803.             contentPane.add(button1);
  3804.             button1.setBounds(0, 295, 520, 45);
  3805.  
  3806.             comboBox12.setSelectedIndex(0);
  3807.             comboBox13.setSelectedIndex(8);
  3808.             comboBox8.setSelectedIndex(1);
  3809.             comboBox9.setSelectedIndex(3);
  3810.             comboBox10.setSelectedIndex(7);
  3811.             comboBox11.setSelectedIndex(6);
  3812.             comboBox14.setSelectedIndex(5);
  3813.             comboBox15.setSelectedIndex(2);
  3814.  
  3815.             { // compute preferred size
  3816.                 Dimension preferredSize = new Dimension();
  3817.                 for (int i = 0; i < contentPane.getComponentCount(); i++) {
  3818.                     Rectangle bounds = contentPane.getComponent(i).getBounds();
  3819.                     preferredSize.width = Math.max(bounds.x + bounds.width,
  3820.                             preferredSize.width);
  3821.                     preferredSize.height = Math.max(bounds.y + bounds.height,
  3822.                             preferredSize.height);
  3823.                 }
  3824.                 Insets insets = contentPane.getInsets();
  3825.                 preferredSize.width += insets.right;
  3826.                 preferredSize.height += insets.bottom;
  3827.                 contentPane.setMinimumSize(preferredSize);
  3828.                 contentPane.setPreferredSize(preferredSize);
  3829.             }
  3830.             pack();
  3831.             setLocationRelativeTo(getOwner());
  3832.             setVisible(true);
  3833.             // JFormDesigner - End of component initialization
  3834.             // //GEN-END:initComponents
  3835.         }
  3836.  
  3837.         // JFormDesigner - Variables declaration - DO NOT MODIFY
  3838.         // //GEN-BEGIN:variables
  3839.         private JTabbedPane tabbedPane1;
  3840.         private JPanel panel4;
  3841.         private JLabel label24;
  3842.         private JLabel label25;
  3843.         private JLabel label2;
  3844.         private JComboBox comboBox2;
  3845.         private JLabel label3;
  3846.         private JComboBox comboBox3;
  3847.         private JLabel label4;
  3848.         private JLabel label5;
  3849.         private JComboBox comboBox4;
  3850.         private JComboBox comboBox5;
  3851.         private JLabel label6;
  3852.         private JLabel label7;
  3853.         private JComboBox comboBox1;
  3854.         private JLabel label8;
  3855.         private JLabel label9;
  3856.         private JLabel label10;
  3857.         private JLabel label11;
  3858.         private JLabel label14;
  3859.         private JLabel label12;
  3860.         private JTextField textField1;
  3861.         private JLabel label13;
  3862.         private JPanel panel2;
  3863.         private JLabel label31;
  3864.         private JLabel label35;
  3865.         private JLabel label36;
  3866.         private JLabel label37;
  3867.         private JLabel label38;
  3868.         private JButton button3;
  3869.         private JLabel label39;
  3870.         private JLabel label40;
  3871.         private JCheckBox checkBox4;
  3872.         private JCheckBox checkBox8;
  3873.         private JCheckBox checkBox9;
  3874.         private JCheckBox checkBox10;
  3875.         private JCheckBox checkBox11;
  3876.         private JCheckBox checkBox12;
  3877.         private JCheckBox checkBox13;
  3878.         private JCheckBox checkBox14;
  3879.         private JLabel label21;
  3880.         private JComboBox comboBox8;
  3881.         private JComboBox comboBox9;
  3882.         private JLabel label43;
  3883.         private JLabel label44;
  3884.         private JLabel label45;
  3885.         private JLabel label46;
  3886.         private JComboBox comboBox10;
  3887.         private JComboBox comboBox11;
  3888.         private JComboBox comboBox12;
  3889.         private JComboBox comboBox13;
  3890.         private JComboBox comboBox14;
  3891.         private JComboBox comboBox15;
  3892.         private JLabel label47;
  3893.         private JLabel label64;
  3894.         private JCheckBox checkBox17;
  3895.         private JLabel label65;
  3896.         private JCheckBox checkBox18;
  3897.         private JPanel panel1;
  3898.         private JLabel label17;
  3899.         private JTextField textField2;
  3900.         private JLabel label18;
  3901.         private JLabel label1;
  3902.         private JButton button4;
  3903.         private JPanel panel3;
  3904.         private JSlider slider1;
  3905.         private JLabel label15;
  3906.         private JLabel label16;
  3907.         private JCheckBox checkBox6;
  3908.         private JLabel label23;
  3909.         private JCheckBox checkBox5;
  3910.         private JLabel label27;
  3911.         private JCheckBox checkBox1;
  3912.         private JCheckBox checkBox2;
  3913.         private JLabel label28;
  3914.         private JCheckBox checkBox3;
  3915.         private JLabel label29;
  3916.         private JLabel label30;
  3917.         private JLabel label48;
  3918.         private JCheckBox checkBox15;
  3919.         private JLabel label49;
  3920.         private JCheckBox checkBox16;
  3921.         private JLabel label19;
  3922.         private JCheckBox checkBox7;
  3923.         private JProgressBar progressBar1;
  3924.         private JLabel label20;
  3925.         private JButton button2;
  3926.         private JPanel panel5;
  3927.         private JToggleButton button5;
  3928.         private JComboBox comboBox6;
  3929.         private JLabel label22;
  3930.         private JCheckBox checkBox81;
  3931.         private JLabel label26;
  3932.         private JLabel label32;
  3933.         private JSlider slider2;
  3934.         private JCheckBox checkBox91;
  3935.         private JCheckBox checkBox101;
  3936.         private JCheckBox checkBox19;
  3937.         private JCheckBox checkBox20;
  3938.         private JTextArea textArea1;
  3939.         private JButton button1;
  3940.         // JFormDesigner - End of variables declaration //GEN-END:variables
  3941.  
  3942.     }
  3943.  
  3944.     @Override
  3945.     public void mouseClicked(MouseEvent e) {
  3946.         if (e.getPoint() != null) {
  3947.             if (constants.BUTTON.contains(e.getPoint())) {
  3948.                 gui.button1.setText("Update!");
  3949.                 gui.setVisible(true);
  3950.             }
  3951.             if (constants.HIDE.contains(e.getPoint())) {
  3952.                 if (fullPaint) {
  3953.                     fullPaint = false;
  3954.                     buttonOption = "Unhide";
  3955.                 } else if (!fullPaint) {
  3956.                     fullPaint = true;
  3957.                     buttonOption = "Hide";
  3958.                 }
  3959.             }
  3960.             if (constants.PAUSE.contains(e.getPoint()) && paused == "Pause") {
  3961.                 pause = true;
  3962.                 paused = "Resume";
  3963.             } else if (constants.PAUSE.contains(e.getPoint())
  3964.                     && paused == "Resume") {
  3965.                 pause = false;
  3966.                 paused = "Pause";
  3967.                 env.setUserInput(Environment.INPUT_KEYBOARD);
  3968.             }
  3969.             if (constants.STOP.contains(e.getPoint())) {
  3970.                 pauseScript();
  3971.                 stopScript();
  3972.             }
  3973.         }
  3974.     }
  3975.  
  3976.     public void mouseEntered(MouseEvent e) {
  3977.     }
  3978.  
  3979.     public void mouseExited(MouseEvent e) {
  3980.     }
  3981.  
  3982.     public void mousePressed(MouseEvent e) {
  3983.     }
  3984.  
  3985.     public void mouseReleased(MouseEvent e) {
  3986.     }
  3987.  
  3988.     @Override
  3989.     public void mouseDragged(MouseEvent e) {
  3990.         if (e.getPoint() != null) {
  3991.             p = e.getPoint().getLocation();
  3992.             if (!fullPaint) {
  3993.                 if (constants.RECT_ONE.contains(e.getPoint())) {
  3994.                     tabOne = true;
  3995.                 }
  3996.                 if (constants.RECT_TWO.contains(e.getPoint())) {
  3997.                     tabTwo = true;
  3998.                 }
  3999.                 if (constants.RECT_THREE.contains(e.getPoint())) {
  4000.                     tabThree = true;
  4001.                 }
  4002.  
  4003.                 if (!constants.RECT_ONE.contains(e.getPoint())) {
  4004.                     tabOne = false;
  4005.                 }
  4006.                 if (!constants.RECT_TWO.contains(e.getPoint())) {
  4007.                     tabTwo = false;
  4008.                 }
  4009.                 if (!constants.RECT_THREE.contains(e.getPoint())) {
  4010.                     tabThree = false;
  4011.                 }
  4012.             }
  4013.         }
  4014.     }
  4015.  
  4016.     @Override
  4017.     public void mouseMoved(MouseEvent e) {
  4018.         if (e.getPoint() != null) {
  4019.             p = e.getPoint().getLocation();
  4020.             if (!fullPaint) {
  4021.                 if (constants.RECT_ONE.contains(e.getPoint())) {
  4022.                     tabOne = true;
  4023.                 }
  4024.                 if (constants.RECT_TWO.contains(e.getPoint())) {
  4025.                     tabTwo = true;
  4026.                 }
  4027.                 if (constants.RECT_THREE.contains(e.getPoint())) {
  4028.                     tabThree = true;
  4029.                 }
  4030.  
  4031.                 if (!constants.RECT_ONE.contains(e.getPoint())) {
  4032.                     tabOne = false;
  4033.                 }
  4034.                 if (!constants.RECT_TWO.contains(e.getPoint())) {
  4035.                     tabTwo = false;
  4036.                 }
  4037.                 if (!constants.RECT_THREE.contains(e.getPoint())) {
  4038.                     tabThree = false;
  4039.                 }
  4040.             }
  4041.         }
  4042.     }
  4043.  
  4044.     private class beeper extends Thread implements Runnable {
  4045.         private String firstMessage = "";
  4046.  
  4047.         public void text() {
  4048.             if (!m().toLowerCase().isEmpty()
  4049.                     && !m().toLowerCase().equals(firstMessage)) {
  4050.                 beep();
  4051.                 firstMessage = m().toLowerCase();
  4052.             }
  4053.         }
  4054.  
  4055.         public void beep() {
  4056.             try {
  4057.                 for (int i = 0; i < 3; i++) {
  4058.                     java.awt.Toolkit.getDefaultToolkit().beep();
  4059.                     Thread.sleep(250);
  4060.                 }
  4061.                 Thread.sleep(random(100, 500));
  4062.             } catch (Exception e) {
  4063.             }
  4064.             return;
  4065.         }
  4066.  
  4067.         @Override
  4068.         public void run() {
  4069.             while (!beep.isInterrupted()) {
  4070.                 text();
  4071.                 try {
  4072.                     Thread.sleep(random(50, 150));
  4073.                 } catch (InterruptedException e) {
  4074.                 }
  4075.             }
  4076.         }
  4077.  
  4078.         public String m() {
  4079.             RSInterface chatBox = interfaces.get(137);
  4080.             for (int i = 281; i >= 180; i--) {// Valid text is from 180 to 281
  4081.                 String text = chatBox.getComponent(i).getText();
  4082.                 if (!text.isEmpty() && text.contains("<")) {
  4083.                     return text;
  4084.                 }
  4085.             }
  4086.             return "";
  4087.         }
  4088.     }
  4089.  
  4090.     private class fetchprices extends Thread implements Runnable {
  4091.         public void run() {
  4092.             try {
  4093.                 objectprice = getObjectPrice();
  4094.                 sleep(100);
  4095.                 logprice = getLogPrice();
  4096.                 sleep(100);
  4097.                 ubowprice = getUnStrungPrice();
  4098.                 sleep(100);
  4099.                 bowprice = getBowPrice();
  4100.                 sleep(100);
  4101.                 stringprice = getStringPrice();
  4102.                 sleep(100);
  4103.                 featherprice = getFeatherPrice();
  4104.                 sleep(100);
  4105.                 arrowprice = getArrowPrice();
  4106.                 sleep(100);
  4107.                 headlessarrowprice = getHeadlessArrowPrice();
  4108.                 sleep(100);
  4109.                 log(Color.BLUE, "Prices fetched successfully!");
  4110.                 this.finalize();
  4111.             } catch (Throwable e) {
  4112.             }
  4113.         }
  4114.     }
  4115.  
  4116.     private class trayInfo extends MenuItem {
  4117.         private static final long serialVersionUID = 1L;
  4118.         private PopupMenu menu = new PopupMenu();
  4119.         public TrayIcon systray;
  4120.  
  4121.         public trayInfo() {
  4122.             initComponents();
  4123.         }
  4124.  
  4125.         private void item1ActionPerformed(ActionEvent e) {
  4126.             stopScript(false);
  4127.         }
  4128.  
  4129.         private void item2ActionPerformed(ActionEvent e) {
  4130.             pause = true;
  4131.             paused = "Resume";
  4132.         }
  4133.  
  4134.         private void item3ActionPerformed(ActionEvent e) {
  4135.             pause = false;
  4136.             paused = "Pause";
  4137.             env.setUserInput(Environment.INPUT_KEYBOARD);
  4138.             log("Resuming..");
  4139.         }
  4140.  
  4141.         private void item4ActionPerformed(ActionEvent e) {
  4142.             gui.button1.setText("Update");
  4143.             gui.setVisible(true);
  4144.         }
  4145.  
  4146.         private void item5ActionPerformed(ActionEvent e) {
  4147.             gui.tabbedPane1.setSelectedIndex(4);
  4148.             gui.button1.setText("Update");
  4149.             gui.setVisible(true);
  4150.         }
  4151.  
  4152.         private void initComponents() {
  4153.             if (!SystemTray.isSupported()) {
  4154.                 JOptionPane.showMessageDialog(null, "SystemTray not supported");
  4155.             } else {
  4156.                 menu.add(constants.item1);
  4157.                 constants.item1.addActionListener(new ActionListener() {
  4158.                     public void actionPerformed(ActionEvent e) {
  4159.                         item1ActionPerformed(e);
  4160.                     }
  4161.                 });
  4162.                 menu.add(constants.item2);
  4163.                 constants.item2.addActionListener(new ActionListener() {
  4164.                     public void actionPerformed(ActionEvent e) {
  4165.                         item2ActionPerformed(e);
  4166.                     }
  4167.                 });
  4168.                 menu.add(constants.item3);
  4169.                 constants.item3.addActionListener(new ActionListener() {
  4170.                     public void actionPerformed(ActionEvent e) {
  4171.                         item3ActionPerformed(e);
  4172.                     }
  4173.                 });
  4174.                 menu.add(constants.item4);
  4175.                 constants.item4.addActionListener(new ActionListener() {
  4176.                     public void actionPerformed(ActionEvent e) {
  4177.                         item4ActionPerformed(e);
  4178.                     }
  4179.                 });
  4180.                 menu.add(constants.item5);
  4181.                 constants.item5.addActionListener(new ActionListener() {
  4182.                     public void actionPerformed(ActionEvent e) {
  4183.                         item5ActionPerformed(e);
  4184.                     }
  4185.                 });
  4186.                 try {
  4187.                     systray = new TrayIcon(
  4188.                             icon.getScaledInstance(SystemTray.getSystemTray()
  4189.                                     .getTrayIconSize().width, SystemTray
  4190.                                     .getSystemTray().getTrayIconSize().height,
  4191.                                     0), "UFletch", menu);
  4192.                     SystemTray.getSystemTray().add(systray);
  4193.                     tray = true;
  4194.                 } catch (Exception e) {
  4195.                     log("Error setting up system tray!");
  4196.                     e.printStackTrace();
  4197.                     tray = false;
  4198.                 }
  4199.             }
  4200.         }
  4201.     }
  4202.  
  4203.     private class AntiBan {
  4204.         private boolean Stats = false, Mouse = false, Camera = false,
  4205.                 Tabs = false;
  4206.         private int ABFreq = 60;
  4207.  
  4208.         private void doWork() {
  4209.             int r = random(0, 2);
  4210.             if (Camera && r == 0) {
  4211.                 switch (random(1, 2)) {
  4212.                 case 1:
  4213.                     camera.turnTo(getMyPlayer().getLocation().randomize(5, 5),
  4214.                             5);
  4215.                 case 2:
  4216.                     camera.moveRandomly(random(1102, 1298));
  4217.                 }
  4218.                 sleep(random(500, 750));
  4219.             } else if (Tabs && r == 1) {
  4220.                 switch (random(1, 2)) {
  4221.                 case 1:
  4222.                     int i = random(0, Tab.values().length);
  4223.                     Tab tab = Tab.values()[i];
  4224.                     if (tab != Tab.LOGOUT) {
  4225.                         game.openTab(tab);
  4226.                         mouse.move((585 + random(-35, 35)),
  4227.                                 (330 + random(-90, 90)));
  4228.                         sleep(2000, 3000);
  4229.                         game.openTab(Tab.INVENTORY);
  4230.                         sleep(random(500, 750));
  4231.                     }
  4232.                 case 2:
  4233.                     if (Stats) {
  4234.                         game.openTab(Tab.STATS);
  4235.                         mouse.moveRandomly(random(1, 300));
  4236.                         sleep(1750, 2000);
  4237.                         game.openTab(Tab.INVENTORY);
  4238.                         sleep(random(500, 750));
  4239.                     } else {
  4240.                         int t = random(0, Tab.values().length);
  4241.                         Tab tabb = Tab.values()[t];
  4242.                         if (tabb != Tab.LOGOUT) {
  4243.                             game.openTab(tabb);
  4244.                             mouse.move((585 + random(-35, 35)),
  4245.                                     (330 + random(-90, 90)));
  4246.                             sleep(2000, 3000);
  4247.                             game.openTab(Tab.INVENTORY);
  4248.                             sleep(random(500, 750));
  4249.                         }
  4250.                     }
  4251.  
  4252.                 }
  4253.             } else if (Mouse && r == 2) {
  4254.                 int s = random(1, 3);
  4255.                 switch (s) {
  4256.                 case 1:
  4257.                     mouse.moveOffScreen();
  4258.                     sleep(750, 1500);
  4259.                 case 2:
  4260.                     mouse.moveSlightly();
  4261.                     sleep(500, 1000);
  4262.                 case 3:
  4263.                     mouse.moveRandomly(random(1, 300));
  4264.                     sleep(750, 1500);
  4265.                 }
  4266.             }
  4267.         }
  4268.  
  4269.         private void antiBan() {
  4270.             int r = random(ABFreq, 250);
  4271.             if (r == ABFreq) {
  4272.                 doWork();
  4273.             } else if (r == random(80, ABFreq)) {
  4274.                 doWork();
  4275.             } else if (r == random(ABFreq / 2, 240)) {
  4276.                 doWork();
  4277.             } else if (r == ABFreq / 3 + random(1, 100)) {
  4278.                 doWork();
  4279.             } else if (r == 60) {
  4280.                 doWork();
  4281.             }
  4282.         }
  4283.  
  4284.         public void getSettings() {
  4285.             if (!gui.button5.isSelected()) {
  4286.                 if (gui.checkBox81.isSelected()) {
  4287.                     ABFreq = gui.slider2.getValue();
  4288.                     Stats = gui.checkBox101.isSelected();
  4289.                     Mouse = gui.checkBox20.isSelected();
  4290.                     Camera = gui.checkBox19.isSelected();
  4291.                     Tabs = gui.checkBox91.isSelected();
  4292.                 } else {
  4293.                     if (gui.comboBox6.getSelectedItem().toString()
  4294.                             .contains("Low")) {
  4295.                         ABFreq = 20;
  4296.                         Camera = true;
  4297.                         Mouse = true;
  4298.  
  4299.                     } else if (gui.comboBox6.getSelectedItem().toString()
  4300.                             .contains("Medium")) {
  4301.                         ABFreq = 40;
  4302.                         Mouse = true;
  4303.                         Camera = true;
  4304.                         Stats = true;
  4305.  
  4306.                     } else if (gui.comboBox6.getSelectedItem().toString()
  4307.                             .contains("High")) {
  4308.                         ABFreq = 60;
  4309.                         Camera = true;
  4310.                         Tabs = true;
  4311.                         Stats = true;
  4312.                         Mouse = true;
  4313.                     }
  4314.                 }
  4315.             }
  4316.         }
  4317.     }
  4318.  
  4319.     private Image getImage(final String fileName, final boolean save,
  4320.             final String url) {
  4321.         final Logger log = Logger.getLogger(this.getClass().getName());
  4322.         final File dir = new File(getCacheDirectory() + "/Images");
  4323.         try {
  4324.             if (!dir.exists()) {
  4325.                 if (!dir.mkdir()) {
  4326.                     return pic();
  4327.                 }
  4328.             }
  4329.         } catch (final Exception e) {
  4330.             return pic();
  4331.         }
  4332.         ImageIO.setCacheDirectory(dir);
  4333.         final File f = new File(getCacheDirectory() + "/Images/" + fileName);
  4334.         final File loc = new File(getCacheDirectory() + "/Images/");
  4335.         if (save) {
  4336.             try {
  4337.                 if (loc.exists()) {
  4338.                     if (f.exists()) {
  4339.                         if (connection) {
  4340.                             log(Color.GREEN,
  4341.                                     "Successfully loaded Image from scripts folder.");
  4342.                         }
  4343.                         return ImageIO.read(f.toURI().toURL());
  4344.                     }
  4345.                 }
  4346.                 final Image img = ImageIO.read(new URL(url));
  4347.                 if (img != null) {
  4348.                     if (!loc.exists()) {
  4349.                         loc.mkdir();
  4350.                     }
  4351.                     ImageIO.write((RenderedImage) img, "PNG", f);
  4352.                     if (connection) {
  4353.                         log.info("Saved Image to Scripts folder successfully.");
  4354.                     }
  4355.                     return img;
  4356.                 }
  4357.             } catch (final IOException e) {
  4358.                 return pic();
  4359.             }
  4360.         } else if (!save) {
  4361.             try {
  4362.                 return ImageIO.read(new URL(url));
  4363.             } catch (final MalformedURLException e) {
  4364.             } catch (final IOException e) {
  4365.                 return pic();
  4366.             }
  4367.         }
  4368.         return pic();
  4369.     }
  4370.  
  4371.     private Image getCachedImage(final String fileName) {
  4372.         final File dir = new File(getCacheDirectory() + "/Images");
  4373.         if (!dir.exists()) {
  4374.             return pic();
  4375.         }
  4376.         ImageIO.setCacheDirectory(dir);
  4377.         final File f = new File(getCacheDirectory() + "/Images/" + fileName);
  4378.         final File loc = new File(getCacheDirectory() + "/Images/");
  4379.         try {
  4380.             if (loc.exists()) {
  4381.                 if (f.exists()) {
  4382.                     log(Color.GREEN,
  4383.                             "Successfully loaded Image from scripts folder.");
  4384.                     return ImageIO.read(f);
  4385.                 }
  4386.             }
  4387.         } catch (final IOException e) {
  4388.             return pic();
  4389.         }
  4390.         return pic();
  4391.     }
  4392.  
  4393.     private Image pic() {
  4394.         return getImage("blank.png", true, "http://i.imgur.com/7nw5i.png");
  4395.     }
  4396. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement