BrownBirdScripts

BBagility

Aug 22nd, 2013
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.04 KB | None | 0 0
  1. import java.awt.*;
  2. import java.awt.event.MouseEvent;
  3.  
  4. import javax.imageio.ImageIO;
  5.  
  6. import java.io.IOException;
  7. import java.net.URL;
  8.  
  9. import org.osbot.script.MethodProvider;
  10. import org.osbot.script.Script;
  11. import org.osbot.script.ScriptManifest;
  12. import org.osbot.script.rs2.map.Position;
  13. import org.osbot.script.rs2.model.Entity;
  14. import org.osbot.script.rs2.model.Item;
  15. import org.osbot.script.rs2.model.Player;
  16. import org.osbot.script.rs2.skill.Skill;
  17. import org.osbot.script.rs2.ui.Tab;
  18. import org.osbot.script.rs2.utility.Area;
  19.  
  20.  
  21. @ScriptManifest(author = "BrownBird", name = "BBagility", version = 1.4, info = "An AIO agillity script! || BETA V1.4")
  22. public class BBaglility extends Script {
  23.  
  24. boolean log = false;
  25. boolean branch = false;
  26. boolean rope = false;
  27. boolean downBranch = false;
  28. boolean pipe = false;
  29. boolean logBarb = false;
  30. boolean ropeSwing = false;
  31. boolean BalanceLedge = false;
  32. boolean steppingStone = false;
  33. boolean rocks = false;
  34. boolean tree1 = false;
  35. boolean tree2 = false;
  36. boolean skullSlope = false;
  37. boolean monkeyBars = false;
  38. int crumblingWall;
  39. int climbNet;
  40. public String CROSS_LOG = "Log balance";
  41. public String NET = "Obstacle net";
  42. public String BRANCH = "Tree branch";
  43. public String ROPE = "Balancing rope";
  44. public String PIPE = "Obstacle pipe";
  45. private final Area areaGnome = (new Area(2489, 3435, 2482, 3438));
  46. private final Area areaBarbSwing = (new Area(2546, 9948, 2555, 9955));
  47. private final Area areBarbSwingTop = (new Area(2551, 3554, 2552, 3554));
  48. private final Area areaBarbEdge = (new Area(2533, 3547, 2537, 3545));
  49. private final Area areaBarbWall = (new Area(2536, 3551, 2534, 3555));
  50. private final Area areaBarbWallDone = (new Area(2543, 3551, 2545, 3555));
  51. private final Area areaBarbEdgeOutside = (new Area(2539, 3548, 2541, 3544));
  52. private final Area areaBarbEdgeWater = (new Area(2549, 3543, 2542, 3542));
  53. private final Area areaBarbLog = (new Area(2252, 3547, 2550, 3545));
  54. private final Area wildPipeArea = (new Area(3005, 3949, 3003, 3951));
  55. private final Area wildLadderUpArea = (new Area(3007, 3962, 3002, 3965));
  56. private final Area wildLogArea = (new Area(3001, 3946, 3002, 3943));
  57. private final Area wildSwingArea = (new Area(3008, 3948, 3003, 3954));
  58. private final Area wildSwingHalfArea = (new Area(3008, 3948, 3005, 3953));
  59. private final Area wildFailSwingArea = (new Area(2993, 10340, 3006, 10365));
  60. private final Area wildLadderUp = (new Area(3006, 10364, 3002, 10358));
  61. /* private final Area apeSwingArea = (new Area(2753, 2729, 2750, 2733));
  62. private final Area apeSteppingStoneArea = (new Area(2757, 2741, 2755, 2744));
  63. private final Area apeFailArea1 = (new Area(2757, 2748, 2757, 2748));
  64. private final Area apeStoneArea = (new Area(2753, 2742, 2753, 2742));
  65. private final Area apeTree1Area = (new Area(2753, 2742, 2753, 2742));
  66. private final Area apeBarArea = (new Area(2747, 2741, 2747, 2741));
  67. private final Area apeSkullArea = (new Area(2742, 2741, 2742, 2741));
  68. private final Area apeSwing2Area = (new Area(2756, 2731, 2756, 2731));
  69. private final Area apeFinalArea = (new Area(2770, 2747, 2770, 2747));*/
  70. String run = "False";
  71. Item food;
  72. String foodName;
  73. int eatLevel;
  74. int startHP;
  75. int randomInt;
  76. int pitch;
  77. int angle;
  78.  
  79. private final Color color1 = new Color(255, 255, 255);
  80. private final Color color2 = new Color(0, 0, 0);
  81. private final BasicStroke stroke1 = new BasicStroke(1);
  82. private final Font font1 = new Font("Arial", 0, 14);
  83. private final Color color4 = new Color(255, 255, 255, 0);
  84. private final Color color3 = new Color(255, 255, 255);
  85. private final Color color5 = new Color(255, 255, 255);
  86. private final Font font5 = new Font("Arial Black", 1, 14);
  87. private final Image img3 = getImage("http://i42.tinypic.com/2hnrz29.png");
  88. private final Image img2 = getImage("http://i43.tinypic.com/b3sb42.png");
  89. private final Image img1 = getImage("http://i42.tinypic.com/5yz1aw.png");
  90. String status = "Loading";
  91. String course = "";
  92. long expPH;
  93. long startExp;
  94. long exp;
  95. long level;
  96. long leveled;
  97. long expTNL;
  98. int runInt;
  99. public long startTime = 0;
  100. public long millis = 0;
  101. public long hours = 0;
  102. public long minutes = 0;
  103. public long seconds = 0;
  104. public long last = 0;
  105. Point p;
  106. boolean setting = true;
  107. boolean progress = false;
  108. boolean info = false;
  109. boolean running = true;
  110. boolean drop = false;
  111. boolean gnome = false;
  112. boolean barb = false;
  113. boolean ape = false;
  114. boolean wild = false;
  115. Rectangle Settings = new Rectangle(428, 339, 50, 19);
  116. Rectangle main = new Rectangle(375, 338, 53, 20);
  117. Rectangle infoTab = new Rectangle(478, 339, 33, 19);
  118. Rectangle enableRun = new Rectangle(107, 349, 12, 11);
  119. Rectangle enableDrop = new Rectangle(107, 363, 12, 11);
  120. Rectangle enableGnome = new Rectangle(107, 379, 12, 11);
  121. Rectangle enableBarb = new Rectangle(126, 395, 12, 11);
  122. Rectangle enableApe = new Rectangle(113, 411, 12, 11);
  123. Rectangle enableWild = new Rectangle(317, 349, 12, 11);
  124.  
  125.  
  126. @Override
  127. public void onStart() {
  128. client.setMouseSpeed(random(5, 8));
  129. startExp = client.getSkills().getExperience(Skill.AGILITY);
  130. level = client.getSkills().getLevel(Skill.AGILITY);
  131. startTime = System.currentTimeMillis();
  132. status = "Starting script";
  133. startHP = client.getSkills().getCurrentLevel(Skill.HITPOINTS);
  134. randomInt = random(1,10);
  135. }
  136.  
  137. @Override
  138. public void onExit() throws InterruptedException {
  139. if(!client.getInventory().contains(foodName)) {
  140. logoutTab.logOut();
  141. log("No food left logging out!");
  142. }
  143.  
  144. }
  145.  
  146. @Override
  147. public int onLoop() throws InterruptedException {
  148. Player player = myPlayer();
  149. food = client.getInventory().getItemForNameThatContains( "Lobster", "Shark", "Meat", "Shrimp", "Chicken",
  150. "Rabbit", "Anchovies", "Sardine", "Trout", "Cod", "Pike", "Salmon",
  151. "Tuna", "Bass", "Swordfish", "Monkfish", "Sea turtle", "Manta ray", "Toad's legs", "Cake");
  152.  
  153. if(food != null) {
  154. foodName = food.getName();
  155. } else {
  156. foodName = null;
  157. }
  158.  
  159. eatLevel = (startHP / 2) - randomInt;
  160.  
  161. if (client.getSkills().getCurrentLevel(Skill.HITPOINTS) <= eatLevel && client.getInventory().contains(foodName)) {
  162. status = "Eating";
  163. client.getInventory().interactWithName(foodName, "Eat");
  164. randomInt = random(1,10);
  165. eatLevel = (startHP / 2) - randomInt;
  166. sleep(random(500, 900));
  167. }
  168.  
  169. if (currentTab() != Tab.INVENTORY) {
  170. openTab(Tab.INVENTORY);
  171. }
  172.  
  173. if (gnome == true) {
  174. course = "Gnome Course";
  175. Entity balanceLog = closestObjectForName(CROSS_LOG);
  176. Entity upNet = closestObjectForName(NET);
  177. Entity upBranch = closestObjectForName(BRANCH);
  178. Entity ropeBalance = closestObjectForName(ROPE);
  179. Entity branch2 = closestObjectForName(BRANCH);
  180. Entity overNet = closestObjectForName(NET);
  181. Entity pipeCrawl = closestObjectForName(PIPE);
  182.  
  183. if (log == false && climbNet == 0 && branch == false
  184. && rope == false && downBranch == false && pipe == false) {
  185. if (balanceLog != null) {
  186. if (!player.isAnimating() && !player.isMoving()) {
  187. if (balanceLog.isVisible()) {
  188. status = "Walking across balancing log";
  189. balanceLog.interact("Walk-across");
  190. sleep(random(700, 900));
  191. } else {
  192. client.moveCameraToEntity(balanceLog);
  193. }
  194. }
  195. }
  196. }
  197.  
  198. if (log == true && climbNet == 0 && branch == false
  199. && rope == false && downBranch == false && pipe == false) {
  200. if (upNet != null) {
  201. if (!player.isAnimating() && !player.isMoving()) {
  202. if (upNet.isVisible()) {
  203. status = "Climbing over net";
  204. upNet.interact("Climb-over");
  205. sleep(random(700, 900));
  206. } else {
  207. client.moveCameraToEntity(upNet);
  208. }
  209. }
  210. }
  211. }
  212.  
  213. if (log == true && climbNet == 1 && branch == false
  214. && rope == false && downBranch == false && pipe == false) {
  215. if (upBranch != null) {
  216. if (!player.isAnimating() && !player.isMoving()) {
  217. if (upBranch.isVisible()) {
  218. status = "Climbing up branch";
  219. upBranch.interact("Climb");
  220. sleep(random(2000, 2200));
  221. } else {
  222. client.moveCameraToEntity(upBranch);
  223. }
  224. }
  225. }
  226. }
  227.  
  228. if (log == true && climbNet == 1 && branch == true && rope == false
  229. && downBranch == false && pipe == false) {
  230. if (ropeBalance != null) {
  231. if (!player.isAnimating() && !player.isMoving()) {
  232. if (ropeBalance.isVisible()) {
  233. status = "Balancing on rope";
  234. ropeBalance.interact("Walk-on");
  235. sleep(random(700, 900));
  236. } else {
  237. client.rotateCameraToAngle(random(200, 240));
  238. }
  239. }
  240. }
  241. }
  242.  
  243. if (log == true && climbNet == 1 && branch == true && rope == true
  244. && downBranch == false && pipe == false) {
  245. if (branch2 != null) {
  246. if (!player.isAnimating() && !player.isMoving()) {
  247. if (branch2.isVisible()) {
  248. status = "Climbing down branch";
  249. branch2.interact("Climb-down");
  250. sleep(random(700, 900));
  251. } else {
  252. client.moveCameraToEntity(branch2);
  253. }
  254. }
  255. }
  256. }
  257.  
  258. if (log == true && climbNet == 1 && branch == true && rope == true
  259. && downBranch == true && pipe == false) {
  260. if (overNet != null) {
  261. if (!player.isAnimating() && !player.isMoving()) {
  262. if (overNet.isVisible()) {
  263. status = "Climbing over net";
  264. overNet.interact("Climb-over");
  265. sleep(random(700, 900));
  266. } else {
  267. client.rotateCameraToAngle(random(25, 75));
  268. }
  269. }
  270. }
  271. }
  272.  
  273. if (log == true && climbNet == 2 && branch == true && rope == true
  274. && downBranch == true && pipe == false) {
  275. if (pipeCrawl != null) {
  276. if (!player.isAnimating() && !player.isMoving()) {
  277. if (pipeCrawl.isVisible()) {
  278. status = "Squeezing through pipe";
  279. pipeCrawl.interact("Squeeze-through");
  280. sleep(random(700, 900));
  281. } else {
  282. client.moveCameraToEntity(pipeCrawl);
  283. }
  284. }
  285. }
  286. }
  287.  
  288. if (player.getAnimation() == 749) {
  289. sleep(random(700, 900));
  290. }
  291.  
  292. if (player.isInArea(areaGnome) && log == true && climbNet == 2
  293. && branch == true && rope == true && downBranch == true
  294. && pipe == false) {
  295. log = false;
  296. branch = false;
  297. rope = false;
  298. downBranch = false;
  299. pipe = false;
  300. climbNet = 0;
  301. sleep(random(700, 900));
  302. }
  303. }
  304.  
  305. if (running == true) {
  306. if (run == "False" && client.getRunEnergy() >= runInt) {
  307. status = "Toggling running";
  308. settingsTab.open();
  309. random(199, 246);
  310. setRunning(true);
  311. run = "True";
  312. } else if (run == "False" && client.getRunEnergy() == 100) {
  313. status = "Toggling running";
  314. settingsTab.open();
  315. random(199, 246);
  316. setRunning(true);
  317. run = "True";
  318. } else if (client.getRunEnergy() == 0) {
  319. runInt = random(1, 70);
  320. run = "False";
  321. }
  322. }
  323.  
  324. if (barb == true) {
  325. course = "Barbarian Course";
  326. Position position = myPlayer().getPosition();
  327. Area area = new Area(position.getX(), position.getY() - 2,
  328. position.getX() + 3, position.getY() + 2);
  329. Entity swing = closestObjectForName("Ropeswing");
  330. Entity log = closestObjectForName("Log balance");
  331. Entity net = closestObjectForName("Obstacle net");
  332. Entity ledge = closestObjectForName("Balancing ledge");
  333. Entity wall = closestObjectForName(area, "Crumbling Wall");
  334. Entity ladder = closestObjectForName("Ladder");
  335.  
  336. if(!client.getInventory().contains(foodName)) {
  337. stop();
  338. }
  339.  
  340. if(player.isInArea(areaBarbEdgeWater) && !player.isAnimating() && !player.isMoving()) {
  341. status = "Re-trying log";
  342. walk(areaBarbLog);
  343. }
  344.  
  345. if (player.isInArea(areaBarbEdge) && player.getZ() == 0) {
  346. if (!player.isAnimating() && !player.isMoving()) {
  347. status = "Re-trying ledge";
  348. climbNet = 0;
  349. walk(areaBarbEdgeOutside);
  350. }
  351. }
  352.  
  353. if (player.isInArea(areaBarbSwing)) {
  354. if (ladder != null) {
  355. if (!player.isAnimating() && !player.isMoving()) {
  356. if (ladder.isVisible()) {
  357. status = "Climbing up ladder";
  358. ladder.interact("Climb-up");
  359. sleep(random(1500, 2000));
  360. } else {
  361. client.moveCameraToEntity(ladder);
  362. }
  363. }
  364. }
  365. }
  366.  
  367. if (!player.isInArea(areBarbSwingTop) && ropeSwing == false
  368. && logBarb == false && climbNet == 0
  369. && BalanceLedge == false && player.getZ() == 0
  370. && crumblingWall == 0) {
  371. if (!player.isAnimating() && !player.isMoving()) {
  372. walk(areBarbSwingTop);
  373. }
  374. }
  375.  
  376. if (ropeSwing == false && logBarb == false && climbNet == 0
  377. && BalanceLedge == false && player.getZ() == 0
  378. && crumblingWall == 0) {
  379. if (swing != null) {
  380. if (!player.isAnimating() && !player.isMoving()) {
  381. if (swing.isVisible()) {
  382. status = "Swinging across";
  383. swing.interact("Swing-on");
  384. sleep(random(700, 900));
  385. } else {
  386. walk(areBarbSwingTop);
  387. }
  388. }
  389. }
  390. }
  391.  
  392. if (ropeSwing == true && logBarb == false && climbNet == 0
  393. && BalanceLedge == false && player.getZ() == 0
  394. && crumblingWall == 0) {
  395. if (log != null) {
  396. if (!player.isAnimating() && !player.isMoving()) {
  397. if (log.isVisible()) {
  398. status = "Walking across balancing log";
  399. log.interact("Walk-across");
  400. sleep(random(700, 900));
  401. } else {
  402. client.moveCameraToEntity(log);
  403. }
  404. }
  405. }
  406. }
  407.  
  408. if (ropeSwing == true && logBarb == true && climbNet == 0
  409. && BalanceLedge == false && player.getZ() == 0
  410. && crumblingWall == 0) {
  411. if (net != null) {
  412. if (!player.isAnimating() && !player.isMoving()) {
  413. if (net.isVisible()) {
  414. status = "Climbing up net";
  415. net.interact("Climb-over");
  416. sleep(random(700, 900));
  417. } else {
  418. client.moveCameraToEntity(net);
  419. }
  420. }
  421. }
  422. }
  423.  
  424. if (ropeSwing == true && logBarb == true && climbNet == 1
  425. && BalanceLedge == false && player.getZ() == 1
  426. && crumblingWall == 0) {
  427. if (ledge != null) {
  428. if (!player.isAnimating() && !player.isMoving()) {
  429. if (ledge.isVisible()) {
  430. status = "Edging across ledge";
  431. ledge.interact("Walk-across");
  432. sleep(random(1000, 1200));
  433. } else {
  434. client.moveCameraToEntity(ledge);
  435. }
  436. }
  437. }
  438. }
  439.  
  440. if (ropeSwing == true && logBarb == true && climbNet == 1
  441. && BalanceLedge == true && player.getZ() == 1
  442. && crumblingWall == 0) {
  443. if (ladder != null) {
  444. if (!player.isAnimating() && !player.isMoving()) {
  445. if (ladder.isVisible()) {
  446. status = "Climbing down ladder";
  447. ladder.interact("Climb-down");
  448. sleep(random(1900, 2100));
  449. walk(areaBarbWall);
  450. } else {
  451. client.moveCameraToEntity(ladder);
  452. }
  453. }
  454. }
  455. }
  456.  
  457. if (ropeSwing == true && logBarb == true && climbNet == 1
  458. && BalanceLedge == true && player.getZ() == 0
  459. && crumblingWall == 0 && !player.isInArea(areaBarbWall)) {
  460. if (!player.isAnimating() && !player.isMoving()) {
  461. status = "Walking to crumbling wall";
  462. walk(areaBarbWall);
  463. }
  464. }
  465.  
  466. if (ropeSwing == true && logBarb == true && climbNet == 1
  467. && BalanceLedge == true && player.getZ() == 0
  468. && crumblingWall == 0 || crumblingWall == 1
  469. || crumblingWall == 2) {
  470. if (wall != null) {
  471. if (!player.isAnimating() && !player.isMoving()) {
  472. if (wall.isVisible()) {
  473. status = "Climbing over wall";
  474. wall.interact("Climb-over");
  475. sleep(random(700, 900));
  476. } else {
  477. client.moveCameraToEntity(wall);
  478. }
  479. }
  480. }
  481. }
  482.  
  483. if (player.isInArea(areaBarbWallDone)) {
  484. ropeSwing = false;
  485. logBarb = false;
  486. climbNet = 0;
  487. BalanceLedge = false;
  488. crumblingWall = 0;
  489. }
  490. }
  491.  
  492. if(ape == true) {
  493. log("Currently Not Availale, Please Wait for Update.");
  494. /* course = "Ape Toll Course";
  495. Entity stepStone = closestObjectForName("Stepping stone");
  496. Entity tree = closestObjectForName("Tropical tree");
  497. Entity bars = closestObjectForName("Monkeybars");
  498. Entity climbSkull = closestObjectForName("Skull slope");
  499. Entity swing = closestObjectForName("Rope");
  500.  
  501. if(!client.getInventory().contains(foodName)) {
  502. stop();
  503. }
  504.  
  505. if(player.isInArea(apeStoneArea)) {
  506. steppingStone = true;
  507. } else if(player.isInArea(apeTree1Area)) {
  508. tree1 = true;
  509. } else if(player.isInArea(apeBarArea)) {
  510. monkeyBars = true;
  511. } else if(player.isInArea(apeSkullArea)) {
  512. skullSlope = true;
  513. } else if(player.isInArea(apeSwing2Area)) {
  514. ropeSwing = true;
  515. } else if(player.isInArea(apeFinalArea)) {
  516. tree2 = true;
  517. }
  518.  
  519. if(!player.isInArea(apeSteppingStoneArea)) {
  520. if(!player.isAnimating() && !player.isMoving()) {
  521. status = "Walking to stepping stone";
  522. walk(apeSteppingStoneArea);
  523. }
  524. }
  525.  
  526. if(player.isInArea(apeFailArea1)) {
  527. if(!player.isAnimating() && !player.isMoving()) {
  528. steppingStone = false;
  529. tree1 = false;
  530. monkeyBars = false;
  531. skullSlope = false;
  532. ropeSwing = false;
  533. }
  534. }
  535.  
  536. if (steppingStone == false && tree1 == false && monkeyBars == false && skullSlope == false && ropeSwing == false && tree2 == false && player.isInArea(apeSteppingStoneArea)) {
  537. if (!player.isAnimating() && !player.isMoving()) {
  538. if(stepStone != null) {
  539. if(stepStone.isVisible()) {
  540. status = "Stepping across stones";
  541. stepStone.interact("Jump-to");
  542. } else {
  543. client.moveCameraToEntity(stepStone);
  544. }
  545. }
  546. }
  547. }
  548.  
  549. if (steppingStone == true && tree1 == true && monkeyBars == false && skullSlope == false && ropeSwing == false && tree2 == false) {
  550. if (!player.isAnimating() && !player.isMoving()) {
  551. if(tree != null) {
  552. if(tree.isVisible()) {
  553. status = "Climbing up tree";
  554. tree.interact("Climb");
  555. } else {
  556. client.moveCameraToEntity(tree);
  557. }
  558. }
  559. }
  560. }
  561.  
  562. if (steppingStone == true && tree1 == true && monkeyBars == false && skullSlope == false && ropeSwing == false && tree2 == false && player.getZ() == 2) {
  563. if (!player.isAnimating() && !player.isMoving()) {
  564. if(bars != null) {
  565. if(bars.isVisible()) {
  566. status = "Going across monekey bars";
  567. bars.interact("Swing Across");
  568. } else {
  569. client.moveCameraToEntity(bars);
  570. }
  571. }
  572. }
  573. }
  574.  
  575. if (steppingStone == true && tree1 == true && monkeyBars == true && skullSlope == false && ropeSwing == false && tree2 == false) {
  576. if (!player.isAnimating() && !player.isMoving()) {
  577. if(climbSkull != null) {
  578. if(climbSkull.isVisible()) {
  579. status = "Climbing skulls";
  580. climbSkull.interact("Climb-up");
  581. } else {
  582. client.moveCameraToEntity(climbSkull);
  583. }
  584. }
  585. }
  586. }
  587.  
  588. if(steppingStone == true && tree1 == true && monkeyBars == true && skullSlope == true && ropeSwing == false && tree2 == false && !player.isInArea(apeSwingArea)) {
  589. if(!player.isAnimating() && !player.isMoving()) {
  590. status = "Walking to swing";
  591. walk(apeSwingArea);
  592. }
  593. }
  594.  
  595. if (steppingStone == true && tree1 == true && monkeyBars == true && skullSlope == true && ropeSwing == false && tree2 == false && player.isInArea(apeSwingArea)) {
  596. if (!player.isAnimating() && !player.isMoving()) {
  597. if(swing != null) {
  598. if(swing.isVisible()) {
  599. status = "Climbing skulls";
  600. swing.interact("Swing");
  601. } else {
  602. client.moveCameraToEntity(swing);
  603. }
  604. }
  605. }
  606. }
  607.  
  608. if (steppingStone == true && tree1 == true && monkeyBars == true && skullSlope == true && ropeSwing == true && tree2 == false) {
  609. if (!player.isAnimating() && !player.isMoving()) {
  610. if(tree != null) {
  611. if(tree.isVisible()) {
  612. status = "Climbing down";
  613. tree.interact("Climb-down");
  614. } else {
  615. client.moveCameraToEntity(tree);
  616. }
  617. }
  618. }
  619. }
  620.  
  621. if (steppingStone == true && tree1 == true && monkeyBars == true && skullSlope == true && ropeSwing == true && tree2 == true) {
  622. steppingStone = false;
  623. tree1 = false;
  624. monkeyBars = false;
  625. skullSlope = false;
  626. ropeSwing = false;
  627. tree2 = false;
  628. }
  629. */
  630. }
  631.  
  632. if(wild == true) {
  633. course = "Wilderness Course";
  634. Entity swing = closestObjectForName("Ropeswing");
  635. Entity logBalance = closestObjectForName("Log balance");
  636. Entity ladder = closestObjectForName("Ladder");
  637. Entity pipeCrawl = closestObjectForName(PIPE);
  638. Entity stepStone = closestObjectForName("Stepping stone");
  639. Entity climbRock = closestObjectForName("Rocks");
  640.  
  641. if(!client.getInventory().contains(foodName)) {
  642. stop();
  643. }
  644.  
  645. if(player.getAnimation() == 749) {
  646. sleep(random(2000, 2000));
  647. }
  648.  
  649. if (pipe == false && ropeSwing == false && steppingStone == false && log == false && rocks == false) {
  650. if (!player.isAnimating() && !player.isMoving()) {
  651. if(pipeCrawl != null) {
  652. if(pipeCrawl.isVisible()) {
  653. status = "Squeezing through pipe";
  654. pipeCrawl.interact("Squeeze-through");
  655. } else {
  656. client.rotateCameraToAngle(random(250, 270));
  657. client.rotateCameraPitch(random(14, 32));
  658. }
  659. }
  660. }
  661. }
  662.  
  663. if(player.isInArea(wildPipeArea)) {
  664. pipe = true;
  665. }
  666.  
  667. if(player.isInArea(wildFailSwingArea)) {
  668. if(!player.isMoving()) {
  669. if(ladder != null) {
  670. if(ladder.isVisible()) {
  671. ladder.interact("Climb-up");
  672. sleep(random(700,900));
  673. } else {
  674. walk(wildLadderUp);
  675. }
  676. }
  677. }
  678. }
  679.  
  680. if (pipe == true && ropeSwing == false && steppingStone == false && log == false && rocks == false && !player.isInArea(wildSwingArea)) {
  681. if (!player.isAnimating() && !player.isMoving()) {
  682. status = "Walking to swing";
  683. walk(wildSwingHalfArea);
  684. }
  685. }
  686.  
  687. if (pipe == true && ropeSwing == false && steppingStone == false && log == false && rocks == false && player.isInArea(wildSwingArea)) {
  688. if (!player.isAnimating() && !player.isMoving()) {
  689. if(swing != null) {
  690. if(swing.isVisible()) {
  691. status = "Swinging across";
  692. swing.interact("Swing-on");
  693. } else {
  694. client.rotateCameraToAngle(random(50, 75));
  695. }
  696. }
  697. }
  698. }
  699.  
  700. if (pipe == true && ropeSwing == true && steppingStone == false && log == false && rocks == false) {
  701. if (!player.isAnimating() && !player.isMoving()) {
  702. if(stepStone != null) {
  703. if(stepStone.isVisible()) {
  704. status = "Crossing lava";
  705. stepStone.interact("Cross");
  706. } else {
  707. client.rotateCameraPitch(random(300,380));
  708. client.rotateCameraToAngle(random(50, 75));
  709. }
  710. }
  711. }
  712. }
  713.  
  714. if(player.isInArea(wildLadderUpArea) && pipe == true && ropeSwing == true && steppingStone == true && log == false && rocks == false) {
  715. steppingStone = false;
  716. }
  717.  
  718. if (pipe == true && ropeSwing == true && steppingStone == true && log == false && rocks == false && !player.isInArea(wildLogArea)) {
  719. if (!player.isAnimating() && !player.isMoving()) {
  720. status = "Walking to log";
  721. walk(wildLogArea);
  722. }
  723. }
  724.  
  725. if (pipe == true && ropeSwing == true && steppingStone == true && log == false && rocks == false && player.isInArea(wildLogArea)) {
  726. if (!player.isAnimating() && !player.isMoving()) {
  727. if(logBalance != null) {
  728. if(logBalance.isVisible()) {
  729. status = "Crossing log";
  730. logBalance.interact("Walk-across");
  731. } else {
  732. client.moveCameraToEntity(logBalance);
  733. }
  734. }
  735. }
  736. }
  737.  
  738. if (pipe == true && ropeSwing == true && steppingStone == true && log == true && rocks == false) {
  739. if (!player.isMoving()) {
  740. if(climbRock != null) {
  741. if(climbRock.isVisible()) {
  742. status = "Climbing rock";
  743. climbRock.interact("Climb");
  744. } else {
  745. client.rotateCameraToAngle(random(110, 150));
  746. client.rotateCameraPitch(random(14, 32));
  747. }
  748. }
  749. }
  750. }
  751.  
  752. if (pipe == true && ropeSwing == true && steppingStone == true && log == true && rocks == true) {
  753. pipe = false;
  754. ropeSwing = false;
  755. steppingStone = false;
  756. log = false;
  757. rocks = false;
  758. }
  759.  
  760. }
  761.  
  762. AntiBan();
  763.  
  764. return random(500, 650);
  765. }
  766.  
  767. private Image getImage(String url) {
  768. try {
  769. return ImageIO.read(new URL(url));
  770. } catch (IOException e) {
  771. return null;
  772. }
  773. }
  774.  
  775. @Override
  776. public void onPaint(Graphics graphics) {
  777. pitch = client.getCameraPitch();
  778. angle = client.getCameraPitchAngle();
  779. exp = client.getSkills().getExperience(Skill.AGILITY) - startExp;
  780. leveled = client.getSkills().getLevel(Skill.AGILITY) - level;
  781. expTNL = experienceToNextLevel(Skill.AGILITY);
  782. millis = System.currentTimeMillis() - startTime;
  783. hours = millis / (1000 * 60 * 60);
  784. millis -= hours * (1000 * 60 * 60);
  785. minutes = millis / (1000 * 60);
  786. millis -= minutes * (1000 * 60);
  787. seconds = millis / 1000;
  788. expPH = (int) ((exp) * 3600000D / (System.currentTimeMillis() - startTime));
  789. Graphics2D g = (Graphics2D) graphics;
  790.  
  791. if (!setting) {
  792. // nothing
  793. } else {
  794. g.drawImage(img2, -3, 266, null);
  795. g.setColor(color4);
  796. g.fillRect(107, 349, 12, 11);
  797. g.setColor(color3);
  798. g.setStroke(stroke1);
  799. g.drawRect(107, 349, 12, 11);
  800. g.setColor(color4);
  801. g.fillRect(107, 363, 12, 11);
  802. g.setColor(color3);
  803. g.drawRect(107, 363, 12, 11);
  804. g.setColor(color4);
  805. g.fillRect(107, 379, 12, 11);
  806. g.setColor(color3);
  807. g.drawRect(107, 379, 12, 11);
  808. g.setColor(color4);
  809. g.fillRect(126, 395, 12, 11);
  810. g.setColor(color3);
  811. g.drawRect(126, 395, 12, 11);
  812. g.setColor(color4);
  813. g.fillRect(113, 411, 12, 11);
  814. g.setColor(color3);
  815. g.drawRect(113, 411, 12, 11);
  816. g.setColor(color4);
  817. g.fillRect(317, 349, 12, 11);
  818. g.setColor(color3);
  819. g.drawRect(317, 349, 12, 11);
  820. g.setColor(color2);
  821. g.setStroke(stroke1);
  822. g.drawRect(478, 339, 33, 19);// info
  823. g.drawRect(375, 338, 53, 20);// main
  824. g.drawRect(428, 339, 50, 19);// settings
  825. }
  826.  
  827. if (!progress) {
  828. // nothing
  829. } else {
  830. g.drawImage(img1, -3, 266, null);
  831. g.setFont(font1);
  832. g.setColor(color1);
  833. g.drawString("" + +hours + " hours " + minutes + " minutes "
  834. + seconds + " seconds", 94, 362);
  835. g.drawString("" + exp, 104, 382);
  836. g.drawString("" + expPH, 135, 403);
  837. g.drawString("" + expTNL, 84, 424);
  838. g.drawString("" + course, 389, 380);
  839. g.drawString("" + level + "(+" + leveled + ")", 303, 401);
  840. g.drawString("" + status, 322, 425);
  841. g.drawString("Food: " + foodName, 10, 100);
  842. g.drawString("HP: " + client.getSkills().getCurrentLevel(Skill.HITPOINTS), 10, 120);
  843. g.drawString("Eating at " + eatLevel, 10, 140);
  844. g.drawString("Running at " + runInt, 10, 160);
  845. g.drawString("Camera pitch is " + pitch, 10, 200);
  846. g.drawString("Camera angle is " + angle, 10, 220);
  847. g.drawString("Running? " + run, 10, 180);
  848. g.setColor(color2);
  849. g.setStroke(stroke1);
  850. g.drawRect(478, 339, 33, 19);// info
  851. g.drawRect(375, 338, 53, 20);// main
  852. g.drawRect(428, 339, 50, 19);// settings
  853. }
  854.  
  855. if (!info) {
  856. // nothing
  857. } else {
  858. g.drawImage(img3, -3, 266, null);
  859. g.setFont(font1);
  860. g.setColor(color1);
  861. g.drawString("BETA 1.4", 155, 414);
  862. g.setColor(color2);
  863. g.setStroke(stroke1);
  864. g.drawRect(478, 339, 33, 19);// info
  865. g.drawRect(375, 338, 53, 20);// main
  866. g.drawRect(428, 339, 50, 19);// settings
  867. }
  868.  
  869. if (setting == true) {
  870. if (!running) {
  871. // nothing..
  872. } else {
  873. g.setFont(font5);
  874. g.setColor(color5);
  875. g.drawString("X", 107, 359);
  876. }
  877.  
  878. if (!drop) {
  879. // nothing..
  880. } else {
  881. g.setFont(font5);
  882. g.setColor(color5);
  883. g.drawString("X", 107, 373);
  884. }
  885.  
  886. if (!gnome) {
  887. // nothing..
  888. } else {
  889. g.setFont(font5);
  890. g.setColor(color5);
  891. g.drawString("X", 107, 389);
  892. }
  893.  
  894. if (!barb) {
  895. // nothing..
  896. } else {
  897. g.setFont(font5);
  898. g.setColor(color5);
  899. g.drawString("X", 126, 405);
  900. }
  901.  
  902. if (!ape) {
  903. // nothing..
  904. } else {
  905. g.setFont(font5);
  906. g.setColor(color5);
  907. g.drawString("X", 113, 421);
  908. }
  909.  
  910. if (!wild) {
  911. // nothing..
  912. } else {
  913. g.setFont(font5);
  914. g.setColor(color5);
  915. g.drawString("X", 317, 359);
  916. }
  917. }
  918. }
  919.  
  920. public void onMessage(String message) throws InterruptedException {
  921. if (message.contains("You walk carefully across the slippery log...")) {
  922. if (gnome == true) {
  923. log = true;
  924. }
  925. }
  926.  
  927. if (message.contains("You climb the netting...")) {
  928. climbNet++;
  929. }
  930.  
  931. if (message.contains("...To the platform above")) {
  932. branch = true;
  933. }
  934.  
  935. if (message.contains("You carefully cross the tightrope.")) {
  936. rope = true;
  937. }
  938.  
  939. if (message.contains("You carefully start")) {
  940. sleep(random(6100, 6200));
  941. }
  942.  
  943. if (message.contains("You climb down the tree...")) {
  944. downBranch = true;
  945. }
  946.  
  947. if (message.contains("You skillfully swing across.")) {
  948. ropeSwing = true;
  949. }
  950.  
  951. if (message.contains("You make it safely")) {
  952. logBarb = true;
  953. }
  954.  
  955. if (message.contains("You reach the top")) {
  956. rocks = true;
  957. }
  958.  
  959. if(message.contains("You safely cross to the other side")) {
  960. steppingStone = true;
  961. }
  962.  
  963. if (message.contains("You skillfully edge across the gap.")) {
  964. log = true;
  965. BalanceLedge = true;
  966. }
  967.  
  968. if (message.contains("You climb the low wall...")) {
  969. crumblingWall++;
  970. }
  971. }
  972.  
  973. public void AntiBan() throws InterruptedException {
  974. int randomNum = (random(1, 500));
  975.  
  976. if (randomNum == 1) {
  977. status = "Anti-Ban";
  978. client.rotateCameraPitch(random(35, 60));
  979. } else if (randomNum == 33) {
  980. status = "Anti-Ban";
  981. client.rotateCameraToAngle(random(100, 350));
  982. } else if (randomNum == 57) {
  983. status = "Anti-Ban";
  984. openTab(Tab.SKILLS);
  985. if (client.getInterface(320).getChild(127).isVisible()) {
  986. client.getInterface(320).getChild(127).hover();
  987. sleep(random(1200, 1500));
  988. openTab(Tab.INVENTORY);
  989. }
  990. } else if (randomNum == 437) {
  991. status = "Anti-Ban";
  992. client.rotateCameraPitch(random(15, 50));
  993. } else if (randomNum == 43) {
  994. status = "Anti-Ban";
  995. client.rotateCameraPitch(random(84, 100));
  996. } else if (randomNum == 78) {
  997. status = "Anti-Ban";
  998. client.rotateCameraPitch(random(5, 19));
  999. } else if (randomNum == 443) {
  1000. status = "Anti-Ban";
  1001. moveMouseOutsideScreen();
  1002. } else if (randomNum == 13) {
  1003. status = "Anti-Ban";
  1004. client.rotateCameraPitch(random(67, 90));
  1005. client.rotateCameraToAngle(random(43, 68));
  1006. }
  1007. }
  1008.  
  1009. @Override
  1010. public void mouseClicked(MouseEvent e) {
  1011. p = e.getPoint();
  1012.  
  1013. if (setting == true) {
  1014. // running support
  1015. if (enableRun.contains(p) && !running) {
  1016. running = true;
  1017. } else if (enableRun.contains(p) && running) {
  1018. running = false;
  1019. }
  1020.  
  1021. if (enableDrop.contains(p) && !drop) {
  1022. drop = true;
  1023. } else if (enableDrop.contains(p) && drop) {
  1024. drop = false;
  1025. }
  1026.  
  1027. if (enableGnome.contains(p) && !gnome) {
  1028. gnome = true;
  1029. } else if (enableGnome.contains(p) && gnome) {
  1030. gnome = false;
  1031. }
  1032.  
  1033. if (enableBarb.contains(p) && !barb) {
  1034. barb = true;
  1035. } else if (enableBarb.contains(p) && barb) {
  1036. barb = false;
  1037. }
  1038.  
  1039. if (enableApe.contains(p) && !ape) {
  1040. ape = true;
  1041. } else if (enableApe.contains(p) && ape) {
  1042. ape = false;
  1043. }
  1044.  
  1045. if (enableWild.contains(p) && !wild) {
  1046. wild = true;
  1047. } else if (enableWild.contains(p) && wild) {
  1048. wild = false;
  1049. }
  1050.  
  1051. }
  1052.  
  1053. // settings
  1054. if (Settings.contains(p) && !setting) {
  1055. setting = true;
  1056. progress = false;
  1057. info = false;
  1058. }
  1059.  
  1060. // main
  1061. if (main.contains(p) && !progress) {
  1062. progress = true;
  1063. setting = false;
  1064. info = false;
  1065. }
  1066.  
  1067. // info
  1068. if (infoTab.contains(p) && !info) {
  1069. info = true;
  1070. setting = false;
  1071. progress = false;
  1072. }
  1073. }
  1074.  
  1075. public boolean WalkAlongPath(int[][] path, boolean AscendThroughPath,
  1076. int distanceFromEnd) {
  1077. if (distanceToPoint(AscendThroughPath ? path[path.length - 1][0]
  1078. : path[0][0], AscendThroughPath ? path[path.length - 1][1]
  1079. : path[0][1]) <= distanceFromEnd)
  1080. return true;
  1081. else {
  1082. WalkAlongPath(path, AscendThroughPath);
  1083. return false;
  1084. }
  1085. }
  1086.  
  1087. public void WalkAlongPath(int[][] path, boolean AscendThroughPath) {
  1088. int destination = 0;
  1089. for (int i = 0; i < path.length; i++)
  1090. if (distanceToPoint(path[i][0], path[i][1]) < distanceToPoint(
  1091. path[destination][0], path[destination][1]))
  1092. destination = i;
  1093. if (client.getMyPlayer().isMoving()
  1094. && distanceToPoint(path[destination][0], path[destination][1]) > (isRunning() ? 3
  1095. : 2))
  1096. return;
  1097. if (AscendThroughPath && destination != path.length - 1
  1098. || !AscendThroughPath && destination != 0)
  1099. destination += (AscendThroughPath ? 1 : -1);
  1100. try {
  1101. walk(new Position(path[destination][0], path[destination][1], 0));
  1102. Thread.sleep(700 + MethodProvider.random(600));
  1103. } catch (InterruptedException e) {
  1104. e.printStackTrace();
  1105. }
  1106. }
  1107.  
  1108. private int distanceToPoint(int pointX, int pointY) {
  1109. return (int) Math.sqrt(Math
  1110. .pow(client.getMyPlayer().getX() - pointX, 2)
  1111. + Math.pow(client.getMyPlayer().getY() - pointY, 2));
  1112. }
  1113.  
  1114. private int experienceToNextLevel(Skill skill) {
  1115. int[] xpForLevels = new int[] { 0, 83, 174, 276, 388, 512, 650, 801,
  1116. 969, 1154, 1358, 1584, 1833, 2107, 2411, 2746, 3115, 3523,
  1117. 3973, 4470, 5018, 5624, 6291, 7028, 7842, 8740, 9730, 10824,
  1118. 12031, 13363, 14833, 16456, 18247, 20224, 22406, 24815, 27473,
  1119. 30408, 33648, 37224, 41171, 45529, 50339, 55649, 61512, 67983,
  1120. 75127, 83014, 91721, 101333, 111945, 123660, 136594, 150872,
  1121. 166636, 184040, 203254, 224466, 247886, 273742, 302288, 333804,
  1122. 368599, 407015, 449428, 496254, 547953, 605032, 668051, 737627,
  1123. 814445, 899257, 992895, 1096278, 1210421, 1336443, 1475581,
  1124. 1629200, 1798808, 1986068, 2192818, 2421087, 2673114, 2951373,
  1125. 3258594, 3597792, 3972294, 4385776, 4842295, 5346332, 5902831,
  1126. 6517253, 7195629, 7944614, 8771558, 9684577, 10692629,
  1127. 11805606, 13034431 };
  1128. int xp = client.getSkills().getExperience(skill);
  1129. for (int i = 0; i < 99; i++) {
  1130. if (xp < xpForLevels[i]) {
  1131. return (xpForLevels[i] - xp);
  1132. }
  1133. }
  1134. return (200000000 - xp);
  1135. }
  1136.  
  1137. }
Advertisement
Add Comment
Please, Sign In to add comment