Advertisement
Guest User

Untitled

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