Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 31st, 2012  |  syntax: None  |  size: 27.28 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import org.rsbot.event.events.MessageEvent;
  2. import org.rsbot.event.listeners.MessageListener;
  3. import org.rsbot.event.listeners.PaintListener;
  4. import org.rsbot.script.Script;
  5. import org.rsbot.script.ScriptManifest;
  6. import org.rsbot.script.util.Timer;
  7. import org.rsbot.script.wrappers.RSArea;
  8. import org.rsbot.script.wrappers.RSComponent;
  9. import org.rsbot.script.wrappers.RSInterface;
  10. import org.rsbot.script.wrappers.RSObject;
  11. import org.rsbot.script.wrappers.RSTile;
  12. import org.rsbot.script.wrappers.RSWeb;
  13. import java.awt.*;
  14. import javax.imageio.ImageIO;
  15. import java.io.IOException;
  16. import java.net.URL;
  17. import java.awt.event.ActionEvent;
  18. import java.awt.event.ActionListener;
  19. import java.awt.event.MouseEvent;
  20. import java.awt.event.MouseListener;
  21. import java.awt.*;
  22. import java.awt.event.*;
  23. import java.awt.geom.Area;
  24. import org.rsbot.script.*;
  25. import org.rsbot.script.wrappers.*;
  26. import org.rsbot.event.events.*;
  27. import org.rsbot.script.methods.*;
  28. import java.awt.event.MouseMotionListener;
  29. import java.awt.image.BufferedImage;
  30. import java.net.MalformedURLException;
  31. import javax.swing.*;
  32. import javax.swing.event.*;
  33. import org.rsbot.script.methods.Game;
  34.  
  35.  
  36.  
  37.  
  38. @ScriptManifest(authors = "Munchkin", name = "Flaxer", version = 1, description = "Picks your flax at Seer's Village")
  39.  
  40.  
  41. public class FlaxerWithSpinning extends Script implements PaintListener, MessageListener, MouseListener {
  42.  
  43.         RSTile flaxArea = new RSTile(2740, 3449, 0);
  44.         RSTile bankArea = new RSTile(2726,3491,0);
  45.         RSTile house = new RSTile(2715, 3471, 0);
  46.         RSTile doorPath = new RSTile(2716, 3472, 0);
  47.         RSArea door = new RSArea (new RSTile(2716,3471,0), new RSTile(2715,3473,0));
  48.         int flaxID = 2646;
  49.         int boothID = 25808;
  50.         int animation = -1;
  51.     int ladderA = 25938;
  52.     int ladderB = 25939;
  53.         int spinnerID = 25824;
  54.         int profit;
  55.         int Flaxes = 0;
  56.         int doorclosedID = 25819;
  57.         long startTime;
  58.         int flaxprice = 1779;
  59.         int ItemPrice;
  60.        
  61.     private final Color color1 = new Color(195, 12, 62);
  62.     private final Color color2 = new Color(51, 102, 0);
  63.     private final Color color3 = new Color(0, 153, 153);
  64.     private final BasicStroke stroke1 = new BasicStroke(4);
  65.     private final Font font1 = new Font("Lucida Sans Unicode", 1, 25);
  66.     private final Image img1 = getImage("http://www.rune-tips.net/misc/images/flax.gif");
  67.     private final RenderingHints antialiasing = new RenderingHints(
  68.             RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  69.  
  70.     private static final Color MOUSE_COLOR = new Color(242, 240, 242),
  71.     MOUSE_BORDER_COLOR = new Color(132, 198, 99),
  72.     MOUSE_CENTER_COLOR = new Color(193, 4, 53);
  73. private boolean pressed = false;
  74. private int absoluteY = 0;
  75.  
  76. public int loop() {
  77.         AB.antiBanMethod();
  78.         if (AB.AFKTimer.isRunning()){return 200;}
  79.        
  80.         if(inventory.isFull() && !atBank()){
  81.                 Doorpath();
  82.                
  83.                 opendoorandclimb();
  84.                
  85.                 spinFlax();
  86.                
  87.                 downladder();
  88.                
  89.                 bankArea();
  90.         }
  91.         if(inventory.isFull() && atBank()){
  92.                 doBank();
  93.         }
  94.         if(!inventory.isFull() && atBank()){
  95.                 flaxArea();
  96.         }
  97.         if(!inventory.isFull() && atflax()){
  98.                 pickingFlax();
  99.         }
  100.        
  101.        
  102. return random(500,1000);
  103. }
  104. private void downladder(){
  105.         RSObject laddertopfloor = objects.getNearest(ladderB);
  106. laddertopfloor.doAction("Climb-down");
  107. }
  108.  
  109. private void climbladder(){
  110.         RSObject Ladderbottomfloor = objects.getNearest(ladderA);
  111. Ladderbottomfloor.doAction("Climb-up");
  112. }
  113.  
  114. public boolean DoorArea(){
  115.         RSArea door = new RSArea (new RSTile(2716,3471,0), new RSTile(2715,3473,0));
  116.         return door.contains(getMyPlayer().getLocation());        
  117. }
  118.  
  119.  
  120.  
  121. private void Doorpath(){
  122.         RSWeb webToBank = web.getWeb(getMyPlayer().getLocation(), doorPath);
  123.         webToBank.step();
  124. }
  125.  
  126. private void opendoorandclimb(){
  127. sleep(random(1200, 1500));
  128. RSObject DoorC = objects.getNearest(doorclosedID);
  129. if(DoorC != null && door.contains(players.getMyPlayer().getLocation())) {
  130.         DoorC.doAction("Open");
  131.         if(!players.getMyPlayer().isMoving()) {
  132.                 climbladder();
  133.         }
  134. }
  135. }    
  136.     private void spinFlax() {
  137.           if(inventory.contains(flaxID) && objects.getNearest(spinnerID).isOnScreen()){
  138.           RSObject SpinningWheel = objects.getNearest(36970);
  139.           if(calc.distanceTo(SpinningWheel) <= 2){
  140.            SpinningWheel.doClick();
  141.            int fail = 0;
  142.             while (fail++ < 10 && !interfaces.getComponent(905, 0).isValid())
  143.              sleep(200);
  144.            }
  145.           RSInterface spinningwheel = interfaces.get(905);
  146.            if(spinningwheel.isValid()){
  147.             RSComponent flax = interfaces.getComponent(905, 16);
  148.             flax.doClick();
  149.            }
  150.           Timer t = new Timer(3000);
  151.            while(t.isRunning()){
  152.             if(getMyPlayer().getAnimation() != -1){
  153.              t.reset();
  154.              if(interfaces.canContinue()){
  155.               interfaces.clickContinue();
  156.               }
  157.             }
  158.             sleep(100);
  159.            }
  160.           }
  161.           }
  162.    
  163.     private Image getImage(String url) {
  164.         try {
  165.             return ImageIO.read(new URL(url));
  166.         } catch(IOException e) {
  167.             return null;
  168.         }
  169.     }
  170.  
  171.     private void drawMouse(Graphics g) {
  172.         ((Graphics2D) g).setRenderingHints(new RenderingHints(
  173.                 RenderingHints.KEY_ANTIALIASING,
  174.                 RenderingHints.VALUE_ANTIALIAS_ON));
  175.         Point p = mouse.getLocation();
  176.         Graphics2D spinG = (Graphics2D) g.create();
  177.         Graphics2D spinGRev = (Graphics2D) g.create();
  178.         Graphics2D spinG2 = (Graphics2D) g.create();
  179.         spinG.setColor(MOUSE_BORDER_COLOR);
  180.         spinGRev.setColor(MOUSE_COLOR);
  181.         spinG.rotate(System.currentTimeMillis() % 2000d / 2000d * (360d) * 2
  182.                 * Math.PI / 180.0, p.x, p.y);
  183.         spinGRev.rotate(System.currentTimeMillis() % 2000d / 2000d * (-360d)
  184.                 * 2 * Math.PI / 180.0, p.x, p.y);
  185.         final int outerSize = 20;
  186.         final int innerSize = 12;
  187.         spinG.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_ROUND,
  188.                 BasicStroke.JOIN_ROUND));
  189.         spinGRev.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_ROUND,
  190.                 BasicStroke.JOIN_ROUND));
  191.         spinG.drawArc(p.x - (outerSize / 2), p.y - (outerSize / 2), outerSize,
  192.                 outerSize, 100, 75);
  193.         spinG.drawArc(p.x - (outerSize / 2), p.y - (outerSize / 2), outerSize,
  194.                 outerSize, -100, 75);
  195.         spinGRev.drawArc(p.x - (innerSize / 2), p.y - (innerSize / 2),
  196.                 innerSize, innerSize, 100, 75);
  197.         spinGRev.drawArc(p.x - (innerSize / 2), p.y - (innerSize / 2),
  198.                 innerSize, innerSize, -100, 75);
  199.         g.setColor(MOUSE_CENTER_COLOR);
  200.         g.fillOval(p.x, p.y, 2, 2);
  201.         spinG2.setColor(MOUSE_CENTER_COLOR);
  202.         spinG2.rotate(System.currentTimeMillis() % 2000d / 2000d * 360d
  203.                 * Math.PI / 180.0, p.x, p.y);
  204.         spinG2.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_ROUND,
  205.                 BasicStroke.JOIN_ROUND));
  206.         spinG2.drawLine(p.x - 5, p.y, p.x + 5, p.y);
  207.         spinG2.drawLine(p.x, p.y - 5, p.x, p.y + 5);
  208.     }
  209.    
  210.     public void onRepaint(Graphics g1) {
  211.        profit = Flaxes * ItemPrice;
  212.        
  213.        long millis = System.currentTimeMillis() - startTime;
  214.         long hours = millis / (1000 * 60 * 60);
  215.         millis -= hours * (1000 * 60 * 60);
  216.         long minuites = millis / (1000 * 60);
  217.         millis -= minuites * (1000 * 60);
  218.         long seconds = millis / 1000;
  219.          
  220.         Graphics2D g = (Graphics2D)g1;
  221.         g.setRenderingHints(antialiasing);
  222.  
  223.         g.setColor(color1);
  224.         g.fillRect(6, 345, 506, 113);
  225.         g.setColor(color2);
  226.         g.setStroke(stroke1);
  227.         g.drawRect(6, 345, 506, 113);
  228.         g.drawImage(img1, 381, 380, null);
  229.         g.drawImage(img1, 327, 370, null);
  230.         g.drawImage(img1, 419, 373, null);
  231.         g.drawImage(img1, 373, 352, null);
  232.         g.setFont(font1);
  233.         g.setColor(color3);
  234.         g.drawString("Munchkin's Flax Picker ", 7, 451);
  235.         g.drawString("Time Elapsed: " + hours + ":" + minuites + ":" + seconds, 20, 370);
  236.         g.drawString("Profit: " + profit, 23, 392);
  237.         if (AB.AFKTimer.isRunning()){
  238.  
  239.                         g.setColor(new Color(51, 51, 51, 150));
  240.                         g.fillRect(2, 1, 516, 336);
  241.                         g.setColor(new Color(255, 255, 255));
  242.                         g.drawRect(2, 1, 516, 336);
  243.                         g.setFont(new Font("Arial", 0, 12));
  244.                         g.drawString("Time Left in AFK: " + AB.AFKTimer.toRemainingString(), 147, 176);
  245.                 }
  246.    
  247.         drawMouse(g);
  248.     }
  249.  
  250.         private void bankArea() {
  251.         RSWeb webToBank = web.getWeb(getMyPlayer().getLocation(), bankArea);
  252.         webToBank.step();
  253. }
  254.  
  255. private void flaxArea(){
  256.         RSWeb webToMine = web.getWeb(getMyPlayer().getLocation(), flaxArea);
  257.     webToMine.step();  
  258. }
  259.         private void pickingFlax(){
  260.                 RSObject flax = objects.getNearest(flaxID);
  261.                 if (getMyPlayer().getAnimation() == animation) {
  262.                 flax.doAction("Pick");
  263.                          sleep(500, 1000);
  264.                          while (players.getMyPlayer().isMoving()) {
  265.                                         sleep(3500, 4000);
  266.                                  }
  267.                                  sleep(900, 1200);
  268.                
  269.                 }
  270.                 }
  271.        
  272.         private void doBank(){
  273.                        
  274.                 if(!bank.isOpen()) {
  275.                     bank.open();
  276.                     sleep(400, 500);
  277.                         }
  278.                 bank.depositAll();
  279.                 sleep(400, 500);
  280.             if(bank.isOpen())
  281.                 bank.close();
  282.             }
  283.        
  284.         private boolean atBank() {
  285.         RSObject bank = objects.getNearest(boothID);
  286.         if(bank != null) {
  287.             if (bank.isReachable()) {
  288.                 return true;
  289.             }
  290.         }
  291.         return false;
  292.     }
  293.        
  294.           private boolean atflax() {
  295.                 RSObject flax = objects.getNearest(flaxID);
  296.                 if(flax != null) {
  297.                     if(flax.isOnScreen()) {
  298.                         return true;
  299.                     }
  300.                 }
  301.                 return false;
  302.             }
  303.        
  304.         public boolean onStart(){
  305.                 AB.setVisible(true);
  306.                 while(AB.isVisible()){
  307.                         sleep(200);
  308.                 }
  309.                
  310.                 startTime = System.currentTimeMillis();
  311.                 ItemPrice = grandExchange.lookup(flaxprice).getGuidePrice();
  312.                
  313.                 log("Welcome to Munchkin's Flax picker");
  314.                 return true;
  315.         }
  316.  
  317.         public  AntiBan AB = new AntiBan();
  318.         class AntiBan extends JFrame {
  319.  
  320.         /*
  321.         @Author                 Joe Titus
  322.         @Date           5/8/2011
  323.         */
  324.                 public Timer antiBanTimer = new Timer(0);
  325.                 public  boolean customAB, AFK, Mouse, Camera, Tabs, LogOut, ABOn;
  326.                 public  int ABFreq;
  327.                
  328.                 public double ABFreqTime;
  329.                 Timer AFKTimer = new Timer (0);
  330.                 public void antiBanMethod(){
  331.                         if (ABOn){
  332.                                 if (!antiBanTimer.isRunning() && !AFKTimer.isRunning()){
  333.                                         antiBan();
  334.                                         antiBanTimer.setEndIn((int)random(ABFreqTime * .33, ABFreqTime * 1.66));
  335.                                 }
  336.                         }
  337.                 }
  338.  
  339.  
  340.  
  341.  
  342.                 public void antiBan(){
  343.                         int t = 0;
  344.                         if (Camera){t++;};
  345.                         if (Tabs){t++;};
  346.                         if (AFK){t++;};
  347.                         if (Mouse){t++;};
  348.                         t += 0;
  349.                         switch(random(1, t)){
  350.                         case 1:
  351.                                 if (Camera){
  352.                                         camera.turnTo(getMyPlayer().getLocation().randomize(5, 5), 5);
  353.                                         sleep(random(500, 750));
  354.                                         return;
  355.                                 }
  356.                         case 2:
  357.                                 if (Tabs){
  358.                                         switch(random(1, 4)){
  359.                                                 case 1:
  360.                                                 game.openTab(Game.TAB_FRIENDS);
  361.                                                 mouse.move((585+random(-35, 35)),  (330+random(-90, 90)));
  362.                                                 sleep(750, 3000);
  363.                                                 game.openTab(Game.TAB_INVENTORY);
  364.                                                 sleep(random(500, 750));
  365.                                                 return;
  366.                                                
  367.                                                 case 2:
  368.                                                 game.openTab(Game.TAB_CLAN);
  369.                                                 mouse.move((585+random(-35, 35)),  (330+random(-90, 90)));
  370.                                                 sleep(750, 1500);
  371.                                                 game.openTab(Game.TAB_INVENTORY);
  372.                                                 sleep(random(500, 750));
  373.                                                 return;
  374.  
  375.                                                 default:
  376.                                                 game.openTab(game.TAB_STATS);
  377.                                                 mouse.moveRandomly(random(1, 300));
  378.                                                 sleep(750, 1500);      
  379.                                                 game.openTab(Game.TAB_INVENTORY);
  380.                                                 sleep(random(500, 750));       
  381.                                                 return;
  382.                                         }
  383.                                 }
  384.                         case 3:                
  385.                                 if (AFK){
  386.                                         int r = random(1, 100);
  387.                                         if (r < 75){
  388.                                                 AFKTimer.setEndIn(random(3000, 5000));
  389.                                         } else if (r >= 70 && r < 90){
  390.                                                 AFKTimer.setEndIn(random(5000, 15000));
  391.                                         } else {
  392.                                                 AFKTimer.setEndIn(random(10000, 30000));
  393.                                         }
  394.                                         return;
  395.                                 }
  396.                         case 4:
  397.                                 if (Mouse){
  398.                                         int s = random(1, 4);
  399.                                         switch(s){
  400.                                         case 1:
  401.                                                 mouse.moveOffScreen();
  402.                                                 sleep(750, 1500);
  403.                                                 return;
  404.                                         case 2:
  405.                                                 mouse.moveSlightly();
  406.                                                 sleep(500, 1000);
  407.                                                 return;
  408.                                         case 3:
  409.                                                 mouse.moveRandomly(random(1, 300));
  410.                                                 sleep(750, 1500);
  411.                                                 return;
  412.                                         default:
  413.                                                 return;
  414.                                         }
  415.  
  416.                                 }
  417.                         default:
  418.                                 return;
  419.                         }
  420.                 }
  421.                 public void setEnabled(boolean a, boolean b, boolean c, boolean d,
  422.                                 boolean e, boolean f, boolean g, boolean h,
  423.                                 boolean i, boolean j, boolean k, boolean l){
  424.  
  425.                         ABFreqSlider.setEnabled(a);
  426.                         ABOnOff.setEnabled(b);
  427.                         customAntiBanButton.setEnabled(c);
  428.                         ABLevelOptions.setEnabled(d);
  429.                         separator1.setEnabled(e);
  430.                         ABFreqLabel.setEnabled(f);
  431.                         AFKCheck.setEnabled(g);
  432.                         mouseMoveCheck.setEnabled(h);
  433.                         camMoveCheck.setEnabled(i);
  434.                         logOutCheck.setEnabled(j);
  435.                         openTabsCheck.setEnabled(k);
  436.                         ABLevelLabel.setEnabled(l);
  437.  
  438.                 }
  439.  
  440.                 public void getSettings(){
  441.                         if (!ABOnOff.isSelected()){
  442.                                 ABOn = true;
  443.                                 if (customAntiBanButton.isSelected()){
  444.                                         customAB = true;
  445.                                         ABFreq = ABFreqSlider.getValue();
  446.                                         AFK = AFKCheck.isSelected();
  447.                                         Mouse = mouseMoveCheck.isSelected();
  448.                                         Camera = camMoveCheck.isSelected();
  449.                                         Tabs = openTabsCheck.isSelected();
  450.                                         LogOut = logOutCheck.isSelected();
  451.                                 } else {
  452.                                         customAB = false;
  453.                                         if (ABLevelOptions.getSelectedItem().toString().contains("Low")) {
  454.                                                 ABFreq = 20;
  455.                                                 LogOut = true;
  456.                                                 Camera = true;
  457.                                                 Mouse = true;
  458.  
  459.                                         } else if (ABLevelOptions.getSelectedItem().toString().contains("Medium")) {
  460.                                                 ABFreq = 40;
  461.                                                 Mouse = true;
  462.                                                 LogOut = true;
  463.                                                 Camera = true;
  464.                                                 AFK = true;
  465.  
  466.                                         } else if (ABLevelOptions.getSelectedItem().toString().contains("High")) {
  467.                                                 ABFreq = 60;
  468.                                                 LogOut = true;
  469.                                                 Camera = true;
  470.                                                 Tabs = true;
  471.                                                 AFK = true;
  472.                                                 Mouse = true;
  473.                                         }
  474.                                 }
  475.                                 log("AntiBan on");
  476.                                 ABFreqTime = ((double)(240 / ABFreq) * 15000);
  477.                                 antiBanTimer = new Timer ((int)random(ABFreqTime * .5, ABFreqTime * 1.5));
  478.                         } else {
  479.                                 log("AntiBan off");
  480.                                 ABOn = false;
  481.                         }
  482.  
  483.                 }
  484.                 public void ABToggle(){
  485.                         if ((ABOnOff.isSelected())){
  486.                                 setEnabled(false, true, false, false, false, false, false, false, false, false, false, false);
  487.                         } else {
  488.                                 if (customAntiBanButton.isSelected()){
  489.                                         setEnabled(true, true, true, false, true, true, true, true, true, false, true, false);
  490.                                 } else {
  491.                                         setEnabled(false, true, true, true, true, false, false, false, false, false, false, true);
  492.                                 }
  493.                         }
  494.                 }
  495.                 public void cantCont(){
  496.                         if ((customAntiBanButton.isSelected() && !AFKCheck.isSelected() && !mouseMoveCheck.isSelected()
  497.                                         && !camMoveCheck.isSelected() && !openTabsCheck.isSelected()) || ABFreqSlider.getValue() == 0){
  498.                                 contButton.setEnabled(false);
  499.                         } else {
  500.                                 contButton.setEnabled(true);
  501.                         }
  502.                 }
  503.  
  504.                 public AntiBan() {
  505.                         initComponents();
  506.                 }
  507.  
  508.                 private void ABFreqSliderStateChanged(ChangeEvent e) {
  509.                         cantCont();
  510.                 }
  511.  
  512.                 private void ABOnOffStateChanged(ChangeEvent e) {
  513.                         ABOnOff.setToolTipText("The AntiBan is currently: " + content());
  514.                         ABOnOff.setText("Turn AntiBan " + OPcontent());
  515.                         ABToggle();
  516.                         cantCont();
  517.                 }
  518.  
  519.                 private void customAntiBanButtonStateChanged(ChangeEvent e) {
  520.                         ABToggle();
  521.                         cantCont();
  522.                 }
  523.  
  524.                 private void AFKCheckStateChanged(ChangeEvent e) {
  525.                         cantCont();
  526.                 }
  527.  
  528.                 private void mouseMoveCheckStateChanged(ChangeEvent e) {
  529.                         cantCont();
  530.                 }
  531.  
  532.                 private void camMoveCheckStateChanged(ChangeEvent e) {
  533.                         cantCont();
  534.                 }
  535.  
  536.                 private void logOutCheckStateChanged(ChangeEvent e) {
  537.                         cantCont();
  538.                 }
  539.  
  540.                 private void openTabsCheckStateChanged(ChangeEvent e) {
  541.                         cantCont();
  542.                 }
  543.  
  544.                 private void contButtonActionPerformed(ActionEvent e) {
  545.                         getSettings();
  546.                         setVisible(false);
  547.                 }
  548.  
  549.  
  550.                 String content(){
  551.                         if (ABOnOff.isSelected()){
  552.                                 return "OFF";
  553.                         } else {
  554.                                 return "ON";
  555.                         }
  556.                 }
  557.                 String OPcontent(){
  558.                         if (!ABOnOff.isSelected()){
  559.                                 return "OFF";
  560.                         } else {
  561.                                 return "ON";
  562.                         }
  563.                 }
  564.                 private void initComponents() {
  565.                         ABFreqSlider = new JSlider();
  566.                         ABOnOff = new JToggleButton();
  567.                         customAntiBanButton = new JRadioButton();
  568.                         ABLevelOptions = new JComboBox();
  569.                         separator1 = new JSeparator();
  570.                         ABFreqLabel = new JLabel();
  571.                         AFKCheck = new JRadioButton();
  572.                         mouseMoveCheck = new JRadioButton();
  573.                         camMoveCheck = new JRadioButton();
  574.                         logOutCheck = new JRadioButton();
  575.                         openTabsCheck = new JRadioButton();
  576.                         ABLevelLabel = new JLabel();
  577.                         contButton = new JButton();
  578.  
  579.                         addWindowListener(new WindowAdapter() {
  580.                                 public void windowClosing(WindowEvent e) {
  581.                                         stopScript();
  582.                                 }
  583.                         });
  584.                         //======== this ========
  585.                         setTitle("AntiBan");
  586.                         Container contentPane = getContentPane();
  587.                         //---- ABFreqSlider ----
  588.                         ABFreqSlider.setMajorTickSpacing(40);
  589.                         ABFreqSlider.setSnapToTicks(true);
  590.                         ABFreqSlider.setPaintTicks(true);
  591.                         ABFreqSlider.setBackground(new Color(238, 238, 238));
  592.                         ABFreqSlider.setEnabled(false);
  593.                         ABFreqSlider.setPaintLabels(true);
  594.                         ABFreqSlider.setMinorTickSpacing(8);
  595.                         ABFreqSlider.setMaximum(240);
  596.                         ABFreqSlider.setValue(60);
  597.                         ABFreqSlider.setToolTipText("Allows you to select the average amount of AntiBans per hour");
  598.                         ABFreqSlider.addChangeListener(new ChangeListener() {
  599.                                 @Override
  600.                                 public void stateChanged(ChangeEvent e) {
  601.                                         ABFreqSliderStateChanged(e);
  602.                                 }
  603.                         });
  604.  
  605.                         //---- ABOnOff ----
  606.                         ABOnOff.setText("Turn AntiBan Off");
  607.  
  608.                         ABOnOff.setToolTipText("The AntiBan is currently: ON");
  609.                         ABOnOff.addChangeListener(new ChangeListener() {
  610.                                 @Override
  611.                                 public void stateChanged(ChangeEvent e) {
  612.                                         ABOnOffStateChanged(e);
  613.                                 }
  614.                         });
  615.  
  616.                         //---- customAntiBanButton ----
  617.                         customAntiBanButton.setText("Custumized AntiBan");
  618.                         customAntiBanButton.setToolTipText("Enables you to customize your AntiBan");
  619.                         customAntiBanButton.addChangeListener(new ChangeListener() {
  620.                                 @Override
  621.                                 public void stateChanged(ChangeEvent e) {
  622.                                         customAntiBanButtonStateChanged(e);
  623.                                 }
  624.                         });
  625.  
  626.                         //---- ABLevelOptions ----
  627.                         ABLevelOptions.setModel(new DefaultComboBoxModel(new String[] {
  628.                                         "Low",
  629.                                         "Medium",
  630.                                         "High"
  631.                         }));
  632.                         ABLevelOptions.setSelectedIndex(2);
  633.                         ABLevelOptions.setToolTipText("Selects the level of AntiBan");
  634.                         //---- separator1 ----
  635.                         separator1.setForeground(new Color(100, 100, 100));
  636.                         //---- ABFreqLabel ----
  637.                         ABFreqLabel.setText("Avg. AntiBans P/H");
  638.                         ABFreqLabel.setToolTipText("Average. AntiBans per hour");
  639.                         ABFreqLabel.setEnabled(false);
  640.  
  641.                         //---- AFKCheck ----
  642.                         AFKCheck.setText("AFK's");
  643.                         AFKCheck.setEnabled(false);
  644.                         AFKCheck.setToolTipText("If checked, the AntiBan will perform AFK's");
  645.                         AFKCheck.addChangeListener(new ChangeListener() {
  646.                                 @Override
  647.                                 public void stateChanged(ChangeEvent e) {
  648.                                         AFKCheckStateChanged(e);
  649.                                 }
  650.                         });
  651.  
  652.                         //---- mouseMoveCheck ----
  653.                         mouseMoveCheck.setText("Mouse MoveMents");
  654.                         mouseMoveCheck.setEnabled(false);
  655.                         mouseMoveCheck.setToolTipText("If checked, the AntiBan will move the mouse");
  656.                         mouseMoveCheck.addChangeListener(new ChangeListener() {
  657.                                 @Override
  658.                                 public void stateChanged(ChangeEvent e) {
  659.                                         mouseMoveCheckStateChanged(e);
  660.                                 }
  661.                         });
  662.  
  663.                         //---- camMoveCheck ----
  664.                         camMoveCheck.setText("Camera Movements");
  665.                         camMoveCheck.setEnabled(false);
  666.                         camMoveCheck.setToolTipText("If checked, the AntiBan will move the camera");
  667.                         camMoveCheck.addChangeListener(new ChangeListener() {
  668.                                 @Override
  669.                                 public void stateChanged(ChangeEvent e) {
  670.                                         camMoveCheckStateChanged(e);
  671.                                 }
  672.                         });
  673.  
  674.                         //---- logOutCheck ----
  675.                         logOutCheck.setText("Log Out if Innactive");
  676.                         logOutCheck.setEnabled(false);
  677.                         logOutCheck.setVisible(false);
  678.                         logOutCheck.setToolTipText("Currently under construction");
  679.                         logOutCheck.addChangeListener(new ChangeListener() {
  680.                                 @Override
  681.                                 public void stateChanged(ChangeEvent e) {
  682.                                         logOutCheckStateChanged(e);
  683.                                 }
  684.                         });
  685.  
  686.                         //---- openTabsCheck ----
  687.                         openTabsCheck.setText("Open Tabs");
  688.                         openTabsCheck.setEnabled(false);
  689.                         openTabsCheck.setToolTipText("If checked, the AntiBan will open your friends list tab");
  690.                         openTabsCheck.addChangeListener(new ChangeListener() {
  691.                                 @Override
  692.                                 public void stateChanged(ChangeEvent e) {
  693.                                         openTabsCheckStateChanged(e);
  694.                                 }
  695.                         });
  696.  
  697.                         //---- ABLevelLabel ----
  698.                         ABLevelLabel.setText("AntiBan Level");
  699.                         ABLevelLabel.setToolTipText("AntiBan Level");
  700.  
  701.                         //---- contButton ----
  702.                         contButton.setText("Continue");
  703.                         contButton.setToolTipText("Starts the Script");
  704.                         contButton.addActionListener(new ActionListener() {
  705.                                 @Override
  706.                                 public void actionPerformed(ActionEvent e) {
  707.                                         contButtonActionPerformed(e);
  708.                                 }
  709.                         });
  710.  
  711.                         GroupLayout contentPaneLayout = new GroupLayout(contentPane);
  712.                         contentPane.setLayout(contentPaneLayout);
  713.                         contentPaneLayout.setHorizontalGroup(
  714.                                         contentPaneLayout.createParallelGroup()
  715.                                         .addGroup(contentPaneLayout.createSequentialGroup()
  716.                                                         .addGroup(contentPaneLayout.createParallelGroup()
  717.                                                                         .addGroup(contentPaneLayout.createSequentialGroup()
  718.                                                                                         .addGap(102, 102, 102)
  719.                                                                                         .addComponent(ABOnOff, GroupLayout.PREFERRED_SIZE, 182, GroupLayout.PREFERRED_SIZE))
  720.                                                                                         .addGroup(contentPaneLayout.createSequentialGroup()
  721.                                                                                                         .addContainerGap()
  722.                                                                                                         .addGroup(contentPaneLayout.createParallelGroup()
  723.                                                                                                                         .addGroup(contentPaneLayout.createSequentialGroup()
  724.                                                                                                                                         .addComponent(ABFreqLabel)
  725.                                                                                                                                         .addGap(12, 12, 12)
  726.                                                                                                                                         .addComponent(ABFreqSlider, GroupLayout.PREFERRED_SIZE, 260, GroupLayout.PREFERRED_SIZE))
  727.                                                                                                                                         .addGroup(GroupLayout.Alignment.TRAILING, contentPaneLayout.createSequentialGroup()
  728.                                                                                                                                                         .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  729.                                                                                                                                                                         .addComponent(ABLevelLabel)
  730.                                                                                                                                                                         .addComponent(customAntiBanButton, GroupLayout.PREFERRED_SIZE, 159, GroupLayout.PREFERRED_SIZE))
  731.                                                                                                                                                                         .addGroup(contentPaneLayout.createParallelGroup()
  732.                                                                                                                                                                                         .addGroup(contentPaneLayout.createSequentialGroup()
  733.                                                                                                                                                                                                         .addGap(18, 18, 18)
  734.                                                                                                                                                                                                         .addComponent(separator1, GroupLayout.PREFERRED_SIZE, 164, GroupLayout.PREFERRED_SIZE))
  735.                                                                                                                                                                                                         .addGroup(contentPaneLayout.createSequentialGroup()
  736.                                                                                                                                                                                                                         .addGap(27, 27, 27)
  737.                                                                                                                                                                                                                         .addComponent(ABLevelOptions, GroupLayout.PREFERRED_SIZE, 140, GroupLayout.PREFERRED_SIZE)))
  738.                                                                                                                                                                                                                         .addGap(96, 96, 96))))
  739.                                                                                                                                                                                                                         .addGroup(contentPaneLayout.createSequentialGroup()
  740.                                                                                                                                                                                                                                         .addGap(20, 20, 20)
  741.                                                                                                                                                                                                                                         .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.TRAILING, false)
  742.                                                                                                                                                                                                                                                         .addGroup(contentPaneLayout.createSequentialGroup()
  743.                                                                                                                                                                                                                                                                         .addComponent(mouseMoveCheck)
  744.                                                                                                                                                                                                                                                                         .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  745.                                                                                                                                                                                                                                                                         .addComponent(logOutCheck))
  746.                                                                                                                                                                                                                                                                         .addGroup(contentPaneLayout.createSequentialGroup()
  747.                                                                                                                                                                                                                                                                                         .addComponent(openTabsCheck)
  748.                                                                                                                                                                                                                                                                                         .addGap(18, 18, 18)
  749.                                                                                                                                                                                                                                                                                         .addComponent(AFKCheck)
  750.                                                                                                                                                                                                                                                                                         .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
  751.                                                                                                                                                                                                                                                                                         .addComponent(camMoveCheck))))
  752.                                                                                                                                                                                                                                                                                         .addGroup(contentPaneLayout.createSequentialGroup()
  753.                                                                                                                                                                                                                                                                                                         .addGap(109, 109, 109)
  754.                                                                                                                                                                                                                                                                                                         .addComponent(contButton, GroupLayout.PREFERRED_SIZE, 167, GroupLayout.PREFERRED_SIZE)))
  755.                                                                                                                                                                                                                                                                                                         .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  756.                         );
  757.                         contentPaneLayout.setVerticalGroup(
  758.                                         contentPaneLayout.createParallelGroup()
  759.                                         .addGroup(contentPaneLayout.createSequentialGroup()
  760.                                                         .addGap(10, 10, 10)
  761.                                                         .addComponent(ABOnOff)
  762.                                                         .addGap(18, 18, 18)
  763.                                                         .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  764.                                                                         .addComponent(ABLevelLabel)
  765.                                                                         .addComponent(ABLevelOptions, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
  766.                                                                         .addGroup(contentPaneLayout.createParallelGroup()
  767.                                                                                         .addGroup(contentPaneLayout.createSequentialGroup()
  768.                                                                                                         .addGap(18, 18, 18)
  769.                                                                                                         .addComponent(customAntiBanButton, GroupLayout.PREFERRED_SIZE, 44, GroupLayout.PREFERRED_SIZE))
  770.                                                                                                         .addGroup(contentPaneLayout.createSequentialGroup()
  771.                                                                                                                         .addGap(35, 35, 35)
  772.                                                                                                                         .addComponent(separator1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
  773.                                                                                                                         .addGroup(contentPaneLayout.createParallelGroup()
  774.                                                                                                                                         .addGroup(contentPaneLayout.createSequentialGroup()
  775.                                                                                                                                                         .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  776.                                                                                                                                                         .addComponent(ABFreqSlider, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
  777.                                                                                                                                                         .addGroup(contentPaneLayout.createSequentialGroup()
  778.                                                                                                                                                                         .addGap(26, 26, 26)
  779.                                                                                                                                                                         .addComponent(ABFreqLabel)))
  780.                                                                                                                                                                         .addGap(15, 15, 15)
  781.                                                                                                                                                                         .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  782.                                                                                                                                                                                         .addComponent(openTabsCheck)
  783.                                                                                                                                                                                         .addComponent(AFKCheck)
  784.                                                                                                                                                                                         .addComponent(camMoveCheck))
  785.                                                                                                                                                                                         .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
  786.                                                                                                                                                                                         .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  787.                                                                                                                                                                                                         .addComponent(logOutCheck)
  788.                                                                                                                                                                                                         .addComponent(mouseMoveCheck))
  789.                                                                                                                                                                                                         .addGap(18, 18, 18)
  790.                                                                                                                                                                                                         .addComponent(contButton)
  791.                                                                                                                                                                                                         .addContainerGap(12, Short.MAX_VALUE))
  792.                         );
  793.                         pack();
  794.                         setLocationRelativeTo(getOwner());
  795.                         // JFormDesigner - End of component initialization  //GEN-END:initComponents
  796.                 }
  797.  
  798.                 // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
  799.                 // Generated using JFormDesigner Evaluation license - Joe Titus
  800.                 private JSlider ABFreqSlider;
  801.                 private JToggleButton ABOnOff;
  802.                 private JRadioButton customAntiBanButton;
  803.                 private JComboBox ABLevelOptions;
  804.                 private JSeparator separator1;
  805.                 private JLabel ABFreqLabel;
  806.                 private JRadioButton AFKCheck;
  807.                 private JRadioButton mouseMoveCheck;
  808.                 private JRadioButton camMoveCheck;
  809.                 private JRadioButton logOutCheck;
  810.                 private JRadioButton openTabsCheck;
  811.                 private JLabel ABLevelLabel;
  812.                 private JButton contButton;
  813.                 // JFormDesigner - End of variables declaration  //GEN-END:variables
  814.  
  815.         }
  816.                
  817.  
  818.  
  819.         public void onFinish(){
  820.         log("Good Bye");
  821.         }
  822.  
  823. @Override
  824. public void messageReceived(MessageEvent e) {
  825.           String txt = e.getMessage();
  826.             if (txt.contains("You pick some"))
  827.                 Flaxes++;
  828.        
  829. }
  830.  
  831. @Override
  832. public void mouseClicked(MouseEvent e) {
  833.  
  834.        
  835. }
  836.  
  837. @Override
  838. public void mousePressed(MouseEvent e) {
  839.  
  840.        
  841. }
  842.  
  843. @Override
  844. public void mouseReleased(MouseEvent e) {
  845.  
  846.        
  847. }
  848.  
  849. @Override
  850. public void mouseEntered(MouseEvent e) {
  851.        
  852. }
  853.  
  854. @Override
  855. public void mouseExited(MouseEvent e) {
  856.  
  857. }
  858. }