Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 50.68 KB | None | 0 0
  1. import java.awt.Point;
  2. import java.util.ArrayList;
  3. import java.util.LinkedList;
  4.  
  5. import org.rsbot.script.Script;
  6. import org.rsbot.script.ScriptManifest;
  7. import org.rsbot.event.listeners.PaintListener;
  8. import org.rsbot.script.wrappers.*;
  9.  
  10. import java.awt.event.KeyEvent; //Antiban
  11. import java.awt.event.KeyListener;
  12. import org.rsbot.script.methods.*;
  13. import org.rsbot.script.methods.Game.CHAT_MODE;
  14.  
  15. import java.awt.*;
  16. import java.awt.event.*;
  17. import javax.swing.*;
  18. import javax.swing.UIManager.LookAndFeelInfo;
  19.  
  20. @ScriptManifest(authors = "Delano_D & Doout", name = "Badass Summoner", version = 1.1, description = "Start In fallador with Opened bank. Uses Fala Tab. (INV)")
  21. public class BadassSumm extends Script implements PaintListener {
  22.  
  23. AntiBan ab = new AntiBan();
  24. ArrayList<Pouch> pouch = new ArrayList<Pouch>();
  25. public boolean showPaint = false;
  26. public long runTime = 0, seconds = 0, minutes = 0, hours = 0;
  27. public int gainedExp = 0;
  28. public int expToLevel = 0;
  29. public long secToLevel = 0;
  30. public long minutesToLevel = 0;
  31. public long hoursToLevel = 0;
  32. private long startTime;
  33. private int startExp;
  34. private int startLevel;
  35. public float secExp = 0;
  36. public float minuteExp = 0;
  37. public float hourExp = 0;
  38. public String status;
  39.  
  40.  
  41. private static int PLACE;
  42. private static int CHARM;
  43. private static int ITEM_ID;
  44. private static boolean isUp = true;
  45. private static RSTile[] toT = new RSTile[] { new RSTile(2952, 3381)
  46. private static RSTile[] toT = new RSTile[] { new RSTile(2946, 3369), new RSTile(2948, 3375), new RSTile(2952, 3381),[FONT=monospace]
  47. [/FONT]new RSTile(2964, 3386), new RSTile(2962, 3398),[FONT=monospace]
  48. [/FONT] new RSTile(2960, 3411), new RSTile(2954, 3420),[FONT=monospace]
  49. [/FONT]new RSTile(2950, 3432), new RSTile(2947, 3444),[FONT=monospace]
  50. [/FONT]new RSTile(2937, 3451), new RSTile(2931, 3450),[FONT=monospace]
  51. [/FONT]new RSTile(2924, 3444), new RSTile(2925, 3444) }; //runescape tiles, might add more.
  52. private static RSPath path;
  53.  
  54.  
  55. public boolean onStart() {
  56. try {
  57. JFrame.setDefaultLookAndFeelDecorated(true);
  58. for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
  59. if ("Nimbus".equals(info.getName())) {
  60. UIManager.setLookAndFeel(info.getClassName());
  61. break;
  62. }
  63. }
  64. } catch (Exception e) {
  65. log.severe("Fail to setLookAndFeel");
  66. }
  67. AddPouch();
  68. new GUISum().setVisible(true);
  69. while (isUp)
  70. sleep(50);
  71. path = walking.newTilePath(toT); //fix to only walk to sum, might be ();
  72. showPaint = true;
  73. return true;
  74. }
  75. //Working on the Antiban here, It's not finished yet i think, will be done @ Version 1.5
  76. public class AntiBan {
  77.  
  78. private int [] Locations = {1 , 2, 3}; //set locations here
  79.  
  80. // COLORS
  81. private int WHITE = 35;
  82. private int GREEN = 37;
  83. private int AMBER = 39;
  84. private int RED = 41;
  85. private int NONE = 53;
  86.  
  87. // ANIMATIONS
  88. private int YES = 2;
  89. private int NO = 3;
  90. private int BOW = 4;
  91. private int ANGRY = 5;
  92. private int THINK = 6;
  93. private int WAVE = 7;
  94. private int SHRUG = 8;
  95. private int CHEER = 9;
  96. private int BECKON = 10;
  97. private int JUMP_FOR_JOY = 11;
  98. private int LAUGH = 12;
  99. private int YAWN = 13;
  100. private int DANCE = 14;
  101. private int JIG = 15;
  102. private int TWIRL = 16;
  103. private int HEADBANG = 17;
  104. private int CRY = 18;
  105. private int BLOW_KISS = 19;
  106. private int PANIC = 20;
  107. private int RASPBERRY = 20;
  108. private int CLAP = 22;
  109. private int SALUTE = 23;
  110. private int GOBLIN_BOW = 24;
  111. private int GOBLIN_SALUTE = 25;
  112. private int GLASS_BOX = 25;
  113. private int CLIMB_ROPE = 26;
  114. private int LEAN = 28;
  115. private int GLASS_WALL = 29;
  116. private int IDEA = 33;
  117. private int STOMP = 31;
  118. private int FLAP = 32;
  119. private int SLAP_HEAD = 30;
  120. private int ZOMBIE_WALK = 34;
  121. private int ZOMBIE_DANCE = 35;
  122. private int ZOMBIE_HAND = 36;
  123. private int SCARED = 37;
  124. private int BUNNY_HOP = 38;
  125. private int SKILLCAPE = 39;
  126. private int SNOWMAN_DANCE = 40;
  127. private int AIR_GUITAR = 41;
  128. private int SAFETY_FIRST = 42;
  129. private int EXPLORE = 43;
  130. private int TRICK = 44;
  131. private int FREEZE = 45;
  132. private int GIVE_THANKS = 46;
  133. private int AROUND_THE_WORLD_IN_EGGTY_DAYS = 47;
  134. private int DRAMATIC_POINT = 48;
  135. private int FAINT = 49;
  136. private int PUPPET_MASTER = 50;
  137. private int TASKMASTER = 51;
  138. private int SEAL_OF_APPROVAL = 52;
  139.  
  140. private void checkXP(int Skill) { //build in anitban.
  141. if(game.getCurrentTab() != Game.TAB_STATS){
  142. game.openTab(game.TAB_STATS);
  143. skills.doHover(Skill);
  144. } else {
  145. skills.doHover(Skill);
  146.  
  147. }
  148. }
  149.  
  150. private void moveMouseOffScreen(int Time){
  151. mouse.moveOffScreen();
  152. sleep(Time);
  153. }
  154.  
  155. private void setRunning(int Energy){
  156. if(!walking.isRunEnabled() && walking.getEnergy() >= Energy){
  157. walking.setRun(true);
  158. moveMouseRandomly(Locations);
  159. }
  160. }
  161.  
  162. private void moveMouseRandomly(int[] location){
  163. switch(location.length){
  164.  
  165. case 0: // chatBox
  166. mouse.move(random(4, 327), random(528, 483));
  167. break;
  168.  
  169. case 2: // Screen
  170. mouse.move(random(3, 0), random(525, 352));
  171. break;
  172.  
  173. case 3: //Minimap
  174. mouse.move(random(521, 0), random(760, 170));
  175. break;
  176.  
  177. case 4: //inventory
  178. mouse.move(random(527, 200), random(744, 464));
  179.  
  180.  
  181. }
  182.  
  183. }
  184.  
  185. private void moveCameraToLeft(int minTime, int maxTime){
  186. keyboard.pressKey((char)KeyEvent.VK_LEFT);
  187. sleep(random(minTime, maxTime));
  188. keyboard.releaseKey((char)KeyEvent.VK_LEFT);
  189.  
  190. }
  191.  
  192. private void moveCameraToRight(int minTime, int maxTime){
  193. keyboard.pressKey((char)KeyEvent.VK_RIGHT);
  194. sleep(random(minTime, maxTime));
  195. keyboard.releaseKey((char)KeyEvent.VK_RIGHT);
  196. }
  197.  
  198. private void moveCameraRandomly() {
  199.  
  200. switch(random(0,3)) {
  201. case 0:
  202. moveCameraToLeft(750, 1000);
  203. camera.setPitch(random(30, 120));
  204. sleep(50, 100);
  205. break;
  206.  
  207. case 1:
  208. moveCameraToRight(1000, 2500);
  209. camera.setPitch(random(30, 120));
  210. sleep(50, 100);
  211. break;
  212. }
  213. }
  214.  
  215. private void addNote(String Text){
  216. RSInterface Notes = interfaces.get(34);
  217. if(game.getCurrentTab() != game.TAB_NOTES){
  218. game.openTab(game.TAB_NOTES);
  219. return;
  220. } else {
  221. mouse.click(Notes.getComponent(3).getLocation(), true);
  222. sleep(600, 800);
  223. keyboard.sendText(Text, true);
  224. }
  225. }
  226.  
  227. private void deleteNote(String Text){
  228. RSInterface Notes = interfaces.get(34);
  229. if(game.getCurrentTab() != game.TAB_NOTES){
  230. game.openTab(game.TAB_NOTES);
  231. return;
  232. } else {
  233. for(int i = 0; i <= 30; i++){
  234. try {
  235. if(Notes.getComponent(9).getComponent(i).getText().equals(Text)){
  236. mouse.click(Notes.getComponent(9).getComponent(i).getLocation(), true);
  237. mouse.click(Notes.getComponent(8).getLocation(), true);
  238. } else {
  239. i++;
  240. }
  241. } catch(Exception e){}
  242. }
  243. }
  244. }
  245.  
  246. private void setNoteColor(String Text, int Color){
  247. RSInterface Notes = interfaces.get(34);
  248. if(game.getCurrentTab() != game.TAB_NOTES){
  249. game.openTab(game.TAB_NOTES);
  250. return;
  251. } else {
  252. for(int i = 0; i <= 30; i++){
  253. try {
  254. if(Notes.getComponent(9).getComponent(i).getText().equals(Text)){
  255. mouse.click(Notes.getComponent(9).getComponent(i).getLocation(), false);
  256. Notes.getComponent(9).doAction("Colour");
  257. sleep(200, 500);
  258. mouse.click(Notes.getComponent(Color).getLocation(), true);
  259. } else {
  260. i++;
  261. }
  262.  
  263. } catch(Exception e){}
  264. }
  265. }
  266. }
  267.  
  268. private boolean isInScrollableArea(final int xMax, final int xMin, final int yMax, final int yMin, final int cmpID) {
  269. RSComponent rsc = interfaces.get(464).getComponent(cmpID);
  270. final int x = (int) rsc.getLocation().getX();
  271. final int y = (int) rsc.getLocation().getY();
  272. if(x >= xMin && x <= xMax && y >= yMin && y <= yMax) {
  273. return true;
  274. } else return false;
  275. }
  276.  
  277. private void doEmote(int Emote){
  278. RSComponent rsc = interfaces.get(464).getComponent(Emote);
  279. int State = 0;
  280. boolean State1 = isInScrollableArea(735, 547, 413, 206, 2);
  281. boolean State2 = isInScrollableArea(735, 547, 413, 206, 28);
  282. boolean State3 = isInScrollableArea(735, 547, 413, 206, 52);
  283.  
  284. mouse.click(interfaces.get(548).getComponent(103).getLocation(), true);
  285.  
  286. if(State1 = true && isInScrollableArea(735, 547, 413, 206, Emote) && getMyPlayer().isIdle()){
  287. rsc.doClick();
  288. } else {
  289. mouse.moveSlightly();
  290. mouse.click(new Point(728, 265), true);
  291. mouse.drag(new Point(728, 334));
  292. }
  293.  
  294. if(State2 = true && isInScrollableArea(735, 547, 413, 206, Emote) && getMyPlayer().isIdle()){
  295. rsc.doClick();
  296. } else {
  297. mouse.moveSlightly();
  298. mouse.click(new Point(728, 334), true);
  299. mouse.drag(new Point(728, 406));
  300. }
  301.  
  302. if(State2 = true && isInScrollableArea(735, 547, 413, 206, Emote) && getMyPlayer().isIdle()){
  303. rsc.doClick();
  304. } else {
  305. mouse.moveSlightly();
  306. mouse.click(new Point(728, 261), true);
  307. }
  308. }
  309.  
  310. private void setMode(int chooseOption, CHAT_MODE setMode){
  311. switch(chooseOption){
  312.  
  313. case 1: // setPublicMode
  314. game.setPublicChat(setMode);
  315. break;
  316.  
  317. case 2:// setTradeMode
  318. game.setTradeMode(setMode);
  319. break;
  320.  
  321. case 3:// setPrivateMode
  322. game.setPrivateChat(setMode);
  323. break;
  324.  
  325. case 4: //setClanMode
  326. game.setClanMode(setMode);
  327.  
  328. case 5:// setAssistMode
  329. game.setAssistMode(setMode);
  330. break;
  331.  
  332. }
  333. }
  334. }
  335.  
  336. private final Color color1 = new Color(0, 0, 0);
  337. private final Color color2 = new Color(0, 0, 0);
  338. private final Color color3 = new Color(255, 0, 0);
  339. private final Color color4 = new Color(204, 0, 0);
  340. private final Color color5 = new Color(255, 255, 255);
  341. final Color GREEN = new Color(0, 255, 0, 255);
  342.  
  343. private final BasicStroke stroke1 = new BasicStroke(1);
  344.  
  345. private final Font font1 = new Font("Vijaya", 1, 25);
  346. private final Font font2 = new Font("Miriam Fixed", 0, 14);
  347. private final Font font3 = new Font("Miriam Fixed", 1, 14);
  348.  
  349. public void onRepaint(Graphics g1) {
  350. if (!showPaint || g1 == null) {
  351. return;
  352. }
  353.  
  354. if (startTime == 0) {
  355. startTime = System.currentTimeMillis();
  356. }
  357.  
  358. if (startExp == 0) {
  359. startExp = skills.getCurrentExp(23);
  360. }
  361.  
  362. if (startLevel == 0) {
  363. startLevel = skills.getRealLevel(23);
  364. }
  365.  
  366. runTime = System.currentTimeMillis() - startTime;
  367. seconds = runTime / 1000;
  368. if (seconds >= 60) {
  369. minutes = seconds / 60;
  370. seconds -= minutes * 60;
  371. }
  372. if (minutes >= 60) {
  373. hours = minutes / 60;
  374. minutes -= hours * 60;
  375. }
  376.  
  377. gainedExp = skills.getCurrentExp(23) - startExp;
  378. expToLevel = skills.getExpToNextLevel(23);
  379.  
  380. if ((minutes > 0 || hours > 0 || seconds > 0) && gainedExp > 0) {
  381. secExp = (float) gainedExp
  382. / (float) (seconds + minutes * 60 + hours * 60 * 60);
  383. }
  384. minuteExp = secExp * 60;
  385. hourExp = minuteExp * 60;
  386.  
  387. if (secExp > 0) {
  388. secToLevel = (int) (expToLevel / secExp);
  389. }
  390. if (secToLevel >= 60) {
  391. minutesToLevel = secToLevel / 60;
  392. secToLevel -= minutesToLevel * 60;
  393. } else {
  394. minutesToLevel = 0;
  395. }
  396. if (minutesToLevel >= 60) {
  397. hoursToLevel = minutesToLevel / 60;
  398. minutesToLevel -= hoursToLevel * 60;
  399. } else {
  400. hoursToLevel = 0;
  401. }
  402.  
  403. drawMouseLines(g1);
  404. Graphics2D g = (Graphics2D)g1;
  405. g.setColor(color1);
  406. g.fillRoundRect(9, 346, 495, 125, 16, 16);
  407. g.setColor(color2);
  408. g.setStroke(stroke1);
  409. g.drawRoundRect(9, 346, 495, 125, 16, 16);
  410. g.setFont(font1);
  411. g.drawString("BadassSummoner 0.6", 70, 366);
  412. g.setColor(color3);
  413. g.drawString("BadassSumm 0.6", 69, 365);
  414. g.setColor(GREEN);
  415. g.fillRect(280, 360, 12, 100);
  416. g.setColor(color4);
  417. g.fillRect(280, 360,12,100-skills.getPercentToNextLevel(23));
  418. g.setColor(color2);
  419. g.drawRect(280, 360, 12, 100);
  420. g.setFont(font2);
  421. g.setColor(color5);
  422. g.setFont(font3);
  423. g.setColor(color2);
  424. g.drawString(skills.getPercentToNextLevel(23) + "% to " + (skills.getRealLevel(23)+1) , 300, 420);
  425. g.setColor(color5);
  426. g.drawString(skills.getPercentToNextLevel(23) + "% to " + (skills.getRealLevel(23)+1), 299, 419);
  427. g.setFont(font2);
  428. g.setColor(color5);
  429. g.drawString("Status: "+status, 12, 388);
  430. g.drawString("Running for: " + hours + ":" + minutes + ":" + seconds,12, 408);
  431. g.drawString("Exp Gained: " + gainedExp + " ("
  432. + (skills.getRealLevel(23) - startLevel) + ")", 12, 420);
  433. g.drawString("Exp per hour: " + (int) hourExp, 12, 432);
  434. g.drawString("Exp TNL: " + expToLevel, 12, 444);
  435. g.drawString("Time to level: " + hoursToLevel + ":" + minutesToLevel
  436. + ":" + secToLevel, 12, 456);
  437. g.setFont(font3);
  438.  
  439. } {
  440.  
  441. }
  442.  
  443. @Override
  444. public int loop() {
  445. BANK();
  446. tosum();
  447. Make_Pouch();
  448. toBank();
  449. return 0;
  450. }
  451.  
  452. public void BANK() {
  453. if (npcs.getNearest(6200) != null) {
  454. if (!inventory.contains(ITEM_ID)) {
  455. if (!bank.isOpen())
  456. bank.open();
  457. if (bank.isOpen()) {
  458. if (inventory.contains(ITEM_ID))
  459. return;
  460. bank.depositAllExcept(12183, 12155, CHARM, 8009, 8013);
  461. sleep(150, 400);
  462. bank.withdraw(ITEM_ID,28);
  463. sleep(150, 400);
  464. }
  465. }
  466. }
  467. }
  468.  
  469. public void toBank() {
  470. RSItem tab = inventory.getItem([COLOR=yellow]8009[/COLOR]);
  471. // RSTtem
  472. if (!inventory.contains(ITEM_ID)) {
  473. if (objects.getNearest(28716) != null
  474. && !inventory.contains(ITEM_ID)) {
  475. if (tab != null && getMyPlayer().getAnimation() == -1) {
  476. tab.doClick(true);
  477. sleep(1000);
  478. } else {
  479. action(objects.getNearest(28714), "Climb");
  480. }
  481. }
  482. if (objects.getNearest(28690) != null
  483. || objects.getNearest(28691) != null)
  484. objects.getNearest(28690).doAction("Open");
  485. path.traverse();
  486. }
  487. }
  488.  
  489. private void drawMouseLines(final Graphics render) { //mouse paint
  490. try{
  491. if (!mouse.isPresent())
  492. return;
  493. render.setColor(Color.BLACK);
  494. render.drawLine(0, (int) mouse.getLocation().getY(), game.getWidth(),
  495. (int) mouse.getLocation().getY());
  496. render.drawLine((int) mouse.getLocation().getX(), 0, (int) mouse
  497. .getLocation().getX(), game.getHeight());
  498. }catch(Exception ex){}
  499. }
  500.  
  501. private final void tosum() {
  502. final RSItem tab = inventory.getItem(8009); //falador tab test.
  503. final RSTile[] to = new RSTile[] { new RSTile(2898, 3457),
  504. new RSTile(2911, 3457), new RSTile(2920, 3449),
  505. new RSTile(2925, 3444) };
  506. if (inventory.containsAll(12183, 12155, CHARM, ITEM_ID)) {
  507. if (npcs.getNearest(6200) != null) {
  508. if (tab != null && getMyPlayer().getAnimation() == -1) {
  509. if (bank.isOpen())
  510. bank.close();
  511. tab.doClick(true);
  512. sleep(1200);
  513. }
  514. }
  515. walking.newTilePath(to).traverse();
  516. if (tab == null)
  517. walking.newTilePath(toT).traverse();
  518. if (objects.getNearest(4039) != null) {
  519. action(objects.getNearest(4039), "Climb");
  520. action(objects.getNearest(4039), "Open");
  521. }
  522. }
  523.  
  524. }
  525.  
  526. private final void Make_Pouch() {
  527. if (inventory.containsAll(12183, 12155, CHARM, ITEM_ID)) {
  528. if (!interfaces.get(79).isValid()) {
  529. open(28716);
  530. } else if (interfaces.get(79).isValid()) {
  531. Pouch p = pouch.get(PLACE);
  532. if (!interfaces.getComponent(79, 16).getArea().contains(
  533. p.getInterface().getCenter()))
  534. mouse.click(p.getLocation(), true);
  535. if (interfaces.getComponent(79, 16).getArea().contains(
  536. p.getInterface().getCenter()))
  537. if (p.getInterface().doAction("All")) {
  538. sleep(1000, 1000);
  539. inventory.getItem(8009).doAction("break");
  540. }
  541. }
  542. }
  543. }
  544.  
  545. private void open(int id) {
  546. RSObject c = objects.getNearest(id);
  547. action(c, "Infuse-pouch");
  548. }
  549.  
  550. private void AddPouch() { //names off the pouches it will load to make.
  551. pouch.add(new Pouch("Spirit wolf pouch", 0, null));
  552. pouch.add(new Pouch("Dreadfowl pouch", 1, null));
  553. pouch.add(new Pouch("Spirit spider pouch", 2, null));
  554. pouch.add(new Pouch("Thorny snail pouch", 3, null));
  555. pouch.add(new Pouch("Granite crab pouch", 4, null));
  556. pouch.add(new Pouch("Spirit mosquito pouch", 5, null));
  557. pouch.add(new Pouch("Desert wyrm pouch", 6, null));
  558. pouch.add(new Pouch("Spirit scorpion pouch", 7, null));
  559.  
  560. pouch.add(new Pouch("Spirit tz-kih pouch", 8, null));
  561. pouch.add(new Pouch("Albino rat pouch", 9, null));
  562. pouch.add(new Pouch("Spirit kalphite pouch", 10, null));
  563. pouch.add(new Pouch("Compost mound pouch", 11, null));
  564. pouch.add(new Pouch("Giant chinchompa pouch", 12, null));
  565. pouch.add(new Pouch("Vampire bat pouch", 13, null));
  566. pouch.add(new Pouch("Honey badger pouch", 14, null));
  567. pouch.add(new Pouch("Beaver pouch", 15, null));
  568.  
  569. pouch.add(new Pouch("Void ravager pouch", 16, null));
  570. pouch.add(new Pouch("Void spinner pouch", 17, null));
  571. pouch.add(new Pouch("Void torcher pouch", 18, null));
  572. pouch.add(new Pouch("Void shifter pouch", 19, null));
  573. pouch.add(new Pouch("Bull ant pouch", 20, null));
  574. pouch.add(new Pouch("Macaw pouch", 21, null));
  575. pouch.add(new Pouch("Evil turnip pouch", 22, null));
  576. pouch.add(new Pouch("Sp. cockatrice pouch", 23, null));
  577.  
  578. pouch.add(new Pouch("Sp. guthatrice pouch", 24, null));
  579. pouch.add(new Pouch("Sp. saratrice pouch", 25, null));
  580. pouch.add(new Pouch("Sp. zamatrice pouch", 26, null));
  581. pouch.add(new Pouch("Sp. pengatrice pouch", 27, null));
  582. pouch.add(new Pouch("Sp. coraxatrice pouch", 28, null));
  583. pouch.add(new Pouch("Sp. vulatrice pouch", 29, null));
  584. pouch.add(new Pouch("Pyrelord pouch", 30, null));
  585. pouch.add(new Pouch("Magpie pouch", 31, null));
  586.  
  587. pouch.add(new Pouch("Bloated leech pouch", 32, null));
  588. pouch.add(new Pouch("Spirit terrorbird pouch", 33, null));
  589. pouch.add(new Pouch("Abyssal parasite pouch", 34, null));
  590. pouch.add(new Pouch("Spirit jelly pouch", 35, null));
  591. pouch.add(new Pouch("Ibis pouch", 36, null));
  592. pouch.add(new Pouch("Spirit kyatt pouch", 37, null));
  593. pouch.add(new Pouch("Spirit larupia pouch", 38, null));
  594. pouch.add(new Pouch("Spirit graahk pouch", 39, null));
  595. // 6
  596. pouch.add(new Pouch("Karam. overlord pouch", 40, new Point(487, 259)));
  597. pouch.add(new Pouch("Smoke devil pouch", 41, new Point(487, 259)));
  598. pouch.add(new Pouch("Abyssal lurker pouch", 42, new Point(487, 259)));
  599. pouch.add(new Pouch("Spirit cobra pouch", 43, new Point(487, 259)));
  600. pouch.add(new Pouch("Stranger plant pouch", 44, new Point(487, 259)));
  601. pouch.add(new Pouch("Barker toad pouch", 45, new Point(487, 259)));
  602. pouch.add(new Pouch("War tortoise pouch", 46, new Point(487, 259)));
  603. pouch.add(new Pouch("Bunyip pouch", 47, new Point(487, 259)));
  604.  
  605. pouch.add(new Pouch("Fruit bat pouch", 48, new Point(487, 259)));
  606. pouch.add(new Pouch("Ravenous locust pouch", 49, new Point(487, 259)));
  607. pouch.add(new Pouch("Arctic bear pouch", 50, new Point(487, 259)));
  608. pouch.add(new Pouch("Phoenix pouch", 51, new Point(487, 259)));
  609. pouch.add(new Pouch("Obsidian golem pouch", 52, new Point(487, 259)));
  610. pouch.add(new Pouch("Granite lobster pouch", 53, new Point(487, 259)));
  611. pouch.add(new Pouch("Praying mantis pouch", 54, new Point(487, 259)));
  612. pouch.add(new Pouch("Forge regent pouch", 55, new Point(487, 259)));
  613.  
  614. pouch.add(new Pouch("Talon beast pouch", 56, new Point(487, 259)));
  615. pouch.add(new Pouch("Giant ent pouch", 57, new Point(487, 259)));
  616. pouch.add(new Pouch("Fire titan pouch", 58, new Point(487, 259)));
  617. pouch.add(new Pouch("Moss titan pouch", 59, new Point(487, 259)));
  618. pouch.add(new Pouch("Ice titan pouch", 60, new Point(487, 259)));
  619. pouch.add(new Pouch("Hydra pouch", 61, new Point(487, 259)));
  620. pouch.add(new Pouch("Spirit dagannoth pouch", 62, new Point(487, 259)));
  621. pouch.add(new Pouch("Lava titan pouch", 63, new Point(487, 259)));
  622.  
  623. pouch.add(new Pouch("Swamp titan pouch", 64, new Point(487, 259)));
  624. pouch.add(new Pouch("Bronze minotaur pouch", 65, new Point(487, 259)));
  625. pouch.add(new Pouch("Iron minotaur pouch", 66, new Point(487, 259)));
  626. pouch.add(new Pouch("Steel minotaur pouch", 67, new Point(487, 259)));
  627. pouch.add(new Pouch("Mithril minotaur pouch", 68, new Point(487, 259)));
  628. pouch.add(new Pouch("Adamant minotaur pouch", 69, new Point(487, 259)));
  629. pouch.add(new Pouch("Rune minotaur pouch", 70, new Point(487, 259)));
  630. pouch.add(new Pouch("Unicorn stallion pouch", 71, new Point(487, 259)));
  631.  
  632. pouch.add(new Pouch("Geyser titan pouch", 72, new Point(485, 300)));
  633. pouch.add(new Pouch("Wolpertinger pouch", 73, new Point(485, 300)));
  634. pouch.add(new Pouch("Abyssal titan pouch", 74, new Point(485, 300)));
  635. pouch.add(new Pouch("Iron titan pouch", 75, new Point(485, 300)));
  636. pouch.add(new Pouch("Pack yak pouch", 76, new Point(485, 300)));
  637. pouch.add(new Pouch("Steel titan pouch", 77, new Point(485, 300)));
  638. }
  639.  
  640. private void action(RSObject c, String str) {
  641. if (c != null) {
  642. if (c.isOnScreen()) {
  643. c.doAction(str);
  644. sleep(1000);
  645. return;
  646. }
  647. }
  648. return;
  649. }
  650.  
  651. public class Pouch {
  652.  
  653. private String Name;
  654. private int POUCH_ID;
  655. private Point point;
  656.  
  657. public Pouch(String name, int interfacesID, Point p) {
  658. this.Name = name;
  659. this.POUCH_ID = interfacesID;
  660. this.point = p;
  661. }
  662.  
  663. public String getName() {
  664. return Name;
  665. }
  666.  
  667. public RSComponent getInterface() {
  668. return interfaces.getComponent(79, 16).getComponent(
  669. (POUCH_ID * 5) + 2);
  670. }
  671.  
  672. public Point getLocation() {
  673. return point;
  674. }
  675.  
  676. public int getIndex() {
  677. return POUCH_ID;
  678. }
  679. }
  680.  
  681. public class GUISum extends JFrame {
  682. public GUISum() {
  683. initComponents();
  684. }
  685.  
  686. private String[] inf() {
  687. LinkedList<String> str = new LinkedList<String>();
  688. for (Pouch p : pouch)
  689. str.add(p.getName());
  690. return str.toArray(new String[str.size()]);
  691. }
  692.  
  693. private void Start(ActionEvent e) {
  694. String c1 = comboBox1.getSelectedItem().toString();
  695. String c2 = comboBox2.getSelectedItem().toString();
  696. String s = this.textField1.getText();
  697. for (Pouch p : pouch) {
  698. if (p.getName().contains(c1))
  699. PLACE = p.getIndex();
  700. }
  701. ITEM_ID = Integer.parseInt(s);
  702. CHARM = inventory.getItemID(c2);
  703. log("charm ID " + CHARM + " Item ID " + ITEM_ID); //says what kinda charm you chose.
  704. isUp = false;
  705. this.dispose();
  706. }
  707.  
  708. private void initComponents() {
  709. // JFormDesigner - Component initialization - DO NOT MODIFY
  710. // //GEN-BEGIN:initComponents
  711. Start = new JButton();
  712. comboBox1 = new JComboBox();
  713. label1 = new JLabel();
  714. comboBox2 = new JComboBox();
  715. label2 = new JLabel();
  716. textField1 = new JTextField();
  717. label3 = new JLabel();
  718.  
  719.  
  720. // ======== this ========
  721. setTitle("Badass Summoner");
  722. Container contentPane = getContentPane();
  723. contentPane.setLayout(null);
  724.  
  725. // ---- Start ----
  726. Start.setText("Start");
  727. Start.addActionListener(new ActionListener() {
  728. public void actionPerformed(ActionEvent e) {
  729. Start(e);
  730. }
  731. });
  732. comboBox1.setModel(new DefaultComboBoxModel(this.inf()));
  733. contentPane.add(Start);
  734. Start.setBounds(10, 195, 495, Start.getPreferredSize().height);
  735. contentPane.add(comboBox1);
  736. comboBox1.setBounds(5, 50, 505, 35);
  737.  
  738. // ---- label1 ----
  739. label1.setText("Pouch Type:");
  740. contentPane.add(label1);
  741. label1.setBounds(205, 25, 100, 20);
  742.  
  743. // ---- comboBox2 ----
  744. comboBox2.setModel(new DefaultComboBoxModel(
  745. new String[] { "Gold charm", "Green charm",
  746. "Crimson charm", "Blue charm" }));
  747. contentPane.add(comboBox2);
  748. comboBox2.setBounds(new Rectangle(new Point(105, 105), comboBox2
  749. .getPreferredSize()));
  750.  
  751. // ---- label2 ----
  752. label2.setText("Charm Kind:");
  753. contentPane.add(label2);
  754. label2.setBounds(20, 110, 75, label2.getPreferredSize().height);
  755. contentPane.add(textField1);
  756. textField1.setBounds(105, 165, 160,
  757. textField1.getPreferredSize().height);
  758.  
  759. // ---- label3 ----
  760. label3.setText("Item ID:");
  761. contentPane.add(label3);
  762. label3.setBounds(10, 165, 75, 20);
  763.  
  764.  
  765. { // compute preferred size
  766. Dimension preferredSize = new Dimension();
  767. for (int i = 0; i < contentPane.getComponentCount(); i++) {
  768. Rectangle bounds = contentPane.getComponent(i).getBounds();
  769. preferredSize.width = Math.max(bounds.x + bounds.width,
  770. preferredSize.width);
  771. preferredSize.height = Math.max(bounds.y + bounds.height,
  772. preferredSize.height);
  773. }
  774. Insets insets = contentPane.getInsets();
  775. preferredSize.width += insets.right;
  776. preferredSize.height += insets.bottom;
  777. contentPane.setMinimumSize(preferredSize);
  778. contentPane.setPreferredSize(preferredSize);
  779. }
  780. pack();
  781. setLocationRelativeTo(getOwner());
  782. // JFormDesigner - End of component initialization
  783. // //GEN-END:initComponents
  784. }
  785.  
  786. // JFormDesigner - Variables declaration - DO NOT MODIFY
  787. // //GEN-BEGIN:variables
  788. private JButton Start;
  789. private JComboBox comboBox1;
  790. private JLabel label1;
  791. private JComboBox comboBox2;
  792. private JLabel label2;
  793. private JTextField textField1;
  794. private JLabel label3;
  795. private JLabel label4;
  796. private JComboBox comboBox3;
  797. // JFormDesigner - End of variables declaration //GEN-END:variables
  798. }
  799.  
  800. }
  801. }
  802.  
  803. Test at Version 1.1 look under here.
  804.  
  805. There should be a code like this:
  806. [COLOR=purple] path = walking.newTilePath(toT);[/COLOR] [COLOR=yellow][SIZE=2]//deleted the ".reverse();" cause that would make u run back.[/SIZE][/COLOR]
  807. If it doesn't work, change the code to this:
  808. [COLOR=lime]path = walking.newTilePath(toT) [/COLOR]
  809.  
  810. I need some Proggies.
  811.  
  812. This post has been edited by delano413: 23 May 2011 - 02:45 PM
  813. Back to top
  814. Report
  815. MultiQuote
  816. Reply
  817. #2 Doout Posted 16 March 2011 - 06:46 PM
  818. OK nice to see someone took over. Really boring doing summ.
  819.  
  820. Here is a better one. You can just update it.
  821. import java.awt.Point;
  822. import java.util.ArrayList;
  823. import java.util.LinkedList;
  824.  
  825. import org.rsbot.script.Script;
  826. import org.rsbot.script.ScriptManifest;
  827. import org.rsbot.script.wrappers.*;
  828.  
  829. import java.awt.*;
  830. import java.awt.event.*;
  831. import javax.swing.*;
  832. import javax.swing.UIManager.LookAndFeelInfo;
  833.  
  834. @ScriptManifest(authors = "Doout", name = "Doout's Summoner", version = 0.1, description = "")
  835. public class Summoner extends Script {
  836.  
  837. ArrayList<Pouch> pouch = new ArrayList<Pouch>();
  838. private static int PLACE;
  839. private static int CHARM;
  840. private static int ITEM_ID;
  841. private static boolean isUp = true;
  842. private static RSTile[] toT = new RSTile[] { new RSTile(2946, 3369),
  843. new RSTile(2948, 3375), new RSTile(2952, 3381),
  844. new RSTile(2964, 3386), new RSTile(2962, 3398),
  845. new RSTile(2960, 3411), new RSTile(2954, 3420),
  846. new RSTile(2950, 3432), new RSTile(2947, 3444),
  847. new RSTile(2937, 3451), new RSTile(2931, 3450),
  848. new RSTile(2924, 3444), new RSTile(2925, 3444) };
  849. private static RSPath path;
  850.  
  851. public boolean onStart() {
  852. try {
  853. JFrame.setDefaultLookAndFeelDecorated(true);
  854. for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
  855. if ("Nimbus".equals(info.getName())) {
  856. UIManager.setLookAndFeel(info.getClassName());
  857. break;
  858. }
  859. }
  860. } catch (Exception e) {
  861. log.severe("Fail to setLookAndFeel");
  862. }
  863. AddPouch();
  864. new GUISum().setVisible(true);
  865. while (isUp)
  866. sleep(50);
  867. path = walking.newTilePath(toT).reverse();
  868. return true;
  869. }
  870.  
  871. @Override
  872. public int loop() {
  873. BANK();
  874. tosum();
  875. Make_Pouch();
  876. toBank();
  877. return 0;
  878. }
  879.  
  880. public void BANK() {
  881. if (npcs.getNearest(6200) != null) {
  882. if (!inventory.contains(ITEM_ID)) {
  883. if (!bank.isOpen())
  884. bank.open();
  885. if (bank.isOpen()) {
  886. if (inventory.contains(ITEM_ID))
  887. return;
  888. bank.depositAllExcept(12183, 12155, CHARM, ITEM_ID, 8009,
  889. 8013);
  890. sleep(300, 500);
  891. bank.withdraw(ITEM_ID, 28);
  892. sleep(300, 500);
  893. }
  894. }
  895. }
  896. }
  897.  
  898. public void toBank() {
  899. RSItem tab = inventory.getItem(8009);
  900. // RSTtem
  901. if (!inventory.contains(ITEM_ID)) {
  902. if (objects.getNearest(28716) != null
  903. && !inventory.contains(ITEM_ID)) {
  904. if (tab != null && getMyPlayer().getAnimation() == -1) {
  905. tab.doClick(true);
  906. sleep(1000);
  907. } else {
  908. action(objects.getNearest(28714), "Climb");
  909. }
  910. }
  911. if (objects.getNearest(28690) != null
  912. || objects.getNearest(28691) != null)
  913. objects.getNearest(28690).doAction("Open");
  914. path.traverse();
  915. }
  916. }
  917.  
  918. private final void tosum() {
  919. final RSItem tab = inventory.getItem(8013);
  920. final RSTile[] to = new RSTile[] { new RSTile(2898, 3457),
  921. new RSTile(2911, 3457), new RSTile(2920, 3449),
  922. new RSTile(2925, 3444) };
  923. if (inventory.containsAll(12183, 12155, CHARM, ITEM_ID)) {
  924. if (npcs.getNearest(6200) != null) {
  925. if (tab != null && getMyPlayer().getAnimation() == -1) {
  926. if (bank.isOpen())
  927. bank.close();
  928. tab.doClick(true);
  929. sleep(1000);
  930. }
  931. }
  932. walking.newTilePath(to).traverse();
  933. if (tab == null)
  934. walking.newTilePath(toT).traverse();
  935. if (objects.getNearest(4039) != null) {
  936. action(objects.getNearest(4039), "Climb");
  937. action(objects.getNearest(4039), "Open");
  938. }
  939. }
  940.  
  941. }
  942.  
  943. private final void Make_Pouch() {
  944. if (inventory.containsAll(12183, 12155, CHARM, ITEM_ID)) {
  945. if (!interfaces.get(79).isValid()) {
  946. open(28716);
  947. } else if (interfaces.get(79).isValid()) {
  948. Pouch p = pouch.get(PLACE);
  949. if (!interfaces.getComponent(79, 16).getArea().contains(
  950. p.getInterface().getCenter()))
  951. mouse.click(p.getLocation(), true);
  952. if (interfaces.getComponent(79, 16).getArea().contains(
  953. p.getInterface().getCenter()))
  954. if (p.getInterface().doAction("All")) {
  955. sleep(1000, 1500);
  956. }
  957. }
  958. }
  959. }
  960.  
  961. private void open(int id) {
  962. RSObject c = objects.getNearest(id);
  963. action(c, "Infuse-pouch");
  964. }
  965.  
  966. private void AddPouch() {
  967. pouch.add(new Pouch("Spirit wolf pouch", 0, null));
  968. pouch.add(new Pouch("Dreadfowl pouch", 1, null));
  969. pouch.add(new Pouch("Spirit spider pouch", 2, null));
  970. pouch.add(new Pouch("Thorny snail pouch", 3, null));
  971. pouch.add(new Pouch("Granite crab pouch", 4, null));
  972. pouch.add(new Pouch("Spirit mosquito pouch", 5, null));
  973. pouch.add(new Pouch("Desert wyrm pouch", 6, null));
  974. pouch.add(new Pouch("Spirit scorpion pouch", 7, null));
  975. pouch.add(new Pouch("Spirit tz-kih pouch", 8, null));
  976. pouch.add(new Pouch("Albino rat pouch", 9, null));
  977. pouch.add(new Pouch("Spirit kalphite pouch", 10, null));
  978. pouch.add(new Pouch("Compost mound pouch", 11, null));
  979. pouch.add(new Pouch("Giant chinchompa pouch", 12, null));
  980. pouch.add(new Pouch("Vampire bat pouch", 13, null));
  981. pouch.add(new Pouch("Honey badger pouch", 14, null));
  982. pouch.add(new Pouch("Beaver pouch", 15, null));
  983. pouch.add(new Pouch("Void ravager pouch", 16, null));
  984. pouch.add(new Pouch("Void spinner pouch", 17, null));
  985. pouch.add(new Pouch("Void torcher pouch", 18, null));
  986. pouch.add(new Pouch("Void shifter pouch", 19, null));
  987. pouch.add(new Pouch("Bull ant pouch", 20, null));
  988. pouch.add(new Pouch("Macaw pouch", 21, null));
  989. pouch.add(new Pouch("Evil turnip pouch", 22, null));
  990. pouch.add(new Pouch("Sp. cockatrice pouch", 23, null));
  991. pouch.add(new Pouch("Sp. guthatrice pouch", 24, null));
  992. pouch.add(new Pouch("Sp. saratrice pouch", 25, null));
  993. pouch.add(new Pouch("Sp. zamatrice pouch", 26, null));
  994. pouch.add(new Pouch("Sp. pengatrice pouch", 27, null));
  995. pouch.add(new Pouch("Sp. coraxatrice pouch", 28, null));
  996. pouch.add(new Pouch("Sp. vulatrice pouch", 29, null));
  997. pouch.add(new Pouch("Pyrelord pouch", 30, null));
  998. pouch.add(new Pouch("Magpie pouch", 31, null));
  999. pouch.add(new Pouch("Bloated leech pouch", 32, null));
  1000. pouch.add(new Pouch("Spirit terrorbird pouch", 33, null));
  1001. pouch.add(new Pouch("Abyssal parasite pouch", 34, null));
  1002. pouch.add(new Pouch("Spirit jelly pouch", 35, null));
  1003. pouch.add(new Pouch("Ibis pouch", 36, null));
  1004. pouch.add(new Pouch("Spirit kyatt pouch", 37, null));
  1005. pouch.add(new Pouch("Spirit larupia pouch", 38, null));
  1006. pouch.add(new Pouch("Spirit graahk pouch", 39, null)); // 6
  1007. pouch.add(new Pouch("Karam. overlord pouch", 40, new Point(487, 259)));
  1008. pouch.add(new Pouch("Smoke devil pouch", 41, new Point(487, 259)));
  1009. pouch.add(new Pouch("Abyssal lurker pouch", 42, new Point(487, 259)));
  1010. pouch.add(new Pouch("Spirit cobra pouch", 43, new Point(487, 259)));
  1011. pouch.add(new Pouch("Stranger plant pouch", 44, new Point(487, 259)));
  1012. pouch.add(new Pouch("Barker toad pouch", 45, new Point(487, 259)));
  1013. pouch.add(new Pouch("War tortoise pouch", 46, new Point(487, 259)));
  1014. pouch.add(new Pouch("Bunyip pouch", 47, new Point(487, 259)));
  1015. pouch.add(new Pouch("Fruit bat pouch", 48, new Point(487, 259)));
  1016. pouch.add(new Pouch("Ravenous locust pouch", 49, new Point(487, 259)));
  1017. pouch.add(new Pouch("Arctic bear pouch", 50, new Point(487, 259)));
  1018. pouch.add(new Pouch("Phoenix pouch", 51, new Point(487, 259)));
  1019. pouch.add(new Pouch("Obsidian golem pouch", 52, new Point(487, 259)));
  1020. pouch.add(new Pouch("Granite lobster pouch", 53, new Point(487, 259)));
  1021. pouch.add(new Pouch("Praying mantis pouch", 54, new Point(487, 259)));
  1022. pouch.add(new Pouch("Forge regent pouch", 55, new Point(487, 259)));
  1023. pouch.add(new Pouch("Talon beast pouch", 56, new Point(487, 259)));
  1024. pouch.add(new Pouch("Giant ent pouch", 57, new Point(487, 259)));
  1025. pouch.add(new Pouch("Fire titan pouch", 58, new Point(487, 259)));
  1026. pouch.add(new Pouch("Moss titan pouch", 59, new Point(487, 259)));
  1027. pouch.add(new Pouch("Ice titan pouch", 60, new Point(487, 259)));
  1028. pouch.add(new Pouch("Hydra pouch", 61, new Point(487, 259)));
  1029. pouch.add(new Pouch("Spirit dagannoth pouch", 62, new Point(487, 259)));
  1030. pouch.add(new Pouch("Lava titan pouch", 63, new Point(487, 259)));
  1031. pouch.add(new Pouch("Swamp titan pouch", 64, new Point(487, 259)));
  1032. pouch.add(new Pouch("Bronze minotaur pouch", 65, new Point(487, 259)));
  1033. pouch.add(new Pouch("Iron minotaur pouch", 66, new Point(487, 259)));
  1034. pouch.add(new Pouch("Steel minotaur pouch", 67, new Point(487, 259)));
  1035. pouch.add(new Pouch("Mithril minotaur pouch", 68, new Point(487, 259)));
  1036. pouch.add(new Pouch("Adamant minotaur pouch", 69, new Point(487, 259)));
  1037. pouch.add(new Pouch("Rune minotaur pouch", 70, new Point(487, 259)));
  1038. pouch.add(new Pouch("Unicorn stallion pouch", 71, new Point(487, 259)));
  1039. pouch.add(new Pouch("Geyser titan pouch", 72, new Point(485, 300)));
  1040. pouch.add(new Pouch("Wolpertinger pouch", 73, new Point(485, 300)));
  1041. pouch.add(new Pouch("Abyssal titan pouch", 74, new Point(485, 300)));
  1042. pouch.add(new Pouch("Iron titan pouch", 75, new Point(485, 300)));
  1043. pouch.add(new Pouch("Pack yak pouch", 76, new Point(485, 300)));
  1044. pouch.add(new Pouch("Steel titan pouch", 77, new Point(485, 300)));
  1045. }
  1046.  
  1047. private void action(RSObject c, String str) {
  1048. if (c != null) {
  1049. if (c.isOnScreen()) {
  1050. c.doAction(str);
  1051. sleep(1000);
  1052. return;
  1053. }
  1054. }
  1055. return;
  1056. }
  1057.  
  1058. public class Pouch {
  1059.  
  1060. private String Name;
  1061. private int POUCH_ID;
  1062. private Point point;
  1063.  
  1064. public Pouch(String name, int interfacesID, Point p) {
  1065. this.Name = name;
  1066. this.POUCH_ID = interfacesID;
  1067. this.point = p;
  1068. }
  1069.  
  1070. public String getName() {
  1071. return Name;
  1072. }
  1073.  
  1074. public RSComponent getInterface() {
  1075. return interfaces.getComponent(79, 16).getComponent(
  1076. (POUCH_ID * 5) + 2);
  1077. }
  1078.  
  1079. public Point getLocation() {
  1080. return point;
  1081. }
  1082.  
  1083. public int getIndex() {
  1084. return POUCH_ID;
  1085. }
  1086. }
  1087.  
  1088. public class GUISum extends JFrame {
  1089. public GUISum() {
  1090. initComponents();
  1091. }
  1092.  
  1093. private String[] inf() {
  1094. LinkedList<String> str = new LinkedList<String>();
  1095. for (Pouch p : pouch)
  1096. str.add(p.getName());
  1097. return str.toArray(new String[str.size()]);
  1098. }
  1099.  
  1100. private void Start(ActionEvent e) {
  1101. String c1 = comboBox1.getSelectedItem().toString();
  1102. String c2 = comboBox2.getSelectedItem().toString();
  1103. String s = this.textField1.getText();
  1104. for (Pouch p : pouch) {
  1105. if (p.getName().contains(c1))
  1106. PLACE = p.getIndex();
  1107. }
  1108. ITEM_ID = Integer.parseInt(s);
  1109. CHARM = inventory.getItemID(c2);
  1110. log("charm ID " + CHARM + " Item ID " + ITEM_ID);
  1111. isUp = false;
  1112. this.dispose();
  1113. }
  1114.  
  1115. private void initComponents() {
  1116. // JFormDesigner - Component initialization - DO NOT MODIFY
  1117. // //GEN-BEGIN:initComponents
  1118. Start = new JButton();
  1119. comboBox1 = new JComboBox();
  1120. label1 = new JLabel();
  1121. comboBox2 = new JComboBox();
  1122. label2 = new JLabel();
  1123. textField1 = new JTextField();
  1124. label3 = new JLabel();
  1125.  
  1126. // ======== this ========
  1127. setTitle("Doout's Summoner");
  1128. Container contentPane = getContentPane();
  1129. contentPane.setLayout(null);
  1130.  
  1131. // ---- Start ----
  1132. Start.setText("Start");
  1133. Start.addActionListener(new ActionListener() {
  1134. public void actionPerformed(ActionEvent e) {
  1135. Start(e);
  1136. }
  1137. });
  1138. comboBox1.setModel(new DefaultComboBoxModel(this.inf()));
  1139. contentPane.add(Start);
  1140. Start.setBounds(10, 195, 495, Start.getPreferredSize().height);
  1141. contentPane.add(comboBox1);
  1142. comboBox1.setBounds(5, 50, 505, 35);
  1143.  
  1144. // ---- label1 ----
  1145. label1.setText(" Pouch to make");
  1146. contentPane.add(label1);
  1147. label1.setBounds(205, 25, 100, 20);
  1148.  
  1149. // ---- comboBox2 ----
  1150. comboBox2.setModel(new DefaultComboBoxModel(
  1151. new String[] { "Gold charm", "Green charm",
  1152. "Crimson charm", "Blue charm" }));
  1153. contentPane.add(comboBox2);
  1154. comboBox2.setBounds(new Rectangle(new Point(105, 105), comboBox2
  1155. .getPreferredSize()));
  1156.  
  1157. // ---- label2 ----
  1158. label2.setText("Charm Colour");
  1159. contentPane.add(label2);
  1160. label2.setBounds(20, 110, 75, label2.getPreferredSize().height);
  1161. contentPane.add(textField1);
  1162. textField1.setBounds(105, 165, 160,
  1163. textField1.getPreferredSize().height);
  1164.  
  1165. // ---- label3 ----
  1166. label3.setText("Secondary ID");
  1167. contentPane.add(label3);
  1168. label3.setBounds(10, 165, 75, 20);
  1169.  
  1170. { // compute preferred size
  1171. Dimension preferredSize = new Dimension();
  1172. for (int i = 0; i < contentPane.getComponentCount(); i++) {
  1173. Rectangle bounds = contentPane.getComponent(i).getBounds();
  1174. preferredSize.width = Math.max(bounds.x + bounds.width,
  1175. preferredSize.width);
  1176. preferredSize.height = Math.max(bounds.y + bounds.height,
  1177. preferredSize.height);
  1178. }
  1179. Insets insets = contentPane.getInsets();
  1180. preferredSize.width += insets.right;
  1181. preferredSize.height += insets.bottom;
  1182. contentPane.setMinimumSize(preferredSize);
  1183. contentPane.setPreferredSize(preferredSize);
  1184. }
  1185. pack();
  1186. setLocationRelativeTo(getOwner());
  1187. // JFormDesigner - End of component initialization
  1188. // //GEN-END:initComponents
  1189. }
  1190.  
  1191. // JFormDesigner - Variables declaration - DO NOT MODIFY
  1192. // //GEN-BEGIN:variables
  1193. private JButton Start;
  1194. private JComboBox comboBox1;
  1195. private JLabel label1;
  1196. private JComboBox comboBox2;
  1197. private JLabel label2;
  1198. private JTextField textField1;
  1199. private JLabel label3;
  1200. // JFormDesigner - End of variables declaration //GEN-END:variables
  1201. }
  1202.  
  1203. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement