Advertisement
Guest User

Untitled

a guest
Aug 10th, 2017
494
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 20.39 KB | None | 0 0
  1. import java.awt.*;
  2. import java.awt.event.KeyEvent;
  3. import java.util.ArrayList;
  4.  
  5. import org.rsbot.event.listeners.PaintListener;
  6. import org.rsbot.script.*;
  7. import org.rsbot.script.util.Timer;
  8. import org.rsbot.script.wrappers.*;
  9.  
  10. @ScriptManifest(authors = "Iscream", name = "ISQuickFish", version = 1.00, keywords = "Fishing")
  11. public class ISQuickFish extends Script implements PaintListener {
  12.  
  13.     private long scriptStartTIME = -1,runTime = 0;
  14.     private static final int Net = 303, FishSpot = 327;
  15.     private int i = 0;
  16.     private boolean inRandom = true;
  17.     private ArrayList<String> AccountList = new ArrayList<String>();
  18.     private ArrayList<String> RandomList = new ArrayList<String>();
  19.     private String Password;
  20.     private LBot Login = new LBot();
  21.     private ISGUI ISGUI = new ISGUI();
  22.     private Timer randomTime;
  23.     private class ISGUI extends javax.swing.JFrame {
  24.         private static final long serialVersionUID = -3358771461877565153L;
  25.  
  26.         public ISGUI() {
  27.             initComponents();
  28.         }
  29.         private void initComponents() {
  30.  
  31.             Title = new javax.swing.JLabel();
  32.             jScrollPane1 = new javax.swing.JScrollPane();
  33.             TextArea = new javax.swing.JTextArea();
  34.             StartButton = new javax.swing.JButton();
  35.             CancelButton = new javax.swing.JButton();
  36.             MessageField = new javax.swing.JTextField();
  37.             jComboBox1 = new javax.swing.JComboBox();
  38.             jLabel1 = new javax.swing.JLabel();
  39.  
  40.             setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  41.  
  42.             Title.setText("Randoms are Friends");
  43.  
  44.             TextArea.setColumns(20);
  45.             TextArea.setRows(5);
  46.             TextArea.setText("Erase All of This Text and Input the  \n usernames you would like botted.\n\nPlace Commas between Usernames.\nExample : Username1@gmail.com,Username2@gmail.com");
  47.             jScrollPane1.setViewportView(TextArea);
  48.  
  49.             StartButton.setText("Start");
  50.             StartButton.addActionListener(new java.awt.event.ActionListener() {
  51.                 public void actionPerformed(java.awt.event.ActionEvent evt) {
  52.                     StartButtonActionPerformed(evt);
  53.                 }
  54.             });
  55.  
  56.             CancelButton.setText("Cancel");
  57.             CancelButton.addActionListener(new java.awt.event.ActionListener() {
  58.                 public void actionPerformed(java.awt.event.ActionEvent evt) {
  59.                     CancelButtonActionPerformed(evt);
  60.                 }
  61.             });
  62.  
  63.             MessageField.setText("Input Universal Password for all Accounts");
  64.  
  65.             jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Default", "Fast", "Faster", "Fastest" }));
  66.             jComboBox1.addActionListener(new java.awt.event.ActionListener() {
  67.                 public void actionPerformed(java.awt.event.ActionEvent evt) {
  68.                     jComboBox1ActionPerformed(evt);
  69.                 }
  70.             });
  71.  
  72.             jLabel1.setText("Mouse Speed");
  73.  
  74.             javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  75.             getContentPane().setLayout(layout);
  76.             layout.setHorizontalGroup(
  77.                     layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  78.                     .addGroup(layout.createSequentialGroup()
  79.                             .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  80.                                     .addGroup(layout.createSequentialGroup()
  81.                                             .addGap(128, 128, 128)
  82.                                             .addComponent(Title))
  83.                                             .addGroup(layout.createSequentialGroup()
  84.                                                     .addContainerGap()
  85.                                                     .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  86.                                                             .addGroup(layout.createSequentialGroup()
  87.                                                                     .addComponent(StartButton)
  88.                                                                     .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 254, Short.MAX_VALUE)
  89.                                                                     .addComponent(CancelButton))
  90.                                                                     .addComponent(MessageField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)
  91.                                                                     .addGroup(layout.createSequentialGroup()
  92.                                                                             .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE)
  93.                                                                             .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  94.                                                                             .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  95.                                                                                     .addComponent(jComboBox1, 0, 95, Short.MAX_VALUE)
  96.                                                                                     .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
  97.                                                                                             .addComponent(jLabel1)
  98.                                                                                             .addGap(11, 11, 11)))))))
  99.                                                                                             .addContainerGap())
  100.             );
  101.             layout.setVerticalGroup(
  102.                     layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  103.                     .addGroup(layout.createSequentialGroup()
  104.                             .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  105.                                     .addGroup(layout.createSequentialGroup()
  106.                                             .addContainerGap()
  107.                                             .addComponent(Title)
  108.                                             .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  109.                                             .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))
  110.                                             .addGroup(layout.createSequentialGroup()
  111.                                                     .addGap(27, 27, 27)
  112.                                                     .addComponent(jLabel1)
  113.                                                     .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  114.                                                     .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
  115.                                                     .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  116.                                                     .addComponent(MessageField, javax.swing.GroupLayout.DEFAULT_SIZE, 53, Short.MAX_VALUE)
  117.                                                     .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  118.                                                     .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  119.                                                             .addComponent(StartButton)
  120.                                                             .addComponent(CancelButton))
  121.                                                             .addContainerGap())
  122.             );
  123.  
  124.             pack();
  125.         }
  126.  
  127.         private void StartButtonActionPerformed(java.awt.event.ActionEvent evt) {
  128.             for (String s : TextArea.getText().split(",")) {
  129.                 AccountList.add(s);
  130.             }
  131.             Password = MessageField.getText();
  132.             ISGUI.dispose();
  133.         }
  134.  
  135.         private void CancelButtonActionPerformed(java.awt.event.ActionEvent evt) {
  136.             log.severe("Failed To Startup - User Cancelled");
  137.             stopScript();
  138.             ISGUI.dispose();
  139.         }
  140.         private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {
  141.             if (jComboBox1.getSelectedIndex() == 1) {
  142.                 mouse.setSpeed(6);
  143.             }
  144.             if (jComboBox1.getSelectedIndex() == 2) {
  145.                 mouse.setSpeed(4);
  146.             }
  147.             if (jComboBox1.getSelectedIndex() == 3) {
  148.                 mouse.setSpeed(2);
  149.             }
  150.         }
  151.  
  152.         private javax.swing.JButton CancelButton;
  153.         private javax.swing.JTextField MessageField;
  154.         private javax.swing.JButton StartButton;
  155.         private javax.swing.JTextArea TextArea;
  156.         private javax.swing.JLabel Title;
  157.         private javax.swing.JComboBox jComboBox1;
  158.         private javax.swing.JLabel jLabel1;
  159.         private javax.swing.JScrollPane jScrollPane1;
  160.  
  161.     }
  162.  
  163.     private class LBot {
  164.  
  165.         private static final int INTERFACE_MAIN = 905;
  166.         private static final int INTERFACE_MAIN_CHILD = 59;
  167.         private static final int INTERFACE_MAIN_CHILD_COMPONENT_ID = 4;
  168.         private static final int INTERFACE_LOGIN_SCREEN = 596;
  169.         private static final int INTERFACE_USERNAME = 65;
  170.         private static final int INTERFACE_USERNAME_WINDOW = 37;
  171.         private static final int INTERFACE_PASSWORD = 71;
  172.         private static final int INTERFACE_PASSWORD_WINDOW = 39;
  173.         private static final int INTERFACE_BUTTON_LOGIN = 42;
  174.         private static final int INTERFACE_TEXT_RETURN = 11;
  175.         private static final int INTERFACE_BUTTON_BACK = 60;
  176.         private static final int INTERFACE_WELCOME_SCREEN = 906;
  177.         private static final int INTERFACE_WELCOME_SCREEN_BUTTON_PLAY_1 = 160;
  178.         private static final int INTERFACE_WELCOME_SCREEN_BUTTON_PLAY_2 = 171;
  179.         private static final int INTERFACE_WELCOME_SCREEN_TEXT_RETURN = 221;
  180.         private static final int INTERFACE_WELCOME_SCREEN_BUTTON_BACK = 228;
  181.         private static final int INTERFACE_WELCOME_SCREEN_HIGH_RISK_WORLD_TEXT = 86;
  182.         private static final int INTERFACE_WELCOME_SCREEN_HIGH_RISK_WORLD_LOGIN_BUTTON = 93;
  183.         private static final int INTERFACE_GRAPHICS_NOTICE = 976;
  184.         private static final int INTERFACE_GRAPHICS_LEAVE_ALONE = 6;
  185.  
  186.         private static final int INDEX_LOGGED_OUT = 3;
  187.         private static final int INDEX_LOBBY = 7;
  188.  
  189.         private int invalidCount, worldFullCount;
  190.  
  191.         public void login(String User, String pass) {
  192.  
  193.  
  194.             String username = User.replaceAll("_", " ").toLowerCase().trim();
  195.             String returnText = interfaces.get(INTERFACE_LOGIN_SCREEN)
  196.             .getComponent(INTERFACE_TEXT_RETURN).getText().toLowerCase();
  197.             int textlength;
  198.             if (game.getClientState() != INDEX_LOGGED_OUT) {
  199.                 if (!game.isWelcomeScreen()) {
  200.                     sleep(random(1000, 2000));
  201.                 }
  202.                 if (game.getClientState() == INDEX_LOBBY) {
  203.                     RSInterface welcome_screen = interfaces
  204.                     .get(INTERFACE_WELCOME_SCREEN);
  205.                     RSComponent welcome_screen_button_play_1 = welcome_screen
  206.                     .getComponent(INTERFACE_WELCOME_SCREEN_BUTTON_PLAY_1);
  207.                     RSComponent welcome_screen_button_play_2 = welcome_screen
  208.                     .getComponent(INTERFACE_WELCOME_SCREEN_BUTTON_PLAY_2);
  209.  
  210.                     mouse.click(welcome_screen_button_play_1.getAbsoluteX(),
  211.                             welcome_screen_button_play_1.getAbsoluteY(),
  212.                             welcome_screen_button_play_2.getAbsoluteX()
  213.                             + welcome_screen_button_play_2.getWidth()
  214.                             - welcome_screen_button_play_1.getAbsoluteX(),
  215.                             welcome_screen_button_play_1.getHeight(), true);
  216.  
  217.                     for (int i = 0; i < 4 && game.getClientState() == 6; i++) {
  218.                         sleep(500);
  219.                     }
  220.                     returnText = interfaces.get(INTERFACE_WELCOME_SCREEN)
  221.                     .getComponent(INTERFACE_WELCOME_SCREEN_TEXT_RETURN)
  222.                     .getText().toLowerCase();
  223.  
  224.                     if (returnText.contains("login limit exceeded")) {
  225.                         if(interfaces.getComponent(INTERFACE_WELCOME_SCREEN_BUTTON_BACK).isValid())
  226.                             interfaces.getComponent(INTERFACE_WELCOME_SCREEN_BUTTON_BACK).doClick();
  227.                     }
  228.  
  229.                     if (returnText.contains("your account has not logged out")) {
  230.                         if (invalidCount > 10) {
  231.                             log.warning("Unable to login after 10 attempts. Stopping script.");
  232.                             log.severe("It seems you are actually already logged in?");
  233.                             stopScript(false);
  234.                         }
  235.                         invalidCount++;
  236.                         log.severe("Waiting for logout..");
  237.                         sleep(5000,15000);
  238.                     }
  239.  
  240.                     if (returnText.contains("member")) {
  241.                         log("Unable to login to a members world. Stopping script.");
  242.                         RSComponent back_button1 = interfaces.get(
  243.                                 INTERFACE_WELCOME_SCREEN).getComponent(228);
  244.                         RSComponent back_button2 = interfaces.get(
  245.                                 INTERFACE_WELCOME_SCREEN).getComponent(231);
  246.                         mouse.click(
  247.                                 back_button1.getAbsoluteX(),
  248.                                 back_button1.getAbsoluteY(),
  249.                                 back_button2.getAbsoluteX()
  250.                                 + back_button2.getWidth()
  251.                                 - back_button1.getAbsoluteX(),
  252.                                 back_button1.getHeight(), true);
  253.                         interfaces.get(INTERFACE_WELCOME_SCREEN).getComponent(203)
  254.                         .doClick();
  255.                         stopScript(false);
  256.                     }
  257.  
  258.                     if (interfaces
  259.                             .get(INTERFACE_WELCOME_SCREEN)
  260.                             .getComponent(
  261.                                     INTERFACE_WELCOME_SCREEN_HIGH_RISK_WORLD_TEXT)
  262.                                     .getText().toLowerCase().trim()
  263.                                     .contains("high-risk wilderness world")) {
  264.                         interfaces
  265.                         .get(INTERFACE_WELCOME_SCREEN)
  266.                         .getComponent(
  267.                                 INTERFACE_WELCOME_SCREEN_HIGH_RISK_WORLD_LOGIN_BUTTON)
  268.                                 .doClick();
  269.                     }
  270.                 }
  271.             }
  272.             if (!game.isLoggedIn()) {
  273.                 if(interfaces.get(INTERFACE_LOGIN_SCREEN).getComponent(INTERFACE_BUTTON_BACK).isValid())
  274.                     interfaces.get(INTERFACE_LOGIN_SCREEN).getComponent(INTERFACE_BUTTON_BACK).doClick();
  275.                 if (returnText.contains("no reply from login server")) {
  276.                     if (invalidCount > 10) {
  277.                         log.warning("Unable to login after 10 attempts. Stopping script.");
  278.                         log.severe("It seems the login server is down.");
  279.                         stopScript(false);
  280.                     }
  281.                     invalidCount++;
  282.                 }
  283.                 if (returnText.contains("update")) {
  284.                     log("Runescape has been updated, please reload RSBot.");
  285.                     stopScript(false);
  286.                 }
  287.                 if (returnText.contains("disable")) {
  288.                     log.severe("Your account is banned/disabled.");
  289.                     stopScript(false);
  290.                 }
  291.                 if (returnText.contains("your account has not logged out")) {
  292.                     if (invalidCount > 10) {
  293.                         log.warning("Unable to login after 10 attempts. Stopping script.");
  294.                         log.severe("It seems you are actually already logged in?");
  295.                         stopScript(false);
  296.                     }
  297.                     invalidCount++;
  298.                     log.severe("Waiting for logout..");
  299.                     sleep(5000,15000);
  300.                 }
  301.                 if (returnText.contains("incorrect")) {
  302.                     log.warning("Failed to login five times in a row. Stopping script.");
  303.                     stopScript(false);
  304.                 }
  305.                 if (returnText.contains("invalid")) {
  306.                     if (invalidCount > 6) {
  307.                         log.warning("Unable to login after 6 attempts. Stopping script.");
  308.                         log("Please verify that your RSBot account profile is correct.");
  309.                         stopScript(false);
  310.                     }
  311.                     invalidCount++;
  312.                 }
  313.                 if (returnText.contains("error connecting")) {
  314.                     interfaces.get(INTERFACE_LOGIN_SCREEN)
  315.                     .getComponent(INTERFACE_BUTTON_BACK).doClick();
  316.                     stopScript(false);
  317.                 }
  318.                 if (returnText.contains("full")) {
  319.                     if (worldFullCount > 30) {
  320.                         log("World Is Full. Waiting for 15 seconds.");
  321.                         sleep(random(10000, 15000));
  322.                         worldFullCount = 0;
  323.                     }
  324.                     sleep(random(1000, 1200));
  325.                     worldFullCount++;
  326.                 }
  327.                 if (returnText.contains("login limit exceeded")) {
  328.                     if (invalidCount > 10) {
  329.                         log.warning("Unable to login after 10 attempts. Stopping script.");
  330.                         log.severe("It seems you are actually already logged in?");
  331.                         stopScript(false);
  332.                     }
  333.                     invalidCount++;
  334.                     sleep(5000,15000);
  335.                 }
  336.             }
  337.             if (game.getClientState() == INDEX_LOGGED_OUT) {
  338.                 if (interfaces.getComponent(INTERFACE_GRAPHICS_NOTICE,
  339.                         INTERFACE_GRAPHICS_LEAVE_ALONE).isValid()) {
  340.                     interfaces.getComponent(INTERFACE_GRAPHICS_NOTICE,
  341.                             INTERFACE_GRAPHICS_LEAVE_ALONE).doClick();
  342.                     if(interfaces.getComponent(INTERFACE_BUTTON_BACK).isValid())
  343.                         interfaces.getComponent(INTERFACE_BUTTON_BACK).doClick();
  344.                 }
  345.                 if (!atLoginScreen()) {
  346.                     if (interfaces.getComponent(INTERFACE_MAIN, INTERFACE_MAIN_CHILD)
  347.                     .getComponent(INTERFACE_MAIN_CHILD_COMPONENT_ID) != null) {
  348.                     interfaces.getComponent(INTERFACE_MAIN, INTERFACE_MAIN_CHILD)
  349.                     .getComponent(INTERFACE_MAIN_CHILD_COMPONENT_ID)
  350.                     .doAction("");
  351.                     }
  352.                 }
  353.                 if (isUsernameFilled(User) && isPasswordFilled(pass)) {
  354.                     if (random(0, 2) == 0)
  355.                         keyboard.pressKey((char) KeyEvent.VK_ENTER);
  356.                     else
  357.                         interfaces.get(INTERFACE_LOGIN_SCREEN)
  358.                         .getComponent(INTERFACE_BUTTON_LOGIN).doClick();
  359.                 }
  360.                 if (!isUsernameFilled(User)) {
  361.                     atLoginInterface(interfaces.get(INTERFACE_LOGIN_SCREEN)
  362.                             .getComponent(INTERFACE_USERNAME_WINDOW));
  363.                     sleep(random(500, 700));
  364.                     textlength = interfaces.get(INTERFACE_LOGIN_SCREEN)
  365.                     .getComponent(INTERFACE_USERNAME).getText().length()
  366.                     + random(3, 5);
  367.                     for (int i = 0; i <= textlength + random(1, 5); i++) {
  368.                         keyboard.sendText("\b", false);
  369.                         if (random(0, 2) == 1) {
  370.                             sleep(random(25, 100));
  371.                         }
  372.                     }
  373.                     keyboard.sendText(username, false);
  374.                 }
  375.                 if (isUsernameFilled(User) && !isPasswordFilled(pass)) {
  376.                     atLoginInterface(interfaces.get(INTERFACE_LOGIN_SCREEN)
  377.                             .getComponent(INTERFACE_PASSWORD_WINDOW));
  378.                     sleep(random(500, 700));
  379.                     textlength = interfaces.get(INTERFACE_LOGIN_SCREEN)
  380.                     .getComponent(INTERFACE_PASSWORD).getText().length()
  381.                     + random(3, 5);
  382.                     for (int i = 0; i <= textlength + random(1, 5); i++) {
  383.                         keyboard.sendText("\b", false);
  384.                         if (random(0, 2) == 1) {
  385.                             sleep(random(25, 100));
  386.                         }
  387.                     }
  388.                     keyboard.sendText(pass, false);
  389.                 }
  390.             }
  391.         }
  392.  
  393.        
  394.         private boolean atLoginInterface(RSComponent i) {
  395.             if (!i.isValid())
  396.                 return false;
  397.             Rectangle pos = i.getArea();
  398.             if (pos.x == -1 || pos.y == -1 || pos.width == -1 || pos.height == -1)
  399.                 return false;
  400.             int dy = (int) (pos.getHeight() - 4) / 2;
  401.             int maxRandomX = (int) (pos.getMaxX() - pos.getCenterX());
  402.             int midx = (int) (pos.getCenterX());
  403.             int midy = (int) (pos.getMinY() + pos.getHeight() / 2);
  404.             if (i.getIndex() == INTERFACE_PASSWORD_WINDOW) {
  405.                 mouse.click(minX(i), midy + random(-dy, dy), true);
  406.             } else {
  407.                 mouse.click(midx + random(1, maxRandomX), midy + random(-dy, dy), true);
  408.             }
  409.             return true;
  410.         }
  411.  
  412.         private int minX(RSComponent a) {
  413.             int x = 0;
  414.             Rectangle pos = a.getArea();
  415.             int dx = (int) (pos.getWidth() - 4) / 2;
  416.             int midx = (int) (pos.getMinX() + pos.getWidth() / 2);
  417.             if (pos.x == -1 || pos.y == -1 || pos.width == -1 || pos.height == -1)
  418.                 return 0;
  419.             for (int i = 0; i < interfaces.get(INTERFACE_LOGIN_SCREEN).getComponent(INTERFACE_PASSWORD).getText().length(); i++) {
  420.                 x += 11;
  421.             }
  422.             if (x > 44) {
  423.                 return (int) (pos.getMinX() + x + 15);
  424.             } else {
  425.                 return midx + random(-dx, dx);
  426.             }
  427.         }
  428.  
  429.         private boolean atLoginScreen() {
  430.             return interfaces.get(596).isValid();
  431.         }
  432.  
  433.         private boolean isUsernameFilled(String user) {
  434.             String username = user.replaceAll("_", " ").toLowerCase().trim();
  435.             return interfaces.get(INTERFACE_LOGIN_SCREEN).getComponent(INTERFACE_USERNAME).getText().toLowerCase().equalsIgnoreCase(username);
  436.         }
  437.  
  438.         private boolean isPasswordFilled(String pass) {
  439.             return interfaces.get(INTERFACE_LOGIN_SCREEN).getComponent(INTERFACE_PASSWORD).getText().toLowerCase().length() == pass.length();
  440.         }
  441.     }
  442.  
  443.     public boolean onStart() {
  444.         ISGUI.setVisible(true);
  445.         randomTime = new Timer(Long.MAX_VALUE);
  446.         return true;
  447.     }
  448.    
  449.     public int loop() {
  450.         while (ISGUI.isVisible())
  451.             return 500;
  452.  
  453.         if (game.isLoginScreen() || game.getClientState() == 7) {
  454.             inRandom = true;
  455.             randomTime.reset();
  456.             for (int a = 0; a < AccountList.size(); a++ ) {
  457.                 if (RandomList.contains(AccountList.get(a))) {
  458.                     continue;
  459.                 }
  460.                 i = a;
  461.                 break;
  462.             }
  463.             Login.login(AccountList.get(i), Password);
  464.             return 500;
  465.         }
  466.         if (game.inRandom()) {
  467.             game.logout(false);
  468.             RandomList.add(AccountList.get(i));
  469.             if (inRandom) {
  470.             log(AccountList.get(i) + " is in random");
  471.             log("Spent : " + randomTime.toElapsedString());
  472.             }
  473.             inRandom = false;
  474.             return 200;
  475.         }
  476.         if (inventory.getCount() == 28) {
  477.             inventory.dropAllExcept(false, Net);
  478.             return random(500,900);
  479.         }
  480.         if (game.isLoggedIn() && calc.distanceTo(new RSTile(3087,3229)) >= 9 && inventory.contains(Net)) {
  481.             walking.walkTo(new RSTile(3087,3229));
  482.             return 1000;
  483.         }
  484.         if (game.isLoggedIn() && calc.distanceTo(new RSTile(3197,3253)) >= 5 && !inventory.contains(Net)) {
  485.             walking.walkTo(new RSTile(3197,3253));
  486.             return 2000;
  487.         }
  488.         RSNPC Shop = npcs.getNearest(8864);
  489.         if (game.isLoggedIn() && calc.distanceTo(new RSTile(3197,3253)) <= 5 && Shop != null && calc.tileOnScreen(Shop.getLocation()) && !inventory.contains(Net)) {
  490.             if (Shop != null && !store.isOpen()) {
  491.                 Shop.doAction("Trade");
  492.                 return 1000;
  493.             }
  494.             if (store.isOpen() && !inventory.contains(Net)) {
  495.                 interfaces.getComponent(620,26).getComponent(0).doAction("Take 1");
  496.                 return 1000;
  497.             }
  498.             return 1000;
  499.         }
  500.         if (inventory.getCount() != 28 && getMyPlayer().getAnimation() != 621 && inventory.contains(Net)) {
  501.             RSNPC Spot = npcs.getNearest(FishSpot);
  502.             if (Spot != null && Spot.getLocation() != null) {
  503.                 if (calc.distanceTo(Spot) > 3 || !calc.tileOnScreen(Spot.getLocation())) {
  504.                     walking.walkTo(Spot.getLocation());
  505.                     return 100;
  506.                 }
  507.                 Spot.doAction("Net");
  508.                 return 3000;
  509.             }
  510.             return 50;
  511.         }
  512.         return 100;
  513.     }
  514.    
  515.     public void onRepaint(final Graphics g) {
  516.         if (!game.isLoggedIn()) {
  517.             g.setColor(new Color(0, 0, 0, 175));
  518.             g.fillRoundRect(1, 62, 125, 215, 10, 10);
  519.             g.setColor(Color.WHITE);
  520.             g.drawString("~ Paint Stopped ~", 8, 77);
  521.             g.drawString("Please Log In", 18, 104);
  522.             return;
  523.         }
  524.         if (scriptStartTIME == -1) {
  525.             scriptStartTIME = System.currentTimeMillis();
  526.         }
  527.         long seconds;
  528.         long minutes = 0;
  529.         long hours = 0;
  530.  
  531.         if (game.isLoggedIn()) {
  532.             runTime = System.currentTimeMillis() - scriptStartTIME;
  533.             seconds = runTime / 1000;
  534.             if (seconds >= 60) {
  535.                 minutes = seconds / 60;
  536.                 seconds -= (minutes * 60);
  537.             }
  538.             if (minutes >= 60) {
  539.                 hours = minutes / 60;
  540.                 minutes -= (hours * 60);
  541.             }
  542.             g.setColor(new Color(0, 0, 0, 175));
  543.             g.fillRoundRect(5, 65, 162, 15, 10, 10);
  544.             g.setColor(Color.WHITE);
  545.             g.drawString("Time running: " + Long.toString(hours) + ":" + Long.toString(minutes) + ":" + Long.toString(seconds), 8, 77);
  546.         }
  547.     }
  548. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement