Advertisement
Guest User

Arbi Fire Script

a guest
Jul 6th, 2010
570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 47.74 KB | None | 0 0
  1. import java.awt.*;
  2. import java.awt.event.*;
  3.  
  4. import javax.swing.*;
  5. import java.util.*;
  6. import java.io.*;
  7.  
  8. import org.rsbot.bot.Bot;
  9. import org.rsbot.script.*;
  10. import org.rsbot.script.wrappers.*;
  11. import org.rsbot.event.listeners.PaintListener;
  12. import org.rsbot.event.listeners.ServerMessageListener;
  13. import org.rsbot.event.events.ServerMessageEvent;
  14. import org.rsbot.util.ScreenshotUtil;
  15.  
  16. //TRIGOON
  17. import org.rsbot.bot.input.Mouse;
  18. import java.awt.Graphics;
  19. import java.awt.Graphics2D;
  20. import java.awt.Point;
  21. import java.awt.RenderingHints;
  22. import java.awt.image.BufferedImage;
  23. import javax.imageio.ImageIO;
  24. import java.net.URL;
  25. import java.io.IOException;
  26. // TRIGOON
  27.  
  28. @ScriptManifest(authors = { "Arbiter, Trigoon, John" }, category = "Firemaking", name = "ArbiFIRE [Universal FMer]", version = 1.34, description = "<html><head>" +
  29. "<style type=\"text/css\"> body {background-color: #E56717; color: #e9d5af; padding: 5px; font-family: Century Gothic; text-align: center;}" +
  30. "h1 {font-weight: bold; color: #e9d5af; font-size: 14px; padding: 0px; margin: 0px; margin-top: 4px; }" +
  31. "h2 {font-weight: bold; color: #E56717; padding: 0px; margin: 0px; margin-top: 1px; margin-bottom: 5px; font-weight: normal; font-size: 10px;}" +
  32. "td {font-weight: bold; width: 50%;}</style>" +
  33. "</head><body>" +
  34. "<div style=\"width: 100%, height: 80px; background-color: #e9d5af; text-align: center; padding: 5px;\">" +
  35. "<h1><img src='http://img256.imageshack.us/img256/5065/fireh.png' alt='ArbiFire' /> </h1>" +
  36. "<h2><b>By Arbiter</b></h2></div><br />" +
  37. "<center><b><FONT COLOR='#800517'>WARNING: I AM SMARTER THAN YOU.</FONT></b><br />" +
  38. "Revolutionizing Firemaking as you humans know it, I am the first of my kind to <b>THINK</b> and <b>LEARN</b>. I run anywhere. I learn my environment. I find the longest strings of available FMing spots and even randomize them for you. If I ever find a tile I can't FM on I automatically learn it and save it to my memory. I never make the same mistake twice, unlike you stupid humans. The more you run me, the more I learn... And remember: I report to Arbiter. " +
  39. "<br /><br />Note: All settings in GUI." +
  40. "</center>" +
  41. "</body></html>")
  42. public class ArbiFire extends Script implements PaintListener, ServerMessageListener {
  43.  
  44. private final ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
  45.  
  46. static int speed;
  47. static int realSpeed;
  48. protected int getMouseSpeed() {
  49. return speed;
  50. }
  51.  
  52. public boolean boxFirst;
  53. public boolean walked;
  54. public boolean forceWalk;
  55. public boolean manualAvoid;
  56. public boolean burning;
  57. public boolean start = true;
  58. public boolean useChests;
  59. public boolean useDen;
  60.  
  61. public RSTile[] spots;
  62. public RSTile[] badTiles = new RSTile[10000];
  63.  
  64. public RSTile dest;
  65. public RSTile bankTile;
  66.  
  67. public double[] scores;
  68.  
  69. public int log;
  70. public int tinderbox = 590;
  71. public int randomUse = random(25,75);
  72. public int randomPath;
  73. static int variable;
  74. public int bad;
  75. public int badTries;
  76. public int trainingSkill = Constants.STAT_FIREMAKING;
  77. public int[] chests = { 27663, 4483 };
  78.  
  79. // TRIGOON
  80. public boolean show;
  81. public boolean NEW = true;
  82. public boolean fullTurn = true;
  83.  
  84. public long expGained;
  85. public long lastSecond;
  86. public long currentExp;
  87. public long startExp;
  88. public long startLevel;
  89. public long st = System.currentTimeMillis();
  90.  
  91. public int logsBurned;
  92. public int expHour;
  93. public int logsHour = 0;
  94.  
  95. public double red = 194;
  96. public double green = 178;
  97. public double blue = 146;
  98.  
  99. public BufferedImage fmPic = null;
  100. // TRIGOON
  101.  
  102. //John
  103. public String logToBurn;
  104.  
  105. public boolean guiStart;
  106. public boolean guiWait;
  107. public boolean worked;
  108. //John
  109.  
  110. public boolean onStart(Map<String, String> args) {
  111. // TRIGOON
  112. try {
  113. final URL url = new URL(
  114. "http://wildimp.com/aiofm.png");
  115. fmPic = ImageIO.read(url);
  116. } catch (final IOException e) {
  117. log("Failed to get FM Pic.");
  118. e.printStackTrace();
  119. }
  120. // TRIGOON
  121.  
  122. //John
  123. final ArbiFireGUI gui = new ArbiFireGUI();
  124. while (!guiStart) {
  125. wait(10);
  126. }
  127. if (!worked)
  128. return false;
  129. //John
  130. //log("" + speed);
  131. //log("" + variable);
  132. st = System.currentTimeMillis();
  133. return true;
  134. }
  135.  
  136. public int loop() {
  137. try {
  138. if (!isLoggedIn())
  139. return 100;
  140. if (start)
  141. {
  142. getBadTiles();
  143. //log("Make sure you started me right next to a bank for best speeds.");
  144. //log("Calculating the best spots... I won't take more than 30 seconds.");
  145. if (getNearestNPCByName("Banker") == null && getNearestObjectByID(chests) == null && getNearestNPCByName("Emerald Benedict") == null)
  146. {
  147. log("You failed. Start me logged in next to a bank/chest.");
  148. log("If you're at a chest and its not recognizing please PM the object ID to Arbiter.");
  149. stopScript(false);
  150. }
  151. if (bankTile == null && getNearestNPCByName("Banker") != null)
  152. {
  153. bankTile = getNearestNPCByName("Banker").getLocation();
  154. }
  155. if (bankTile == null && getNearestNPCByName("Emerald Benedict") != null)
  156. {
  157. useDen = true;
  158. bankTile = getNearestNPCByName("Emerald Benedict").getLocation();
  159. }
  160. if (bankTile == null && getNearestObjectByID(chests) != null)
  161. {
  162. useChests = true;
  163. bankTile = getNearestObjectByID(chests).getLocation();
  164. }
  165. if (!inventoryContains(tinderbox))
  166. {
  167. log("You failed. Start with a tinderbox in inventory.");
  168. stopScript(false);
  169. }
  170. startExp = (long)skills.getCurrentSkillExp(trainingSkill);
  171. startLevel = (long)skills.getCurrentSkillLevel(trainingSkill);
  172. spots = findStart(27);
  173. dest = spots[0];
  174. realSpeed = speed;
  175. show = true;
  176. start = false;
  177. }
  178. speed = random(realSpeed - 1, realSpeed + 1);
  179. getMouseSpeed();
  180. antiBan();
  181. restoreRun();
  182. if (getMyPlayer().isInCombat())
  183. {
  184. walkTileMM(getClosestTileOnMap(bankTile),3,3);
  185. wait(random(1000,2000));
  186. return 100;
  187. }
  188.  
  189. switch(getState()) {
  190. case burn:
  191. burning = true;
  192. badTries = 0;
  193. RSTile lastSpot = getMyPlayer().getLocation();
  194. /*if (!getMenuActions().get(0).contains("se") && isItemSelected())
  195. {
  196. int tab = random(0,16);
  197. if (tab == 4)
  198. openTab(1);
  199. else
  200. openTab(tab);
  201. return 100;
  202. }*/
  203. /*if (getMouseLocation().getX() > 550 && getMouseLocation().getY() > 200 && isItemSelected())
  204. {
  205. clickMouse(true);
  206. wait(random(50,100));
  207. }
  208. else */
  209. if (isItemSelected())
  210. {
  211. if (boxFirst)
  212. {
  213. if (getMenuActions().get(0).contains("se"))
  214. clickMouse(true);
  215. else
  216. atInventoryItem(log,"");
  217. logsBurned++;
  218. }
  219. else
  220. {
  221. if (getMenuActions().get(0).contains("se"))
  222. clickMouse(true);
  223. else
  224. atInventoryItem(tinderbox,"");
  225. logsBurned++;
  226. }
  227. for (int i = 0; i < 100; i++)
  228. {
  229. if (!isItemSelected())
  230. break;
  231. wait(random(5,15));
  232. }
  233. //wait(random(50,100));
  234. }
  235. else if (random(1,100) >= randomUse)
  236. {
  237. atInventoryItem(tinderbox,"");
  238. boxFirst = true;
  239. for (int i = 0; i < 100; i++)
  240. {
  241. if (isItemSelected())
  242. break;
  243. wait(random(5,15));
  244. }
  245. atInventoryItem(log,"");
  246. logsBurned++;
  247. }
  248. else
  249. {
  250. atInventoryItem(log,"");
  251. boxFirst = false;
  252. for (int i = 0; i < 100; i++)
  253. {
  254. if (isItemSelected())
  255. break;
  256. wait(random(5,15));
  257. }
  258. atInventoryItem(tinderbox,"");
  259. logsBurned++;
  260. }
  261. int lastCount = getInventoryCount(log);
  262. boolean attempt = true;
  263. for (int i = 0; i < 200; i++)
  264. {
  265. if (getDistance2(lastSpot) > 0)
  266. break;
  267. if (attempt && !isItemSelected() && inventoryContains(log) && getInventoryCount(log) < lastCount && getObjectAt(getMyPlayer().getLocation().getX() - 1, getMyPlayer().getLocation().getY()) == null)
  268. {
  269. if (random(1,100) >= randomUse)
  270. {
  271. atInventoryItem(tinderbox,"");
  272. boxFirst = true;
  273. for (int j = 0; j < 100; j++)
  274. {
  275. if (isItemSelected())
  276. break;
  277. wait(random(5,15));
  278. }
  279. moveToItem(log,"");
  280. /*for (int j = 0; j < 100; j++)
  281. {
  282. if (getMenuActions().get(0).contains("se"))
  283. break;
  284. wait(random(1,20));
  285. }*/
  286. }
  287. else
  288. {
  289. atInventoryItem(log,"");
  290. boxFirst = false;
  291. for (int j = 0; j < 100; j++)
  292. {
  293. if (isItemSelected())
  294. break;
  295. wait(random(5,15));
  296. }
  297. moveToItem(tinderbox,"");
  298. /*for (int j = 0; j < 100; j++)
  299. {
  300. if (getMenuActions().get(0).contains("se"))
  301. break;
  302. wait(random(1,20));
  303. }*/
  304. }
  305. attempt = false;
  306. //log(getMenuActions().get(0));
  307. }
  308. //if (getMyPlayer().getAnimation() != -1)
  309. // break;
  310. //if (getMyPlayer().isMoving())
  311. // break;
  312. wait(random(10,20));
  313. }
  314. burning = false;
  315. return 100;
  316.  
  317. case walk:
  318. if (getDistance2(bankTile) > 50)
  319. {
  320. walkTileMM(getClosestTileOnMap(bankTile),3,3);
  321. wait(random(1000,2000));
  322. dest = spots[random(0, variable - 1)];
  323. return 100;
  324. }
  325. walked = true;
  326. forceWalk = false;
  327. //dest = spots[randomPath];
  328. /*if (getObjectAt(getMyPlayer().getLocation()) != null || getObjectAt(getMyPlayer().getLocation().getX() - 1, getMyPlayer().getLocation().getY()) != null)
  329. {
  330. if (getMyPlayer().isMoving())
  331. return 100;
  332. for (int i = 0; i < 1000; i++)
  333. {
  334. int newRandom = random(1, variable + 1);
  335. newRandom--;
  336. log(""+newRandom);
  337. if (randomPath != newRandom)
  338. {
  339. walked = false;
  340. randomPath = newRandom;
  341. dest = spots[randomPath];
  342. break;
  343. }
  344. }
  345. }*/
  346. //log(dest.getX() + ", " + dest.getY());
  347. if (getMyPlayer().getLocation().equals(dest))
  348. return 100;
  349. if (!tileOnScreen(dest))
  350. {
  351. if (walkTileMM(getClosestTileOnMap(dest),0,0))
  352. {
  353. RSTile before = getMyPlayer().getLocation();
  354. if (waitToMove(random(1500,2000)))
  355. {
  356. //wait(random(1000,1500));
  357. while (getMyPlayer().isMoving())
  358. wait(random(5,10));
  359. }
  360. else
  361. {
  362. if (getDistance2(before) < 1 && !getMyPlayer().isMoving())
  363. {
  364. badTries++;
  365. if (badTries > random(3,4))
  366. manualAvoid = true;
  367. }
  368. if (badTries == 3)
  369. {
  370. walkTileOnScreen(dest);
  371. return 100;
  372. }
  373. }
  374. }
  375. }
  376. else
  377. {
  378. for (int i = 0; i < 100; i++)
  379. {
  380. if (!getMyPlayer().isMoving())
  381. {
  382. wait(random(100,200));
  383. break;
  384. }
  385. wait(random(50,100));
  386. }
  387. if (getMyPlayer().getLocation().equals(dest))
  388. return 100;
  389. atTile(dest, "Walk here");
  390. //walkTileOnScreen(dest);
  391. RSTile before = getMyPlayer().getLocation();
  392. if (waitToMove(random(1500,2000)))
  393. {
  394. //wait(random(1000,1500));
  395. while (getMyPlayer().isMoving())
  396. wait(random(5,10));
  397. }
  398. else
  399. {
  400. if (getDistance2(before) < 1 && !getMyPlayer().isMoving())
  401. {
  402. badTries++;
  403. if (badTries > random(3,4))
  404. manualAvoid = true;
  405. }
  406. }
  407. }
  408. if(manualAvoid) {
  409. badTries = 0;
  410. manualAvoid = false;
  411. if (getMyPlayer().isMoving())
  412. return 100;
  413. forceWalk = true;
  414. badTiles[bad] = dest;
  415. int badX = badTiles[bad].getX();
  416. int badY = badTiles[bad].getY();
  417. bad++;
  418. try {
  419. BufferedWriter out = new BufferedWriter(new FileWriter("badTiles.txt", true));
  420. out.write("" + badX);
  421. out.newLine();
  422. out.write("" + badY);
  423. out.newLine();
  424. out.close();
  425. } catch (IOException e) {
  426. }
  427.  
  428. log("I just added badTile [" + badX + "," + badY + "] to my memory.");
  429. log("I'll never make that mistake again!");
  430. }
  431. return 100;
  432.  
  433. case bank:
  434. //dest = spots[random(0, variable - 1)];
  435. if (getDistance2(bankTile) > 5)
  436. {
  437. walkTileMM(getClosestTileOnMap(bankTile),0,0);
  438. if (waitToMove(random(1000,1500)))
  439. {
  440. for (int i = 0; i < 100; i++)
  441. {
  442. if (getDestination()== null || distanceBetween(getDestination(),bankTile) > 3)
  443. break;
  444. if (!getMyPlayer().isMoving())
  445. {
  446. wait(random(50,100));
  447. break;
  448. }
  449. wait(random(50,150));
  450. }
  451. }
  452. else
  453. {
  454. walkTo2(bankTile);
  455. if (waitToMove(random(1000,1500)))
  456. {
  457. for (int i = 0; i < 100; i++)
  458. {
  459. if (getDestination()== null || distanceBetween(getDestination(),bankTile) > 3)
  460. break;
  461. if (!getMyPlayer().isMoving())
  462. {
  463. wait(random(50,100));
  464. break;
  465. }
  466. wait(random(50,150));
  467. }
  468. }
  469. }
  470. for (int i = 0; i < 5; i++)
  471. {
  472. if (!getMyPlayer().isMoving())
  473. {
  474. wait(random(50,100));
  475. break;
  476. }
  477. if (tileOnScreen(bankTile))
  478. break;
  479. if (i == 4)
  480. walkTo2(bankTile);
  481. wait(random(250,750));
  482. }
  483. return 100;
  484. }
  485. speed = random(9,10);
  486. getMouseSpeed();
  487. if (bank.isOpen() && RSInterface.getInterface(762).getChild(9).getAbsoluteY() > 50)
  488. {
  489. for (int i = 0; i < 100; i++)
  490. {
  491. if (bank.getCount(log) + getInventoryCount(log) > 26)
  492. break;
  493. if (i == 99 && (bank.getCount(log) + getInventoryCount(log) < 27))
  494. {
  495. log("FEED ME MOAR!");
  496. stopScript();
  497. }
  498. wait(random(20,30));
  499. }
  500. if (getInventoryCount() > 1)
  501. {
  502. bank.depositAllExcept(tinderbox);
  503. return 100;
  504. }
  505. if (!inventoryContains(tinderbox))
  506. {
  507. bank.atItem(tinderbox, "Withdraw-1");
  508. for (int i = 0; i < 100; i++)
  509. {
  510. if (inventoryContains(tinderbox))
  511. break;
  512. wait(random(30,50));
  513. }
  514. return 100;
  515. }
  516. if (getInventoryCount() != 28)
  517. {
  518. if (!bank.atItem(log, "Withdraw-All"))
  519. {
  520. return 100;
  521. }
  522. else
  523. {
  524. for (int i = 0; i < 1000; i++)
  525. {
  526. int newRandom = random(1, variable + 1);
  527. newRandom--;
  528. if (randomPath != newRandom)
  529. {
  530. spots = findStart(27);
  531. walked = false;
  532. randomPath = newRandom;
  533. dest = spots[randomPath];
  534. break;
  535. }
  536. }
  537. }
  538. }
  539. for (int i = 0; i < 75; i++)
  540. {
  541. if (inventoryContains(log))
  542. break;
  543. wait(random(20,30));
  544. }
  545. if (getInventoryCount() == 28)
  546. {
  547. bank.close();
  548. for (int i = 0; i < 75; i++)
  549. {
  550. if (!bank.isOpen() || RSInterface.getInterface(762).getChild(9).getAbsoluteY() < 50)
  551. break;
  552. wait(random(20,30));
  553. }
  554. }
  555. }
  556. if (getInventoryCount() != 28 && ((!bank.isOpen() || RSInterface.getInterface(762).getChild(9).getAbsoluteY() < 50) || RSInterface.getInterface(762).getChild(9).getAbsoluteY() < 50))
  557. {
  558. if (useChests)
  559. {
  560. RSObject bankChest = getNearestObjectByID(chests);
  561. if (!tileOnScreen(bankChest.getLocation()))
  562. {
  563. walkTo2(bankChest.getLocation());
  564. return 100;
  565. }
  566. if (atObject(bankChest, "Bank Bank"))
  567. {
  568. for (int i = 0; i < 200; i++)
  569. {
  570. if (bank.isOpen() && RSInterface.getInterface(762).getChild(9).getAbsoluteY() > 50)
  571. break;
  572. wait(random(20,30));
  573. }
  574. return 100;
  575. }
  576. }
  577. else if (useDen)
  578. {
  579. RSNPC bankPerson = getNearestNPCByName("Emerald Benedict");
  580. if (!tileOnScreen(bankPerson.getLocation()))
  581. {
  582. walkTo2(bankPerson.getLocation());
  583. return 100;
  584. }
  585. if (atNPC(bankPerson, "Bank Emerald"))
  586. {
  587. for (int i = 0; i < 200; i++)
  588. {
  589. if (bank.isOpen() && RSInterface.getInterface(762).getChild(9).getAbsoluteY() > 50)
  590. break;
  591. wait(random(20,30));
  592. }
  593. return 100;
  594. }
  595. }
  596. else
  597. {
  598. RSNPC bankPerson = getNearestNPCByName("Banker");
  599. if (!tileOnScreen(bankPerson.getLocation()))
  600. {
  601. walkTo2(bankPerson.getLocation());
  602. return 100;
  603. }
  604. if (atNPC(bankPerson, "Bank Banker"))
  605. {
  606. for (int i = 0; i < 200; i++)
  607. {
  608. if (bank.isOpen() && RSInterface.getInterface(762).getChild(9).getAbsoluteY() > 50)
  609. break;
  610. wait(random(20,30));
  611. }
  612. return 100;
  613. }
  614. }
  615. return 100;
  616. }
  617. return 100;
  618.  
  619. case sleep:
  620. burning = true;
  621. wait(random(1,50));
  622. burning = false;
  623. return 100;
  624. }
  625. }
  626. catch (final Exception e) {
  627. }
  628. return 100;
  629. }
  630.  
  631. private enum State {
  632. walk, burn, bank, sleep;
  633. }
  634.  
  635. private State getState(){
  636. if (getMyPlayer().getAnimation() != -1)
  637. {
  638. return State.sleep;
  639. }
  640. else if (inventoryContains(log) && inventoryContains(tinderbox))
  641. {
  642. if (getObjectAt(getMyPlayer().getLocation()) != null) {
  643. spots = findStart(getInventoryCount(log));
  644. for (int i = 0; i < 1000; i++)
  645. {
  646. int newRandom = random(1, variable + 1);
  647. newRandom--;
  648. if (randomPath != newRandom)
  649. {
  650. walked = false;
  651. randomPath = newRandom;
  652. dest = spots[randomPath];
  653. break;
  654. }
  655. }
  656. return State.walk;
  657. }
  658. else if (forceWalk) {
  659. if (getDistance2(bankTile) > 10)
  660. {
  661. walkTileMM(getClosestTileOnMap(bankTile),3,3);
  662. wait(random(1000,2000));
  663. return State.sleep;
  664. }
  665. else
  666. {
  667. spots = findStart(getInventoryCount(log));
  668. for (int i = 0; i < 1000; i++)
  669. {
  670. int newRandom = random(1, variable + 1);
  671. newRandom--;
  672. if (randomPath != newRandom)
  673. {
  674. walked = false;
  675. randomPath = newRandom;
  676. dest = spots[randomPath];
  677. break;
  678. }
  679. }
  680. return State.walk;
  681. }
  682. }
  683. else if (getMyPlayer().getLocation().getY() != dest.getY() || getMyPlayer().getLocation().getX() > dest.getX()) {
  684. return State.walk;
  685. }
  686. else if (!getMyPlayer().isMoving()) {
  687. return State.burn;
  688. }
  689. else {
  690. return State.sleep;
  691. }
  692. }
  693. else
  694. {
  695. return State.bank;
  696. }
  697. }
  698.  
  699. public RSTile[] findStart(int count) {
  700. spots = new RSTile[variable];
  701. scores = new double[variable];
  702. RSTile spot;
  703. double score = 0;
  704. for (int x = 0; x < 104; x++) {
  705. for (int y = 0; y < 104; y++) {
  706. score = 0;
  707. spot = new RSTile(x + Bot.getClient().getBaseX(), y + Bot.getClient().getBaseY());
  708. boolean badSpot = false;
  709. for (int a = 0; a < bad; a++)
  710. {
  711. if (spot.equals(badTiles[a]))
  712. {
  713. badSpot = true;
  714. break;
  715. }
  716. }
  717. if (!badSpot && getObjectAt(spot) == null) {
  718. for (int x2 = 0; x2 < 30; x2++) {
  719. RSTile tempTile = new RSTile(x + Bot.getClient().getBaseX() - x2, y + Bot.getClient().getBaseY());
  720. if (!tileOnMap(tempTile))
  721. break;
  722. if (getObjectAt(tempTile) == null)
  723. score++;
  724. else
  725. break;
  726. if (score >= count)
  727. break;
  728. }
  729. score = score - (getDistance3(spot) / 5.0);
  730. for (int i = 0; i < spots.length; i++)
  731. {
  732. if (score > scores[i] || scores[i] == 0)
  733. {
  734. boolean skip = false;
  735. for (int z = 0; z < spots.length; z++)
  736. {
  737. if (spots[z] != null && spot.getY() == spots[z].getY())
  738. {
  739. if (score > scores[z])
  740. spots[z] = spot;
  741. skip = true;
  742. }
  743. }
  744. if (skip)
  745. break;
  746. for (int j = scores.length - 2; j >= i; j--)
  747. {
  748. scores[j + 1] = scores[j];
  749. }
  750. for (int j = spots.length - 2; j >= i; j--)
  751. {
  752. spots[j + 1] = spots[j];
  753. }
  754. scores[i] = score;
  755. spots[i] = spot;
  756. break;
  757. }
  758. }
  759. }
  760.  
  761. }
  762. }
  763. return spots;
  764. }
  765.  
  766. public void restoreRun() {
  767. if (getEnergy() > random(50,60) && !isRunning())
  768. {
  769. setRun(true);
  770. wait(random(500,1000));
  771. }
  772. }
  773.  
  774. private void antiBan() {
  775. int random = random(1, 5);
  776. switch (random) {
  777. case 1:
  778. if (random(1, 25) != 1)
  779. return;
  780. moveMouse(random(10, 750), random(10, 495));
  781. return;
  782. case 2:
  783. if (random(1, 6) != 1)
  784. return;
  785. int angle = getCameraAngle() + random(-45, 45);
  786. if (angle < 0) {
  787. angle = random(0, 10);
  788. }
  789. if (angle > 359) {
  790. angle = random(0, 10);
  791. }
  792. char whichDir = 37; //left
  793. if (random(0,100) < 50)
  794. whichDir = 39; //right
  795. Bot.getInputManager().pressKey(whichDir);
  796. wait(random(100,500));
  797. Bot.getInputManager().releaseKey(whichDir);
  798. return;
  799. case 3:
  800. if (random(1, 15) != 1)
  801. return;
  802. moveMouseSlightly();
  803. return;
  804. default:
  805. return;
  806. }
  807. }
  808.  
  809. public boolean moveToItem(int itemID, String option) {
  810. try {
  811. if (getCurrentTab() != TAB_INVENTORY && !RSInterface.getInterface(INTERFACE_BANK).isValid() && !RSInterface.getInterface(INTERFACE_STORE).isValid()) {
  812. openTab(TAB_INVENTORY);
  813. }
  814.  
  815. RSInterfaceChild inventory = getInventoryInterface();
  816. if (inventory == null || inventory.getComponents() == null)
  817. return false;
  818.  
  819. java.util.List<RSInterfaceComponent> possible = new ArrayList<RSInterfaceComponent>();
  820. for (RSInterfaceComponent item : inventory.getComponents()) {
  821. if (item != null && item.getComponentID() == itemID) {
  822. possible.add(item);
  823. }
  824. }
  825.  
  826. if (possible.size() == 0)
  827. return false;
  828.  
  829. RSInterfaceComponent item = possible.get(random(0, Math.min(2, possible.size())));
  830. if (!item.isValid())
  831. return false;
  832. Rectangle pos = item.getArea();
  833. if (pos.x == -1 || pos.y == -1 || pos.width == -1 || pos.height == -1)
  834. return false;
  835. int dx = (int) (pos.getWidth() - 4) / 2;
  836. int dy = (int) (pos.getHeight() - 4) / 2;
  837. int midx = (int) (pos.getMinX() + pos.getWidth() / 2);
  838. int midy = (int) (pos.getMinY() + pos.getHeight() / 2);
  839. moveMouse(midx + random(-dx, dx), midy + random(-dy, dy));
  840. return true;
  841. } catch (Exception e) {
  842. log("atInventoryItem(int itemID, String option) Error: " + e);
  843. return false;
  844. }
  845. }
  846.  
  847. public boolean walkTo2(RSTile t) {
  848. return walkTo2(t, 2, 2);
  849. }
  850.  
  851. public boolean walkTo2(RSTile t, int x, int y) {
  852. Point p = tileToMinimap(t);
  853. if (p.x == -1 || p.y == -1) {
  854. for (int i = 0; i < 5; i++) {
  855. RSTile[] temp = cleanPath(generateFixedPath(t));
  856. if (distanceTo(temp[temp.length - 1]) < 6)
  857. return true;
  858. RSTile next = nextTile(temp, 15);
  859. if (next != null && tileOnMap(next)) {
  860. if (walkTileMM(next, x, y))
  861. return true;
  862. } else {
  863. walkTileMM(nextTile(temp, 10), x, y);
  864. }
  865. if (i == 9 && !getMyPlayer().isMoving())
  866. walkTileOnScreen(nextTile(temp,10));
  867. wait(random(200, 400));
  868. }
  869. return false;
  870. }
  871. clickMouse(p, x, y, true);
  872. return true;
  873. }
  874.  
  875. public int getDistance2(RSTile t)
  876. {
  877. return (Math.abs(getMyPlayer().getLocation().getX() - t.getX()) + Math.abs(getMyPlayer().getLocation().getY() - t.getY()));
  878. }
  879.  
  880. public int getDistance3(RSTile t)
  881. {
  882. return (Math.abs(bankTile.getX() - t.getX()) + Math.abs(bankTile.getY() - t.getY()));
  883. }
  884.  
  885. public void getBadTiles() {
  886. try {
  887. File file = new File("badTiles.txt");
  888. boolean create = file.createNewFile();
  889.  
  890. BufferedReader br = new BufferedReader(new FileReader("badTiles.txt"));
  891. String thisLine = br.readLine();
  892. while (thisLine != null)
  893. {
  894. int x = Integer.parseInt(thisLine);
  895. thisLine = br.readLine();
  896. if (thisLine == null)
  897. {
  898. log("Somehow you managed to corrupt my badTiles memory.");
  899. log("Now I have to delete my brain.");
  900. log("Restart me and I'll be smart again I promise. :(");
  901. try {
  902. if (br != null)
  903. br.close();
  904. } catch (IOException ex) {
  905. ex.printStackTrace();
  906. }
  907. boolean destroy = file.delete();
  908. stopScript();
  909. return;
  910. }
  911. int y = Integer.parseInt(thisLine);
  912. badTiles[bad] = new RSTile(x,y);
  913. bad++;
  914. thisLine = br.readLine();
  915. }
  916. try {
  917. if (br != null)
  918. br.close();
  919. } catch (IOException ex) {
  920. ex.printStackTrace();
  921. }
  922. }
  923. catch (IOException e) {
  924. System.err.println("Error: " + e);
  925. }
  926. }
  927.  
  928. public void serverMessageRecieved(final ServerMessageEvent arg0) {
  929. final String serverString = arg0.getMessage();
  930. if(serverString.contains("can't reach")) {
  931. manualAvoid = false;
  932. if (getMyPlayer().isMoving())
  933. return;
  934. forceWalk = true;
  935. badTiles[bad] = dest;
  936. int badX = badTiles[bad].getX();
  937. int badY = badTiles[bad].getY();
  938. bad++;
  939. try {
  940. BufferedWriter out = new BufferedWriter(new FileWriter("badTiles.txt", true));
  941. out.write("" + badX);
  942. out.newLine();
  943. out.write("" + badY);
  944. out.newLine();
  945. out.close();
  946. } catch (IOException e) {
  947. }
  948. log("I just added badTile [" + badX + "," + badY + "] to my memory.");
  949. log("I'll never make that mistake again!");
  950. }
  951. if(serverString.contains("can't light")) {
  952. manualAvoid = false;
  953. if (getMyPlayer().isMoving())
  954. return;
  955. if (getObjectAt(getMyPlayer().getLocation()) != null)
  956. return;
  957. forceWalk = true;
  958. badTiles[bad] = getMyPlayer().getLocation();
  959. int badX = badTiles[bad].getX();
  960. int badY = badTiles[bad].getY();
  961. bad++;
  962. try {
  963. BufferedWriter out = new BufferedWriter(new FileWriter("badTiles.txt", true));
  964. out.write("" + badX);
  965. out.newLine();
  966. out.write("" + badY);
  967. out.newLine();
  968. out.close();
  969. } catch (IOException e) {
  970. }
  971. log("I just added badTile [" + badX + "," + badY + "] to my memory.");
  972. log("I'll never make that mistake again!");
  973. }
  974. }
  975.  
  976. // TRIGOON
  977. private boolean mousePressed() {
  978. return Bot.getClient().getMouse().pressed;
  979. }
  980.  
  981. private final RenderingHints rh = new RenderingHints(
  982. RenderingHints.KEY_TEXT_ANTIALIASING,
  983. RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
  984. // TRIGOON
  985.  
  986.  
  987. public void onRepaint(Graphics g) {
  988. if(!isLoggedIn() || isLoginScreen()) {
  989. return;
  990. }
  991. // TRIGOON
  992. Graphics2D g2 = (Graphics2D)g;
  993. g2.setRenderingHints(rh);
  994.  
  995. int x = 2, y=377;
  996.  
  997. if ((skills.getCurrentSkillExp(trainingSkill) - startExp) > 0 && startExp > 0) {
  998. expGained = skills.getCurrentSkillExp(trainingSkill) - startExp;
  999. }
  1000.  
  1001. long millis = System.currentTimeMillis() - st;
  1002. long totalseconds = millis / 1000;
  1003. long hours = millis / (1000 * 60 * 60);
  1004. millis -= hours * 1000 * 60 * 60;
  1005. long minutes = millis / (1000 * 60);
  1006. millis -= minutes * 1000 * 60;
  1007. long seconds = millis / 1000;
  1008. if (lastSecond == 0)
  1009. lastSecond = seconds;
  1010.  
  1011. if (lastSecond != seconds) {
  1012. if (fullTurn) {
  1013. if (red == 238) {
  1014. red = 238;
  1015. green = 218;
  1016. blue = 179;
  1017. fullTurn = false;
  1018. } else {
  1019. red = red+6.45;
  1020. green = green+6.15;
  1021. blue = blue+4.8;
  1022. }
  1023. } else {
  1024. if (red == 195) {
  1025. red = 195;
  1026. green = 177;
  1027. blue = 147;
  1028. fullTurn = true;
  1029. } else {
  1030. red = red-6.45;
  1031. green = green-6.15;
  1032. blue = blue-4.8;
  1033. }
  1034. }
  1035. }
  1036. if (red > 238 || green > 218 || blue > 179) {
  1037. red = 238;
  1038. green = 218;
  1039. blue = 179;
  1040. }
  1041. if (red < 195 || green < 177 || blue < 147) {
  1042. red = 195;
  1043. green = 177;
  1044. blue = 147;
  1045. }
  1046. lastSecond = seconds;
  1047.  
  1048. long timeToLevel = 0;
  1049. String timeToLevel2 = "Calculating...";
  1050. if (expHour > 0) {
  1051. timeToLevel = (skills.getXPToNextLevel(trainingSkill)*60/expHour);
  1052. if (timeToLevel >= 60) {
  1053. long thours = (int)timeToLevel/60;
  1054. long tmin = (timeToLevel-(thours*60));
  1055. timeToLevel2 = thours+":"+tmin;
  1056. } else {
  1057. timeToLevel2 = timeToLevel+" Minutes";
  1058. }
  1059. }
  1060.  
  1061. if (expGained > 0 && totalseconds > 0) {
  1062. expHour = (int)(3600*expGained/(totalseconds));
  1063. logsHour = (int)(3600*logsBurned/(totalseconds));
  1064. }
  1065.  
  1066. if (show) {
  1067. drawMouse(g);
  1068.  
  1069. g2.setColor(new Color((int)red, (int)green, (int)blue, 255));
  1070. g2.fillRect(6, 344, 506, 128);
  1071. g2.setColor(new Color(49, 42, 27, 255));
  1072. g2.drawRect(6, 344, 506, 128);
  1073.  
  1074. g2.setColor(new Color(187,0, 0, 255));
  1075. g2.setFont(new Font("Arial", Font.BOLD, 12));
  1076. g2.drawString("Time Running:",x+14,y-10);
  1077. g2.drawString("Time To Level:",x+14,y+5);
  1078. g2.drawString("Logs Burned:",x+14,y+20);
  1079. g2.drawString("XP Gained:",x+14,y+35);
  1080. g2.drawString("XP / Hour:",x+14,y+50);
  1081. g2.drawString("Logs / Hour:",x+14,y+65);
  1082. g2.drawString("Tiles Avoided:",x+14,y+80);
  1083.  
  1084. g2.setColor(Color.black);
  1085. g2.setFont(new Font("Arial", Font.PLAIN, 12));
  1086. g2.drawString(hours + ":" + minutes + ":" + seconds,x+100,y-10);
  1087. g2.drawString(timeToLevel2,x+100,y+5);
  1088. g2.drawString(logsBurned+" Logs",x+100,y+20);
  1089. g2.drawString(expGained+" XP",x+100,y+35);
  1090. g2.drawString(expHour+" XP/Hour",x+100,y+50);
  1091. g2.drawString(logsHour+" Logs/Hour",x+100,y+65);
  1092. g2.drawString(bad + " Tiles",x+100,y+80);
  1093. g.drawImage(fmPic, 237, 311, null);
  1094. }
  1095.  
  1096. if (show) {
  1097. g2.setColor(new Color(192,0,0, 255));
  1098. g2.fillRect(498, 344, 14, 14);
  1099. g2.setColor(new Color(49, 42, 27, 255));
  1100. g2.drawRect(498, 344, 14, 14);
  1101. g2.setColor(new Color(255, 255, 255, 255));
  1102. g2.drawString("X",502,356);
  1103. } else {
  1104. g2.setColor(new Color(0,154,0, 255));
  1105. g2.fillRect(498, 344, 14, 14);
  1106. g2.setColor(new Color(49, 42, 27, 255));
  1107. g2.drawRect(498, 344, 14, 14);
  1108. g2.setColor(new Color(255, 255, 255, 255));
  1109. g2.drawString("O",501,356);
  1110. }
  1111.  
  1112. Mouse m = Bot.getClient().getMouse();
  1113. if (!show && mousePressed() && m.x >= 498 && m.x <= 512 && m.y >= 344 && m.y <= 359 && NEW) {
  1114. show = true;
  1115. NEW = false;
  1116. } else if (show && mousePressed() && m.x >= 498 && m.x <= 512 && m.y >= 344 && m.y <= 359 && NEW) {
  1117. show = false;
  1118. NEW = false;
  1119. }
  1120.  
  1121. if (!mousePressed())
  1122. NEW = true;
  1123.  
  1124. if (show) {
  1125. double percent = skills.getPercentToNextLevel(trainingSkill);
  1126. g2.setColor(new Color(255,164,0, 255));
  1127. g2.fill3DRect(x+215, y+57, (int) (2.845 * percent), 17, true);
  1128. g2.setColor(new Color(187,0, 0, 255));
  1129. g2.drawRoundRect(x+214, y+55, 285, 20, 5, 5);
  1130. g2.setColor(new Color(83,54,0, 255));
  1131. g2.setFont(new Font("Arial", Font.BOLD, 16));
  1132. g2.drawString(percent+"% TL", x+325, y+72);
  1133. g.setColor(Color.black);
  1134. g2.setFont(new Font("Arial", Font.BOLD, 10));
  1135. if ((skills.getRealSkillLevel(trainingSkill) - startLevel) == 0)
  1136. g2.drawString("Currently Level "+skills.getRealSkillLevel(trainingSkill)+", "+(skills.getRealSkillLevel(trainingSkill) - startLevel)+" Levels Gained.", x+268, y+86);
  1137. else if ((skills.getRealSkillLevel(trainingSkill) - startLevel) == 1)
  1138. g2.drawString("Currently Level "+skills.getRealSkillLevel(trainingSkill)+", "+(skills.getRealSkillLevel(trainingSkill) - startLevel)+" Level Gained!", x+268, y+86);
  1139. else
  1140. g2.drawString("Currently Level "+skills.getRealSkillLevel(trainingSkill)+", "+(skills.getRealSkillLevel(trainingSkill) - startLevel)+" Levels Gained!", x+268, y+86);
  1141. }
  1142. // TRIGOON
  1143. if (show) {
  1144. /*for (int i = 0; i < badTiles.length; i++)
  1145. {
  1146. try {
  1147. if (tileOnMap(badTiles[i]) && tileOnScreen(badTiles[i]))
  1148. overlayTile(g2, badTiles[i],new Color(192,0,0, 50));
  1149. } catch (final Exception e) {
  1150. }
  1151. }*/
  1152. if (burning)
  1153. {
  1154. RSTile nextTile = new RSTile(getMyPlayer().getLocation().getX() - 1,getMyPlayer().getLocation().getY());
  1155. if (getObjectAt(nextTile) == null)
  1156. {
  1157. if (tileOnScreen(nextTile))
  1158. overlayTile(g2, nextTile, new Color(0, 200, 0, 50));
  1159. }
  1160. else
  1161. {
  1162. if (tileOnScreen(nextTile))
  1163. overlayTile(g2, nextTile, new Color(192, 0, 0, 50));
  1164. }
  1165. }
  1166. }
  1167. }
  1168.  
  1169. public void drawMouse(final Graphics g) {
  1170. final Point loc = getMouseLocation();
  1171. if (System.currentTimeMillis()
  1172. - Bot.getClient().getMouse().getMousePressTime() < 250) {
  1173. g.setColor(new Color(192, 0, 0, 225));
  1174. g.fillOval(loc.x - 5, loc.y - 5, 10, 10);
  1175. } else {
  1176. g.setColor(new Color(192, 0, 0, 50));
  1177. }
  1178. g.drawLine(0, loc.y, 766, loc.y);
  1179. g.drawLine(loc.x, 0, loc.x, 505);
  1180. }
  1181.  
  1182. public void overlayTile(final Graphics g, final RSTile t, final Color c) {
  1183. if (!tileOnScreen(t))
  1184. return;
  1185. final Point p = Calculations.tileToScreen(t);
  1186. final Point pn = Calculations.tileToScreen(t.getX(), t.getY(), 0, 0, 0);
  1187. final Point px = Calculations.tileToScreen(t.getX() + 1, t.getY(), 0,
  1188. 0, 0);
  1189. final Point py = Calculations.tileToScreen(t.getX(), t.getY() + 1, 0,
  1190. 0, 0);
  1191. final Point pxy = Calculations.tileToScreen(t.getX() + 1, t.getY() + 1,
  1192. 0, 0, 0);
  1193. final Point[] points = { p, pn, px, py, pxy };
  1194. for (final Point point : points) {
  1195. if (!pointOnScreen(point)) {
  1196. return;
  1197. }
  1198. }
  1199. g.setColor(c);
  1200. g.fillPolygon(new int[] { py.x, pxy.x, px.x, pn.x }, new int[] { py.y,
  1201. pxy.y, px.y, pn.y }, 4);
  1202. g.drawPolygon(new int[] { py.x, pxy.x, px.x, pn.x }, new int[] { py.y,
  1203. pxy.y, px.y, pn.y }, 4);
  1204. }
  1205.  
  1206. public void onFinish() {
  1207. ScreenshotUtil.takeScreenshot(true);
  1208. }
  1209.  
  1210. public class ArbiFireGUI extends JFrame {
  1211. public ArbiFireGUI() {
  1212. initComponents();
  1213. }
  1214.  
  1215. private void initComponents() {
  1216.  
  1217. ArbiFireGUI = new JFrame();
  1218. panel1 = new JPanel();
  1219. label1 = new JLabel();
  1220. tabbedPane1 = new JTabbedPane();
  1221. panel2 = new JPanel();
  1222. slider1 = new JSlider();
  1223. logSelected = new JComboBox();
  1224. textField3 = new JTextField();
  1225. textField4 = new JTextField();
  1226. textField5 = new JTextField();
  1227. slider3 = new JSlider();
  1228. label5 = new JLabel();
  1229. label6 = new JLabel();
  1230. label7 = new JLabel();
  1231. label8 = new JLabel();
  1232. panel4 = new JPanel();
  1233. label2 = new JLabel();
  1234. radioButton1 = new JRadioButton();
  1235. radioButton2 = new JRadioButton();
  1236. label3 = new JLabel();
  1237. label4 = new JLabel();
  1238. formattedTextField1 = new JFormattedTextField();
  1239. formattedTextField2 = new JFormattedTextField();
  1240. formattedTextField3 = new JFormattedTextField();
  1241. formattedTextField4 = new JFormattedTextField();
  1242. textField1 = new JTextField();
  1243. textField2 = new JTextField();
  1244. panel3 = new JPanel();
  1245. scrollPane1 = new JScrollPane();
  1246. textPane1 = new JTextPane();
  1247. button1 = new JButton();
  1248.  
  1249. {
  1250.  
  1251. ArbiFireGUI.addWindowListener(new WindowAdapter() {
  1252. @Override
  1253. public void windowClosing(WindowEvent arg0) {
  1254. guiStart = true;
  1255. ArbiFireGUI.dispose();
  1256. }
  1257. });
  1258.  
  1259. ArbiFireGUI.setFont(new Font("Century Gothic", Font.PLAIN, 12));
  1260. ArbiFireGUI.setFocusable(false);
  1261. ArbiFireGUI.setTitle("ArbiFire");
  1262. ArbiFireGUI.setVisible(true);
  1263. ArbiFireGUI.setResizable(false);
  1264. ArbiFireGUI.setAlwaysOnTop(true);
  1265. Container ArbiFireGUIContentPane = ArbiFireGUI.getContentPane();
  1266. ArbiFireGUIContentPane.setLayout(null);
  1267.  
  1268. {
  1269. panel1.setBackground(Color.red);
  1270. panel1.setFont(new Font("Century Gothic", Font.PLAIN, 12));
  1271. panel1.setFocusable(false);
  1272. panel1.setLayout(null);
  1273.  
  1274. label1.setText("ArbiFire");
  1275. label1.setFont(new Font("Century Gothic", Font.PLAIN, 34));
  1276. label1.setHorizontalTextPosition(SwingConstants.CENTER);
  1277. label1.setHorizontalAlignment(SwingConstants.CENTER);
  1278. label1.setBorder(null);
  1279. label1.setFocusable(false);
  1280. panel1.add(label1);
  1281. label1.setBounds(-1, -1, 376, 75);
  1282.  
  1283. {
  1284. tabbedPane1.setBackground(Color.red);
  1285. tabbedPane1.setFont(new Font("Century Gothic", Font.PLAIN, 12));
  1286. tabbedPane1.setBorder(null);
  1287. tabbedPane1.setFocusable(false);
  1288.  
  1289. {
  1290. panel2.setBackground(Color.red);
  1291. panel2.setBorder(null);
  1292. panel2.setForeground(Color.red);
  1293. panel2.setFont(new Font("Century Gothic", Font.PLAIN, 12));
  1294. panel2.setFocusable(false);
  1295. panel2.setLayout(null);
  1296.  
  1297. slider1.setMaximum(10);
  1298. slider1.setMinimum(4);
  1299. slider1.setBorder(null);
  1300. slider1.setOpaque(false);
  1301. slider1.setPaintTicks(true);
  1302. slider1.setPaintLabels(true);
  1303. slider1.setSnapToTicks(true);
  1304. slider1.setMajorTickSpacing(1);
  1305. slider1.setValue(7);
  1306. slider1.setFocusable(false);
  1307. panel2.add(slider1);
  1308. slider1.setBounds(31, 106, 290, 41);
  1309.  
  1310. logSelected.setModel(new DefaultComboBoxModel(new String[] {
  1311. "Normal",
  1312. "Oak",
  1313. "Willow",
  1314. "Teak",
  1315. "Maple",
  1316. "Mahogany",
  1317. "Yew",
  1318. "Magic"
  1319. }));
  1320. logSelected.setBorder(null);
  1321. logSelected.setOpaque(false);
  1322. logSelected.setFocusable(false);
  1323. panel2.add(logSelected);
  1324. logSelected.setBounds(131, 40, 90, 25);
  1325.  
  1326. textField3.setText("Log Type");
  1327. textField3.setHorizontalAlignment(SwingConstants.CENTER);
  1328. textField3.setEditable(false);
  1329. textField3.setOpaque(false);
  1330. textField3.setBorder(null);
  1331. textField3.setFont(textField3.getFont().deriveFont(textField3.getFont().getSize() + 3f));
  1332. textField3.setFocusable(false);
  1333. panel2.add(textField3);
  1334. textField3.setBounds(126, 5, 100, 30);
  1335.  
  1336. textField4.setText("Mouse Speed");
  1337. textField4.setHorizontalAlignment(SwingConstants.CENTER);
  1338. textField4.setEditable(false);
  1339. textField4.setOpaque(false);
  1340. textField4.setBorder(null);
  1341. textField4.setFont(textField4.getFont().deriveFont(textField4.getFont().getSize() + 3f));
  1342. textField4.setFocusable(false);
  1343. panel2.add(textField4);
  1344. textField4.setBounds(126, 70, 100, 30);
  1345.  
  1346. textField5.setText("Path Choices");
  1347. textField5.setHorizontalAlignment(SwingConstants.CENTER);
  1348. textField5.setEditable(false);
  1349. textField5.setOpaque(false);
  1350. textField5.setBorder(null);
  1351. textField5.setFont(textField5.getFont().deriveFont(textField5.getFont().getSize() + 3f));
  1352. textField5.setFocusable(false);
  1353. panel2.add(textField5);
  1354. textField5.setBounds(126, 151, 100, 30);
  1355.  
  1356. slider3.setMaximum(4);
  1357. slider3.setMinimum(2);
  1358. slider3.setBorder(null);
  1359. slider3.setOpaque(false);
  1360. slider3.setPaintTicks(true);
  1361. slider3.setPaintLabels(true);
  1362. slider3.setSnapToTicks(true);
  1363. slider3.setMajorTickSpacing(1);
  1364. slider3.setValue(3);
  1365. slider3.setFocusable(false);
  1366. panel2.add(slider3);
  1367. slider3.setBounds(31, 187, 290, 41);
  1368.  
  1369. label5.setText("Fastest");
  1370. panel2.add(label5);
  1371. label5.setBounds(31, 172, 60, label5.getPreferredSize().height);
  1372.  
  1373. label6.setText("Fastest");
  1374. panel2.add(label6);
  1375. label6.setBounds(31, 91, 60, 16);
  1376.  
  1377. label7.setText("Safest");
  1378. panel2.add(label7);
  1379. label7.setBounds(286, 172, 60, 16);
  1380.  
  1381. label8.setText("Slowest");
  1382. panel2.add(label8);
  1383. label8.setBounds(284, 91, 60, 16);
  1384.  
  1385. {
  1386. Dimension preferredSize = new Dimension();
  1387. for(int i = 0; i < panel2.getComponentCount(); i++) {
  1388. Rectangle bounds = panel2.getComponent(i).getBounds();
  1389. preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
  1390. preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
  1391. }
  1392. Insets insets = panel2.getInsets();
  1393. preferredSize.width += insets.right;
  1394. preferredSize.height += insets.bottom;
  1395. panel2.setMinimumSize(preferredSize);
  1396. panel2.setPreferredSize(preferredSize);
  1397. }
  1398. }
  1399. tabbedPane1.addTab("Main", panel2);
  1400.  
  1401.  
  1402. {
  1403. panel4.setBackground(Color.red);
  1404. panel4.setFocusable(false);
  1405. panel4.setLayout(null);
  1406.  
  1407. label2.setText("Custom Breaking");
  1408. label2.setHorizontalTextPosition(SwingConstants.CENTER);
  1409. label2.setHorizontalAlignment(SwingConstants.CENTER);
  1410. label2.setFont(label2.getFont().deriveFont(label2.getFont().getSize() + 10f));
  1411. panel4.add(label2);
  1412. label2.setBounds(0, 5, 350, 46);
  1413.  
  1414. radioButton1.setText("Use Breaking");
  1415. radioButton1.setBackground(Color.red);
  1416. radioButton1.setOpaque(false);
  1417. radioButton1.setEnabled(false);
  1418. panel4.add(radioButton1);
  1419. radioButton1.setBounds(112, 55, 125, 25);
  1420.  
  1421. radioButton2.setText("Completely Random");
  1422. radioButton2.setBackground(Color.red);
  1423. radioButton2.setOpaque(false);
  1424. radioButton2.setEnabled(false);
  1425. panel4.add(radioButton2);
  1426. radioButton2.setBounds(112, 85, 143, 25);
  1427.  
  1428. label3.setText("Time between breaks:");
  1429. label3.setEnabled(false);
  1430. panel4.add(label3);
  1431. label3.setBounds(51, 128, 130, 35);
  1432.  
  1433. label4.setText("Length of Breaks:");
  1434. label4.setEnabled(false);
  1435. panel4.add(label4);
  1436. label4.setBounds(51, 169, 130, 35);
  1437.  
  1438. formattedTextField1.setText("120");
  1439. formattedTextField1.setEnabled(false);
  1440. panel4.add(formattedTextField1);
  1441. formattedTextField1.setBounds(175, 135, 45, 25);
  1442.  
  1443. formattedTextField2.setText("30");
  1444. formattedTextField2.setEnabled(false);
  1445. panel4.add(formattedTextField2);
  1446. formattedTextField2.setBounds(175, 175, 45, 25);
  1447.  
  1448. formattedTextField3.setText("45");
  1449. formattedTextField3.setEnabled(false);
  1450. panel4.add(formattedTextField3);
  1451. formattedTextField3.setBounds(250, 135, 45, 25);
  1452.  
  1453. formattedTextField4.setText("15");
  1454. formattedTextField4.setEnabled(false);
  1455. panel4.add(formattedTextField4);
  1456. formattedTextField4.setBounds(250, 175, 45, 25);
  1457.  
  1458. textField1.setText("+ / -");
  1459. textField1.setOpaque(false);
  1460. textField1.setEditable(false);
  1461. textField1.setFocusable(false);
  1462. textField1.setCaretColor(Color.red);
  1463. textField1.setBorder(null);
  1464. textField1.setEnabled(false);
  1465. panel4.add(textField1);
  1466. textField1.setBounds(223, 133, 30, 25);
  1467.  
  1468. textField2.setText("+ / -");
  1469. textField2.setOpaque(false);
  1470. textField2.setEditable(false);
  1471. textField2.setFocusable(false);
  1472. textField2.setCaretColor(Color.red);
  1473. textField2.setBorder(null);
  1474. textField2.setEnabled(false);
  1475. panel4.add(textField2);
  1476. textField2.setBounds(223, 173, 30, 25);
  1477.  
  1478. {
  1479. Dimension preferredSize = new Dimension();
  1480. for(int i = 0; i < panel4.getComponentCount(); i++) {
  1481. Rectangle bounds = panel4.getComponent(i).getBounds();
  1482. preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
  1483. preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
  1484. }
  1485. Insets insets = panel4.getInsets();
  1486. preferredSize.width += insets.right;
  1487. preferredSize.height += insets.bottom;
  1488. panel4.setMinimumSize(preferredSize);
  1489. panel4.setPreferredSize(preferredSize);
  1490. }
  1491. }
  1492. tabbedPane1.addTab("Breaking", panel4);
  1493.  
  1494.  
  1495. {
  1496. panel3.setBackground(Color.red);
  1497. panel3.setFocusable(false);
  1498. panel3.setBorder(null);
  1499. panel3.setLayout(null);
  1500.  
  1501. {
  1502.  
  1503. textPane1.setText("Current Version: 1.24\n\nCheck here for more info about this script:\nhttp://www.rsbot.org/vb/showthread.php?t=313221");
  1504. textPane1.setEditable(false);
  1505. textPane1.setFont(new Font("Century Gothic", Font.PLAIN, 12));
  1506. scrollPane1.setViewportView(textPane1);
  1507. }
  1508. panel3.add(scrollPane1);
  1509. scrollPane1.setBounds(15, 33, 315, 180);
  1510.  
  1511. {
  1512. Dimension preferredSize = new Dimension();
  1513. for(int i = 0; i < panel3.getComponentCount(); i++) {
  1514. Rectangle bounds = panel3.getComponent(i).getBounds();
  1515. preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
  1516. preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
  1517. }
  1518. Insets insets = panel3.getInsets();
  1519. preferredSize.width += insets.right;
  1520. preferredSize.height += insets.bottom;
  1521. panel3.setMinimumSize(preferredSize);
  1522. panel3.setPreferredSize(preferredSize);
  1523. }
  1524. }
  1525. tabbedPane1.addTab("Updates", panel3);
  1526.  
  1527. }
  1528. panel1.add(tabbedPane1);
  1529. tabbedPane1.setBounds(10, 78, 355, 270);
  1530.  
  1531. button1.addActionListener(new java.awt.event.ActionListener() {
  1532. public void actionPerformed(java.awt.event.ActionEvent arg0) {
  1533. ArbiFire.speed = (int)slider1.getValue();
  1534. ArbiFire.variable = (int)slider3.getValue();
  1535. logToBurn = logSelected.getSelectedItem().toString();
  1536. if(logToBurn.contains("Norma")) {
  1537. log = 1511;
  1538. }
  1539. if(logToBurn.contains("Oa")) {
  1540. log = 1521;
  1541. }
  1542. if(logToBurn.contains("Willo")) {
  1543. log = 1519;
  1544. }
  1545. if(logToBurn.contains("Tea")) {
  1546. log = 6333;
  1547. }
  1548. if(logToBurn.contains("Mapl")) {
  1549. log = 1517;
  1550. }
  1551. if(logToBurn.contains("Mahogan")) {
  1552. log = 6332;
  1553. }
  1554. if(logToBurn.contains("Ye")) {
  1555. log = 1515;
  1556. }
  1557. if(logToBurn.contains("Magi")) {
  1558. log = 1513;
  1559. }
  1560.  
  1561. guiStart = true;
  1562. guiWait = false;
  1563. worked = true;
  1564. ArbiFireGUI.dispose();
  1565. }
  1566. });
  1567. button1.setText("Start");
  1568. button1.setFont(new Font("Century Gothic", Font.PLAIN, 12));
  1569. button1.setBorder(null);
  1570. button1.setFocusable(false);
  1571. panel1.add(button1);
  1572. button1.setBounds(10, 358, 355, 70);
  1573. }
  1574.  
  1575. ArbiFireGUIContentPane.add(panel1);
  1576. panel1.setBounds(0, 0, 395, 460);
  1577.  
  1578. ArbiFireGUIContentPane.setPreferredSize(new Dimension(375, 450));
  1579. ArbiFireGUI.pack();
  1580. ArbiFireGUI.setLocationRelativeTo(ArbiFireGUI.getOwner());
  1581. }
  1582. }
  1583.  
  1584. private JFrame ArbiFireGUI;
  1585. private JPanel panel1;
  1586. private JLabel label1;
  1587. private JTabbedPane tabbedPane1;
  1588. private JPanel panel2;
  1589. private JSlider slider1;
  1590. private JComboBox logSelected;
  1591. private JTextField textField3;
  1592. private JTextField textField4;
  1593. private JTextField textField5;
  1594. private JSlider slider3;
  1595. private JLabel label5;
  1596. private JLabel label6;
  1597. private JLabel label7;
  1598. private JLabel label8;
  1599. private JPanel panel4;
  1600. private JLabel label2;
  1601. private JRadioButton radioButton1;
  1602. private JRadioButton radioButton2;
  1603. private JLabel label3;
  1604. private JLabel label4;
  1605. private JFormattedTextField formattedTextField1;
  1606. private JFormattedTextField formattedTextField2;
  1607. private JFormattedTextField formattedTextField3;
  1608. private JFormattedTextField formattedTextField4;
  1609. private JTextField textField1;
  1610. private JTextField textField2;
  1611. private JPanel panel3;
  1612. private JScrollPane scrollPane1;
  1613. private JTextPane textPane1;
  1614. private JButton button1;
  1615. }
  1616. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement