wafflecat

asg3gh

Mar 13th, 2012
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.63 KB | None | 0 0
  1. import com.rarebot.script.*;
  2. import com.rarebot.script.wrappers.*;
  3. import com.rarebot.event.listeners.MessageListener;
  4. import com.rarebot.event.listeners.PaintListener;
  5. import com.rarebot.event.events.*;
  6. import com.rarebot.script.methods.*;
  7. import java.awt.*;
  8. import java.awt.event.MouseEvent;
  9. import java.awt.event.MouseListener;
  10. import java.awt.event.MouseMotionListener;
  11. import java.awt.image.BufferedImage;
  12. import java.io.IOException;
  13. import java.net.MalformedURLException;
  14. import java.net.URL;
  15. import java.util.LinkedList;
  16.  
  17. import java.awt.*;
  18. import java.awt.event.*;
  19. import javax.swing.*;
  20.  
  21. import javax.imageio.ImageIO;
  22.  
  23. @ScriptManifest(authors = {"eShade"}, keywords = {"thieving"}, name = "FuserBanditStealer", description = "Pickpockets bandits for 100k+ profit and 120k+ exp/hour!", version = 0.15)
  24.  
  25. public class FuserBanditStealer extends Script implements PaintListener, MessageListener, MouseListener, MouseMotionListener {
  26.  
  27.  
  28. public long startTime = 0;
  29. public long timeMilliSeconds = 0;
  30. public long timeHours = 0;
  31. public long timeMinutes = 0;
  32. public long timeSeconds = 0;
  33. public int expHour;
  34. public int startExp;
  35. public int glovesID = 10075;
  36. public int expGained;
  37. boolean check;
  38. public Double ver = FuserBanditStealer.class.getAnnotation(ScriptManifest.class)
  39. .version();
  40. private boolean guiWait = true;
  41. gui g = new gui();
  42. public boolean fiveleft;
  43. public long millis = 0;
  44. public long hours = 0;
  45. public long minutes = 0;
  46. public long seconds = 0;
  47. public boolean usingGloves = true;
  48. public boolean stuck = false;
  49. public int foodID;
  50. public int untilDegrade;
  51. public int[] banditID = {1879};
  52. public boolean showhide = true;
  53. private String status = "Loading...";
  54. public int bankerID = 3046;
  55. public int bankTrips;
  56. public boolean haveGloves;
  57. public boolean onstartequip = true;
  58. RSTile nardahGypsie = new RSTile(3401, 2917, 0);
  59. RSTile banditGypsie = new RSTile(3349, 2942, 0);
  60. RSTile nardahBank = new RSTile(3428, 2891, 0);
  61. RSTile banditTile = new RSTile(3351, 2998, 0);
  62. //Mouse
  63. private final LinkedList<MousePathPoint1> mousePath = new LinkedList<MousePathPoint1>();
  64. BufferedImage normal = null;
  65. public boolean showPaint = true ;
  66. BufferedImage clicked = null;
  67.  
  68. RSArea banditLocation = new RSArea(new RSTile[] {
  69. new RSTile(3344, 3011), new RSTile(3360, 3011),
  70. new RSTile(3369, 3010), new RSTile(3374, 3009),
  71. new RSTile(3375, 3004), new RSTile(3376, 2990),
  72. new RSTile(3371, 2992), new RSTile(3366, 2992),
  73. new RSTile(3361, 2992), new RSTile(3356, 2992),
  74. new RSTile(3351, 2993), new RSTile(3346, 2993)
  75. });
  76.  
  77. RSArea banditGypoGuy = new RSArea(new RSTile[] {
  78. new RSTile(3340, 2950), new RSTile(3351, 2950),
  79. new RSTile(3356, 2948), new RSTile(3356, 2941),
  80. new RSTile(3353, 2937), new RSTile(3348, 2937),
  81. new RSTile(3342, 2937)
  82. });
  83.  
  84. RSArea bankArea = new RSArea(new RSTile[] {
  85. new RSTile(3421, 2898), new RSTile(3431, 2898),
  86. new RSTile(3435, 2895), new RSTile(3432, 2886),
  87. new RSTile(3427, 2885), new RSTile(3422, 2885)
  88. });
  89.  
  90. RSArea nardah = new RSArea(new RSTile[] {
  91. new RSTile(3393, 2944), new RSTile(3398, 2945),
  92. new RSTile(3403, 2945), new RSTile(3408, 2945),
  93. new RSTile(3417, 2945), new RSTile(3422, 2945),
  94. new RSTile(3427, 2945), new RSTile(3432, 2945),
  95. new RSTile(3440, 2945), new RSTile(3445, 2943),
  96. new RSTile(3450, 2943), new RSTile(3453, 2938),
  97. new RSTile(3453, 2931), new RSTile(3453, 2926),
  98. new RSTile(3453, 2921), new RSTile(3453, 2916),
  99. new RSTile(3453, 2909), new RSTile(3452, 2904),
  100. new RSTile(3449, 2896), new RSTile(3448, 2891),
  101. new RSTile(3446, 2886), new RSTile(3442, 2879),
  102. new RSTile(3437, 2877), new RSTile(3426, 2877),
  103. new RSTile(3421, 2877), new RSTile(3412, 2878),
  104. new RSTile(3405, 2882), new RSTile(3400, 2883),
  105. new RSTile(3392, 2887), new RSTile(3386, 2889)
  106. });
  107.  
  108. RSArea nardahGypoGuy = new RSArea(new RSTile[] {
  109. new RSTile(3391, 2925), new RSTile(3396, 2925),
  110. new RSTile(3401, 2925), new RSTile(3406, 2925),
  111. new RSTile(3410, 2922), new RSTile(3410, 2917),
  112. new RSTile(3407, 2913), new RSTile(3402, 2913),
  113. new RSTile(3397, 2913), new RSTile(3392, 2913)
  114. });
  115.  
  116. //your script variable section
  117. Point m = new Point(-1,-1);
  118.  
  119. @Override
  120. public boolean onStart() {
  121. g.setVisible(true);
  122. while(guiWait) sleep(500);
  123. startExp = skills.getCurrentExp(Skills.THIEVING);
  124. startTime = System.currentTimeMillis();
  125. try {
  126. final URL cursorURL = new URL("http://i48.tinypic.com/313623n.png");
  127. final URL cursor80URL = new URL("http://i46.tinypic.com/9prjnt.png");
  128. normal = ImageIO.read(cursorURL);
  129. clicked = ImageIO.read(cursor80URL);
  130. } catch (MalformedURLException e) {
  131. log("Unable to buffer cursor.");
  132. } catch (IOException e) {
  133. log("Unable to open cursor image.");
  134. }
  135. return true;
  136. }
  137.  
  138. public boolean atBandits(){
  139. RSArea area = banditLocation;
  140. return area.contains(getMyPlayer().getLocation());
  141. }
  142.  
  143. public boolean atGypoToBandits(){
  144. RSArea area = nardahGypoGuy;
  145. return area.contains(getMyPlayer().getLocation());
  146. }
  147.  
  148. public boolean atGypoToNardah(){
  149. RSArea area = banditGypoGuy;
  150. return area.contains(getMyPlayer().getLocation());
  151. }
  152.  
  153. public boolean atNardah(){
  154. RSArea area = nardah;
  155. return area.contains(getMyPlayer().getLocation());
  156. }
  157.  
  158. public boolean atBank(){
  159. RSArea area = bankArea;
  160. return area.contains(getMyPlayer().getLocation());
  161. }
  162.  
  163. public void messageReceived(MessageEvent arg0) {
  164. final String serverString = arg0.getMessage();
  165. if (serverString.toLowerCase().contains("reach")) {
  166. stuck = true;
  167. }
  168. if(usingGloves = true){
  169. if (serverString.toLowerCase().contains("going to fall")) {
  170. fiveleft = true;
  171. } if (serverString.toLowerCase().contains("been stun")) {
  172. if(fiveleft = true){
  173. untilDegrade++;
  174. }
  175. }
  176. }
  177. }
  178.  
  179. public void openCurtain(){
  180. RSObject curtain = objects.getNearest(1528);
  181. if(curtain != null){
  182. if(curtain.isOnScreen()){
  183. status = ("Opening curtain...");
  184. curtain.interact("Open");
  185. sleep(random(2000,3000));
  186. stuck = false;
  187. } else {
  188. walking.walkTileMM(curtain.getLocation());
  189. }
  190. }
  191. }
  192.  
  193. public void checkRun() {
  194. if(!walking.isRunEnabled()) {
  195. if(walking.getEnergy() < 25) {
  196. walking.rest();
  197. status = "Resting...";
  198. } else
  199. walking.setRun(true);
  200. }
  201. }
  202.  
  203. private void antiBan() {
  204. int random = Methods.random(1, 9);
  205. while (game.getClientState() == 10) {
  206. switch (random) {
  207. case 1:
  208. status = "Antiban...";
  209. if (Methods.random(1, 17) != 1) {
  210. return;
  211. }
  212. mouse.move(random(10, 750), random(10, 495));
  213. if (Methods.random(1, 7) == 1) {
  214. mouse.move(random(10, 750), random(10, 495));
  215. }
  216. return;
  217. case 2:
  218. status = "Antiban...";
  219. if (Methods.random(1, 12) != 1) {
  220. return;
  221. }
  222. mouse.moveSlightly();
  223. return;
  224. case 3:
  225. status = "Antiban...";
  226. if (Methods.random(1, 18) != 1) {
  227. return;
  228. }
  229. if (Methods.random(1, 11) == 1) {
  230. camera.setPitch(true);
  231. }
  232. int angle = camera.getAngle() + Methods.random(-45, 45);
  233. if (angle < 0) {
  234. angle = Methods.random(0, 10);
  235. }
  236. if (angle > 359) {
  237. angle = Methods.random(0, 10);
  238. }
  239. char whichDir = 37;
  240. if (Methods.random(0, 100) < 50) {
  241. whichDir = 39;
  242. }
  243. keyboard.pressKey(whichDir);
  244. Methods.sleep(Methods.random(100, 700));
  245. keyboard.releaseKey(whichDir);
  246. return;
  247. default:
  248. return;
  249. }
  250. }
  251. }
  252.  
  253. public void steal(){
  254. RSNPC bandit = npcs.getNearest(banditID);
  255. if(atBandits()){
  256. if(bandit != null){
  257. if(bandit.isOnScreen()){
  258. if(!getMyPlayer().isInCombat()){
  259. if(banditLocation.contains(bandit.getLocation())){
  260. status = ("Pickpocketing...");
  261. bandit.interact("Pickpocket");
  262. sleep(random(400,600));
  263. }
  264. }
  265. } else if(!bandit.isOnScreen()){
  266. if (calc.distanceTo(bandit) <= 5) {
  267. camera.turnTo(bandit.getLocation());
  268. } else if (calc.distanceTo(bandit) >= 5) {
  269. walking.walkTileMM(bandit.getLocation());
  270. }
  271. }
  272. }
  273. } else if(!atBandits()){
  274. walkToBandits();
  275. }
  276. }
  277.  
  278. private void eat(){
  279. RSItem y = inventory.getItem(foodID);
  280. if(combat.getHealth() <= 60){
  281. if(inventory.containsOneOf(foodID)){
  282. if(y != null){
  283. status = "Eating...";
  284. y.interact("Eat");
  285. sleep(50, 60);
  286. }
  287. } else if(!inventory.containsOneOf(foodID)){
  288. doBank();
  289. }
  290. }
  291. }
  292.  
  293. public void travelToBandits(){
  294. RSNPC nardahGypo = npcs.getNearest(3020);
  295. if(nardahGypo != null){
  296. if(nardahGypo.isOnScreen()){
  297. status = ("Going to bandits...");
  298. nardahGypo.interact("Travel");
  299. sleep(random(1750,2000));
  300. interfaces.getComponent(236, 1).doClick();
  301. sleep(random(1050,1200));
  302. if(interfaces.canContinue()){
  303. interfaces.clickContinue();
  304. }
  305. } else {
  306. walking.walkTileMM(nardahGypo.getLocation());
  307. }
  308. sleep(random(1000,2000));
  309. }
  310. }
  311.  
  312. public void walkToBandits(){
  313. status = ("Walking to bandits...");
  314. RSWeb walkToGypo = web.getWeb(getMyPlayer().getLocation(), nardahGypsie);
  315. RSNPC nardahGypo = npcs.getNearest(3020);
  316. if(atNardah()){
  317. if(inventory.containsOneOf(foodID)){
  318. if(atGypoToBandits()){
  319. if(nardahGypo != null){
  320. if(nardahGypo.isOnScreen()){
  321. travelToBandits();
  322. }
  323. }
  324. } else {
  325. walkToGypo.step();
  326. }
  327. } else if(!inventory.containsOneOf(foodID)){
  328. doBank();
  329. }
  330. } else if(!atNardah()){
  331. RSWeb walkToBandits = web.getWeb(getMyPlayer().getLocation(), banditTile);
  332. walkToBandits.step();
  333. }
  334. }
  335.  
  336. public void walkToNardah(){
  337. status = ("Walking to bank...");
  338. RSWeb walkToGypo = web.getWeb(getMyPlayer().getLocation(), banditGypsie);
  339. RSWeb walkToBank = web.getWeb(getMyPlayer().getLocation(), nardahBank);
  340. RSNPC banditGypo = npcs.getNearest(2293);
  341. if(!atNardah()){
  342. if(atGypoToNardah()){
  343. if(banditGypo != null){
  344. if(banditGypo.isOnScreen()){
  345. banditGypo.interact("Travel");
  346. sleep(random(1750,2000));
  347. interfaces.getComponent(237, 1).doClick();
  348. sleep(random(1050,1200));
  349. if(interfaces.canContinue()){
  350. interfaces.clickContinue();
  351. sleep(1000);
  352. }
  353. }
  354. }
  355. } else {
  356. walkToGypo.step();
  357. }
  358. } else if(atNardah() && !atBank()){
  359. walkToBank.step();
  360. }
  361. }
  362.  
  363. private void bankOpen(){
  364. RSNPC banker = npcs.getNearest(bankerID);
  365. if(banker.isOnScreen()){
  366. banker.interact("Bank Nardah Banker");
  367. sleep(random(750, 1000));
  368. } else if(!banker.isOnScreen()){
  369. banker.getLocation();
  370. camera.turnTo(banker);
  371. if(calc.distanceTo(banker) >= 7){
  372. walking.walkTileMM(banker.getLocation());
  373. }
  374. }
  375. }
  376.  
  377. public void doBank(){
  378. status = ("Banking...");
  379. RSNPC banker = npcs.getNearest(bankerID);
  380. if(atBank()){
  381. if(banker != null){
  382. bankOpen();
  383. withdraw();
  384. }
  385. } else {
  386. walkToNardah();
  387. }
  388. }
  389.  
  390. public void checkInterfaces(){
  391. if(interfaces.getComponent(620, 18).isValid()){
  392. interfaces.getComponent(620, 18).doClick();
  393. sleep(random(100,200));
  394. }
  395. }
  396.  
  397. private void withdraw() {
  398. RSItem gloves = bank.getItem(glovesID);
  399. RSItem food = bank.getItem(foodID);
  400. if (bank.isOpen()) {
  401. status = "Banking...";
  402. if(usingGloves = true){
  403. if(inventory.contains(glovesID)){
  404. bank.deposit(glovesID, 10);
  405. sleep(random(300,500));
  406. }
  407. if(gloves != null){
  408. bank.withdraw(glovesID, 5);
  409. sleep(random(300,500));
  410. } else {
  411. log.severe("Out of gloves of silence, stopping script...");
  412. bank.close();
  413. stopScript();
  414. }
  415. }
  416. if(food != null){
  417. bank.withdraw(foodID, 20);
  418. sleep(random(300,500));
  419. bankTrips++;
  420. } else {
  421. log.severe("No more food, stopping script...");
  422. bank.close();
  423. stopScript();
  424. }
  425. } else {
  426. bankOpen();
  427. sleep(1800, 2200);
  428. }
  429. }
  430.  
  431. public void equipGloves() {
  432. if(usingGloves == true){
  433. if(inventory.containsOneOf(glovesID)){
  434. RSItem gloves = inventory.getItem(glovesID);
  435. gloves.interact("Wear");
  436. onstartequip = false;
  437. sleep(random(500,700));
  438. } else {
  439. doBank();
  440. }
  441. }
  442. }
  443.  
  444. public int loop() {
  445. mouse.setSpeed(random(4,6));
  446. checkInterfaces();
  447. if(random(1,9) == 3){
  448. antiBan();
  449. }
  450. if(onstartequip == true){
  451. equipGloves();
  452. }
  453. if(untilDegrade == 5){
  454. equipGloves();
  455. untilDegrade = 0;
  456. }
  457. while(getMyPlayer().isInCombat()){
  458. sleep(random(25,50));
  459. }
  460. if(atBandits()){
  461. while(getMyPlayer().isMoving()){
  462. sleep(50);
  463. }
  464. }
  465. if(stuck == true){
  466. openCurtain();
  467. }
  468. while(getMyPlayer().getAnimation() == 330){
  469. sleep(random(50,100));
  470. }
  471. checkRun();
  472. eat();
  473. if(inventory.containsOneOf(foodID) && inventory.containsOneOf(glovesID)){
  474. steal();
  475. } else {
  476. doBank();
  477. }
  478. return 1;
  479. }
  480.  
  481. @Override
  482. public void onFinish() {
  483. }
  484.  
  485. @SuppressWarnings("serial")
  486. private class MousePathPoint1 extends Point {
  487. private long finishTime;
  488. private double lastingTime;
  489.  
  490. private int toColor(double d) {
  491. return Math.min(255, Math.max(0, (int) d));
  492. }
  493.  
  494. public MousePathPoint1(int x, int y, int lastingTime) {
  495. super(x, y);
  496. this.lastingTime = lastingTime;
  497. finishTime = System.currentTimeMillis() + lastingTime;
  498. }
  499.  
  500. public boolean isUp() {
  501. return System.currentTimeMillis() > finishTime;
  502. }
  503.  
  504. public Color getColor() {
  505. return new Color(255, 255, 255, toColor(256 * ((finishTime - System // first
  506. // 3
  507. // numbers
  508. // are
  509. // the
  510. // colour
  511. .currentTimeMillis()) / lastingTime)));
  512. }
  513. }
  514.  
  515. private final RenderingHints antialiasing = new RenderingHints(
  516. RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
  517.  
  518. ///////////////////////////////////PAINT\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  519. private Image getImage(String url) {
  520. try {
  521. return ImageIO.read(new URL(url));
  522. } catch(IOException e) {
  523. return null;
  524. }
  525. }
  526.  
  527. public String outputTTL() {
  528. long runTime = System.currentTimeMillis() - startTime;
  529. int xptl = skills.getExpToNextLevel(Skills.THIEVING);
  530. long ttl = (long) (xptl * ((double) runTime / expGained));
  531. int ttlH = (int) (ttl / 3600000D);
  532. int ttlM = (int) ((ttl % 3600000D) / 60000D);
  533. int ttlS = (int) (((ttl % 3600000D) % 60000D) / 1000D);
  534. return (ttlH + ":" + ttlM + ":" + ttlS);
  535. }
  536.  
  537. private final Color color1 = new Color(204, 204, 204);
  538. private final Font font1 = new Font("Arial", 0, 14);
  539.  
  540. private final Image img1 = getImage("http://i1143.photobucket.com/albums/n630/TiSgOeGeWiSt/Private/Right_eShade_Thief_Paint.png");
  541. private final Image img2 = getImage("http://i1143.photobucket.com/albums/n630/TiSgOeGeWiSt/Private/SHOW_Right_eShade_Thief_Paint.png");
  542.  
  543.  
  544.  
  545. private final Rectangle TAB1_BOX = new Rectangle(712, 177, 26, 27); ////MAIN TAB
  546.  
  547. ////////////The location of the g.drawString can be different, depending on what you modified in the Images.\\\\\\\\\\\\\\\\\
  548. public void onRepaint(Graphics g1) {
  549. Graphics2D g = (Graphics2D)g1;
  550. g.setRenderingHints(antialiasing);
  551.  
  552. millis = System.currentTimeMillis() - startTime;
  553. hours = millis / (1000 * 60 * 60);
  554. millis -= hours * (1000 * 60 * 60);
  555. minutes = millis / (1000 * 60);
  556. millis -= minutes * (1000 * 60);
  557. seconds = millis / 1000;
  558. expGained = skills.getCurrentExp(Skills.THIEVING) - startExp;
  559. expHour = (int) ((expGained) * 3600000D / (System.currentTimeMillis() - startTime));
  560.  
  561. if(showPaint){
  562. g.drawImage(img1, 546, 167, null);
  563. g.setFont(font1);
  564. g.setColor(color1);
  565. g.drawString(hours + ":" + minutes + ":" + seconds, 632, 273); //// runtime
  566. g.drawString("" + status, 625, 290); //// status
  567. g.drawString("" + ver, 628, 306); //// version
  568. g.drawString("" + expGained, 648, 335); //// exp gained
  569. g.drawString("" + expHour, 648, 355); //// exp per hour
  570. g.drawString("" + skills.getExpToNextLevel(Skills.THIEVING), 648, 373); //// Exp to level
  571. g.drawString("" + outputTTL(), 603, 389); //// TTL
  572. g.drawString("" + bankTrips, 662, 419); //// banktrips
  573. } else {
  574. g.drawImage(img2, 546, 167, null);
  575. }
  576. while (!mousePath.isEmpty() && mousePath.peek().isUp())
  577. mousePath.remove();
  578. Point clientCursor = mouse.getLocation();
  579. MousePathPoint1 mpp = new MousePathPoint1(clientCursor.x,
  580. clientCursor.y, 2500); // 1000 = lasting time/MS
  581. if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp))
  582. mousePath.add(mpp);
  583. MousePathPoint1 lastPoint = null;
  584. for (MousePathPoint1 a : mousePath) {
  585. if (lastPoint != null) {
  586. g.setColor(a.getColor());
  587. g.drawLine(a.x, a.y, lastPoint.x, lastPoint.y);
  588. }
  589. lastPoint = a;
  590. }
  591.  
  592. final Point p1 = mouse.getLocation();
  593. final Point c = mouse.getPressLocation();
  594. final long mpt = System.currentTimeMillis() - mouse.getPressTime();
  595. if (mouse.getPressTime() == -1 || mpt >= 1000) {
  596. g.drawImage(normal, p1.x - 8, p1.y - 8, null); // this
  597. }
  598. if (mpt < 2050) {
  599. g.drawImage(normal, p1.x - 8, p1.y - 8, null);
  600. g.drawImage(clicked, c.x - 8, c.y - 8, null);
  601. }
  602. }
  603.  
  604.  
  605.  
  606.  
  607. @Override
  608. public void mouseClicked(MouseEvent e) {
  609. if (TAB1_BOX.contains(e.getPoint())) {
  610. showPaint = !showPaint;
  611. }
  612. }
  613.  
  614. @Override
  615. public void mouseEntered(MouseEvent e) {
  616. // TODO Auto-generated method stub
  617.  
  618. }
  619.  
  620. @Override
  621. public void mouseExited(MouseEvent e) {
  622. // TODO Auto-generated method stub
  623.  
  624. }
  625.  
  626. @Override
  627. public void mousePressed(MouseEvent e) {
  628. // TODO Auto-generated method stub
  629.  
  630. }
  631.  
  632. @Override
  633. public void mouseReleased(MouseEvent e) {
  634. // TODO Auto-generated method stub
  635.  
  636. }
  637.  
  638. @Override
  639. public void mouseDragged(MouseEvent arg0) {
  640. // TODO Auto-generated method stub
  641.  
  642. }
  643.  
  644. @Override
  645. public void mouseMoved(MouseEvent arg0) {
  646. // TODO Auto-generated method stub
  647.  
  648. }
  649.  
  650. class gui extends JFrame {
  651. public gui() {
  652. initComponents();
  653. }
  654.  
  655. private void button1ActionPerformed(ActionEvent e) {
  656. if(comboBox1.getSelectedItem().toString().equalsIgnoreCase("trout")){
  657. foodID = 333;
  658. } else
  659. if(comboBox1.getSelectedItem().toString().equalsIgnoreCase("salmon")){
  660. foodID = 329;
  661. } else
  662. if(comboBox1.getSelectedItem().toString().equalsIgnoreCase("tuna")){
  663. foodID = 361;
  664. } else
  665. if(comboBox1.getSelectedItem().toString().equalsIgnoreCase("lobster")){
  666. foodID = 379;
  667. } else
  668. if(comboBox1.getSelectedItem().toString().equalsIgnoreCase("swordfish")){
  669. foodID = 373;
  670. } else
  671. if(comboBox1.getSelectedItem().toString().equalsIgnoreCase("monkfish")){
  672. foodID = 7946;
  673. } else
  674. if(comboBox1.getSelectedItem().toString().equalsIgnoreCase("shark")){
  675. foodID = 385;
  676. }
  677. guiWait = false;
  678. g.dispose();
  679. }
  680.  
  681. private void initComponents() {
  682. // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
  683. // Generated using JFormDesigner Evaluation license - Jack Daniel
  684. panel1 = new JPanel();
  685. label1 = new JLabel();
  686. comboBox1 = new JComboBox();
  687. scrollPane1 = new JScrollPane();
  688. textPane1 = new JTextPane();
  689. button1 = new JButton();
  690.  
  691. //======== this ========
  692. Container contentPane = getContentPane();
  693.  
  694. //======== panel1 ========
  695. {
  696. panel1.setBackground(Color.black);
  697.  
  698. //---- label1 ----
  699. label1.setText("Select your food:");
  700. label1.setForeground(Color.green);
  701.  
  702. //---- comboBox1 ----
  703. comboBox1.setModel(new DefaultComboBoxModel(new String[] {
  704. "Trout",
  705. "Salmon",
  706. "Tuna",
  707. "Lobster",
  708. "Swordfish",
  709. "Monkfish",
  710. "Shark"
  711. }));
  712. comboBox1.setBackground(Color.black);
  713.  
  714. //======== scrollPane1 ========
  715. {
  716.  
  717. //---- textPane1 ----
  718. textPane1.setText("Please ensure you have\nGloves of Silence and \nfood in your inventory \nand in your bank.");
  719. textPane1.setBackground(Color.black);
  720. textPane1.setForeground(Color.green);
  721. textPane1.setEditable(false);
  722. scrollPane1.setViewportView(textPane1);
  723. }
  724.  
  725. //---- button1 ----
  726. button1.setText("Start");
  727. button1.setBackground(Color.black);
  728. button1.addActionListener(new ActionListener() {
  729. @Override
  730. public void actionPerformed(ActionEvent e) {
  731. button1ActionPerformed(e);
  732. }
  733. });
  734.  
  735. GroupLayout panel1Layout = new GroupLayout(panel1);
  736. panel1.setLayout(panel1Layout);
  737. panel1Layout.setHorizontalGroup(
  738. panel1Layout.createParallelGroup()
  739. .addGroup(panel1Layout.createSequentialGroup()
  740. .addGroup(panel1Layout.createParallelGroup()
  741. .addGroup(panel1Layout.createSequentialGroup()
  742. .addContainerGap()
  743. .addGroup(panel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
  744. .addComponent(label1)
  745. .addComponent(comboBox1, 0, 143, Short.MAX_VALUE)))
  746. .addGroup(panel1Layout.createSequentialGroup()
  747. .addGap(20, 20, 20)
  748. .addComponent(scrollPane1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
  749. .addContainerGap(22, Short.MAX_VALUE))
  750. .addGroup(GroupLayout.Alignment.TRAILING, panel1Layout.createSequentialGroup()
  751. .addContainerGap(91, Short.MAX_VALUE)
  752. .addComponent(button1, GroupLayout.PREFERRED_SIZE, 74, GroupLayout.PREFERRED_SIZE)
  753. .addContainerGap())
  754. );
  755. panel1Layout.setVerticalGroup(
  756. panel1Layout.createParallelGroup()
  757. .addGroup(panel1Layout.createSequentialGroup()
  758. .addContainerGap()
  759. .addComponent(label1)
  760. .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
  761. .addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  762. .addGap(18, 18, 18)
  763. .addComponent(scrollPane1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  764. .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE)
  765. .addComponent(button1, GroupLayout.PREFERRED_SIZE, 23, GroupLayout.PREFERRED_SIZE)
  766. .addContainerGap())
  767. );
  768. }
  769.  
  770. GroupLayout contentPaneLayout = new GroupLayout(contentPane);
  771. contentPane.setLayout(contentPaneLayout);
  772. contentPaneLayout.setHorizontalGroup(
  773. contentPaneLayout.createParallelGroup()
  774. .addGroup(contentPaneLayout.createSequentialGroup()
  775. .addComponent(panel1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  776. .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
  777. );
  778. contentPaneLayout.setVerticalGroup(
  779. contentPaneLayout.createParallelGroup()
  780. .addComponent(panel1, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  781. );
  782. pack();
  783. setLocationRelativeTo(getOwner());
  784. // JFormDesigner - End of component initialization //GEN-END:initComponents
  785. }
  786.  
  787. // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
  788. // Generated using JFormDesigner Evaluation license - Jack Daniel
  789. private JPanel panel1;
  790. private JLabel label1;
  791. private JComboBox comboBox1;
  792. private JScrollPane scrollPane1;
  793. private JTextPane textPane1;
  794. private JButton button1;
  795. // JFormDesigner - End of variables declaration //GEN-END:variables
  796. }
  797.  
  798. }
Advertisement
Add Comment
Please, Sign In to add comment