Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.20 KB | None | 0 0
  1. import java.awt.BasicStroke;
  2. import java.awt.Color;
  3. import java.awt.Font;
  4. import java.awt.Graphics;
  5. import java.awt.Graphics2D;
  6. import java.awt.Point;
  7. import java.awt.Rectangle;
  8. import java.awt.event.MouseEvent;
  9. import java.awt.event.MouseListener;
  10. import java.io.BufferedReader;
  11. import java.io.BufferedWriter;
  12. import java.io.IOException;
  13. import java.io.InputStreamReader;
  14. import java.io.OutputStreamWriter;
  15. import java.net.Socket;
  16. import java.net.UnknownHostException;
  17. import java.util.regex.Matcher;
  18. import java.util.regex.Pattern;
  19.  
  20. import org.rsbot.event.listeners.PaintListener;
  21. import org.rsbot.script.Script;
  22. import org.rsbot.script.ScriptManifest;
  23. import org.rsbot.script.methods.Game;
  24. import org.rsbot.script.methods.Skills;
  25. import org.rsbot.script.wrappers.RSArea;
  26. import org.rsbot.script.wrappers.RSItem;
  27. import org.rsbot.script.wrappers.RSObject;
  28. import org.rsbot.script.wrappers.RSTile;
  29.  
  30. import org.rsbot.script.wrappers.RSComponent;
  31. import org.rsbot.script.wrappers.RSInterface;
  32.  
  33. @ScriptManifest(authors = "Anarki, Uplift", keywords = "Smithing", name = "Epic Edgeville Gold Bar Smelter", version = 1.04, description = "Smelt Gold Bar at Edgeville. Made by Uplift and Improved by Anarki.")
  34. public class EpicEdgevilleGoldBarSmelter extends Script implements PaintListener,
  35. MouseListener {
  36.  
  37. public double getVersion() {
  38. return 1.04;
  39. }
  40.  
  41. // Ints/Longs
  42. private int goldBarID = 2357, barID = goldBarID,
  43. failSafe, itemID, itemsDone, interfaceParent,
  44. interfaceChild, bankID, startXP, cXP, startLevel, runEnergy = 50,
  45. XPPH;
  46. private long startTime, rSeconds, rMinutes, rHours;
  47. // Tiles
  48. private RSTile smith, bankTile, stage2, failSafeTile;
  49. // Areas
  50. private RSArea bankArea, furnArea;
  51. // Strings
  52. String location, itemName = "Null", cLine;
  53. // Boolean
  54. private boolean gem, canCount = true, canStoreAll = true, usedFurance,
  55. usedBank, has2Stages, showPaint = true, scriptRunning;
  56. // Other
  57. Point mouseP;
  58. Rectangle togglePaint = new Rectangle(421, 350, 70, 20);
  59.  
  60. // ---------------- Auto Login int --------------------
  61. private static final int INTERFACE_LOGIN_SCREEN = 596;
  62. private static final int INTERFACE_TEXT_RETURN = 11;
  63. private static final int INTERFACE_WELCOME_SCREEN = 906;
  64. private static final int INTERFACE_WELCOME_SCREEN_BUTTON_PLAY_1 = 160;
  65. private static final int INTERFACE_WELCOME_SCREEN_BUTTON_PLAY_2 = 171;
  66. private static final int INTERFACE_WELCOME_SCREEN_BUTTON_LOGOUT = 193;
  67. private static final int INTERFACE_WELCOME_SCREEN_BUTTON_BACK = 228;
  68. private static final int INTERFACE_WELCOME_SCREEN_TEXT_RETURN = 221;
  69. private static final int INTERFACE_WELCOME_SCREEN_HIGH_RISK_WORLD_TEXT = 86;
  70. private static final int INTERFACE_WELCOME_SCREEN_HIGH_RISK_WORLD_LOGIN_BUTTON = 93;
  71.  
  72. private static final int INDEX_LOGGED_OUT = 3;
  73. private static final int INDEX_LOBBY = 7;
  74.  
  75. private int invalidCount;
  76.  
  77. public boolean onStart() {
  78. camera.setPitch(true);
  79. camera.setPitch(true);
  80. trentCrafterGUI g = new trentCrafterGUI();
  81. g.setVisible(true);
  82. while (g.isVisible())
  83. sleep(100);
  84. startXP = skills.getCurrentExp(Skills.SMITHING);
  85. startLevel = skills.getCurrentLevel(Skills.SMITHING);
  86. scriptRunning = true;
  87. return true;
  88. }
  89.  
  90. public void onFinish() {
  91. log("You made " + itemsDone + " " + itemName + "'s in " + rHours
  92. + " hours " + rMinutes + " minutes and " + rSeconds
  93. + " seconds!");
  94.  
  95. scriptRunning = false;
  96. }
  97.  
  98. @Override
  99. public int loop() {
  100. if (game.isLoggedIn()) {
  101. mouse.setSpeed(random(6, 8));
  102. }
  103. while (interfaces.get(906).containsText("Logging")) {
  104. sleep(10000);
  105. }
  106. if (!game.isLoggedIn()) {
  107. String returnText = interfaces.get(INTERFACE_LOGIN_SCREEN)
  108. .getComponent(INTERFACE_TEXT_RETURN).getText().toLowerCase();
  109. int textlength;
  110. if (game.getClientState() != INDEX_LOGGED_OUT) {
  111. if (!game.isWelcomeScreen()) {
  112. sleep(random(1000, 2000));
  113. }
  114. if (game.getClientState() == INDEX_LOBBY) {
  115. RSInterface welcome_screen = interfaces
  116. .get(INTERFACE_WELCOME_SCREEN);
  117. RSComponent welcome_screen_button_play_1 = welcome_screen
  118. .getComponent(INTERFACE_WELCOME_SCREEN_BUTTON_PLAY_1);
  119. RSComponent welcome_screen_button_play_2 = welcome_screen
  120. .getComponent(INTERFACE_WELCOME_SCREEN_BUTTON_PLAY_2);
  121.  
  122. mouse.click(welcome_screen_button_play_1.getAbsoluteX(),
  123. welcome_screen_button_play_1.getAbsoluteY(),
  124. welcome_screen_button_play_2.getAbsoluteX()
  125. + welcome_screen_button_play_2.getWidth()
  126. - welcome_screen_button_play_1.getAbsoluteX(),
  127. welcome_screen_button_play_1.getHeight(), true);
  128.  
  129. for (int i = 0; i < 4 && game.getClientState() == 6; i++) {
  130. sleep(500);
  131. }
  132. returnText = interfaces.get(INTERFACE_WELCOME_SCREEN)
  133. .getComponent(INTERFACE_WELCOME_SCREEN_TEXT_RETURN)
  134. .getText().toLowerCase();
  135.  
  136. if (returnText.contains("total skill level of")) {
  137. log("You don't have enough total level of the world required.");
  138. interfaces.getComponent(INTERFACE_WELCOME_SCREEN,
  139. INTERFACE_WELCOME_SCREEN_BUTTON_BACK).doClick();
  140. return -1;
  141. }
  142.  
  143. if (returnText.contains("login limit exceeded")) {
  144. if(interfaces.getComponent(INTERFACE_WELCOME_SCREEN_BUTTON_BACK).isValid())
  145. interfaces.getComponent(INTERFACE_WELCOME_SCREEN_BUTTON_BACK).doClick();
  146. }
  147.  
  148. if (returnText.contains("your account has not logged out")) {
  149. if (invalidCount > 10) {
  150. log.warning("Unable to login after 10 attempts. Stopping script.");
  151. log.severe("It seems you are actually already logged in?");
  152. return -1;
  153. }
  154. invalidCount++;
  155. log.severe("Waiting for logout..");
  156. sleep(5000,15000);
  157. }
  158.  
  159. if (returnText.contains("member")) {
  160. log("Unable to login to a members world. Stopping script.");
  161. RSComponent back_button1 = interfaces.get(
  162. INTERFACE_WELCOME_SCREEN).getComponent(228);
  163. RSComponent back_button2 = interfaces.get(
  164. INTERFACE_WELCOME_SCREEN).getComponent(231);
  165. mouse.click(
  166. back_button1.getAbsoluteX(),
  167. back_button1.getAbsoluteY(),
  168. back_button2.getAbsoluteX()
  169. + back_button2.getWidth()
  170. - back_button1.getAbsoluteX(),
  171. back_button1.getHeight(), true);
  172. interfaces.get(INTERFACE_WELCOME_SCREEN).getComponent(203)
  173. .doClick();
  174. return -1;
  175. }
  176. if (interfaces
  177. .get(INTERFACE_WELCOME_SCREEN)
  178. .getComponent(
  179. INTERFACE_WELCOME_SCREEN_HIGH_RISK_WORLD_TEXT)
  180. .getText().toLowerCase().trim()
  181. .contains("high-risk wilderness world")) {
  182. interfaces
  183. .get(INTERFACE_WELCOME_SCREEN)
  184. .getComponent(
  185. INTERFACE_WELCOME_SCREEN_HIGH_RISK_WORLD_LOGIN_BUTTON)
  186. .doClick();
  187. }
  188. }
  189. }
  190. }
  191. if (camera.getPitch() < 3000)
  192. camera.setPitch(true);
  193. if (game.getCurrentTab() != Game.TAB_INVENTORY) {
  194. game.openTab(Game.TAB_INVENTORY);
  195. }
  196. if (interfaces.getComponent(interfaceParent, interfaceChild).isValid()) {
  197. interfaces.getComponent(interfaceParent, interfaceChild).doAction("Make All");
  198. usedFurance = false;
  199. failSafe = 0;
  200. return random(500, 1000);
  201. }
  202. if (interfaces.getComponent(446, 12).isValid()) {
  203. interfaces.getComponent(446, 12).doClick();
  204. return random(500, 1000);
  205. }
  206. if (walking.getEnergy() >= runEnergy)
  207. walking.setRun(true);
  208.  
  209. if (atBank()) {
  210. if (!game.isLoggedIn()) {
  211. log("You have logged out. Maybe forced by Jagex due to continuous playing of 6 hours.");
  212. log("or disconnection.");
  213. }
  214. if (inventory.getCount(itemID) > 0) {
  215. canCount = true;
  216. walkTo(smith, furnArea);
  217. return random(500, 1000);
  218. } else {
  219. if (bank.isOpen()) {
  220. if (inventory.getCount() > 1) {
  221. bank.depositAll();
  222. return random(50, 900);
  223. }
  224. if (inventory.getCount() > 1
  225. && !inventory.contains(itemID)) {
  226. bank.depositAll();
  227. return random(500, 1000);
  228. }
  229. if (bank.getCount(itemID) < 1) {
  230. sleep(random(250, 500));
  231. if (bank.getCount(itemID) < 1) {
  232. sleep(random(250, 500));
  233. if (bank.getCount(itemID) < 1) {
  234. sleep(random(250, 500));
  235. if (bank.getCount(itemID) < 1) {
  236. sleep(random(250, 500));
  237. if (bank.getCount(itemID) < 1) {
  238. sleep(random(250, 500));
  239. if (bank.getCount(itemID) < 1) {
  240. sleep(random(1000, 2000));
  241. if (bank.getCount(itemID) < 1) {
  242. log("Smelted all the bars! Stopping script!");
  243. if (bank.isOpen())
  244. bank.close();
  245. env.saveScreenshot(false);
  246. game.logout(false);
  247. return -1;
  248. }
  249. }
  250. }
  251. }
  252. }
  253. }
  254. }
  255. if (inventory.getCount(itemID) == 0) {
  256. withdrawItems(itemID, 0);
  257. return random(1000, 1300);
  258. }
  259. } else {
  260. if (usedBank) {
  261. if (getMyPlayer().isMoving()) {
  262. return random(50, 300);
  263. }
  264. }
  265. RSObject banker = objects.getNearest(bankID);
  266. if (banker != null) {
  267. if (!calc.tileOnScreen(banker.getLocation())) {
  268. walkTo(bankTile, bankArea);
  269. return random(500, 1000);
  270. }
  271. if (canCount) {
  272. itemsDone += inventory.getCount(barID);
  273. canCount = false;
  274. }
  275. if (!banker.doAction("Use-quickly")) {
  276. camera.turnToObject(banker);
  277. } else {
  278. usedBank = true;
  279. sleep(800, 900);
  280. }
  281.  
  282. return random(500, 900);
  283. }
  284. }
  285. }
  286. }
  287. if (atFur()) {
  288. if (!game.isLoggedIn()) {
  289. log("You have logged out. Maybe forced by Jagex due to continuous playing of 6 hours.");
  290. log("or disconnection.");
  291. }
  292. if (failSafe != 0)
  293. failSafe = 0;
  294. if (inventory.getCount(barID) > 27) {
  295. walkTo(bankTile, bankArea);
  296. return random(1000, 2000);
  297. }
  298. if (isSmelting()) {
  299. antiBan();
  300. return random(500, 1000);
  301. }
  302. if (inventory.getCount(itemID) < 1) {
  303. walkTo(bankTile, bankArea);
  304. return random(500, 1000);
  305. }
  306. RSObject Furnace = objects.getNearest(26814);
  307. RSItem goldBar = inventory.getItem(itemID);
  308. if (Furnace != null & Furnace.isOnScreen()) {
  309. Furnace.doClick();
  310. mouse.move(257, 423, 8, 8);
  311. sleep(random(1500, 1800));
  312. mouse.click(true);
  313. sleep(random(300, 500));
  314. mouse.click(true);
  315. sleep(random(300, 500));
  316. mouse.click(true);
  317. sleep(random(300, 500));
  318. mouse.click(true);
  319. sleep(random(300, 500));
  320. mouse.click(true);
  321. sleep(random(300, 500));
  322. }
  323. int rand = random(0, 40);
  324. if (rand > 35)
  325. camera.setAngle(random(0, 360));
  326. else if (rand < 5)
  327. camera.setPitch(true);
  328. if (inventory.getCount(barID) > 27) {
  329. walkTo(bankTile, bankArea);
  330. return random(1000, 2000);
  331. }
  332. if (inventory.getCount(itemID) < 1) {
  333. walkTo(bankTile, bankArea);
  334. return random(500, 1000);
  335. }
  336. }
  337. if (!atFur() & !atBank() & !getMyPlayer().isMoving()) {
  338. if (inventory.getCount(barID) > 0) {
  339. if (!usedFurance || !getMyPlayer().isMoving()
  340. && calc.distanceTo(walking.getDestination()) < 3)
  341. walkTo(smith, furnArea);
  342. } else {
  343. walkTo(bankTile, bankArea);
  344. }
  345. }
  346. if (inventory.getCount(barID) > 27) {
  347. walkTo(bankTile, bankArea);
  348. return random(1000, 2000);
  349. }
  350. if (inventory.getCount(itemID) < 1) {
  351. walkTo(bankTile, bankArea);
  352. return random(500, 1000);
  353. }
  354. return 50;
  355. }
  356.  
  357. public boolean atFur() {
  358. return objects.getNearest(26814).isOnScreen();
  359. }
  360.  
  361. public boolean atBank() {
  362. return objects.getNearest(26972).isOnScreen();
  363. }
  364.  
  365. private final Color color1 = new Color(0, 0, 0, 140);
  366. private final Color color2 = new Color(0, 0, 0);
  367. private final Color color3 = new Color(255, 255, 255);
  368. private final Color colorGreen = new Color(0, 255, 0);
  369. private final Color colorRed = new Color(255, 0, 0);
  370. private final BasicStroke stroke1 = new BasicStroke(1);
  371.  
  372. private final Font font1 = new Font("Arial", 0, 17);
  373. private final Font font2 = new Font("Arial", 0, 14);
  374.  
  375. public void onRepaint(Graphics g1) {
  376. if (game.isLoggedIn()) {
  377. if (startTime == 0)
  378. startTime = System.currentTimeMillis();
  379. long millis = System.currentTimeMillis() - startTime;
  380. final long hours = millis / (1000 * 60 * 60);
  381. millis -= hours * 1000 * 60 * 60;
  382. final long minutes = millis / (1000 * 60);
  383. millis -= minutes * 1000 * 60;
  384. final long seconds = millis / 1000;
  385. cXP = skills.getCurrentExp(Skills.SMITHING);
  386. rHours = hours;
  387. int percentToNextLevel = skills.getPercentToNextLevel(Skills.SMITHING);
  388. rMinutes = minutes;
  389. rSeconds = seconds;
  390. XPPH = (int) ((cXP - startXP) * 3600000D / (System.currentTimeMillis() - startTime));
  391. int x = 20;
  392. int y = 370;
  393. Graphics2D g = (Graphics2D) g1;
  394. if (showPaint) {
  395. g.setColor(color1);
  396. g.fillRect(13, 349, 478, 103);
  397. g.setColor(color2);
  398. g.setStroke(stroke1);
  399. g.drawRect(13, 349, 478, 103);
  400. g.setFont(font1);
  401. g.setColor(color3);
  402. g.drawString("Epic Edgeville Gold Bar Smelter : V" + getVersion(), x, y);
  403. g.setFont(font2);
  404. g.drawString("Runtime : " + rHours + ":" + rMinutes + ":" + rSeconds, x, y + 30);
  405. g.drawString("Levels Gained : " + (skills.getCurrentLevel(Skills.SMITHING) - startLevel), x, y + 45);
  406. g.drawString("Current Level : " + skills.getCurrentLevel(Skills.SMITHING), x, y + 60);
  407. g.drawString("Exp gained : " + (cXP - startXP) + " xp", x, y + 75);
  408. g.setColor(color3);
  409. g.drawString("Items Banked : " + itemsDone, x + 210, y + 30);
  410. g.drawString("Exp per hour : " + XPPH + " xp", x + 210, y + 45);
  411. g.drawString("Exp to next level : " + skills.getExpToNextLevel(Skills.SMITHING) + " xp", x + 210, y + 60);
  412. g.setColor(colorRed);
  413. g.fillRoundRect(9, 460, 483, 12, 10, 10);
  414. g.setColor(colorGreen);
  415. int greenWidth = 460 * percentToNextLevel / 100;
  416. g.fillRoundRect(9, 460, greenWidth, 12, 10, 10);
  417. g.setColor(color2);
  418. g.drawString("% to next level : " + percentToNextLevel, 166, 471);
  419. g.setColor(color1);
  420. g.fillRect(421, 350, 70, 20);
  421. g.setColor(color3);
  422. g.drawString("Hide Paint", 423, 364);
  423. g.setColor(colorGreen);
  424. } else {
  425. g.setColor(color1);
  426. g.fillRect(421, 350, 70, 20);
  427. g.setColor(color3);
  428. g.drawString("Show Paint", 423, 364);
  429. }
  430.  
  431. }
  432.  
  433. }
  434.  
  435. public boolean isSmelting() {
  436. if (getMyPlayer().getAnimation() == -1) {
  437. sleep(random(800, 1300));
  438. if (getMyPlayer().getAnimation() == -1) {
  439. sleep(random(400, 900));
  440. if (getMyPlayer().getAnimation() == -1) {
  441. sleep(random(200, 500));
  442. if (getMyPlayer().getAnimation() == -1) {
  443. return false;
  444. }
  445. }
  446. }
  447. }
  448. return true;
  449. }
  450.  
  451. public void withdrawItems(int id, int count) {
  452. RSItem item = bank.getItem(id);
  453. String action = null;
  454. boolean hasAction = false;
  455. if (count == 0) {
  456. action = "Withdraw-All";
  457. } else {
  458. action = "Withdraw-" + count;
  459. }
  460. if (item != null) {
  461. item.doClick(false);
  462. String[] actions = menu.getActions();
  463. for (int i = 0; i < actions.length - 1; i++) {
  464. if (actions[i].equals(action)) {
  465. hasAction = true;
  466. }
  467. }
  468. if (hasAction) {
  469. item.doAction(action);
  470. } else {
  471. item.doAction("Withdraw-X");
  472. sleep(random(1000, 1500));
  473. keyboard.sendText("" + count, true);
  474. }
  475. }
  476. sleep(random(100, 500));
  477. }
  478.  
  479. public void antiBan() {
  480. int rand = random(0, 999);
  481. if (rand < 99) {
  482. runEnergy = random(30, 100);
  483. } else if (rand >= 99 && rand < 199) {
  484. camera.setAngle(random(1, 360));
  485. } else if (rand >= 199 && rand < 299) {
  486. mouse.move(random(1, 770), random(1, 550));
  487. } else if (rand >= 299 && rand < 399) {
  488. mouse.move(random(1, 770), random(1, 550));
  489. } else if (rand >= 399 && rand < 499) {
  490. mouse.setSpeed(random(7, 10));
  491. }
  492. }
  493.  
  494. public void walkTo(RSTile tile, RSArea area) {
  495. RSTile[] p = walking.findPath(tile);
  496. int len = p.length - 1;
  497. if (!getMyPlayer().isMoving()
  498. || (walking.getDestination() != null && calc.distanceTo(walking
  499. .getDestination()) < 10)) {
  500. if (walking.getDestination() == null
  501. || calc.distanceBetween(walking.getDestination(), p[len]) > 5)
  502. if (!calc.tileOnScreen(tile)) {
  503. walking.walkPathMM(walking.randomizePath(p, 2, 2));
  504. } else {
  505. walking.walkTileMM(walking.randomizeTile(tile, 3, 3));
  506. }
  507.  
  508. }
  509. }
  510.  
  511. public class trentCrafterGUI extends javax.swing.JFrame {
  512.  
  513. /** Creates new form trentCrafterGUI */
  514. public trentCrafterGUI() {
  515. initComponents();
  516. }
  517.  
  518. @SuppressWarnings("unchecked")
  519. private void initComponents() {
  520.  
  521. jLabel1 = new javax.swing.JLabel();
  522. jComboBox1 = new javax.swing.JComboBox();
  523. jComboBox2 = new javax.swing.JComboBox();
  524. jLabel2 = new javax.swing.JLabel();
  525. jLabel3 = new javax.swing.JLabel();
  526. jButton1 = new javax.swing.JButton();
  527.  
  528. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  529.  
  530. jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
  531. jLabel1.setText("Epic Edgeville Gold Bar Smelter");
  532.  
  533. jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(
  534. new String[] { "Gold Bar" }));
  535.  
  536. jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(
  537. new String[] { "Edgeville" }));
  538.  
  539. jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
  540. jLabel2.setText("Bar to Smelt: (Make sure Gold Bars are visible in your bank!)");
  541.  
  542. jLabel3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
  543. jLabel3.setText("Location:");
  544.  
  545. jButton1.setText("Start script!");
  546. jButton1.addActionListener(new java.awt.event.ActionListener() {
  547. public void actionPerformed(java.awt.event.ActionEvent evt) {
  548. jButton1ActionPerformed(evt);
  549. }
  550. });
  551.  
  552. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
  553. getContentPane());
  554. getContentPane().setLayout(layout);
  555. layout.setHorizontalGroup(layout
  556. .createParallelGroup(
  557. javax.swing.GroupLayout.Alignment.LEADING)
  558. .addGroup(
  559. layout.createSequentialGroup()
  560. .addContainerGap()
  561. .addGroup(
  562. layout.createParallelGroup(
  563. javax.swing.GroupLayout.Alignment.LEADING)
  564. .addGroup(
  565. javax.swing.GroupLayout.Alignment.TRAILING,
  566. layout.createSequentialGroup()
  567. .addComponent(
  568. jLabel1)
  569. .addGap(174,
  570. 174,
  571. 174))
  572. .addGroup(
  573. layout.createSequentialGroup()
  574. .addGroup(
  575. layout.createParallelGroup(
  576. javax.swing.GroupLayout.Alignment.LEADING)
  577. .addComponent(
  578. jComboBox1,
  579. javax.swing.GroupLayout.PREFERRED_SIZE,
  580. 276,
  581. javax.swing.GroupLayout.PREFERRED_SIZE)
  582. .addComponent(
  583. jComboBox2,
  584. javax.swing.GroupLayout.PREFERRED_SIZE,
  585. 276,
  586. javax.swing.GroupLayout.PREFERRED_SIZE)
  587. .addGroup(
  588. layout.createSequentialGroup()
  589. .addComponent(
  590. jLabel2)
  591. .addPreferredGap(
  592. javax.swing.LayoutStyle.ComponentPlacement.RELATED,
  593. 168,
  594. javax.swing.GroupLayout.PREFERRED_SIZE))
  595. .addGroup(
  596. layout.createSequentialGroup()
  597. .addComponent(
  598. jLabel3)
  599. .addPreferredGap(
  600. javax.swing.LayoutStyle.ComponentPlacement.RELATED,
  601. 219,
  602. javax.swing.GroupLayout.PREFERRED_SIZE)))
  603. .addContainerGap(
  604. javax.swing.GroupLayout.DEFAULT_SIZE,
  605. Short.MAX_VALUE))
  606. .addGroup(
  607. layout.createSequentialGroup()
  608. .addComponent(
  609. jButton1,
  610. javax.swing.GroupLayout.DEFAULT_SIZE,
  611. 276,
  612. Short.MAX_VALUE)
  613. .addContainerGap()))));
  614. layout.setVerticalGroup(layout
  615. .createParallelGroup(
  616. javax.swing.GroupLayout.Alignment.LEADING)
  617. .addGroup(
  618. layout.createSequentialGroup()
  619. .addContainerGap()
  620. .addComponent(jLabel1)
  621. .addGap(18, 18, 18)
  622. .addComponent(jLabel2)
  623. .addPreferredGap(
  624. javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  625. .addComponent(
  626. jComboBox1,
  627. javax.swing.GroupLayout.PREFERRED_SIZE,
  628. javax.swing.GroupLayout.DEFAULT_SIZE,
  629. javax.swing.GroupLayout.PREFERRED_SIZE)
  630. .addPreferredGap(
  631. javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  632. .addComponent(jLabel3)
  633. .addGap(4, 4, 4)
  634. .addComponent(
  635. jComboBox2,
  636. javax.swing.GroupLayout.PREFERRED_SIZE,
  637. javax.swing.GroupLayout.DEFAULT_SIZE,
  638. javax.swing.GroupLayout.PREFERRED_SIZE)
  639. .addPreferredGap(
  640. javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  641. .addComponent(jButton1)
  642. .addContainerGap(
  643. javax.swing.GroupLayout.DEFAULT_SIZE,
  644. Short.MAX_VALUE)));
  645.  
  646. pack();
  647. }//
  648.  
  649. /**
  650. * @param args
  651. * the command line arguments
  652. */
  653.  
  654. // Variables declaration - do not modify
  655. private javax.swing.JButton jButton1;
  656. private javax.swing.JComboBox jComboBox1;
  657. private javax.swing.JComboBox jComboBox2;
  658. private javax.swing.JLabel jLabel1;
  659. private javax.swing.JLabel jLabel2;
  660. private javax.swing.JLabel jLabel3;
  661.  
  662. // End of variables declaration
  663.  
  664. private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
  665. itemName = jComboBox1.getSelectedItem().toString();
  666. location = jComboBox2.getSelectedItem().toString();
  667. log("Assigning vars");
  668. if (location.contains("Edgeville")) {
  669. smith = new RSTile(3109, 3501);
  670. bankTile = new RSTile(3096, 3497);
  671. bankArea = new RSArea(new RSTile(3096, 3497), new RSTile(3096, 3497));
  672. furnArea = new RSArea(new RSTile(3109, 3501), new RSTile(3109, 3501));
  673. // RSArea = new RSArea( north-east RSTile, South-west RSTile );
  674. bankID = 26972;
  675. }
  676. if (itemName.equals("Gold Bar")) {
  677. interfaceParent = 905;
  678. interfaceChild = 14;
  679. barID = goldBarID;
  680. itemID = 444;
  681. itemName = "Gold Bar";
  682. }
  683. log("Smelting " + itemName + " at: " + location + "!");
  684. this.setVisible(false);
  685. }
  686.  
  687. }
  688.  
  689. @Override
  690. public void mouseClicked(MouseEvent e) {
  691. mouseP = e.getPoint();
  692. if (togglePaint.contains(mouseP)) {
  693. if (showPaint)
  694. showPaint = false;
  695. else
  696. showPaint = true;
  697. }
  698.  
  699. }
  700.  
  701.  
  702.  
  703. @Override
  704. public void mouseEntered(MouseEvent arg0) {
  705. // TODO Auto-generated method stub
  706.  
  707. }
  708.  
  709. @Override
  710. public void mouseExited(MouseEvent arg0) {
  711. // TODO Auto-generated method stub
  712.  
  713. }
  714.  
  715. @Override
  716. public void mousePressed(MouseEvent arg0) {
  717. // TODO Auto-generated method stub
  718.  
  719. }
  720.  
  721. @Override
  722. public void mouseReleased(MouseEvent arg0) {
  723. // TODO Auto-generated method stub
  724.  
  725. }
  726.  
  727. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement