Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 45.38 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.Polygon;
  7. import java.awt.RenderingHints;
  8. import java.awt.event.MouseEvent;
  9. import java.awt.event.MouseListener;
  10. import java.awt.event.MouseMotionListener;
  11.  
  12. import javax.swing.SwingUtilities;
  13.  
  14. import org.rsbot.event.events.MessageEvent;
  15. import org.rsbot.event.listeners.MessageListener;
  16. import org.rsbot.event.listeners.PaintListener;
  17. import org.rsbot.script.Script;
  18. import org.rsbot.script.ScriptManifest;
  19. import org.rsbot.script.methods.Skills;
  20. import org.rsbot.script.task.LoopTask;
  21. import org.rsbot.script.task.TaskContainer;
  22. import org.rsbot.script.wrappers.RSArea;
  23. import org.rsbot.script.wrappers.RSItem;
  24. import org.rsbot.script.wrappers.RSModel;
  25. import org.rsbot.script.wrappers.RSObject;
  26. import org.rsbot.script.wrappers.RSTile;
  27.  
  28. @ScriptManifest(name = "Agility Killer", version = 1.0, authors = "Popm4n", keywords =
  29.  
  30. "Agility", description = "Get that Agility Cape in No Time.")
  31. public class AgilityKiller extends Script implements PaintListener, MessageListener,
  32.  
  33. MouseListener, MouseMotionListener {
  34.  
  35. AntiBan antiban = new AntiBan();
  36. AgilityGUI scriptGUI;
  37. Skill agility;
  38. long startTime;
  39. int levelsGained;
  40. String courseName = "";
  41. boolean failedCourse = false;
  42.  
  43. TaskContainer taskContainer = new TaskContainer();
  44.  
  45. boolean developerMode = false;
  46. int failed = 0;
  47. public boolean showPaint = true;
  48. int percentageToEat;
  49. int numberInCourse;
  50.  
  51. AgilityCourse course;
  52. Obstacle currentObstacle;
  53. Obstacle nextObstacle;
  54.  
  55. private Area startOfApeAtollCourse = new Area(new RSTile(2755, 2742), new RSTile
  56.  
  57. (2775, 2755), 0);
  58. private Area underTropicalTree = new Area(new RSTile(2752, 2742), new RSTile(2753,
  59.  
  60. 2742), 0);
  61. private Area beforeMonkeyBars = new Area(new RSTile(2752, 2741), new RSTile(2754,
  62.  
  63. 2742), 2);
  64. private Area afterMonkeyBars = new Area(new RSTile(2747, 2741), new RSTile(2747,
  65.  
  66. 2741), 0);
  67. private Area beforeRopeSwing = new Area(new RSTile(2738, 2725), new RSTile(2752,
  68.  
  69. 2741), 0);
  70. private Area beforeFinishTree = new Area(new RSTile(2755, 2723), new RSTile(2760,
  71.  
  72. 2737), 0);
  73.  
  74. private RSArea apeAtollArea = new RSArea(2738, 2725, 2775, 2755);
  75. private Obstacle steppingStone = new Obstacle(new int[]{12568}, true, 3481,
  76.  
  77. startOfApeAtollCourse, "Jump-to");
  78. private Obstacle tropicalTree = new Obstacle(new int[]{12570}, false, 3492,
  79.  
  80. underTropicalTree, "Climb");
  81. private Obstacle monkeyBars = new Obstacle(new int[]{12573}, false, 3484,
  82.  
  83. beforeMonkeyBars, "Swing Across");
  84. private Obstacle skullSlope = new Obstacle(new int[]{12576}, false, 500,
  85.  
  86. afterMonkeyBars, "Climb-up");
  87. private Obstacle ropeSwing = new Obstacle(new int[]{12578}, true, 3488,
  88.  
  89. beforeRopeSwing, "Swing");
  90. private Obstacle finishTree = new Obstacle(new int[]{12618}, false, 500,
  91.  
  92. beforeFinishTree, "Climb-down");
  93. private Obstacle[] apeAtollCourse = {
  94. steppingStone, tropicalTree, monkeyBars, skullSlope,
  95. ropeSwing, finishTree
  96. };
  97. private AgilityCourse apeAtoll = new AgilityCourse(startOfApeAtollCourse, 6,
  98.  
  99. apeAtollCourse, apeAtollArea, new RSTile(-1, -1));
  100.  
  101. private Area gnomeStrongholdArea = new Area(new RSTile(2469, 3414), new RSTile(2490,
  102.  
  103. 3440), 0);
  104. private Obstacle logBalance = new Obstacle(new int[]{2295}, true, 9908, new Area(new
  105.  
  106. RSTile(2469, 3433), new RSTile(2490, 3440), 0), "Walk-across");
  107. private Obstacle firstObstacleNet = new Obstacle(new int[]{2285}, false, 828, new
  108.  
  109. Area(new RSTile(2469, 3419), new RSTile(2478, 3430), 0), "Climb-over");
  110. private Obstacle firstTreeBranch = new Obstacle(new int[]{35970}, false, 828, new
  111.  
  112. Area(new RSTile(2471, 3422), new RSTile(2476, 3424), 1), "Climb");
  113. private Obstacle balancingRope = new Obstacle(new int[]{2312}, false, 9908, new
  114.  
  115. Area(new RSTile(2472, 3418), new RSTile(2477, 3421), 2), "Walk-on");
  116. private Obstacle secondTreeBranch = new Obstacle(new int[]{2314}, false, 828, new
  117.  
  118. Area(new RSTile(2483, 3418), new RSTile(2488, 3421), 2), "Climb-down");
  119. private Obstacle secondObstacleNet = new Obstacle(new int[]{2286}, true, 828, new
  120.  
  121. Area(new RSTile(2482, 3418), new RSTile(2490, 3425), 0), "Climb-over");
  122. private Obstacle obstaclePipe = new Obstacle(new int[]{43544, 43543}, false, 10580,
  123.  
  124. new Area(new RSTile(2481, 3426), new RSTile(2490, 3435), 0),
  125.  
  126. "Squeeze-through");
  127. private Obstacle[] basicGnomeStrongholdCourse = {
  128. logBalance, firstObstacleNet, firstTreeBranch, balancingRope,
  129. secondTreeBranch, secondObstacleNet, obstaclePipe
  130. };
  131. private AgilityCourse basicGnomeStronghold = new AgilityCourse
  132.  
  133. (logBalance.getAreaToUseObstacle(), 7, basicGnomeStrongholdCourse, gnomeStrongholdArea,
  134.  
  135. new
  136.  
  137. RSTile(2474, 3437));
  138.  
  139. private Obstacle advBranch = new Obstacle(new int[]{43528}, false, 828, new Area(new
  140.  
  141. RSTile(2472, 3418), new RSTile(2477, 3421), 2), "Climb-up");
  142. private Obstacle signPost = new Obstacle(new int[]{43581}, false, -1, new Area(new
  143.  
  144. RSTile(2472, 3418), new RSTile(2477, 3421), 3), "Run-across");
  145. private Obstacle poleSwing = new Obstacle(new int[]{43529, 43547, 43548}, false, -1,
  146.  
  147. new Area(new RSTile(2484, 3418), new RSTile(2487, 3421), 3),
  148.  
  149. "Swing-to");
  150. private Obstacle barrierJump = new Obstacle(new int[]{43539}, false, -1, new Area
  151.  
  152. (new RSTile(2482, 3432), new RSTile(2488, 3435), 3), "Jump-over");
  153. private Obstacle[] advGnomeStrongholdCourse = {
  154. logBalance, firstObstacleNet, firstTreeBranch, advBranch,
  155. signPost, poleSwing, barrierJump
  156. };
  157.  
  158. private AgilityCourse advGnomeStronghold = new AgilityCourse
  159.  
  160. (logBalance.getAreaToUseObstacle(), -1, advGnomeStrongholdCourse, gnomeStrongholdArea,
  161.  
  162. new
  163.  
  164. RSTile(-1, -1));
  165.  
  166. private Area barbOutpostArea = new Area(new RSTile(2529, 3542), new RSTile(2555,
  167.  
  168. 3557), 0);
  169. private Obstacle barbRopeSwing = new Obstacle(new int[]{43526}, true, 751, new Area
  170.  
  171. (new RSTile(2543, 3551), new RSTile(2555, 3557), 0), "Swing-on");
  172. private Obstacle barbLogBalance = new Obstacle(new int[]{43595}, false, 9908, new
  173.  
  174. Area(new RSTile(2544, 3542), new RSTile(2555, 3549), 0), "Walk-across");
  175. private Obstacle barbObstacleNet = new Obstacle(new int[]{20211}, false, 828, new
  176.  
  177. Area(new RSTile(2538, 3542), new RSTile(2543, 3549), 0), "Climb-over");
  178. private Obstacle barbBalancingLedge = new Obstacle(new int[]{2302}, false, 753, new
  179.  
  180. Area(new RSTile(2536, 3545), new RSTile(2538, 3547), 1), "Walk-across");
  181. private Obstacle barbLadder = new Obstacle(new int[]{3205}, false, 827, new Area(new
  182.  
  183. RSTile(2532, 3546), new RSTile(2532, 3547), 1), "Climb-down");
  184. private Obstacle barbFirstCrumblingWall = new Obstacle(new int[]{1948}, true, 4853,
  185.  
  186. new Area(new RSTile(2529, 3542), new RSTile(2537, 3556), 0), "Climb-over");
  187. private Obstacle[] basicBarbOutpostCourse = {
  188. barbRopeSwing, barbLogBalance, barbObstacleNet,
  189. barbBalancingLedge, barbLadder, barbFirstCrumblingWall
  190. };
  191. private AgilityCourse basicBarbOutpost = new AgilityCourse
  192.  
  193. (barbRopeSwing.getAreaToUseObstacle(), 6, basicBarbOutpostCourse, barbOutpostArea, new
  194.  
  195. RSTile
  196.  
  197. (2755, 2742));
  198.  
  199. @Override
  200. public boolean onStart() {
  201. try {
  202. SwingUtilities.invokeAndWait(new Runnable() {
  203. public void run() {
  204. scriptGUI = new AgilityGUI();
  205. scriptGUI.setVisible(true);
  206. }
  207. });
  208. } catch (Exception e) {
  209. e.printStackTrace();
  210. }
  211. while (scriptGUI.isVisible()) {
  212. sleep(100);
  213. }
  214. if (AgilityGUI.courseList.getSelectedItem().toString().equals("Basic Gnome
  215.  
  216. Stronghold")) {
  217. log("Course is Basic Gnome Stronghold");
  218. course = basicGnomeStronghold;
  219. courseName = "Basic Gnome Stronghold";
  220. } else if (AgilityGUI.courseList.getSelectedItem().toString().equals("Basic
  221.  
  222. Barbarian Outpost")) {
  223. course = basicBarbOutpost;
  224. log("Course is Basic Barbarian Outpost");
  225. courseName = "Basic Barbarian Outpost";
  226. } else if (AgilityGUI.courseList.getSelectedItem().toString().equals("Ape
  227.  
  228. Atoll")) {
  229. log("Course is Ape Atoll");
  230. course = apeAtoll;
  231. courseName = "Ape Atoll";
  232. } else if (AgilityGUI.courseList.getSelectedItem().toString().equals("Adv Gnome
  233.  
  234. Stronghold")) {
  235. log("Course is Advanced Gnome Stronghold");
  236. course = advGnomeStronghold;
  237. courseName = "Adv Gnome Stronghold";
  238. }
  239. if (course == null) {
  240. log("Course is null, stopping script");
  241. return false;
  242. }
  243. percentageToEat = AgilityGUI.percentageToEat.getValue();
  244. log("Eating at: " + percentageToEat + "%");
  245. taskContainer.pool(antiban);
  246. agility = new Skill(Skills.AGILITY);
  247. mouse.setSpeed(5);
  248. startTime = System.currentTimeMillis();
  249. return true;
  250. }
  251.  
  252. private boolean isHovered(RSModel model) {
  253. for (Polygon p : model.getTriangles()) {
  254. if (p.contains(mouse.getLocation())) {
  255. return true;
  256. }
  257. }
  258. return false;
  259. }
  260.  
  261. public boolean hover(RSObject object) {
  262. if (object != null) {
  263. for (Polygon i : object.getModel().getTriangles()) {
  264. if (i.contains(mouse.getLocation())) {
  265. return true;
  266. }
  267. }
  268. mouse.move(object.getModel().getPoint());
  269. sleep(300, 500);
  270. return true;
  271. }
  272. //log("object is null");
  273. return false;
  274. }
  275.  
  276. private RSItem getFood() {
  277. for (RSItem i : inventory.getItems()) {
  278. if (i == null || i.getID() == -1)
  279. continue;
  280. if (i.getComponent().getActions() == null || i.getComponent().getActions()
  281.  
  282. [0] == null)
  283. continue;
  284. if (i.getComponent().getActions()[0].contains("Eat"))
  285. return i;
  286. }
  287. return null;
  288. }
  289.  
  290. private void eatFood() {
  291. if (getFood() != null) {
  292. getFood().interact("Eat");
  293. } else if (getFood() == null) {
  294. log("Out of food");
  295. stop();
  296. }
  297. }
  298.  
  299. private int getHP() {
  300. return Integer.parseInt(interfaces.getComponent(748, 8).getText().trim());
  301. }
  302.  
  303. private int getHealthPercent() {
  304. return (int) ((double) (Integer.parseInt(interfaces.get(748).getComponent
  305.  
  306. (8).getText()) / 10) / skills.getRealLevel(Skills.CONSTITUTION) * 100);
  307. }
  308.  
  309. private void useObject(String option, int... IDs) {
  310. RSObject object = objects.getNearest(IDs);
  311. if (object != null) {
  312. if (!object.isOnScreen()) {
  313. mouse.click(calc.tileToMinimap(object.getLocation().randomize(1, 1)),
  314.  
  315. true);
  316. sleep(800, 1000);
  317. while (players.getMyPlayer().isMoving() && !object.isOnScreen()) {
  318. sleep(10);
  319. }
  320. }
  321. if (players.getMyPlayer().getAnimation() == -1) {
  322. if (object.interact(option)) {
  323. sleep(1500, 2000);
  324. }
  325. }
  326. //sleep(800, 1000);
  327. while (players.getMyPlayer().isMoving() && players.getMyPlayer
  328.  
  329. ().getAnimation() == -1) {
  330. sleep(30);
  331. }
  332. }
  333. }
  334.  
  335. private void useObject(String option, RSTile tile) {
  336. RSObject object = objects.getTopAt(tile);
  337. if (object != null) {
  338. if (!object.isOnScreen()) {
  339. mouse.click(calc.tileToMinimap(object.getLocation().randomize(1, 1)),
  340.  
  341. true);
  342. sleep(800, 1000);
  343. while (players.getMyPlayer().isMoving() && !object.isOnScreen()) {
  344. sleep(10);
  345. }
  346. }
  347. if (players.getMyPlayer().getAnimation() == -1)
  348. object.interact(option);
  349. sleep(800, 1000);
  350. while (players.getMyPlayer().isMoving() && players.getMyPlayer
  351.  
  352. ().getAnimation() == -1) {
  353. sleep(30);
  354. }
  355. }
  356. }
  357.  
  358. //SW = 2546, 9948
  359. //NE = 2555, 9955
  360. public int loop() {
  361. try {
  362. if (getHealthPercent() <= percentageToEat) {
  363. eatFood();
  364. }
  365. while (players.getMyPlayer().isMoving() && players.getMyPlayer
  366.  
  367. ().getAnimation() == -1) {
  368. sleep(100);
  369. }
  370. if (course.equals(basicBarbOutpost)) {
  371. barbCourse();
  372. }
  373. else if (course.equals(advGnomeStronghold)) {
  374. advGnomeCourse();
  375. }
  376. else {
  377. quickFixes();
  378. if (!players.getMyPlayer().isIdle()) {
  379. //log("Player is not idle");
  380. hover(objects.getNearest(nextObstacle.IDs));
  381. return random(100, 400);
  382. }
  383. //log("In loop()");
  384. findCurrentObstacle(course);
  385. //log("Found current Obstacle");
  386. course.runNextObstacle();
  387. //log("Just ran Obstacle");
  388. }
  389.  
  390. } catch (Exception e) {
  391. e.printStackTrace();
  392. }
  393. /*try {
  394. quickFixes();
  395. if (getHealthPercent() <= percentageToEat) {
  396. eatFood();
  397. }
  398. if (!players.getMyPlayer().isIdle()) {
  399. //log("Player is not idle");
  400. hover(objects.getNearest(nextObstacle.IDs));
  401. return random(100, 400);
  402. }
  403. //log("In loop()");
  404. findCurrentObstacle(course);
  405. //log("Found current Obstacle");
  406. course.runNextObstacle();
  407. //log("Just ran Obstacle");
  408. } catch (NullPointerException e) {
  409. e.printStackTrace();
  410. }*/
  411. return 0;
  412. }
  413.  
  414. private void barbCourse() {
  415. if (new Area(new RSTile(2546, 9948), new RSTile(2555, 9955), 0).contains
  416.  
  417. (players.getMyPlayer().getLocation())) {
  418. //Under Rope Swing
  419. useObject("Climb-up", 32015);
  420. } else if (new RSArea(2543, 3549, 2555, 3559).contains(players.getMyPlayer
  421.  
  422. ().getLocation()) &&
  423. game.getPlane() == 0 &&
  424. !new RSArea(2543, 3542, 2555, 3550).contains(players.getMyPlayer
  425.  
  426. ().getLocation())) {
  427. //Rope Swing
  428. useObject("Swing-on", 43526);
  429. } else if (new RSArea(2542, 3546, 2550, 3546).contains(players.getMyPlayer
  430.  
  431. ().getLocation())) {
  432. //On log
  433. if (random(1, 100) == 50) {
  434. mouse.moveSlightly();
  435. }
  436. sleep(200, 500);
  437. } else if (new RSArea(2543, 3542, 2555, 3550).contains(players.getMyPlayer
  438.  
  439. ().getLocation()) &&
  440. game.getPlane() == 0) {
  441. //Log Balance
  442. useObject("Walk-across", 43595);
  443. } else if (new RSArea(2533, 3545, 2537, 3547).contains(players.getMyPlayer
  444.  
  445. ().getLocation()) &&
  446. game.getPlane() == 0) {
  447. //West of obstacle net
  448. walking.getPath(new RSTile(2540, 3546).randomize(1, 1)).traverse();
  449. sleep(800, 1000);
  450. } else if (new RSArea(2533, 3542, 2542, 3549).contains(players.getMyPlayer
  451.  
  452. ().getLocation()) &&
  453. game.getPlane() == 0) {
  454. //Obstacle Net
  455. useObject("Climb-over", 20211);
  456. } else if (new RSArea(2536, 3545, 2538, 3547).contains(players.getMyPlayer
  457.  
  458. ().getLocation()) &&
  459. game.getPlane() == 1) {
  460. //Balancing Ledge
  461. useObject("Walk-across", 2302);
  462. } else if (new RSArea(2532, 3546, 2532, 3547).contains(players.getMyPlayer
  463.  
  464. ().getLocation()) &&
  465. game.getPlane() == 1) {
  466. //Ladder
  467. useObject("Climb-down", 3205);
  468. } else if ((new RSArea(2529, 3542, 2532, 3556).contains(players.getMyPlayer
  469.  
  470. ().getLocation()) ||
  471. new RSArea(2533, 3548, 2537, 3556).contains(players.getMyPlayer
  472.  
  473. ().getLocation()) ||
  474. new RSArea(2538, 3548, 2539, 3551).contains(players.getMyPlayer().getLocation())
  475.  
  476. ||
  477. new RSArea(2538, 3555, 2542, 3556).contains(players.getMyPlayer().getLocation
  478.  
  479. ())) &&
  480. game.getPlane() == 0) {
  481. //first wall
  482. useObject("Climb-over", 1948);
  483. } else if (new RSArea(2538, 3552, 2542, 3554).contains(players.getMyPlayer
  484.  
  485. ().getLocation()) &&
  486. game.getPlane() == 0) {
  487. //Second wall
  488. useObject("Climb-over", new RSTile(2542, 3553));
  489. }
  490. }
  491.  
  492. private void advGnomeCourse() {
  493. if (new RSArea(new RSTile(2474, 3430), new RSTile(2474, 3435)).contains
  494.  
  495. (players.getMyPlayer().getLocation()) &&
  496. game.getPlane() == 0) {
  497. //On log
  498. if (random(1, 100) == 50) {
  499. mouse.moveSlightly();
  500. }
  501. sleep(200, 500);
  502. }
  503. if (new RSArea(new RSTile(2469, 3430), new RSTile(2478, 3440)).contains
  504.  
  505. (players.getMyPlayer().getLocation()) ||
  506. new RSArea (new RSTile(2469, 3436), new RSTile(2490, 3440)).contains
  507.  
  508. (players.getMyPlayer().getLocation()) &&
  509. game.getPlane() == 0) {
  510. //Log Cross
  511. useObject("Walk-across", 2295);
  512. }
  513. if (new RSTile(2470, 3425).equals(players.getMyPlayer().getLocation())) {
  514. walking.getPath(new RSTile(2474, 3427).randomize(1, 1)).traverse();
  515. }
  516. if (new RSArea(new RSTile(2469, 3414), new RSTile(2478, 3429)).contains
  517.  
  518. (players.getMyPlayer().getLocation()) &&
  519. game.getPlane() == 0) {
  520. //First obstacle net
  521. useObject("Climb-over", 2285);
  522. }
  523. if (new RSArea(new RSTile(2471, 3422), new RSTile(2476, 3424)).contains
  524.  
  525. (players.getMyPlayer().getLocation()) &&
  526. game.getPlane() == 1) {
  527. //Tree branch
  528. useObject("Climb", 35970);
  529. }
  530. if (new RSArea(new RSTile(2472, 3418), new RSTile(2477, 3421)).contains
  531.  
  532. (players.getMyPlayer().getLocation()) &&
  533. game.getPlane() == 2) {
  534. //Tree branch to advanced course
  535. useObject("Climb-up", 43528);
  536. }
  537. if (new RSArea(new RSTile(2472, 3418), new RSTile(2477, 3420)).contains
  538.  
  539. (players.getMyPlayer().getLocation()) &&
  540. game.getPlane() == 3) {
  541. //Signpost run
  542. useObject("Run-across", 43581);
  543. }
  544. if (new RSArea(new RSTile(2484, 3418), new RSTile(2487, 3421)).contains
  545.  
  546. (players.getMyPlayer().getLocation()) &&
  547. game.getPlane() == 3) {
  548. //Pole swing
  549. useObject("Swing-to", 43529);
  550. }
  551. if (new RSArea(new RSTile(2482, 3432), new RSTile(2488, 3435)).contains
  552.  
  553. (players.getMyPlayer().getLocation()) &&
  554. game.getPlane() == 3) {
  555. useObject("Jump-over", 43539);
  556. }
  557. /*if (new RSTile(2485, 3434).equals(players.getMyPlayer().getLocation())) {
  558. new RSTile(2485, 3438).randomize(1, 1).clickOnMap();
  559. sleep(400, 500);
  560. }*/
  561. }
  562.  
  563.  
  564. private int quickFixes() {
  565. //One tile to the left of the first gnome obstacle net
  566. if (players.getMyPlayer().getLocation().equals(new RSTile(2470, 3425))) {
  567. walking.walkTileMM(new RSTile(2474, 3427).randomize(1, 1));
  568. sleep(800, 1000);
  569. while (players.getMyPlayer().isMoving()) {
  570. sleep(100);
  571. }
  572. }
  573. //Before Ape Atoll Rope Swing
  574. if (new Area(new RSTile(2738, 2725), new RSTile(2743, 2741), 0).contains
  575.  
  576. (players.getMyPlayer().getLocation()) &&
  577. game.getPlane() == 0) {
  578. RSObject ropeSwing = objects.getNearest(12578);
  579. if (ropeSwing != null) {
  580. if (!ropeSwing.isOnScreen()) {
  581. mouse.click(calc.tileToMinimap(new RSTile(2750, 2733).randomize(1,
  582.  
  583. 1)), true);
  584. sleep(800, 1000);
  585. while (players.getMyPlayer().isMoving()) {
  586. sleep(100);
  587. }
  588. }
  589. ropeSwing.interact("Swing Rope");
  590. sleep(800, 1000);
  591. while (players.getMyPlayer().isMoving()) {
  592. sleep(100);
  593. }
  594. }
  595. }
  596. if (course.equals(basicGnomeStronghold) || course.equals(advGnomeStronghold)) {
  597. if (new RSArea(2476, 3414, 2480, 3430).contains(players.getMyPlayer
  598.  
  599. ().getLocation())) {
  600. walking.getPath(course.startTile).traverse();
  601. }
  602. }
  603. //Before second obstacle net in Gnome Stronghold
  604. if (new RSArea(new RSTile(2482, 3418), new RSTile(2490, 3425)).contains
  605.  
  606. (players.getMyPlayer().getLocation()) &&
  607. game.getPlane() == 0) {
  608. RSObject net = objects.getNearest(2286);
  609. if (net != null) {
  610. if (!net.isOnScreen()) {
  611. mouse.click(calc.tileToMinimap( new RSTile(2486,
  612.  
  613. 3424).randomize(1, 1)), true);
  614. sleep(800, 1000);
  615. while (players.getMyPlayer().isMoving()) {
  616. sleep(100);
  617. }
  618. }
  619. net.interact("Climb-over");
  620. sleep(800, 1000);
  621. while (players.getMyPlayer().isMoving()) {
  622. sleep(100);
  623. }
  624. }
  625. loop();
  626. }
  627. //Under Barb Rope Swing
  628. //SW = 2546, 9948
  629. //NE = 2555, 9955
  630. if (new RSArea(new RSTile(2546, 9948), new RSTile(2555, 9955), 0).contains
  631.  
  632. (players.getMyPlayer().getLocation())) {
  633. RSObject ladder = objects.getNearest(32015);
  634. if (ladder != null) {
  635. if (!ladder.isOnScreen()) {
  636. walking.getPath(ladder.getLocation()).traverse();
  637. sleep(600, 800);
  638. while (players.getMyPlayer().isMoving()) {
  639. sleep(30);
  640. }
  641. }
  642. ladder.interact("Climb-up");
  643. sleep(600, 800);
  644. while (players.getMyPlayer().isMoving()) {
  645. sleep(30);
  646. }
  647. }
  648. quickFixes();
  649. }
  650. //West of Gnome obstacle pipes
  651. if (new Area(new RSTile(2479, 3431), new RSTile(2481, 3433), 0).contains
  652.  
  653. (players.getMyPlayer().getLocation())) {
  654. RSObject pipe = objects.getNearest(obstaclePipe.getIDs());
  655. if (pipe != null) {
  656. if (!pipe.isOnScreen()) {
  657. mouse.click(calc.tileToMinimap(pipe.getLocation()), true);
  658. sleep(600, 900);
  659. while (players.getMyPlayer().isMoving()) {
  660. sleep(30);
  661. }
  662. }
  663. pipe.interact("Squeeze-through");
  664. sleep(600, 900);
  665. while (players.getMyPlayer().isMoving()) {
  666. sleep(30);
  667. }
  668. }
  669. }
  670. if (new RSArea(new RSTile(2750, 2747), new RSTile(2753, 2757), 0).contains
  671.  
  672. (players.getMyPlayer().getLocation()) ||
  673. new RSArea(new RSTile(2746, 2744), new RSTile(2749, 2746), 0).contains
  674.  
  675. (players.getMyPlayer().getLocation())) {
  676. mouse.click(calc.tileToMinimap(objects.getNearest(steppingStone.getIDs
  677.  
  678. ()).getLocation()), true);
  679. sleep(600, 900);
  680. }
  681. if (new RSArea(new RSTile(2764, 2735), new RSTile(2769, 2741)).contains
  682.  
  683. (players.getMyPlayer().getLocation()) &&
  684. game.getPlane() == 0) {
  685. RSObject stone = objects.getNearest(steppingStone.getIDs());
  686. if (stone != null) {
  687. mouse.click(calc.tileToMinimap(stone.getLocation()), true);
  688. sleep(600, 900);
  689. while (players.getMyPlayer().isMoving()) {
  690. sleep(30);
  691. }
  692. }
  693. }
  694. if (new Area(new RSTile(2550, 3547), new RSTile(2553, 3549), 0).contains
  695.  
  696. (players.getMyPlayer().getLocation())) {
  697. RSObject log = objects.getNearest(barbLogBalance.getIDs());
  698. if (log != null) {
  699. if (!log.isOnScreen()) {
  700. mouse.click(calc.tileToMinimap(log.getLocation()), true);
  701. sleep(600, 800);
  702. while (players.getMyPlayer().isMoving()) {
  703. sleep(30);
  704. }
  705. }
  706. log.interact("Walk-across");
  707. }
  708. }
  709.  
  710. //Check for area west of barbarian outpost net
  711. if (new Area(new RSTile(2533, 3545), new RSTile(2537, 3547), 0).contains
  712.  
  713. (players.getMyPlayer().getLocation())) {
  714. mouse.click(calc.tileToMinimap(new RSTile(2540, 3545).randomize(1, 1)),
  715.  
  716. true);
  717. }
  718. //Check for area between two crumbling walls at barb outpost
  719. if (new Area(new RSTile(2538, 3552), new RSTile(2542, 3554), 0).contains
  720.  
  721. (players.getMyPlayer().getLocation())) {
  722. RSObject wall = objects.getTopAt(new RSTile(2542, 3553));
  723. if (wall != null) {
  724. if (!wall.isOnScreen()) {
  725. mouse.click(calc.tileToMinimap(wall.getLocation()), true);
  726. sleep(600, 800);
  727. }
  728. wall.interact("Climb-over");
  729. }
  730. sleep(800, 1200);
  731. while (!players.getMyPlayer().isIdle()) {
  732. sleep(30);
  733. }
  734. }
  735. //
  736. if (!course.agilityCourseArea.contains(players.getMyPlayer().getLocation())) {
  737. for (int i = 0; i <= 2; i++) {
  738. while (!players.getMyPlayer().isIdle()) {
  739. sleep(300);
  740. }
  741. if (!course.agilityCourseArea.contains(players.getMyPlayer
  742.  
  743. ().getLocation())) {
  744. walking.getPath(course.startTile).traverse();
  745. sleep(500, 600);
  746. while (players.getMyPlayer().isMoving()) {
  747. sleep(30);
  748. }
  749. if (!course.agilityCourseArea.contains(players.getMyPlayer
  750.  
  751. ().getLocation())) {
  752. log("Not in agility course area, stopping script");
  753. stop();
  754. }
  755. }
  756. }
  757. return 0;
  758. }
  759. return 0;
  760. }
  761.  
  762. public void messageReceived(MessageEvent e) {
  763. String s = e.getMessage();
  764.  
  765. if (s.contains("You've just advanced an Agility")) {
  766. levelsGained++;
  767. }
  768. }
  769.  
  770. private final RenderingHints antialiasing = new RenderingHints(
  771. RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  772.  
  773.  
  774. private int timesInSameSpot = 0;
  775. private int lastX;
  776. private int lastY;
  777.  
  778. public void mouseClicked(MouseEvent e) {
  779. int x = e.getX();
  780. int y = e.getY();
  781.  
  782. if (x == lastX && y == lastY) {
  783. timesInSameSpot++;
  784. } else {
  785. lastX = x;
  786. lastY = y;
  787. timesInSameSpot = 0;
  788. }
  789. if (timesInSameSpot >= random(10, 15)) {
  790. log("Possibly making a disastrous mistake, stopping script");
  791. stop();
  792. }
  793.  
  794. }
  795.  
  796. public void mousePressed(MouseEvent e) {
  797. }
  798.  
  799. public void mouseReleased(MouseEvent e) {
  800. }
  801.  
  802. public void mouseEntered(MouseEvent e) {
  803. }
  804.  
  805. public void mouseExited(MouseEvent e) {
  806. }
  807.  
  808. public void mouseDragged(MouseEvent e) {
  809. }
  810.  
  811. public void mouseMoved(MouseEvent e) {
  812. }
  813.  
  814. public void onPause() {
  815. antiban.pauseThread();
  816. }
  817.  
  818. public void onResume() {
  819. antiban.unpauseThread();
  820. }
  821.  
  822. @Override
  823. public void onFinish() {
  824. antiban.customStop();
  825. env.saveScreenshot(true);
  826. }
  827.  
  828. Obstacle findCurrentObstacle(AgilityCourse course) {
  829. RSTile location = players.getMyPlayer().getLocation();
  830. for (int i = 0; i <= course.courseMap.length - 1; i++) {
  831. //log(i);
  832. if (course.courseMap[i].areaToUseObstacle.contains(location) &&
  833. game.getPlane() == course.courseMap[i].areaToUseObstacle.getPlane())
  834.  
  835. {
  836. if (i + 1 > course.courseMap.length - 1) {
  837. nextObstacle = course.courseMap[0];
  838. } else {
  839. numberInCourse = i + 2;
  840. nextObstacle = course.courseMap[i + 1];
  841. }
  842. return course.courseMap[i];
  843. }
  844. }
  845. return null;
  846. }
  847.  
  848. class AgilityCourse {
  849. RSArea agilityCourseArea;
  850. Area startArea;
  851. int numberOfObstacles;
  852. Obstacle[] courseMap;
  853. RSTile startTile;
  854.  
  855. AgilityCourse() {
  856. super();
  857. }
  858.  
  859. AgilityCourse(Area startArea, int numberOfObstacles, Obstacle[] courseMap,
  860.  
  861. RSArea apeAtollArea, RSTile startTile) {
  862. this.startArea = startArea;
  863. this.numberOfObstacles = numberOfObstacles;
  864. this.courseMap = courseMap;
  865. this.agilityCourseArea = apeAtollArea;
  866. this.startTile = startTile;
  867. }
  868.  
  869. void runNextObstacle() {
  870. //log("In runNextObstacle");
  871. Obstacle o = findCurrentObstacle(course);
  872. if (o != null) {
  873. RSObject obstacle;
  874. obstacle = objects.getNearest(o.IDs);
  875. if (obstacle != null) {
  876. //log("Obstacle is not null");
  877. if (obstacle.isOnScreen()) {
  878. //log("Obstacle is onScreen");
  879. obstacle.interact(o.interactText);
  880. if (random(1, 10) == 1) {
  881. mouse.move(random(4, 7), random(0, 700), random(0, 500),
  882.  
  883. random(80, 300), random(80, 200));
  884. }
  885. sleep(900, 1300);
  886. RSObject nextObstacleGO = objects.getNearest
  887.  
  888. (nextObstacle.getIDs());
  889. RSModel nextObstacleModel = null;
  890. if (nextObstacleGO != null) {
  891. nextObstacleModel = nextObstacleGO.getModel();
  892. }
  893. while (players.getMyPlayer().isMoving() ||
  894. !players.getMyPlayer().isIdle()) {
  895. antiban.canMouse = false;
  896. if (nextObstacleModel != null && !isHovered
  897.  
  898. (nextObstacleModel)) {
  899. nextObstacleGO.doHover();
  900. }
  901. sleep(30);
  902. }
  903. antiban.canMouse = false;
  904. }
  905. if (!obstacle.isOnScreen()) {
  906. //log("Obstacle is not on screen" + obstacle.getLocation());
  907. //walking.getPath(obstacle.getLocation()).traverse();
  908. mouse.click(calc.tileToMinimap(obstacle.getLocation().randomize
  909.  
  910. (1, 1)), true);
  911. }
  912. }
  913. if (obstacle == null) {
  914. //log("Obstacle is null");
  915. hover(objects.getNearest(nextObstacle.IDs));
  916. }
  917. }
  918. }
  919. }
  920.  
  921. class Obstacle {
  922.  
  923. int[] IDs;
  924. boolean haveToMove;
  925. int animation;
  926. Area areaToUseObstacle;
  927. String interactText;
  928.  
  929. Obstacle(int[] IDs, boolean haveToMove, int animation, Area areaToUseObstacle,
  930. String interactText) {
  931. this.IDs = IDs;
  932. this.haveToMove = haveToMove;
  933. this.animation = animation;
  934. this.areaToUseObstacle = areaToUseObstacle;
  935. this.interactText = interactText;
  936. }
  937.  
  938. Area getAreaToUseObstacle() {
  939. return this.areaToUseObstacle;
  940. }
  941.  
  942. int[] getIDs() {
  943. return this.IDs;
  944. }
  945.  
  946. int getAnimation() {
  947. return this.animation;
  948. }
  949. }
  950.  
  951. class Skill {
  952.  
  953. private final long startime;
  954. private final int startxp;
  955. private final int startLevel;
  956. private final int skillint;
  957. private final String name;
  958.  
  959. public Skill(int skillInt) {
  960. startime = System.currentTimeMillis();
  961. startxp = skills.getCurrentExp(skillInt);
  962. startLevel = skills.getCurrentLevel(skillInt);
  963. skillint = skillInt;
  964. name = Skills.SKILL_NAMES[skillint];
  965. }
  966.  
  967. public int xpGained() {
  968. return skills.getCurrentExp(skillint) - startxp;
  969. }
  970.  
  971. public int levelsGained() {
  972. return skills.getCurrentLevel(skillint) - startLevel;
  973. }
  974.  
  975. public int xpTL() {
  976. return skills.getExpToNextLevel(skillint);
  977. }
  978.  
  979. public int percentTL() {
  980. return skills.getPercentToNextLevel(skillint);
  981. }
  982.  
  983. public int xpPH() {
  984. return (int) ((xpGained()) * 3600000D / (System.currentTimeMillis() -
  985.  
  986. startime));
  987. }
  988.  
  989. public int curLevel() {
  990. return skills.getCurrentLevel(skillint);
  991. }
  992.  
  993. public int curXP() {
  994. return skills.getCurrentExp(skillint);
  995. }
  996.  
  997. public String timeToLevel() {
  998. String TTL = "Calculating..";
  999. long ttlCalculations;
  1000. if (xpPH() != 0) {
  1001. ttlCalculations = (long) (xpTL() * 3600000D) / xpPH();
  1002. TTL = getTime(ttlCalculations);
  1003. }
  1004. return TTL;
  1005. }
  1006.  
  1007. public String getName() {
  1008. return name;
  1009. }
  1010.  
  1011. public void drawSkill(Graphics2D g, int x, int y) {
  1012. g.drawString(name +
  1013. ": Gained " +
  1014. xpGained() +
  1015. " P/H " +
  1016. xpPH() +
  1017. " | Level " +
  1018. curLevel() +
  1019. " (" +
  1020. levelsGained() +
  1021. ")", x, y);
  1022. }
  1023.  
  1024. private String getTime(long millis) {
  1025. long time = millis / 1000;
  1026. String seconds = Integer.toString((int) (time % 60));
  1027. String minutes = Integer.toString((int) ((time % 3600) / 60));
  1028. String hours = Integer.toString((int) (time / 3600));
  1029. for (int i = 0; i < 2; i++) {
  1030. if (seconds != null && seconds.length() < 2) {
  1031. seconds = "0" + seconds;
  1032. }
  1033. if (minutes.length() < 2) {
  1034. minutes = "0" + minutes;
  1035. }
  1036. if (hours.length() < 2) {
  1037. hours = "0" + hours;
  1038. }
  1039. }
  1040. String returnThis = hours + ":" + minutes + ":" + seconds;
  1041. return hours + ":" + minutes + ":" + seconds;
  1042. }
  1043. }
  1044.  
  1045.  
  1046. class AntiBan extends LoopTask {
  1047.  
  1048. private boolean running = true;
  1049. private boolean paused = false;
  1050. public boolean canMouse = false;
  1051.  
  1052. public int loop() {
  1053. while (running) {
  1054. if (!paused) {
  1055. if (game.isLoggedIn()) {
  1056. int random = random(1, 60);
  1057. switch (random) {
  1058. case 1:
  1059. //Camera.setPitch(random(1, 101));
  1060. camera.setAngle(random(1, 360));
  1061. break;
  1062. case 2:
  1063. case 3:
  1064. case 4:
  1065. if (canMouse)
  1066. mouse.moveOffScreen();
  1067. //Mouse.move(random(4, 7), random(0, 700), random(0,
  1068.  
  1069. 500), random(80, 300), random(80, 200));
  1070. break;
  1071. }
  1072. }
  1073. }
  1074. try {
  1075. sleep(1000, 1200);
  1076. } catch (Exception e) {
  1077. }
  1078. }
  1079. return 0;
  1080. }
  1081.  
  1082. public void customStop() {
  1083. running = false;
  1084. }
  1085.  
  1086. public void customPause(final boolean vPaused) {
  1087. paused = vPaused;
  1088. }
  1089.  
  1090. public void pauseThread() {
  1091. customPause(true);
  1092. }
  1093.  
  1094. public void unpauseThread() {
  1095. customPause(false);
  1096. }
  1097. }
  1098.  
  1099.  
  1100. class Area extends RSArea {
  1101.  
  1102. int plane;
  1103. RSTile sw;
  1104. RSTile ne;
  1105.  
  1106. public Area(RSTile arg0, RSTile arg1, int arg2) {
  1107. super(arg0, arg1, arg2);
  1108. plane = arg2;
  1109. sw = arg0;
  1110. ne = arg1;
  1111. }
  1112.  
  1113. }
  1114. //Paint
  1115.  
  1116. private final Color color1 = new Color(0, 0, 0, 205);
  1117. private final Color color2 = new Color(0, 0, 0);
  1118. private final Color color3 = new Color(0, 0, 0, 218);
  1119. private final Color color4 = new Color(0, 0, 153);
  1120. private final Color color5 = new Color(255, 204, 0);
  1121. private final Color color6 = new Color(0, 0, 0, 225);
  1122.  
  1123. private final BasicStroke stroke1 = new BasicStroke(1);
  1124.  
  1125. private final Font font1 = new Font("Segoe UI", 3, 14);
  1126. private final Font font2 = new Font("Segoe UI", 3, 12);
  1127. private final Font font3 = new Font("Arial", 0, 12);
  1128.  
  1129. public void onRepaint(Graphics g1) {
  1130. Graphics2D g = (Graphics2D)g1;
  1131. g.setColor(color1);
  1132. g.fillRect(238, 344, 258, 114);
  1133. g.setColor(color2);
  1134. g.setStroke(stroke1);
  1135. g.drawRect(238, 344, 258, 114);
  1136. g.setColor(color3);
  1137. g.fillRect(269, 406, 158, 15);
  1138. g.setColor(color2);
  1139. g.drawRect(269, 406, 158, 15);
  1140. g.setColor(color3);
  1141. g.fillRect(269, 374, 85, 16);
  1142. g.setColor(color2);
  1143. g.drawRect(269, 374, 85, 16);
  1144. g.setColor(color3);
  1145. g.fillRect(269, 390, 106, 16);
  1146. g.setColor(color2);
  1147. g.drawRect(269, 390, 106, 16);
  1148.  
  1149. g.setFont(font1);
  1150. g.drawString("v1.0", 455, 366);
  1151. g.setColor(color4);
  1152. g.drawString("v1.0", 453, 365);
  1153. g.setColor(color2);
  1154. g.drawString("Agility Killer", 271, 366);
  1155. g.setColor(color4);
  1156. g.drawString("Agility Killer", 269, 365);
  1157. g.setFont(font2);
  1158. g.setColor(color2);
  1159. g.drawString("By Popm4n", 421, 383);
  1160. g.setColor(color5);
  1161. g.drawString("By Popm4n", 419, 382);
  1162. g.setFont(font3);
  1163. g.setColor(color2);
  1164. g.drawString("Time: " + org.rsbot.script.util.Timer.format
  1165.  
  1166. (System.currentTimeMillis() - startTime), 273, 388);
  1167. g.setColor(color4);
  1168. g.drawString("Time: " + org.rsbot.script.util.Timer.format
  1169.  
  1170. (System.currentTimeMillis() - startTime), 272, 387);
  1171. g.setColor(color2);
  1172. g.drawString("Level: " + skills.getRealLevel(Skills.AGILITY) + " (" +
  1173.  
  1174. levelsGained + ")", 272, 403);
  1175. g.setColor(color4);
  1176. g.drawString("Level: " + skills.getRealLevel(Skills.AGILITY) + " (" +
  1177.  
  1178. levelsGained + ")", 271, 402);
  1179. g.setColor(color6);
  1180. g.fillRect(269, 421, 148, 14);
  1181. g.setColor(color2);
  1182. g.drawRect(269, 421, 148, 14);
  1183. g.drawString("Exp: " + agility.xpGained() + "xp (" + agility.xpPH() + "xp)",
  1184.  
  1185. 272, 418);
  1186. g.setColor(color4);
  1187. g.drawString("Exp: " + agility.xpGained() + "xp (" + agility.xpPH() + "xp)",
  1188.  
  1189. 271, 417);
  1190. g.setColor(color2);
  1191. g.drawString("TNL: " + agility.xpTL() + "xp (" + agility.timeToLevel() + ")",
  1192.  
  1193. 273, 433);
  1194. g.setColor(color6);
  1195. g.fillRect(269, 435, 140, 15);
  1196. g.setColor(color2);
  1197. g.drawRect(269, 435, 140, 15);
  1198. g.setColor(color4);
  1199. g.drawString("TNL: " + agility.xpTL() + "xp (" + agility.timeToLevel() + ")",
  1200.  
  1201. 272, 432);
  1202. g.setColor(color6);
  1203. g.drawString(courseName, 272, 448);
  1204. g.setColor(color4);
  1205. g.drawString(courseName, 271, 447);
  1206. }
  1207.  
  1208. //End Paint
  1209.  
  1210.  
  1211.  
  1212.  
  1213. }
  1214.  
  1215. class AgilityGUI extends javax.swing.JFrame {
  1216.  
  1217. private static final long serialVersionUID = 1L;
  1218. /**
  1219. * Creates new form AgilityGUI
  1220. */
  1221. public AgilityGUI() {
  1222. setLocationRelativeTo(getOwner());
  1223. initComponents();
  1224. }
  1225.  
  1226. /**
  1227. * This method is called from within the constructor to
  1228. * initialize the form.
  1229. * WARNING: Do NOT modify this code. The content of this method is
  1230. * always regenerated by the Form Editor.
  1231. */
  1232. // <editor-fold defaultstate="collapsed" desc="Generated Code">
  1233. private void initComponents() {
  1234.  
  1235. jLabel1 = new javax.swing.JLabel();
  1236. jButton1 = new javax.swing.JButton();
  1237. percentageToEat = new javax.swing.JSlider();
  1238. courseList = new javax.swing.JComboBox();
  1239. jLabel2 = new javax.swing.JLabel();
  1240.  
  1241. setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  1242.  
  1243. jLabel1.setFont(new java.awt.Font("Ubuntu", 0, 24));
  1244. jLabel1.setText("Agility Killer");
  1245.  
  1246. jButton1.setText("Start Script!");
  1247. jButton1.addActionListener(new java.awt.event.ActionListener() {
  1248. public void actionPerformed(java.awt.event.ActionEvent evt) {
  1249. jButton1ActionPerformed(evt);
  1250. }
  1251. });
  1252.  
  1253. percentageToEat.setMajorTickSpacing(10);
  1254. percentageToEat.setMinimum(1);
  1255. percentageToEat.setPaintTicks(true);
  1256.  
  1257. courseList.setModel(new javax.swing.DefaultComboBoxModel(new String[]{"Basic
  1258.  
  1259. Gnome Stronghold", "Basic Barbarian Outpost", "Ape Atoll", "Adv Gnome Stronghold"}));
  1260.  
  1261. jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
  1262. jLabel2.setText("Percentage to eat: ");
  1263.  
  1264. javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  1265. getContentPane().setLayout(layout);
  1266. layout.setHorizontalGroup(
  1267. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  1268. .addComponent(jButton1,
  1269.  
  1270. javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 211,
  1271.  
  1272. Short.MAX_VALUE)
  1273. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
  1274.  
  1275. layout.createSequentialGroup()
  1276. .addContainerGap()
  1277. .addComponent(percentageToEat,
  1278.  
  1279. javax.swing.GroupLayout.DEFAULT_SIZE, 187, Short.MAX_VALUE)
  1280. .addContainerGap())
  1281. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
  1282.  
  1283. layout.createSequentialGroup()
  1284. .addContainerGap()
  1285. .addComponent(courseList, 0, 187, Short.MAX_VALUE)
  1286. .addContainerGap())
  1287. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
  1288.  
  1289. layout.createSequentialGroup()
  1290. .addContainerGap()
  1291. .addComponent(jLabel1,
  1292.  
  1293. javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
  1294.  
  1295. Short.MAX_VALUE)
  1296. .addContainerGap())
  1297. .addGroup(layout.createSequentialGroup()
  1298. .addContainerGap()
  1299. .addComponent(jLabel2)
  1300. .addContainerGap(63, Short.MAX_VALUE))
  1301. );
  1302. layout.setVerticalGroup(
  1303. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  1304. .addGroup(layout.createSequentialGroup()
  1305. .addContainerGap()
  1306. .addComponent(jLabel1)
  1307. .addPreferredGap
  1308.  
  1309. (javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  1310. .addComponent(courseList,
  1311.  
  1312. javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
  1313.  
  1314. javax.swing.GroupLayout.PREFERRED_SIZE)
  1315. .addGap(18, 18, 18)
  1316. .addComponent(jLabel2)
  1317. .addPreferredGap
  1318.  
  1319. (javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  1320. .addComponent(percentageToEat,
  1321.  
  1322. javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
  1323.  
  1324. javax.swing.GroupLayout.PREFERRED_SIZE)
  1325. .addGap(12, 12, 12)
  1326. .addComponent(jButton1,
  1327.  
  1328. javax.swing.GroupLayout.DEFAULT_SIZE, 30, Short.MAX_VALUE)
  1329. .addContainerGap())
  1330. );
  1331.  
  1332. pack();
  1333. }// </editor-fold>
  1334.  
  1335. private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
  1336. setVisible(false);
  1337. }
  1338.  
  1339. /**
  1340. * @param args the command line arguments
  1341. */
  1342. public static void main(String args[]) {
  1343. java.awt.EventQueue.invokeLater(new Runnable() {
  1344. public void run() {
  1345. new AgilityGUI().setVisible(true);
  1346. }
  1347. });
  1348. }
  1349.  
  1350. // Variables declaration - do not modify
  1351. public static javax.swing.JComboBox courseList;
  1352. private javax.swing.JButton jButton1;
  1353. private javax.swing.JLabel jLabel1;
  1354. private javax.swing.JLabel jLabel2;
  1355. public static javax.swing.JSlider percentageToEat;
  1356. // End of variables declaration
  1357.  
  1358. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement