Thondar

GuildMiner 1.0

Jun 24th, 2012
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.23 KB | None | 0 0
  1. import java.awt.*;
  2. import java.text.DecimalFormat;
  3. import java.awt.event.*;
  4. import java.io.BufferedReader;
  5. import java.io.IOException;
  6. import java.io.InputStreamReader;
  7. import java.net.URL;
  8. import java.net.URLConnection;
  9. import javax.swing.*;
  10.  
  11. import org.powerbot.concurrent.Task;
  12. import org.powerbot.concurrent.strategy.Condition;
  13. import org.powerbot.concurrent.strategy.Strategy;
  14. import org.powerbot.game.api.ActiveScript;
  15. import org.powerbot.game.api.Manifest;
  16. import org.powerbot.game.api.methods.Tabs;
  17. import org.powerbot.game.api.methods.Walking;
  18. import org.powerbot.game.api.methods.Widgets;
  19. import org.powerbot.game.api.methods.input.Mouse;
  20. import org.powerbot.game.api.methods.interactive.NPCs;
  21. import org.powerbot.game.api.methods.interactive.Players;
  22. import org.powerbot.game.api.methods.node.SceneEntities;
  23. import org.powerbot.game.api.methods.tab.Inventory;
  24. import org.powerbot.game.api.methods.tab.Skills;
  25. import org.powerbot.game.api.methods.widget.Camera;
  26. import org.powerbot.game.api.util.Random;
  27. import org.powerbot.game.api.util.Time;
  28. import org.powerbot.game.api.wrappers.Area;
  29. import org.powerbot.game.api.wrappers.Tile;
  30. import org.powerbot.game.api.wrappers.node.SceneObject;
  31. import org.powerbot.game.api.wrappers.widget.WidgetChild;
  32. import org.powerbot.game.bot.event.MessageEvent;
  33. import org.powerbot.game.bot.event.listener.MessageListener;
  34. import org.powerbot.game.bot.event.listener.PaintListener;
  35.  
  36. @Manifest(name = "GuildMiner", description = "Mines Mithril at the Mining Guild", version = 1.0, authors = {"Thondar"})
  37. public class GuildMiner extends ActiveScript implements PaintListener, MessageListener {
  38.  
  39. private int MithrilP(int id) throws IOException {
  40. URL url = new URL("http://open.tip.it/json/ge_single_item?item=" + MithrilOre);
  41. URLConnection con = url.openConnection();
  42. BufferedReader in = new BufferedReader(new InputStreamReader(
  43. con.getInputStream()));
  44. String line = "";
  45. String inputLine;
  46. while ((inputLine = in.readLine()) != null) {
  47. line += inputLine;
  48. }
  49. in.close();
  50. if (!line.contains("mark_price"))
  51. return -1;
  52. line = line.substring(line.indexOf("mark_price\":\"")
  53. + "mark_price\":\"".length());
  54. line = line.substring(0, line.indexOf("\""));
  55. return Integer.parseInt(line.replaceAll(",", ""));
  56. }
  57.  
  58.  
  59. int RandomGift = 14664;
  60. int startLVL;
  61. int MithrilVein[] = {5786, 5785, 5784};
  62. int MithrilOre = 447;
  63. int Ladder = 2113;
  64. int MithrilPrice;
  65. int MithrilCount;
  66. int Profit;
  67. int ProfitHour;
  68. int Banker = 6200;
  69. int Saphire = 1623;
  70. int Ruby = 1619;
  71. int Emerald = 1621;
  72. int Diamond = 1617;
  73.  
  74. long startXP;
  75. long startTime;
  76. long runTime, xpTime;
  77. long hr, min, sec, xphr, xpmin, xpsec;
  78. long xpGain;
  79.  
  80. private static WidgetChild FalaTele;
  81.  
  82. String time;
  83. String status;
  84. String xptime;
  85.  
  86. GUI g;
  87. private boolean guiWait = true;
  88.  
  89. Tile MineTile = new Tile(3047, 9739, 0);
  90. Tile StilesTile = new Tile(2857, 3146, 0);
  91.  
  92. DecimalFormat format = new DecimalFormat("#.##");
  93.  
  94. boolean start = false;
  95. boolean Note = true;
  96.  
  97. Area BankArea = new Area(new Tile(3009, 3355, 0), new Tile(3018, 3358, 0));
  98. Area GuildArea = new Area(new Tile(3041, 9732, 0), new Tile(3055, 9749, 0));
  99. Area WalkArea = new Area(new Tile(3015, 9732, 0), new Tile(3040, 9749, 0));
  100. Area ClimbArea = new Area(new Tile(3014, 3335, 0), new Tile(3025, 3345, 0));
  101.  
  102.  
  103. Tile[] TilesToBank = new Tile[] { new Tile(2966, 3394, 0),
  104. new Tile(2967, 3381, 0), new Tile(2975, 3378, 0),
  105. new Tile(2986, 3373, 0), new Tile(2995, 3366, 0),
  106. new Tile(3005, 3362, 0), new Tile(3013, 3357, 0)
  107. };
  108.  
  109. Tile[] TilesToOre = new Tile[] { new Tile(3024, 9739, 0),
  110. new Tile(3034, 9738, 0), new Tile(3042, 9737, 0),
  111. };
  112.  
  113. Tile[] TilesToGuild = new Tile[] { new Tile(3018, 3361, 0),
  114. new Tile(3023, 3350, 0), new Tile(3030, 3343, 0),
  115. new Tile(3022, 3338, 0)
  116. };
  117.  
  118.  
  119.  
  120. @Override
  121. protected void setup() {
  122. log.info("GuildMiner 1.0");
  123. log.info("Made by Thondar");
  124. start = true;
  125. status = ("Starting Up");
  126. Walking.setRun(true);
  127.  
  128. try {
  129. MithrilPrice = MithrilP(MithrilOre);
  130. } catch (IOException e) {
  131. e.printStackTrace();
  132. }
  133.  
  134. g = new GUI();
  135. g.setVisible(true);
  136. final WaitGui guiTask = new WaitGui();
  137. provide(new Strategy(guiTask, guiTask));
  138. provide(new Strategy(new WaitGui(), new WaitGui()));
  139.  
  140. startTime = System.currentTimeMillis();
  141.  
  142. startXP = Skills.getExperience(Skills.MINING);
  143. startLVL = Skills.getLevel(Skills.MINING);
  144.  
  145. Mine mine = new Mine();
  146. Strategy mineStrategy = new Strategy(mine, mine);
  147. provide(mineStrategy);
  148.  
  149. MineWait minewait = new MineWait();
  150. Strategy minewaitStrategy = new Strategy(minewait, minewait);
  151. provide(minewaitStrategy);
  152.  
  153. GuildWalk guildwalk = new GuildWalk();
  154. Strategy guildwalkStrategy = new Strategy(guildwalk, guildwalk);
  155. provide(guildwalkStrategy);
  156.  
  157. BankWalk bankwalk = new BankWalk();
  158. Strategy bankwalkStrategy = new Strategy(bankwalk, bankwalk);
  159. provide(bankwalkStrategy);
  160.  
  161. MineWalk minewalk = new MineWalk();
  162. Strategy minewalkStrategy = new Strategy(minewalk, minewalk);
  163. provide(minewalkStrategy);
  164.  
  165. Climb climb = new Climb();
  166. Strategy climbStrategy = new Strategy(climb, climb);
  167. provide(climbStrategy);
  168.  
  169. FalaTele falatele = new FalaTele();
  170. Strategy falateleStrategy = new Strategy(falatele, falatele);
  171. provide(falateleStrategy);
  172.  
  173. Bank bank = new Bank();
  174. Strategy bankStrategy = new Strategy(bank, bank);
  175. provide(bankStrategy);
  176.  
  177. BankOpen bankopen = new BankOpen();
  178. Strategy bankopenStrategy = new Strategy(bankopen, bankopen);
  179. provide(bankopenStrategy);
  180.  
  181. AntiBan ab = new AntiBan();
  182. Strategy abStrategy = new Strategy(ab, ab);
  183. provide(abStrategy);
  184.  
  185. Tabs.INVENTORY.open(false);
  186.  
  187. }
  188.  
  189. private class WaitGui implements Task, Condition {
  190.  
  191. @Override
  192. public void run() {
  193. while (guiWait) {
  194. Time.sleep(500);
  195.  
  196. }
  197. }
  198.  
  199. public boolean validate() {
  200. return guiWait;
  201. }
  202.  
  203. }
  204.  
  205.  
  206. private class Mine implements Task, Condition {
  207.  
  208. @Override
  209. public void run() {
  210. Mine();
  211. Time.sleep(Random.nextInt(1200, 1600));
  212. }
  213.  
  214. @Override
  215. public boolean validate() {
  216. return !Inventory.isFull() && GuildArea.contains(Players.getLocal()) && SceneEntities.getNearest(MithrilVein).isOnScreen();
  217. }
  218.  
  219. }
  220.  
  221. private class MineWait implements Task, Condition {
  222.  
  223. @Override
  224. public void run() {
  225. Walking.walk(MineTile);
  226. status = ("Waiting");
  227. Camera.setPitch(Random.nextInt(19, 68));
  228. Camera.setAngle(Random.nextInt(204, 224));
  229. Time.sleep(Random.nextInt(600, 1100));
  230. }
  231.  
  232. @Override
  233. public boolean validate() {
  234. return !Inventory.isFull() && (Players.getLocal().getAnimation() == -1) && GuildArea.contains(Players.getLocal()) && !SceneEntities.getNearest(MithrilVein).isOnScreen();
  235. }
  236.  
  237. }
  238.  
  239. private class GuildWalk implements Task, Condition {
  240.  
  241. @Override
  242. public void run() {
  243. status = ("Walking");
  244. Walking.newTilePath(TilesToOre).traverse();
  245. Time.sleep(Random.nextInt(300, 500));
  246. }
  247.  
  248. @Override
  249. public boolean validate() {
  250. return !Inventory.isFull() && (Players.getLocal().getAnimation() == -1) && WalkArea.contains(Players.getLocal());
  251. }
  252.  
  253. }
  254.  
  255. private class BankWalk implements Task, Condition {
  256.  
  257. @Override
  258. public void run() {
  259. Walking.setRun(true);
  260. status = ("Walking");
  261. Walking.newTilePath(TilesToBank).traverse();
  262. Time.sleep(Random.nextInt(300, 500));
  263. }
  264.  
  265. @Override
  266. public boolean validate() {
  267. return Inventory.isFull() && !BankArea.contains(Players.getLocal()) && !GuildArea.contains(Players.getLocal());
  268. }
  269.  
  270. }
  271.  
  272. private class MineWalk implements Task, Condition {
  273.  
  274. @Override
  275. public void run() {
  276. status = ("Walking");
  277. Walking.newTilePath(TilesToGuild).traverse();
  278. Time.sleep(Random.nextInt(300, 500));
  279. }
  280.  
  281. @Override
  282. public boolean validate() {
  283. return !Inventory.isFull() && !WalkArea.contains(Players.getLocal()) && !GuildArea.contains(Players.getLocal());
  284. }
  285.  
  286. }
  287.  
  288. private class FalaTele implements Task, Condition {
  289.  
  290. @Override
  291. public void run() {
  292. FalaTele();
  293. }
  294.  
  295. @Override
  296. public boolean validate() {
  297. return Inventory.isFull() && (Players.getLocal().getAnimation() == -1) && GuildArea.contains(Players.getLocal());
  298. }
  299.  
  300. }
  301.  
  302.  
  303. private class Climb implements Task, Condition {
  304.  
  305. @Override
  306. public void run() {
  307. SceneEntities.getNearest(Ladder).interact("Climb-down");
  308. Time.sleep(Random.nextInt(600, 900));
  309. }
  310.  
  311. @Override
  312. public boolean validate() {
  313. return !Inventory.isFull() && (Players.getLocal().getAnimation() == -1) && ClimbArea.contains(Players.getLocal());
  314. }
  315.  
  316. }
  317.  
  318. private class BankOpen implements Task, Condition {
  319.  
  320. @Override
  321. public void run() {
  322. status = ("Banking");
  323. NPCs.getNearest(Banker).interact("Bank");
  324. Time.sleep(500);
  325. }
  326.  
  327. @Override
  328. public boolean validate() {
  329. return Inventory.isFull() && NPCs.getNearest(Banker).isOnScreen() && (Players.getLocal().getAnimation() == -1);
  330. }
  331.  
  332. }
  333.  
  334.  
  335. private class Bank implements Task, Condition {
  336.  
  337. @Override
  338. public void run() {
  339. status = ("Banking");
  340. org.powerbot.game.api.methods.widget.Bank.deposit(MithrilOre, 28);
  341. Time.sleep(Random.nextInt(300, 500));
  342. org.powerbot.game.api.methods.widget.Bank.deposit(Saphire, 28);
  343. Time.sleep(Random.nextInt(300, 500));
  344. org.powerbot.game.api.methods.widget.Bank.deposit(Ruby, 28);
  345. Time.sleep(Random.nextInt(300, 500));
  346. org.powerbot.game.api.methods.widget.Bank.deposit(Emerald, 28);
  347. Time.sleep(Random.nextInt(300, 500));
  348. org.powerbot.game.api.methods.widget.Bank.deposit(Diamond, 28);
  349. Time.sleep(Random.nextInt(300, 500));
  350. org.powerbot.game.api.methods.widget.Bank.close();
  351. }
  352.  
  353. @Override
  354. public boolean validate() {
  355. return Inventory.isFull() && org.powerbot.game.api.methods.widget.Bank.isOpen();
  356. }
  357.  
  358. }
  359.  
  360.  
  361. private class AntiBan implements Task, Condition {
  362.  
  363. @Override
  364. public void run() {
  365. switch(Random.nextInt(1, 100)){
  366. case 3:
  367. Camera.setAngle(Random.nextInt(1, 150));
  368. Camera.setPitch(Random.nextInt(20, 50));
  369. case 33:
  370. Camera.setAngle(Random.nextInt(1, 310));
  371. Camera.setPitch(Random.nextInt(20, 50));
  372. case 75:
  373. Camera.setAngle(Random.nextInt(1, 210));
  374. Camera.setPitch(Random.nextInt(20, 50));
  375. default:
  376. }
  377. Time.sleep(Random.nextInt(500, 1000));
  378. }
  379.  
  380. @Override
  381. public boolean validate() {
  382. return start;
  383. }
  384.  
  385. }
  386.  
  387.  
  388. public void Mine() {
  389. log.info("Mining");
  390. status = ("Mining");
  391. Tabs.INVENTORY.open(false);
  392. SceneObject i = SceneEntities.getNearest(MithrilVein);
  393. if (i != null) {
  394. Camera.turnTo(i.getLocation());
  395. SceneEntities.getNearest(MithrilVein).interact("Mine");
  396. }
  397. }
  398.  
  399. public void FalaTele() {
  400. Tabs.MAGIC.open(false);
  401. Time.sleep(500);
  402. FalaTele = Widgets.get(192, 24);
  403. FalaTele.click(true);
  404. Time.sleep(500);
  405. Mouse.move(275, 200);
  406. Mouse.click(true);
  407. status = ("Teleporting");
  408. Time.sleep(500);
  409. }
  410.  
  411. @Override
  412. public void messageReceived(MessageEvent e) {
  413. String txt = e.getMessage().toLowerCase();
  414. if(txt.contains("you manage to mine some mithril")) {
  415. MithrilCount++;}
  416. }
  417.  
  418.  
  419. private AlphaComposite makeComposite(float alpha) {
  420. int type = AlphaComposite.SRC_OVER;
  421.  
  422. return(AlphaComposite.getInstance(type, alpha));
  423. }
  424.  
  425.  
  426. private final Font font1 = new Font("Verdana", 0, 16);
  427. private final Font font2 = new Font("Verdana", 0, 12);
  428. private final Font font3 = new Font("Verdana", 0, 13);
  429. private final Font font4 = new Font("Verdana", 0, 9);
  430.  
  431.  
  432. @Override
  433. public void onRepaint(Graphics g) {
  434. Graphics2D g2d = (Graphics2D) g;
  435.  
  436. runTime = System.currentTimeMillis() - startTime;
  437. time = "";
  438. hr = runTime / (1000 * 60 * 60);
  439. min = (runTime % (1000 * 60 * 60)) / (1000 * 60);
  440. sec = ((runTime % (1000 * 60 * 60)) % (1000 * 60)) / 1000;
  441.  
  442. xpGain = (Skills.getExperience(Skills.MINING) - startXP);
  443.  
  444. int xpHour = (int) ((xpGain) * 3600000D / (System
  445. .currentTimeMillis() - startTime));
  446.  
  447. int level = Skills.getLevel(Skills.MINING);
  448. int startXP = Skills.getExperienceRequired(level);
  449. int nextXP = Skills.getExperienceRequired(level + 1);
  450. double rangeXP = nextXP-startXP;
  451. double currentRelativeXP = Skills.getExperience(Skills.MINING) - startXP;
  452. double currentXPleft = nextXP - Skills.getExperience(Skills.MINING);
  453. double percentA = currentRelativeXP/rangeXP;
  454. double percentToLvl = ((percentA) * 100D);
  455.  
  456. double percent = (int) ((percentA) * 500D);
  457.  
  458. xpTime = (long) ((currentXPleft / xpHour) * 3600000D);
  459. xptime = "";
  460.  
  461. if(MithrilCount == 0) {
  462. xphr = 0;
  463. xpmin = 0;
  464. xpsec = 0;
  465. }
  466. if(MithrilCount >= 1) {
  467. xphr = xpTime / (1000 * 60 * 60);
  468. xpmin = (xpTime % (1000 * 60 * 60)) / (1000 * 60);
  469. xpsec = ((xpTime % (1000 * 60 * 60)) % (1000 * 60)) / 1000;
  470. }
  471.  
  472.  
  473. int MithrilHour = (int) ((MithrilCount) * 3600000D / (System
  474. .currentTimeMillis() - startTime));
  475.  
  476. Profit = MithrilCount * MithrilPrice;
  477. ProfitHour = MithrilHour * MithrilPrice;
  478.  
  479. Rectangle bg = new Rectangle(10, 10, 160, 320);
  480. g2d.setComposite(makeComposite(.5f));
  481. g2d.setColor(Color.LIGHT_GRAY);
  482. g2d.fill(bg);
  483.  
  484. g2d.setComposite(makeComposite(.5f));
  485. g2d.setColor(Color.BLACK);
  486. g2d.drawRect(10, 10, 160, 320);
  487.  
  488. g2d.setFont(font1);
  489. g2d.setComposite(makeComposite(1f));
  490. g2d.setColor(Color.BLUE);
  491. g2d.drawString("GuildMiner", 50, 30);
  492. g2d.setFont(font3);
  493. g2d.drawString("By Thondar", 55, 45);
  494.  
  495. g2d.setFont(font4);
  496. g2d.setComposite(makeComposite(.8f));
  497. g2d.setColor(Color.BLUE);
  498. g2d.drawString("Version 1.0", 61, 55);
  499.  
  500. g2d.setComposite(makeComposite(.5f));
  501. g2d.setColor(Color.BLACK);
  502. g2d.drawLine(20, 60, 160, 60);
  503. g2d.drawLine(20, 110, 160, 110);
  504. g2d.drawLine(20, 160, 160, 160);
  505. g2d.drawLine(20, 210, 160, 210);
  506. g2d.drawLine(20, 260, 160, 260);
  507. g2d.drawLine(20, 310, 160, 310);
  508.  
  509.  
  510. g2d.setFont(font2);
  511. g2d.setComposite(makeComposite(.8f));
  512. g2d.setColor(new Color (0x00, 0x33, 0xff));
  513. g2d.drawString("Time Run: " + hr + ":" + min + ":" + sec, 30, 80);
  514.  
  515. g2d.setComposite(makeComposite(.8f));
  516. g2d.setColor(new Color (0x00, 0x33, 0xff));
  517. g2d.drawString("Status: " + status, 30, 100);
  518.  
  519. g2d.setComposite(makeComposite(.8f));
  520. g2d.setColor(new Color (0x00, 0x33, 0xff));
  521. g2d.drawString("XP/H: " + xpHour, 30, 130);
  522.  
  523. g2d.setComposite(makeComposite(.8f));
  524. g2d.setColor(new Color (0x00, 0x33, 0xff));
  525. g2d.drawString("XP Gained: " + xpGain, 30, 150);
  526.  
  527. g2d.setComposite(makeComposite(.8f));
  528. g2d.setColor(new Color (0x00, 0x33, 0xff));
  529. g2d.drawString("Current Level: " + (Skills.getLevel(Skills.MINING)), 30, 180);
  530.  
  531. g2d.setComposite(makeComposite(.8f));
  532. g2d.setColor(new Color (0x00, 0x33, 0xff));
  533. g2d.drawString("Levels Gained: " + (Skills.getLevel(Skills.MINING) - startLVL), 30, 200);
  534.  
  535. g2d.setComposite(makeComposite(.8f));
  536. g2d.setColor(new Color (0x00, 0x33, 0xff));
  537. g2d.drawString("Mithril Mined: " + MithrilCount, 30, 230);
  538.  
  539. g2d.setComposite(makeComposite(.8f));
  540. g2d.setColor(new Color (0x00, 0x33, 0xff));
  541. g2d.drawString("Mithril Mined/H: " + MithrilHour , 30, 250);
  542.  
  543. g2d.setComposite(makeComposite(.8f));
  544. g2d.setColor(new Color (0x00, 0x33, 0xff));
  545. g2d.drawString("Profit: " + Profit, 30, 280);
  546.  
  547. g2d.setComposite(makeComposite(.8f));
  548. g2d.setColor(new Color (0x00, 0x33, 0xff));
  549. g2d.drawString("Profit/h: " + ProfitHour, 30, 300);
  550.  
  551. g2d.setComposite(makeComposite(.8f));
  552. g2d.setColor(new Color (0x00, 0x33, 0xff));
  553. g2d.drawString("Time to lvl: " + xphr + ":" + xpmin + ":" + xpsec, 30, 325);
  554.  
  555. g2d.setComposite(makeComposite(1f));
  556. g2d.setColor(Color.BLACK);
  557. g2d.drawRect(10, 330, 500, 15);
  558.  
  559. g2d.setComposite(makeComposite(1f));
  560. g2d.setColor(Color.LIGHT_GRAY);
  561. g2d.fillRect(11, 331, 499, 13);
  562.  
  563. g2d.setComposite(makeComposite(1f));
  564. g2d.setColor(Color.GREEN);
  565. g2d.fillRect(11, 331,(int) (percent), 13);
  566.  
  567. g2d.setComposite(makeComposite(1f));
  568. g2d.setColor(Color.BLUE);
  569. g2d.drawString (String.format("%.2f", percentToLvl) + "%" , 225, 342);
  570.  
  571.  
  572. }
  573.  
  574.  
  575. class GUI extends JFrame {
  576. public GUI() {
  577. initComponents();
  578. }
  579.  
  580. private void StartButtonActionPerformed(ActionEvent e) {
  581. guiWait = false;
  582. g.dispose();
  583. }
  584.  
  585. private void initComponents() {
  586. // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
  587. // Generated using JFormDesigner Evaluation license - Jonas Bill Jensen
  588. StartButton = new JButton();
  589. label1 = new JLabel();
  590. label2 = new JLabel();
  591. label3 = new JLabel();
  592. label4 = new JLabel();
  593. label5 = new JLabel();
  594. label6 = new JLabel();
  595. label7 = new JLabel();
  596.  
  597. //======== this ========
  598. Container contentPane = getContentPane();
  599. contentPane.setLayout(null);
  600.  
  601. //---- StartButton ----
  602. StartButton.setText("Start");
  603. StartButton.setFont(new Font("Calibri", Font.PLAIN, 14));
  604. StartButton.addActionListener(new ActionListener() {
  605. @Override
  606. public void actionPerformed(ActionEvent e) {
  607. StartButtonActionPerformed(e);
  608. }
  609. });
  610. contentPane.add(StartButton);
  611. StartButton.setBounds(5, 195, 230, 75);
  612.  
  613. //---- label1 ----
  614. label1.setText("GuildMiner");
  615. label1.setFont(new Font("MV Boli", Font.BOLD, 24));
  616. label1.setHorizontalAlignment(SwingConstants.CENTER);
  617. contentPane.add(label1);
  618. label1.setBounds(5, 0, 225, 65);
  619.  
  620. //---- label2 ----
  621. label2.setText("By Thondar");
  622. label2.setHorizontalAlignment(SwingConstants.CENTER);
  623. label2.setFont(new Font("MV Boli", Font.PLAIN, 14));
  624. contentPane.add(label2);
  625. label2.setBounds(0, 45, 240, label2.getPreferredSize().height);
  626.  
  627. //---- label3 ----
  628. label3.setText("Make sure you have your desired");
  629. label3.setHorizontalAlignment(SwingConstants.CENTER);
  630. label3.setFont(new Font("Calibri", Font.PLAIN, 12));
  631. contentPane.add(label3);
  632. label3.setBounds(0, 100, 240, 15);
  633.  
  634. //---- label4 ----
  635. label4.setText(" Pickaxe in your inventory before starting");
  636. label4.setHorizontalAlignment(SwingConstants.CENTER);
  637. label4.setFont(new Font("Calibri", Font.PLAIN, 12));
  638. contentPane.add(label4);
  639. label4.setBounds(0, 115, 240, 15);
  640.  
  641. //---- label5 ----
  642. label5.setText(" If you start the script without a Pickaxe,");
  643. label5.setHorizontalAlignment(SwingConstants.CENTER);
  644. label5.setFont(new Font("Calibri", Font.PLAIN, 12));
  645. contentPane.add(label5);
  646. label5.setBounds(0, 135, 240, 20);
  647.  
  648. //---- label6 ----
  649. label6.setText("it will use your Bronze Pickaxe");
  650. label6.setHorizontalAlignment(SwingConstants.CENTER);
  651. label6.setFont(new Font("Calibri", Font.PLAIN, 12));
  652. contentPane.add(label6);
  653. label6.setBounds(0, 155, 240, 15);
  654.  
  655. //---- label7 ----
  656. label7.setText(" from your toolbelt");
  657. label7.setHorizontalAlignment(SwingConstants.CENTER);
  658. label7.setFont(new Font("Calibri", Font.PLAIN, 12));
  659. contentPane.add(label7);
  660. label7.setBounds(0, 170, 240, label7.getPreferredSize().height);
  661.  
  662. { // compute preferred size
  663. Dimension preferredSize = new Dimension();
  664. for(int i = 0; i < contentPane.getComponentCount(); i++) {
  665. Rectangle bounds = contentPane.getComponent(i).getBounds();
  666. preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
  667. preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
  668. }
  669. Insets insets = contentPane.getInsets();
  670. preferredSize.width += insets.right;
  671. preferredSize.height += insets.bottom;
  672. contentPane.setMinimumSize(preferredSize);
  673. contentPane.setPreferredSize(preferredSize);
  674. }
  675. pack();
  676. setLocationRelativeTo(getOwner());
  677. // JFormDesigner - End of component initialization //GEN-END:initComponents
  678. }
  679.  
  680. // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
  681. // Generated using JFormDesigner Evaluation license - Jonas Bill Jensen
  682. private JButton StartButton;
  683. private JLabel label1;
  684. private JLabel label2;
  685. private JLabel label3;
  686. private JLabel label4;
  687. private JLabel label5;
  688. private JLabel label6;
  689. private JLabel label7;
  690. // JFormDesigner - End of variables declaration //GEN-END:variables
  691. }
  692.  
  693.  
  694.  
  695. }
Advertisement
Add Comment
Please, Sign In to add comment