Advertisement
tmanowen

osbot script

Nov 30th, 2014
1,028
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 85.41 KB | None | 0 0
  1. import java.awt.Graphics2D;
  2. import java.awt.Rectangle;
  3. import java.util.List;
  4. import java.util.concurrent.TimeUnit;
  5.  
  6. import org.osbot.rs07.api.Equipment;
  7. import org.osbot.rs07.api.Magic;
  8. import org.osbot.rs07.api.map.Position;
  9. import org.osbot.rs07.api.model.NPC;
  10. import org.osbot.rs07.api.model.Player;
  11. import org.osbot.rs07.api.model.RS2Object;
  12. import org.osbot.rs07.api.ui.EquipmentSlot;
  13. import org.osbot.rs07.api.ui.Skill;
  14. import org.osbot.rs07.api.ui.Tab;
  15. import org.osbot.rs07.input.mouse.MiniMapTileDestination;
  16. import org.osbot.rs07.input.mouse.RectangleDestination;
  17. import org.osbot.rs07.script.MethodProvider;
  18. import org.osbot.rs07.script.Script;
  19. import org.osbot.rs07.script.ScriptManifest;
  20. import org.osbot.rs07.utility.Area;
  21.  
  22.  
  23.  
  24. @ScriptManifest(name="Pug Tutorial Island", author="Pug", info="V1.05", logo="", version=1.05D)
  25. public final class pugTutorial
  26. extends Script
  27. {
  28. // pug tutorial island solver - Declarations
  29. private int randomPath = 0;
  30. private long timeRan;
  31. private long timeBegan;
  32.  
  33. Area Area1 = new Area(3097,3105,3091,3110); // house 1
  34. Area Area2 = new Area(3105,3092,3099,3099); // fishing area
  35. Area Area3 = new Area(3093,3090,3090,3093); // east of gate 1
  36. Area Area4 = new Area(3081,3083,3079,3086); // outside enterance of house 2
  37. Area Area5 = new Area(3075,3089,3073,3091); // east of outside door of house 2
  38. Area Area6 = new Area(3087,3126,3082,3129); // outside enterance of house 3
  39. Area Area7 = new Area(3084,9501,3078,9509); // mining instrutor area
  40. Area Area8 = new Area(3094,9501,3091,9505); // west side of gate 2
  41. Area Area9 = new Area(3113,9517,3111,9520); // east side of gate 3
  42. Area Area10 = new Area(3112,9524,3109,9527); // next to ladder up next to rat pen
  43. Area Area11 = new Area(3123,3120,3119,3123); // bank area
  44. Area Area12 = new Area(3128,3103,3120,3110); // church area
  45. Area Area13 = new Area(3140,3085,3144,3091); // mage area
  46. Area Area14 = new Area(3235,3227,3229,3233); // finishing area
  47.  
  48. // path to house three 1
  49. private Position[] pathToHouseThree =
  50. {
  51. new Position(3072,3090, 0),
  52. new Position(3071,3097, 0),
  53. new Position(3072,3106, 0),
  54. new Position(3069,3112, 0),
  55. new Position(3074,3123, 0),
  56. new Position(3086,3126, 0)
  57. };
  58. // path to house three 1
  59. private Position[] pathToHouseThree2 =
  60. {
  61. new Position(3072,3090, 0),
  62. new Position(3071,3099, 0),
  63. new Position(3071,3109, 0),
  64. new Position(3071,3119, 0),
  65. new Position(3078,3126, 0),
  66. new Position(3086,3126, 0)
  67. };
  68. // path to house three 1
  69. private Position[] pathToHouseThree3 =
  70. {
  71. new Position(3072,3090, 0),
  72. new Position(3070,3097, 0),
  73. new Position(3070,3107, 0),
  74. new Position(3071,3118, 0),
  75. new Position(3077,3125, 0),
  76. new Position(3086,3126, 0)
  77. };
  78. // path to house three 1
  79. private Position[] pathToHouseThree4 =
  80. {
  81. new Position(3072,3090, 0),
  82. new Position(3062,3094, 0),
  83. new Position(3069,3101, 0),
  84. new Position(3070,3112, 0),
  85. new Position(3074,3122, 0),
  86. new Position(3085,3126, 0)
  87. };
  88.  
  89. // path to house two 1
  90. private Position[] pathToHouseTwo = {
  91. new Position(3089,3092, 0), new Position(3089,3082, 0), new Position(3079,3084, 0)
  92. };
  93.  
  94. // path to house two 2
  95. private Position[] pathToHouseTwo2 = {
  96. new Position(3089,3092, 0), new Position(3087,3082, 0), new Position(3080,3084, 0)
  97. };
  98.  
  99. // path to house two 3
  100. private Position[] pathToHouseTwo3 = {
  101. new Position(3089,3092, 0), new Position(3083,3092, 0), new Position(3080,3084, 0)
  102. };
  103.  
  104. // path to house two 4
  105. private Position[] pathToHouseTwo4 = {
  106. new Position(3089,3092, 0), new Position(3084,3091, 0), new Position(3079,3084, 0)
  107. };
  108.  
  109. private Position[] pathToMiner = {
  110. new Position(3088,9520, 0), new Position(3078,9515, 0), new Position(3080,9505, 0)
  111. };
  112.  
  113. private Position[] pathToLadder = {
  114. new Position(3107,9509, 0), new Position(3112,9517, 0), new Position(3111,9525, 0)
  115. };
  116.  
  117. private Position[] pathToBank = {
  118. new Position(3111,3125, 0), new Position(3118,3114, 0), new Position(3122,3123, 0)
  119. };
  120.  
  121. private Position[] pathToPriest = {
  122. new Position(3130,3124, 0), new Position(3133,3114, 0), new Position(3129,3106, 0)
  123. };
  124.  
  125. private Position[] pathToMage = {
  126. new Position(3122,3102, 0), new Position(3129,3092, 0), new Position(3141,3088, 0)
  127. };
  128.  
  129. State state = State.WELCOME_SCREEN;
  130.  
  131. enum State {
  132. WELCOME_SCREEN,
  133. TALK_TO_RUNESCAPE_GUIDE,
  134. CONTINUE_DIALOGUE,
  135. CLICK_ON_SPANNER,
  136. GO_THROUGH_DOOR_ONE,
  137. WALK_TO_SURVIVAL_EXPERT,
  138. TALK_TO_SURVIVAL_EXPERT,
  139. CLICK_ON_BAG,
  140. CHOP_TREE,
  141. LIGHT_FIRE,
  142. CLICK_ON_LEVELS,
  143. GO_FISH,
  144. COOK_FOOD,
  145. WALK_TO_GATE_ONE,
  146. GO_THROUGH_GATE_ONE,
  147. WALK_TO_HOUSE_TWO,
  148. ENTER_HOUSE_TWO,
  149. TALK_TO_CHEF,
  150. MIX_INGREDIENTS,
  151. MAKE_BREAD,
  152. CLICK_ON_MUSIC,
  153. WALK_TO_DOOR_TWO,
  154. GO_THROUGH_DOOR_TWO,
  155. CLICK_ON_EMOTES,
  156. CLICK_ON_YES,
  157. CLICK_ON_RUN,
  158. RUN_TO_HOUSE_THREE,
  159. ENTER_HOUSE_THREE,
  160. TALK_TO_QUEST_GUIDE,
  161. CLICK_ON_QUESTS,
  162. GO_DOWN_LADDER,
  163. WALK_TO_MINING_INSTRUCTOR,
  164. TALK_TO_MINING_INSTRUCTOR,
  165. PROSPECT_TIN,
  166. PROSPECT_COPPER,
  167. MINE_TIN,
  168. MINE_COPPER,
  169. SMELT_ORE,
  170. TALK_TO_MINER,
  171. CLICK_ON_ANVIL,
  172. SMITH_DAGGER,
  173. WALK_TO_GATE_TWO,
  174. GO_THROUGH_GATE_TWO,
  175. TALK_TO_COMBAT_INSTRUCTOR,
  176. CLICK_ON_EQUIPMENT,
  177. CLICK_ON_STATS,
  178. EQUIP_DAGGER,
  179. CLOSE_STATS,
  180. REMOVE_DAGGER,
  181. EQUIP_SWORD_AND_SHEILD,
  182. CLICK_ON_COMBAT,
  183. GO_THROUGH_GATE_THREE,
  184. KILL_RAT,
  185. GO_BACK_THROUGH_GATE_THREE,
  186. EQUIP_RANGE_GEAR,
  187. RANGE_RAT,
  188. WALK_TO_LADDER,
  189. CLIMB_UP_LADDER,
  190. WALK_TO_BANK,
  191. OPEN_BANK,
  192. CLOSE_BANK,
  193. CLICK_ON_POLL,
  194. CLOSE_POLL,
  195. TALK_TO_FINANICAL_ADVISOR,
  196. GO_THROUGH_DOOR_THREE,
  197. WALK_TO_CHURCH,
  198. TALK_TO_BROTHER,
  199. CLICK_ON_PRAY,
  200. CLICK_ON_FRIENDS,
  201. CLICK_ON_IGNORE,
  202. GO_THROUGH_DOOR_FOUR,
  203. WALK_TO_MAGE,
  204. TALK_TO_MAGE,
  205. CLICK_ON_MAGIC,
  206. CAST_AT_CHICKEN
  207. }
  208.  
  209.  
  210. public final void onStart()
  211. {
  212. log("------------------------------------------------------------------------------------------");
  213. log("SCRIPT IS NOW IN BETA V"+ getVersion() + " PLEASE REPORT ALL BUGS ASAP.");
  214. log("Thankyou.");
  215. log("------------------------------------------------------------------------------------------");
  216.  
  217. this.timeBegan = System.currentTimeMillis();
  218. }
  219.  
  220. public final void onExit()
  221. {
  222. log("------------------------------------------------------------------------------------------");
  223. log("THANKYOU FOR USING A Pug SCRIPT - V"+ getVersion() + " PLEASE REPORT ALL BUGS ASAP.");
  224. log("SCRIPT COMPLETED IN: " + ft(timeRan));
  225. log("------------------------------------------------------------------------------------------");
  226.  
  227. this.timeBegan = System.currentTimeMillis();
  228. }
  229.  
  230. public int onLoop() throws InterruptedException
  231. {
  232.  
  233. state = getState();
  234.  
  235. switch (state)
  236. {
  237. case WELCOME_SCREEN:
  238. return welcomeScreen();
  239. case TALK_TO_RUNESCAPE_GUIDE:
  240. return talkToRunescapeGuide();
  241. case CONTINUE_DIALOGUE:
  242. return continueDialogue();
  243. case CLICK_ON_SPANNER:
  244. return clickOnSpanner();
  245. case GO_THROUGH_DOOR_ONE:
  246. return goThroughDoorOne();
  247. case WALK_TO_SURVIVAL_EXPERT:
  248. return walkToSurvivalExpert();
  249. case TALK_TO_SURVIVAL_EXPERT:
  250. return talkToSurvivalExpert();
  251. case CLICK_ON_BAG:
  252. return clickOnBag();
  253. case CHOP_TREE:
  254. return chopTree();
  255. case LIGHT_FIRE:
  256. return lightFire();
  257. case CLICK_ON_LEVELS:
  258. return clickOnLevels();
  259. case GO_FISH:
  260. return goFish();
  261. case COOK_FOOD:
  262. return cookFood();
  263. case WALK_TO_GATE_ONE:
  264. return walkToGateOne();
  265. case GO_THROUGH_GATE_ONE:
  266. return goThroughGateOne();
  267. case WALK_TO_HOUSE_TWO:
  268. return walkToHouseTwo();
  269. case ENTER_HOUSE_TWO:
  270. return enterHouseTwo();
  271. case TALK_TO_CHEF:
  272. return talkToChef();
  273. case MIX_INGREDIENTS:
  274. return mixIngredients();
  275. case MAKE_BREAD:
  276. return makeBread();
  277. case CLICK_ON_MUSIC:
  278. return clickOnMusic();
  279. case WALK_TO_DOOR_TWO:
  280. return walkToDoorTwo();
  281. case GO_THROUGH_DOOR_TWO:
  282. return goThroughDoorTwo();
  283. case CLICK_ON_EMOTES:
  284. return clickOnEmotes();
  285. case CLICK_ON_YES:
  286. return clickOnYes();
  287. case CLICK_ON_RUN:
  288. return clickOnRun();
  289. case RUN_TO_HOUSE_THREE:
  290. return runToHouseThree();
  291. case ENTER_HOUSE_THREE:
  292. return enterHouseThree();
  293. case TALK_TO_QUEST_GUIDE:
  294. return talkToQuestGuide();
  295. case CLICK_ON_QUESTS:
  296. return clickOnQuests();
  297. case GO_DOWN_LADDER:
  298. return goDownLadder();
  299. case WALK_TO_MINING_INSTRUCTOR:
  300. return walkToMiningInstructor();
  301. case TALK_TO_MINING_INSTRUCTOR:
  302. return talkToMiningInstructor();
  303. case PROSPECT_TIN:
  304. return prospectTin();
  305. case PROSPECT_COPPER:
  306. return prospectCopper();
  307. case MINE_TIN:
  308. return mineTin();
  309. case MINE_COPPER:
  310. return mineCopper();
  311. case SMELT_ORE:
  312. return smeltOre();
  313. case TALK_TO_MINER:
  314. return talkToMiner();
  315. case CLICK_ON_ANVIL:
  316. return clickOnAnvil();
  317. case SMITH_DAGGER:
  318. return smithDagger();
  319. case WALK_TO_GATE_TWO:
  320. return walkToGateTwo();
  321. case GO_THROUGH_GATE_TWO:
  322. return goThroughGateTwo();
  323. case TALK_TO_COMBAT_INSTRUCTOR:
  324. return talkToCombatInstructor();
  325. case CLICK_ON_EQUIPMENT:
  326. return clickOnEquipment();
  327. case CLICK_ON_STATS:
  328. return clickOnStats();
  329. case EQUIP_DAGGER:
  330. return equipDagger();
  331. case CLOSE_STATS:
  332. return closeStats();
  333. case REMOVE_DAGGER:
  334. return removeDagger();
  335. case EQUIP_SWORD_AND_SHEILD:
  336. return equipSwordAndShield();
  337. case CLICK_ON_COMBAT:
  338. return clickOnCombat();
  339. case GO_THROUGH_GATE_THREE:
  340. return goThroughGateThree();
  341. case KILL_RAT:
  342. return killRat();
  343. case GO_BACK_THROUGH_GATE_THREE:
  344. return goBackThroughGateThree();
  345. case EQUIP_RANGE_GEAR:
  346. return equipRangeGear();
  347. case RANGE_RAT:
  348. return rangeRat();
  349. case WALK_TO_LADDER:
  350. return walkToLadder();
  351. case CLIMB_UP_LADDER:
  352. return climbUpLadder();
  353. case WALK_TO_BANK:
  354. return walkToBank();
  355. case OPEN_BANK:
  356. return openBank();
  357. case CLOSE_BANK:
  358. return closeBank();
  359. case CLICK_ON_POLL:
  360. return clickOnPoll();
  361. case CLOSE_POLL:
  362. return closePoll();
  363. case TALK_TO_FINANICAL_ADVISOR:
  364. return talkToFinancialAdvisor();
  365. case GO_THROUGH_DOOR_THREE:
  366. return goThroughDoorThree();
  367. case WALK_TO_CHURCH:
  368. return walkToChurch();
  369. case TALK_TO_BROTHER:
  370. return talkToBrother();
  371. case CLICK_ON_PRAY:
  372. return clickOnPray();
  373. case CLICK_ON_FRIENDS:
  374. return clickOnFriends();
  375. case CLICK_ON_IGNORE:
  376. return clickOnIgnore();
  377. case GO_THROUGH_DOOR_FOUR:
  378. return goThroughDoorFour();
  379. case WALK_TO_MAGE:
  380. return walkToMage();
  381. case TALK_TO_MAGE:
  382. return talkToMage();
  383. case CLICK_ON_MAGIC:
  384. return clickOnMagic();
  385. case CAST_AT_CHICKEN:
  386. return castAtChicken();
  387. default:
  388. continueDialogue();
  389. break;
  390.  
  391. }
  392. return 150 + random(12,92);
  393. }
  394.  
  395. State getState() throws InterruptedException {
  396.  
  397. if(!interfaces.containingText(269, "Use the buttons below to design your player").isEmpty())
  398. {
  399. log("welcome screen state");
  400. return State.WELCOME_SCREEN;
  401. }
  402.  
  403. if(!interfaces.containingText("To start the tutorial use your left mouse button",
  404. "On the side panel, you can now see a variety of options").isEmpty())
  405. {
  406. log("talk to rs guide");
  407. return State.TALK_TO_RUNESCAPE_GUIDE;
  408. }
  409.  
  410. if(!interfaces.containingText("Greetings! I see you are a new arrival",
  411. "You have already learned the first thing",
  412. "You will find many inhabitants of this world",
  413. "I would also suggest reading through",
  414. "contains maps and helpful tips to help you",
  415. "You will notice a flashing icon",
  416. "I'm glad you're making progress!",
  417. "To continue the tutorial go through that door",
  418. "Hello there, newcomer. My name is Brynna.",
  419. "You get some logs.",
  420. "Well done! Next we need to get some food in our",
  421. "The Survival Guide gives you a net!",
  422. "Ah! Welcome, newcomer. I am the Master Chef, Lev.",
  423. "teach you the fine art of cooking bread.",
  424. "And no fine meal is complete without good music",
  425. "Ah. Welcome, Adventurer. I'm here to tell you all about",
  426. "Now you have the journal open",
  427. "When you start a quest it will change colour",
  428. "The start of quests are easy to find. Look out for",
  429. "The quests themselves can vary greatly from collecting",
  430. "There's not a lot more I can tell you about questing",
  431. "Hi there. You must be new around here. So what do I",
  432. "miner by trade.",
  433. "I prospected both types of rock!",
  434. "be smelted together to make bronze.",
  435. "So now you know what ore is in the rocks over there,",
  436. "Okay, I'll show you how to make a dagger out of it.",
  437. "Do i look like i care? To me you're just another",
  438. "I am Vannaka, the greatest swordsman alive.",
  439. "Let's get Started by teaching you to wield a weapon.",
  440. "Very good, but that little butter knife isn't going to",
  441. "I did it! I killed a giant rat!",
  442. "Now that you have grasped basic swordplay,",
  443. "try some ranged attacking, with this you can kill",
  444. "Good day, would you like to access your bank account",
  445. "the financial Advisor.",
  446. "Okay. How can I make money then?",
  447. "How you can make money? Quite.",
  448. "Well, there are three basic ways of making money here",
  449. "start with combat as it is probably still fresh in",
  450. "Now, the next way to earn money quickly is by quests",
  451. "By getting a high level in skills such as Cooking",
  452. "Well, that about covers it. Come back if",
  453. "Good day, brother, my",
  454. "you all about Prayer.",
  455. "This is your Prayer list. Prayers can help a lot in",
  456. "Active prayers will drain your Prayer Points, which",
  457. "As you noticed, most enemies will drop bones when",
  458. "job to tell you about your friends and ignore list.",
  459. "clicking the add button then typing their name into the",
  460. "You remove people from the lists in the same way.",
  461. "Your friends list shows the online status of your",
  462. "Are there rules on",
  463. "Yes, you should read the rules of conduct on the",
  464. "But in general, always try to be courteous to other",
  465. "character could end up being the one in trouble.",
  466. "bear that in mind.",
  467. "Good day, newcomer. My name is Terrova.",
  468. "only cast one offensive spell called Wind Strike.",
  469. "reasonable number of runes when you leave.",
  470. "When you get to the mainland you will find yourself",
  471. "and carries a rucksack full of scrolls. There are also",
  472. "When you get to Lumbridge, look for this icon on your",
  473. "If all else fails, visit the RuneScape website for").isEmpty())
  474. {
  475. log("continue dialogue");
  476. return State.CONTINUE_DIALOGUE;
  477. }
  478.  
  479. if(!interfaces.containingText(131, "Click here to continue").isEmpty() ||
  480. !interfaces.containingText(519, "Click here to continue").isEmpty() ||
  481. !interfaces.containingText(65, "Click here to continue").isEmpty() ||
  482. !interfaces.containingText(64, "Click here to continue").isEmpty() ||
  483. !interfaces.containingText(204, "Click here to continue").isEmpty() ||
  484. !interfaces.containingText(519, "Click here to continue").isEmpty())
  485. {
  486. log("continue dialogue");
  487. return State.CONTINUE_DIALOGUE;
  488. }
  489.  
  490. if(!interfaces.containingText("Please click on the flashing spanner icon").isEmpty() ||
  491. !interfaces.containingText("It's only a short distance to the next guide.").isEmpty())
  492. {
  493. log("click on spanner");
  494. return State.CLICK_ON_SPANNER;
  495. }
  496.  
  497. if(!interfaces.containingText("You can interact with many items of scenery by simply").isEmpty())
  498. {
  499. log("go through door 1");
  500. return State.GO_THROUGH_DOOR_ONE;
  501. }
  502.  
  503. if(!interfaces.containingText("Follow the path to find the next instructor.").isEmpty() && !Area2.contains(myPlayer()))
  504. {
  505. log("walk to expert");
  506. return State.WALK_TO_SURVIVAL_EXPERT;
  507. }
  508.  
  509. if(Area2.contains(myPlayer()) && !interfaces.containingText("Follow the path to find the next instructor.").isEmpty() ||
  510. !interfaces.containingText("Here you will see how good your skills are.").isEmpty())
  511. {
  512. log("talk to expert");
  513. return State.TALK_TO_SURVIVAL_EXPERT;
  514. }
  515.  
  516. if(!interfaces.containingText("Click on the flashing backpack icon to the right hand side").isEmpty() ||
  517. (!equipment.isWieldingWeapon("Bronze dagger") && !Tab.INVENTORY.isOpen(bot) &&
  518. !interfaces.containingText("In your worn inventory panel, right click on the dagger").isEmpty()))
  519. {
  520. log("click on inventory");
  521. return State.CLICK_ON_BAG;
  522. }
  523.  
  524. if(!interfaces.containingText("You can click on the backpack icon at any time to view").isEmpty())
  525. {
  526. log("chop down tree");
  527. return State.CHOP_TREE;
  528. }
  529.  
  530. if(!interfaces.containingText("Well done! You managed to cut some logs from the tree!").isEmpty())
  531. {
  532. log("light fire");
  533. return State.LIGHT_FIRE;
  534. }
  535.  
  536. if(!interfaces.containingText("Click on the flashing bar graph icon near the inventory button").isEmpty())
  537. {
  538. log("click on levels");
  539. return State.CLICK_ON_LEVELS;
  540. }
  541.  
  542. if((!interfaces.containingText("Click on the sparkling fishing spot, indicated by the flashing").isEmpty() && !inventory.contains("Raw shrimps"))
  543. || (inventory.getAmount("Raw shrimps")== 1 && !inventory.contains("Burnt shrimp")))
  544. {
  545. log("fish some fishies");
  546. return State.GO_FISH;
  547. }
  548.  
  549. if((!interfaces.containingText("Now you have caught some shrimp, let's cook it.").isEmpty() && inventory.getAmount("Raw shrimps")== 2) ||
  550. !interfaces.containingText("Now right click on the shrimp and select the use option.").isEmpty() ||
  551. !interfaces.containingText("You have just burnt your first shrimp. this is normal.").isEmpty())
  552. {
  553. log("cook the food");
  554. return State.COOK_FOOD;
  555. }
  556.  
  557. if(!interfaces.containingText("If you'd like a recap on anything you've learnt so far").isEmpty() &&
  558. !Area3.contains(myPlayer()))
  559. {
  560. log("walk to gate 1");
  561. return State.WALK_TO_GATE_ONE;
  562. }
  563.  
  564. if(Area3.contains(myPlayer()))
  565. {
  566. log("near first gate");
  567. return State.GO_THROUGH_GATE_ONE;
  568. }
  569.  
  570. if(!interfaces.containingText("Follow the path until you get to the door").isEmpty() &&
  571. !Area4.contains(myPlayer()))
  572. {
  573. log("walk to house 2");
  574. return State.WALK_TO_HOUSE_TWO;
  575. }
  576.  
  577. if(Area4.contains(myPlayer()))
  578. {
  579. log("near door to house two.");
  580. return State.ENTER_HOUSE_TWO;
  581. }
  582.  
  583. if(!interfaces.containingText("Talk to the chef indicated.").isEmpty())
  584. {
  585. log("chef is nearby");
  586. return State.TALK_TO_CHEF;
  587. }
  588.  
  589. if(!interfaces.containingText("This is the base for many of the meals.").isEmpty())
  590. {
  591. log("Time to make some dough.");
  592. return State.MIX_INGREDIENTS;
  593. }
  594.  
  595. if(!interfaces.containingText("Now you have made dough, you can cook it.").isEmpty())
  596. {
  597. log("Time to cook the dough.");
  598. return State.MAKE_BREAD;
  599. }
  600.  
  601. if(!interfaces.containingText("Well done! Your first loaf of bread.").isEmpty())
  602. {
  603. log("bread made, click on music");
  604. return State.CLICK_ON_MUSIC;
  605. }
  606.  
  607. if(!interfaces.containingText("From this interface you can control the music that is played.").isEmpty() &&
  608. !Area5.contains(myPlayer()))
  609. {
  610. log("need to walk to door 2");
  611. return State.WALK_TO_DOOR_TWO;
  612. }
  613.  
  614. if(Area5.contains(myPlayer()))
  615. {
  616. log("near outside door of house 2");
  617. return State.GO_THROUGH_DOOR_TWO;
  618. }
  619.  
  620. if(!interfaces.containingText("Now, how about showing some feelings?").isEmpty())
  621. {
  622. log("need to click on emote tab");
  623. return State.CLICK_ON_EMOTES;
  624. }
  625.  
  626. if(!interfaces.containingText("For those situations where words don't quite describe").isEmpty())
  627. {
  628. log("click on yes emoji");
  629. return State.CLICK_ON_YES;
  630. }
  631.  
  632. if(!interfaces.containingText("In this menu you will see many options. At the bottom").isEmpty())
  633. {
  634. log("click on run");
  635. return State.CLICK_ON_RUN;
  636. }
  637.  
  638. if(!interfaces.containingText("Now that you have the run button turned on,").isEmpty() &&
  639. !Area6.contains(myPlayer()))
  640. {
  641. log("run to house three");
  642. return State.RUN_TO_HOUSE_THREE;
  643. }
  644.  
  645. if(Area6.contains(myPlayer()))
  646. {
  647. log("near door to house three.");
  648. return State.ENTER_HOUSE_THREE;
  649. }
  650.  
  651. if(!interfaces.containingText("Talk with the Quest Guide.").isEmpty() ||
  652. !interfaces.containingText("This is your Quest Journal, a list of all the quests in the game.").isEmpty())
  653. {
  654. log("Talk with the Quest Guide.");
  655. return State.TALK_TO_QUEST_GUIDE;
  656. }
  657.  
  658. if(!interfaces.containingText("Click on the flashing icon next to your inventory.").isEmpty())
  659. {
  660. log("click on the quest button");
  661. return State.CLICK_ON_QUESTS;
  662. }
  663.  
  664. if(!interfaces.containingText("It's time to enter some caves. Click on the ladder to go down").isEmpty())
  665. {
  666. log("click on the ladder");
  667. return State.GO_DOWN_LADDER;
  668. }
  669.  
  670. if(!interfaces.containingText("Next let's get you a weapon, or more to the point").isEmpty() &&
  671. !Area7.contains(myPlayer()))
  672. {
  673. log("walk to mining instructor");
  674. return State.WALK_TO_MINING_INSTRUCTOR;
  675. }
  676.  
  677. if((!interfaces.containingText("Next let's get you a weapon, or more to the point").isEmpty() &&
  678. Area7.contains(myPlayer())) ||
  679. !interfaces.containingText("Talk to the Mining Instructor to find out about these types").isEmpty())
  680. {
  681. log("Talk to mining instructor");
  682. return State.TALK_TO_MINING_INSTRUCTOR;
  683. }
  684.  
  685. if(!interfaces.containingText("To Prospect a mineable rock, just right click it").isEmpty())
  686. {
  687. log("prospect tin.");
  688. return State.PROSPECT_TIN;
  689. }
  690.  
  691. if(!interfaces.containingText("So now you know there's tin in the grey rocks,").isEmpty())
  692. {
  693. log("prospect copper.");
  694. return State.PROSPECT_COPPER;
  695. }
  696.  
  697. if(!interfaces.containingText("It's quite simple really. All you need to do is right click").isEmpty())
  698. {
  699. log("mine some tin.");
  700. return State.MINE_TIN;
  701. }
  702.  
  703. if(!interfaces.containingText("Now you have some tin ore you just need some copper ore,").isEmpty())
  704. {
  705. log("mine some copper.");
  706. return State.MINE_COPPER;
  707. }
  708.  
  709. if(!interfaces.containingText("You should now have both some copper and tin ore. So").isEmpty())
  710. {
  711. log("smelt the ores.");
  712. return State.SMELT_ORE;
  713. }
  714.  
  715. if(!interfaces.containingText(548, "Click to continue").isEmpty())
  716. {
  717. log("click to continue");
  718. Rectangle Rectangle1 = new Rectangle(210,425, 50, 10);
  719. mouse.click(new RectangleDestination(bot, Rectangle1), false);
  720. sleep(252);
  721. }
  722.  
  723. if(!interfaces.containingText("Speak to the Mining Instructor and he'll show you how to make").isEmpty())
  724. {
  725. log("talk to mining instructor.");
  726. return State.TALK_TO_MINER;
  727. }
  728.  
  729. if(!interfaces.containingText("To smith you'll need a hammer").isEmpty())
  730. {
  731. log("Click on the anvil");
  732. return State.CLICK_ON_ANVIL;
  733. }
  734.  
  735. if(!interfaces.containingText("Now you have the smithing menu open, you will see").isEmpty())
  736. {
  737. log("Click on the dagger");
  738. return State.SMITH_DAGGER;
  739. }
  740.  
  741. if(!interfaces.containingText("So let's move on. Go through the gates shown by the arrow.").isEmpty() &&
  742. !Area8.contains(myPlayer()))
  743. {
  744. log("walk to gates");
  745. return State.WALK_TO_GATE_TWO;
  746. }
  747.  
  748. if(Area8.contains(myPlayer()))
  749. {
  750. log("go through gate 2");
  751. return State.GO_THROUGH_GATE_TWO;
  752. }
  753.  
  754. if((!interfaces.containingText("In this area you will find out about combat with swords").isEmpty()) ||
  755. !interfaces.containingText("Clothes, Armour, weapons and many other items are equipped").isEmpty() &&
  756. !interfaces.get(84).isValid())
  757. {
  758. log("go talk to combat instructor");
  759. return State.TALK_TO_COMBAT_INSTRUCTOR;
  760. }
  761.  
  762. if(!interfaces.containingText("You now have access to a new interface. Click on the flashing").isEmpty())
  763. {
  764. log("click on equipment tab");
  765. return State.CLICK_ON_EQUIPMENT;
  766. }
  767.  
  768. if(!interfaces.containingText("From here you can see what items you have equipped.").isEmpty())
  769. {
  770. log("click on equipment stats");
  771. return State.CLICK_ON_STATS;
  772. }
  773.  
  774. if(!interfaces.containingText("You can see what items you are wearing in the worn inventory").isEmpty())
  775. {
  776. log("equip the dagger");
  777. return State.EQUIP_DAGGER;
  778. }
  779.  
  780. if(!interfaces.containingText("Clothes, Armour, weapons and many other items are equipped").isEmpty() &&
  781. interfaces.get(84).isValid())
  782. {
  783. log("close stats");
  784. return State.CLOSE_STATS;
  785. }
  786.  
  787. if(!interfaces.containingText("In your worn inventory panel, right click on the dagger").isEmpty() &&
  788. !Tab.INVENTORY.isOpen(bot))
  789. {
  790. log("remove the dagger");
  791. return State.REMOVE_DAGGER;
  792. }
  793.  
  794. if(!interfaces.containingText("In your worn inventory panel, right click on the dagger").isEmpty() &&
  795. Tab.INVENTORY.isOpen(bot) &&
  796. !equipment.isWieldingWeapon("Bronze dagger"))
  797. {
  798. log("equip new stuff");
  799. return State.EQUIP_SWORD_AND_SHEILD;
  800. }
  801.  
  802. if(!interfaces.containingText("Click on the flashing crossed swords icon to see the combat").isEmpty())
  803. {
  804. log("click on combat options");
  805. return State.CLICK_ON_COMBAT;
  806. }
  807.  
  808. if(!interfaces.containingText("From this interface you can select the type of attack").isEmpty())
  809. {
  810. log("go through gates to pen");
  811. return State.GO_THROUGH_GATE_THREE;
  812. }
  813.  
  814. if(!interfaces.containingText("To attack the rat, right click it and select the attack option.").isEmpty() ||
  815. !interfaces.containingText("While you are fighting you will see a bar over your head.").isEmpty())
  816. {
  817. log("kill the rat!");
  818. return State.KILL_RAT;
  819. }
  820.  
  821. if(!interfaces.containingText("Pass through the gate and talk to the Combat Instructor").isEmpty())
  822. {
  823. log("go back to instructor");
  824. return State.GO_BACK_THROUGH_GATE_THREE;
  825. }
  826.  
  827. if(!interfaces.containingText("Now you have a bow and some arrows. Before you can use").isEmpty() &&
  828. !equipment.isWieldingWeapon("Shortbow"))
  829. {
  830. log("equip new range gear");
  831. return State.EQUIP_RANGE_GEAR;
  832. }
  833.  
  834. if(!interfaces.containingText("Now you have a bow and some arrows. Before you can use").isEmpty() &&
  835. equipment.isWieldingWeapon("Shortbow") && equipment.isWearingItem(EquipmentSlot.ARROWS, "Bronze arrow"))
  836. {
  837. log("range the rat");
  838. return State.RANGE_RAT;
  839. }
  840.  
  841. if(!interfaces.containingText("You have completed the tasks here. To move on, click on the").isEmpty() &&
  842. !Area10.contains(myPlayer()))
  843. {
  844. log("walk to ladder");
  845. return State.WALK_TO_LADDER;
  846. }
  847.  
  848. if(!interfaces.containingText("You have completed the tasks here. To move on, click on the").isEmpty() &&
  849. Area10.contains(myPlayer()))
  850. {
  851. log("Climb up ladder");
  852. return State.CLIMB_UP_LADDER;
  853. }
  854.  
  855. if(!interfaces.containingText("Follow the path and you will come to the front of the building.").isEmpty() &&
  856. !Area11.contains(myPlayer()))
  857. {
  858. log("walk to bank");
  859. return State.WALK_TO_BANK;
  860. }
  861.  
  862. if(!interfaces.containingText("Follow the path and you will come to the front of the building.").isEmpty() &&
  863. Area11.contains(myPlayer()))
  864. {
  865. log("open bank");
  866. return State.OPEN_BANK;
  867. }
  868.  
  869. if(!interfaces.containingText("Select an Option").isEmpty())
  870. {
  871. log("click yes.");
  872. if(interfaces.get(228) != null)
  873. {
  874. log("clicking on yes.");
  875. interfaces.interactWithChild(228, 1, "Continue");
  876. sleep(200 + random (100, 200));
  877. }
  878. }
  879.  
  880. if(!interfaces.containingText("You can store stuff here for safekeeping. If you die,").isEmpty() &&
  881. bank.isOpen())
  882. {
  883. log("close the bank");
  884. return State.CLOSE_BANK;
  885. }
  886.  
  887. if(!interfaces.containingText("You can store stuff here for safekeeping. If you die,").isEmpty() &&
  888. !bank.isOpen())
  889. {
  890. log("click on poll station");
  891. return State.CLICK_ON_POLL;
  892. }
  893.  
  894. if(!interfaces.containingText("Polls are run periodically to let the Runescape community").isEmpty())
  895. {
  896. log("close the poll window.");
  897. return State.CLOSE_POLL;
  898. }
  899.  
  900. RS2Object poll = objects.closest("Poll booth");
  901. if(!interfaces.containingText("Polls are run periodically to let the Runescape community").isEmpty() &&
  902. !interfaces.containingText("This poll will close on").isEmpty())
  903. {
  904. log("close the poll window.");
  905. return State.CLOSE_POLL;
  906. }
  907.  
  908. if(!interfaces.containingText("The guide here will tell you all about making cash.").isEmpty())
  909. {
  910. log("talk to finanicial advisor");
  911. return State.TALK_TO_FINANICAL_ADVISOR;
  912. }
  913.  
  914. if(!interfaces.containingText("Continue through the next door.").isEmpty() &&
  915. myPosition().getX() >= 3124 && myPosition().getX() <= 3129)
  916. {
  917. log("go through next door to walk to priest.");
  918. return State.GO_THROUGH_DOOR_THREE;
  919. }
  920.  
  921. if(!interfaces.containingText("Follow the path to the chapel and enter it.").isEmpty() &&
  922. !Area12.contains(myPlayer()))
  923. {
  924. log("walk to chapel.");
  925. return State.WALK_TO_CHURCH;
  926. }
  927.  
  928. if((!interfaces.containingText("Follow the path to the chapel and enter it.").isEmpty() &&
  929. Area12.contains(myPlayer())) ||
  930. (!interfaces.containingText("Talk with Brother Brace and").isEmpty()) ||
  931. (!interfaces.containingText("keeping track of when your friends are online or for blocking").isEmpty()))
  932. {
  933. log("Talk to brother priest.");
  934. return State.TALK_TO_BROTHER;
  935. }
  936.  
  937. if(!interfaces.containingText("Click on the flashing icon to open the Prayer menu.").isEmpty())
  938. {
  939. log("Click on prayer menu");
  940. return State.CLICK_ON_PRAY;
  941. }
  942.  
  943. if(!interfaces.containingText("You should now see another new icon. Click on the flashing").isEmpty())
  944. {
  945. log("Click on friends list");
  946. return State.CLICK_ON_FRIENDS;
  947. }
  948.  
  949. if(!interfaces.containingText("This will be explained by Brother Brace shortly, but first click").isEmpty())
  950. {
  951. log("Click on ignore list");
  952. return State.CLICK_ON_IGNORE;
  953. }
  954.  
  955. if(!interfaces.containingText("almost finished on tutorial island. Pass through").isEmpty())
  956. {
  957. log("go through door 4");
  958. return State.GO_THROUGH_DOOR_FOUR;
  959. }
  960.  
  961. if(!interfaces.containingText("shown how to cast spells. Just talk with the mage").isEmpty() &&
  962. !Area13.contains(myPlayer()))
  963. {
  964. log("walk to mage");
  965. return State.WALK_TO_MAGE;
  966. }
  967.  
  968. if((!interfaces.containingText("shown how to cast spells. Just talk with the mage").isEmpty() &&
  969. Area13.contains(myPlayer())) ||
  970. !interfaces.containingText("All you need to do now is move on to the mainland.").isEmpty())
  971. {
  972. log("talk to mage");
  973. return State.TALK_TO_MAGE;
  974. }
  975.  
  976. if(!interfaces.containingText("Open up the Magic menu by clicking on the flashing icon").isEmpty())
  977. {
  978. log("click on magic tab");
  979. return State.CLICK_ON_MAGIC;
  980. }
  981.  
  982. if(!interfaces.containingText("Now you have runes you should see the Wind Strike icon").isEmpty())
  983. {
  984. log("cast wind strike on chicken.");
  985. return State.CAST_AT_CHICKEN;
  986. }
  987.  
  988. if(!interfaces.containingText("Do you want to go to the mainland?").isEmpty())
  989. {
  990. log("click on yes go to mainland.");
  991. if(interfaces.get(228) != null)
  992. {
  993. log("clicking yes");
  994. interfaces.interactWithChild(228, 1, "Continue");
  995. }
  996. }
  997.  
  998. if(!interfaces.containingText("Welcome to Lumbridge! To get more help, simply click").isEmpty() ||
  999. Area14.contains(myPlayer()))
  1000. {
  1001. stopScript();
  1002. }
  1003.  
  1004. return getState();
  1005.  
  1006. }
  1007.  
  1008. //-----------------------------------------------------------------------------------------------------
  1009. //-----------------------------------------------------------------------------------------------------
  1010. //-----------------------------------------------------------------------------------------------------
  1011.  
  1012. public void headDesign() throws InterruptedException {
  1013. int head = 0;
  1014. // head design
  1015. if(interfaces.get(269).getChild(113) != null)
  1016. {
  1017. head = random(0,15);
  1018. for (int i = 0; i < head; i++)
  1019. {
  1020. interfaces.interactWithChild(269, 113, "Change head");
  1021. sleep(252 + random(1,100));
  1022. }
  1023.  
  1024. }
  1025. }
  1026.  
  1027. public void jawDesign() throws InterruptedException {
  1028. int jaw = 0;
  1029. // jaw design
  1030. if(interfaces.get(269).getChild(114) != null)
  1031. {
  1032. jaw = random(0,5);
  1033. for (int i = 0; i < jaw; i++)
  1034. {
  1035. interfaces.interactWithChild(269, 114, "Change jaw");
  1036. sleep(252 + random(1,100));
  1037. }
  1038.  
  1039. }
  1040. }
  1041.  
  1042. public void torsoDesign() throws InterruptedException {
  1043. // torso design
  1044. if(interfaces.get(269).getChild(115) != null)
  1045. {
  1046. int torso = 0;
  1047. torso = random(0,14);
  1048. for (int i = 0; i < torso; i++)
  1049. {
  1050. interfaces.interactWithChild(269, 115, "Change torso");
  1051. sleep(252 + random(1,100));
  1052. }
  1053.  
  1054. }
  1055. }
  1056.  
  1057. public void armsDesign() throws InterruptedException {
  1058. int arms = 0;
  1059. // arms design
  1060. if(interfaces.get(269).getChild(116) != null)
  1061. {
  1062. arms = random(0,12);
  1063. for (int i = 0; i < arms; i++)
  1064. {
  1065. interfaces.interactWithChild(269, 116, "Change arms");
  1066. sleep(252 + random(1,100));
  1067. }
  1068.  
  1069. }
  1070. }
  1071.  
  1072. public void handsDesign() throws InterruptedException {
  1073. int hands = 0;
  1074. // hands design
  1075. if(interfaces.get(269).getChild(117) != null)
  1076. {
  1077. hands = random(0,2);
  1078. for (int i = 0; i < hands; i++)
  1079. {
  1080. interfaces.interactWithChild(269, 117, "Change hands");
  1081. sleep(252 + random(1,100));
  1082. }
  1083.  
  1084. }
  1085. }
  1086.  
  1087. public void legsDesign() throws InterruptedException {
  1088. int legs = 0;
  1089. // legs design
  1090. if(interfaces.get(269).getChild(118) != null)
  1091. {
  1092. legs = random(0,14);
  1093. for (int i = 0; i < legs; i++)
  1094. {
  1095. interfaces.interactWithChild(269, 118, "Change legs");
  1096. sleep(252 + random(1,100));
  1097. }
  1098.  
  1099. }
  1100. }
  1101.  
  1102. public void feetDesign() throws InterruptedException {
  1103. int feet = 0;
  1104. // feet design
  1105. if(interfaces.get(269).getChild(119) != null)
  1106. {
  1107. feet = random(0,3);
  1108. for (int i = 0; i < feet; i++)
  1109. {
  1110. interfaces.interactWithChild(269, 119, "Change feet");
  1111. sleep(252 + random(1,100));
  1112. }
  1113.  
  1114. }
  1115. }
  1116.  
  1117. public void hairColour() throws InterruptedException {
  1118. int hair = 0;
  1119. // hair colour
  1120. if(interfaces.get(269).getChild(121) != null)
  1121. {
  1122. hair = random(0,22);
  1123. for (int i = 0; i < hair; i++)
  1124. {
  1125. interfaces.interactWithChild(269, 121, "Recolour hair");
  1126. sleep(252 + random(1,100));
  1127. }
  1128.  
  1129. }
  1130. }
  1131.  
  1132. public void torsoColour() throws InterruptedException {
  1133. int torsoc = 0;
  1134. // torso colour
  1135. if(interfaces.get(269).getChild(127) != null)
  1136. {
  1137. torsoc = random(0,22);
  1138. for (int i = 0; i < torsoc; i++)
  1139. {
  1140. interfaces.interactWithChild(269, 127, "Recolour torso");
  1141. sleep(252 + random(1,100));
  1142. }
  1143.  
  1144. }
  1145. }
  1146.  
  1147. public void legsColour() throws InterruptedException {
  1148. int legsc = 0;
  1149. // legs colour
  1150. if(interfaces.get(269).getChild(129) != null)
  1151. {
  1152. legsc = random(0,9);
  1153. for (int i = 0; i < legsc; i++)
  1154. {
  1155. interfaces.interactWithChild(269, 129, "Recolour legs");
  1156. sleep(252 + random(1,100));
  1157. }
  1158.  
  1159. }
  1160. }
  1161.  
  1162. public void feetColour() throws InterruptedException {
  1163. int feetc = 0;
  1164. // feet colour
  1165. if(interfaces.get(269).getChild(130) != null)
  1166. {
  1167. feetc = random(0,3);
  1168. for (int i = 0; i < feetc; i++)
  1169. {
  1170. interfaces.interactWithChild(269, 130, "Recolour feet");
  1171. sleep(252 + random(1,100));
  1172. }
  1173.  
  1174. }
  1175. }
  1176.  
  1177. public void skinColour() throws InterruptedException {
  1178. int skin = 0;
  1179. // skin colour
  1180. if(interfaces.get(269).getChild(131) != null)
  1181. {
  1182. skin = random(0,7);
  1183. for (int i = 0; i < skin; i++)
  1184. {
  1185. interfaces.interactWithChild(269, 131, "Recolour skin");
  1186. sleep(252 + random(1,100));
  1187. }
  1188.  
  1189. }
  1190. }
  1191.  
  1192. public void character() throws InterruptedException {
  1193. log("making character.");
  1194. headDesign();
  1195. jawDesign();
  1196. torsoDesign();
  1197. armsDesign();
  1198. handsDesign();
  1199. legsDesign();
  1200. feetDesign();
  1201. hairColour();
  1202. torsoColour();
  1203. legsColour();
  1204. feetColour();
  1205. skinColour();
  1206. return;
  1207. }
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214. int welcomeScreen() throws InterruptedException {
  1215. if(interfaces.get(269) != null)
  1216. {
  1217. character();
  1218. if(interfaces.get(269).getChild(100) != null)
  1219. {
  1220. log("found accept box, interacting!");
  1221. interfaces.interactWithChild(269, 100, "Accept");
  1222. sleep(200 + random (100, 200));
  1223. return 200 + gRandom(200, 400.0D);
  1224. }
  1225. }
  1226. else
  1227. {
  1228. return 200 + gRandom(200, 400.0D);
  1229. }
  1230. return 200 + gRandom(200, 400.0D);
  1231.  
  1232. }
  1233.  
  1234. int talkToRunescapeGuide() throws InterruptedException {
  1235. NPC guide = npcs.closest("RuneScape Guide");
  1236. if(guide != null)
  1237. {
  1238. if(guide.isVisible())
  1239. {
  1240. guide.interact("Talk-to");
  1241. mouse.moveSlightly();
  1242. sleep(200 + random (100, 200));
  1243. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1244. {
  1245. sleep(200 + random (100, 200));
  1246. }
  1247. return 200 + gRandom(200, 400.0D);
  1248. }
  1249. if(!guide.isVisible())
  1250. {
  1251. log("cant see guide, moving camyPlayer()ra");
  1252. camera.toEntity(guide);
  1253. }
  1254. }
  1255. return 200 + gRandom(200, 400.0D);
  1256.  
  1257. }
  1258.  
  1259. int continueDialogue() throws InterruptedException {
  1260. interfaces.getDialogues().clickContinue();
  1261. sleep(200 + random (100, 200));
  1262. antiban();
  1263. return 90 + gRandom(200, 400.0D);
  1264.  
  1265. }
  1266.  
  1267. int clickOnSpanner() throws InterruptedException {
  1268. if(interfaces.get(548) != null)
  1269. {
  1270. log("548 != null, clicking options tab");
  1271. interfaces.interactWithChild(548, 35, "Options");
  1272. sleep(200 + random (100, 200));
  1273. return 200 + gRandom(200, 400.0D);
  1274. }
  1275. return 100 + gRandom(200, 400.0D);
  1276.  
  1277. }
  1278.  
  1279. int goThroughDoorOne() throws InterruptedException {
  1280. RS2Object door = objects.closest("Door");
  1281. if(door != null)
  1282. {
  1283. if(door.isVisible())
  1284. {
  1285. log("door exists and is visible, interacting.");
  1286. door.interact("Open");
  1287. mouse.moveSlightly();
  1288. sleep(200 + random (100, 200));
  1289. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1290. {
  1291. sleep(200 + random(100,200));
  1292. }
  1293. run();
  1294. return 200 + gRandom(200, 400.0D);
  1295. }
  1296. if(!door.isVisible())
  1297. {
  1298. log("cant see the soor, moving camera to it.");
  1299. camera.toEntity(door);
  1300. }
  1301. }
  1302. return 200 + gRandom(200, 400.0D);
  1303.  
  1304. }
  1305.  
  1306. int walkToSurvivalExpert() throws InterruptedException
  1307. {
  1308. log("walking to expert");
  1309. localWalker.walk(new Position(3103,3096,0));
  1310. sleep(200 + random (100, 200));
  1311. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1312. {
  1313. sleep(200 + random(100,200));
  1314. }
  1315. return 200 + gRandom(200, 300.0D);
  1316. }
  1317.  
  1318. int talkToSurvivalExpert() throws InterruptedException
  1319. {
  1320. NPC expert = npcs.closest("Survival Expert");
  1321. if(expert != null)
  1322. {
  1323. if(expert.isVisible())
  1324. {
  1325. expert.interact("Talk-to");
  1326. mouse.moveSlightly();
  1327. sleep(200 + random (100, 200));
  1328. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1329. {
  1330. sleep(200 + random(100,200));
  1331. }
  1332. return 200 + gRandom(200, 300.0D);
  1333. }
  1334. }
  1335. return 200 + gRandom(200, 400.0D);
  1336. }
  1337.  
  1338. int clickOnBag() throws InterruptedException
  1339. {
  1340. if(interfaces.get(548) != null)
  1341. {
  1342. log("inventory button exists, clicking on it");
  1343. interfaces.interactWithChild(548, 51, "Inventory");
  1344. sleep(200 + random (100, 200));
  1345. }
  1346. return 200 + gRandom(200, 400.0D);
  1347. }
  1348.  
  1349. int chopTree() throws InterruptedException
  1350. {
  1351. RS2Object tree = objects.closest("Tree");
  1352. if(tree != null)
  1353. {
  1354. if(tree.isVisible())
  1355. {
  1356. log("tree is visible, chopping");
  1357. tree.interact("Chop down");
  1358. antiban();
  1359. sleep(300 + random (100, 200));
  1360. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1361. {
  1362. sleep(200 + random(100,200));
  1363. }
  1364. return 200 + gRandom(200, 400.0D);
  1365. }
  1366. }
  1367. return 200 + gRandom(200, 400.0D);
  1368. }
  1369.  
  1370. int lightFire() throws InterruptedException
  1371. {
  1372. localWalker.walk(new Position(3101,3092,0));
  1373. log("using tinderbox on logs");
  1374. inventory.interact("Use", 590);
  1375. sleep(500 + random (100, 200));
  1376. inventory.interact("Use", 2511);
  1377. mouse.moveRandomly();
  1378. sleep(500 + random (100, 200));
  1379. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1380. {
  1381. sleep(100 + random(200,400));
  1382. }
  1383. return 300 + gRandom(200, 400.0D);
  1384. }
  1385.  
  1386. int clickOnLevels() throws InterruptedException
  1387. {
  1388. if(interfaces.get(548) != null)
  1389. {
  1390. interfaces.interactWithChild(548, 49, "Stats");
  1391. mouse.moveSlightly();
  1392. sleep(500 + random (100, 200));
  1393. clickOnBag();
  1394. return 500 + gRandom(200, 400.0D);
  1395. }
  1396. return 200 + gRandom(200, 400.0D);
  1397. }
  1398.  
  1399. int goFish() throws InterruptedException
  1400. {
  1401. log("walking to spot.");
  1402. localWalker.walk(new Position(3101,3093,0));
  1403. sleep(200 + random (100, 200));
  1404. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1405. {
  1406. sleep(200 + random(100,200));
  1407. }
  1408. NPC fish = npcs.closest("Fishing spot");
  1409. if(fish != null)
  1410. {
  1411. if(fish.isVisible())
  1412. {
  1413. log("spot is available and visible, go go");
  1414. fish.interact("Net");
  1415. mouse.moveVerySlightly();
  1416. sleep(300 + random (100, 200));
  1417. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1418. {
  1419. sleep(400 + random(100,200));
  1420. }
  1421. return 200 + gRandom(200, 400.0D);
  1422. }
  1423. }
  1424. return 200 + gRandom(200, 400.0D);
  1425. }
  1426.  
  1427. int cookFood() throws InterruptedException
  1428. {
  1429. RS2Object fire = objects.closest("Fire");
  1430. log("time to cook some shrimp");
  1431. if(fire != null)
  1432. {
  1433. inventory.interact("Use", "Raw shrimps");
  1434. sleep(400 + random (100, 200));
  1435. fire.interact("Use");
  1436. mouse.moveVerySlightly();
  1437. sleep(400 + random (100, 200));
  1438. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1439. {
  1440. sleep(400 + random(200,400));
  1441. }
  1442. }
  1443. else if(fire == null)
  1444. {
  1445. log("fire went out, cutting + lighting again.");
  1446. chopTree();
  1447. lightFire();
  1448. }
  1449. return 200 + gRandom(200, 400.0D);
  1450. }
  1451.  
  1452. int walkToGateOne() throws InterruptedException
  1453. {
  1454. localWalker.walk(new Position(3091,3091,0));
  1455. sleep(400 + random (100, 200));
  1456. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1457. {
  1458. sleep(400 + random (100, 200));
  1459. }
  1460. return 200 + gRandom(200, 400.0D);
  1461. }
  1462.  
  1463. int goThroughGateOne() throws InterruptedException
  1464. {
  1465. RS2Object gate = objects.closest("Gate");
  1466. if(gate != null)
  1467. {
  1468. if(gate.isVisible())
  1469. {
  1470. gate.interact("Open");
  1471. sleep(400 + random (100, 200));
  1472. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1473. {
  1474. sleep(400 + random (100, 200));
  1475. }
  1476. return 200 + gRandom(200, 400.0D);
  1477. }
  1478. }
  1479. return 200 + gRandom(200, 400.0D);
  1480. }
  1481.  
  1482. int walkToHouseTwo() throws InterruptedException
  1483. {
  1484. if (randomPath == 0)
  1485. {
  1486. log("random = 0");
  1487. randomPath = random(1,4);
  1488. }
  1489. if(randomPath == 1)
  1490. {
  1491. localWalker.walkPath(pathToHouseTwo);
  1492. sleep(100 + random (100, 200));
  1493. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1494. {
  1495. sleep(400 + random (100, 200));
  1496. }
  1497. return 200 + gRandom(200, 400.0D);
  1498. }
  1499. else if (randomPath == 2)
  1500. {
  1501. localWalker.walkPath(pathToHouseTwo2);
  1502. sleep(100 + random (100, 200));
  1503. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1504. {
  1505. sleep(400 + random (100, 200));
  1506. }
  1507. return 200 + gRandom(200, 400.0D);
  1508. }
  1509. else if (randomPath == 3)
  1510. {
  1511. localWalker.walkPath(pathToHouseTwo3);
  1512. sleep(100 + random (100, 200));
  1513. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1514. {
  1515. sleep(400 + random (100, 200));
  1516. }
  1517. return 200 + gRandom(200, 400.0D);
  1518. }
  1519. else if (randomPath == 4)
  1520. {
  1521. localWalker.walkPath(pathToHouseTwo4);
  1522. sleep(100 + random (100, 200));
  1523. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1524. {
  1525. sleep(400 + random (100, 200));
  1526. }
  1527. return 200 + gRandom(200, 400.0D);
  1528. }
  1529. return 200 + gRandom(200, 400.0D);
  1530. }
  1531.  
  1532. int enterHouseTwo() throws InterruptedException
  1533. {
  1534. randomPath = 0;
  1535. RS2Object door = objects.closest("Door");
  1536. if(door != null)
  1537. {
  1538. if(door.isVisible())
  1539. {
  1540. log("door is visible, interacting");
  1541. door.interact("Open");
  1542. sleep(400 + random (100, 200));
  1543. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1544. {
  1545. sleep(400 + random (100, 200));
  1546. }
  1547. return 200 + gRandom(200, 400.0D);
  1548. }
  1549. }
  1550. return 200 + gRandom(200, 400.0D);
  1551. }
  1552.  
  1553. int talkToChef() throws InterruptedException
  1554. {
  1555. NPC chef = npcs.closest("Master Chef");
  1556. localWalker.walk(new Position(3075,3085,0));
  1557. camera.movePitch(50+ random(10,17));
  1558. if(chef != null)
  1559. {
  1560. if(chef.isVisible())
  1561. {
  1562. log("Chef is near, talk to him.");
  1563. chef.interact("Talk-to");
  1564. mouse.moveVerySlightly();
  1565. sleep(400 + random (100, 200));
  1566. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1567. {
  1568. sleep(400 + random (100, 200));
  1569. }
  1570. return 200 + gRandom(200, 400.0D);
  1571. }
  1572. }
  1573. return 200 + gRandom(200, 400.0D);
  1574. }
  1575.  
  1576. int mixIngredients() throws InterruptedException
  1577. {
  1578. log("using flour on water");
  1579. inventory.interact("Use", 2516);
  1580. sleep(400 + random (100, 200));
  1581. inventory.interact("Use", 1929);
  1582. mouse.moveVerySlightly();
  1583. sleep(400 + random (100, 200));
  1584. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1585. {
  1586. sleep(400 + random (100, 200));
  1587. }
  1588. return 200 + gRandom(200, 400.0D);
  1589. }
  1590.  
  1591. int makeBread() throws InterruptedException
  1592. {
  1593. log("using dough on stove");
  1594. RS2Object oven = objects.closest("Range");
  1595. localWalker.walk(oven);
  1596. inventory.interact("Use", 2307);
  1597. sleep(400 + random (100, 200));
  1598. if(oven != null)
  1599. {
  1600. if(oven.isVisible())
  1601. {
  1602. log("interacting with range");
  1603. oven.interact("Use");
  1604. mouse.moveVerySlightly();
  1605. sleep(400 + random (100, 200));
  1606. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1607. {
  1608. sleep(400 + random (100, 200));
  1609. }
  1610. return 200 + gRandom(200, 400.0D);
  1611. }
  1612. }
  1613. return 200 + gRandom(200, 400.0D);
  1614. }
  1615.  
  1616. int clickOnMusic() throws InterruptedException
  1617. {
  1618. if(interfaces.get(548) != null)
  1619. {
  1620. log("clicking the music tab");
  1621. interfaces.interactWithChild(548, 37, "Music Player");
  1622. sleep(400 + random (100, 200));
  1623. return 200 + gRandom(200, 400.0D);
  1624. }
  1625. return 200 + gRandom(200, 400.0D);
  1626. }
  1627.  
  1628. int walkToDoorTwo() throws InterruptedException
  1629. {
  1630. localWalker.walk(new Position(3073,3090,0));
  1631. sleep(400 + random (100, 200));
  1632. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1633. {
  1634. sleep(400 + random (100, 200));
  1635. }
  1636. return 200 + gRandom(200, 400.0D);
  1637. }
  1638.  
  1639. int goThroughDoorTwo() throws InterruptedException
  1640. {
  1641. RS2Object door = objects.closest("Door");
  1642. if(door != null)
  1643. {
  1644. if(door.isVisible())
  1645. {
  1646. log("door is visible, interacting");
  1647. door.interact("Open");
  1648. sleep(400 + random (100, 200));
  1649. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1650. {
  1651. sleep(400 + random (100, 200));
  1652. }
  1653. return 200 + gRandom(200, 400.0D);
  1654. }
  1655. }
  1656. return 200 + gRandom(200, 400.0D);
  1657. }
  1658.  
  1659. int clickOnEmotes() throws InterruptedException
  1660. {
  1661. if(interfaces.get(548) != null)
  1662. {
  1663. log("Clicking on emotes tab");
  1664. interfaces.interactWithChild(548, 36, "Emotes");
  1665. sleep(400 + random (100, 200));
  1666. return 200 + gRandom(200, 400.0D);
  1667. }
  1668. return 200 + gRandom(200, 400.0D);
  1669. }
  1670.  
  1671. int clickOnYes() throws InterruptedException
  1672. {
  1673. if(interfaces.get(464) != null)
  1674. {
  1675. log("Clicking on yes emoji");
  1676. //interfaces.interactWithChild(464, 38, "Yes");
  1677. Rectangle rec1 = new Rectangle(555,212,15,30);
  1678. Rectangle rec2 = new Rectangle(595,212,15,30);
  1679. Rectangle rec3 = new Rectangle(640,212,15,30);
  1680. Rectangle rec4 = new Rectangle(680,212,15,30);
  1681. Rectangle rec5 = new Rectangle(555,265,15,30);
  1682. Rectangle rec6 = new Rectangle(595,265,15,30);
  1683. Rectangle rec7 = new Rectangle(640,265,15,30);
  1684. Rectangle rec8 = new Rectangle(680,265,15,30);
  1685. Rectangle rec9 = new Rectangle(595,312,15,30);
  1686. Rectangle rec10 = new Rectangle(640,312,15,30);
  1687. int c = random(1, 23);
  1688. if(c == 1)
  1689. {
  1690. log("Random emote 1");
  1691. mouse.click(new RectangleDestination(bot, rec1), false);
  1692. mouse.moveRandomly();
  1693. sleep(920 + random(10,34));
  1694. tabs.open(Tab.INVENTORY);
  1695. sleep(950 + random(100,400));
  1696. }
  1697. if(c == 3)
  1698. {
  1699. log("Random emote 2");
  1700. mouse.click(new RectangleDestination(bot, rec2), false);
  1701. mouse.moveRandomly();
  1702. sleep(920 + random(10,34));
  1703. tabs.open(Tab.INVENTORY);
  1704. sleep(950 + random(100,400));
  1705. }
  1706. if(c == 5)
  1707. {
  1708. log("Random emote 3");
  1709. mouse.click(new RectangleDestination(bot, rec3), false);
  1710. mouse.moveRandomly();
  1711. sleep(920 + random(10,34));
  1712. tabs.open(Tab.INVENTORY);
  1713. sleep(950 + random(100,400));
  1714. }
  1715. if(c == 7)
  1716. {
  1717. log("Random emote 4");
  1718. mouse.click(new RectangleDestination(bot, rec4), false);
  1719. mouse.moveRandomly();
  1720. sleep(920 + random(10,34));
  1721. tabs.open(Tab.INVENTORY);
  1722. sleep(950 + random(100,400));
  1723. }
  1724. if(c == 9)
  1725. {
  1726. log("Random emote 5");
  1727. mouse.click(new RectangleDestination(bot, rec5), false);
  1728. mouse.moveRandomly();
  1729. sleep(920 + random(10,34));
  1730. tabs.open(Tab.INVENTORY);
  1731. sleep(950 + random(100,400));
  1732. }
  1733. if(c == 11)
  1734. {
  1735. log("Random emote 6");
  1736. mouse.click(new RectangleDestination(bot, rec6), false);
  1737. mouse.moveRandomly();
  1738. sleep(920 + random(10,34));
  1739. tabs.open(Tab.INVENTORY);
  1740. sleep(950 + random(100,400));
  1741. }
  1742. if(c == 13)
  1743. {
  1744. log("Random emote 7");
  1745. mouse.click(new RectangleDestination(bot, rec7), false);
  1746. mouse.moveRandomly();
  1747. sleep(920 + random(10,34));
  1748. tabs.open(Tab.INVENTORY);
  1749. sleep(950 + random(100,400));
  1750. }
  1751. if(c == 15)
  1752. {
  1753. log("Random emote 8");
  1754. mouse.click(new RectangleDestination(bot, rec8), false);
  1755. mouse.moveRandomly();
  1756. sleep(920 + random(10,34));
  1757. tabs.open(Tab.INVENTORY);
  1758. sleep(950 + random(100,400));
  1759. }
  1760. if(c == 17)
  1761. {
  1762. log("Random emote 9");
  1763. mouse.click(new RectangleDestination(bot, rec9), false);
  1764. mouse.moveRandomly();
  1765. sleep(920 + random(10,34));
  1766. tabs.open(Tab.INVENTORY);
  1767. sleep(950 + random(100,400));
  1768. }
  1769. if(c == 19)
  1770. {
  1771. log("Random emote 10");
  1772. mouse.click(new RectangleDestination(bot, rec10), false);
  1773. mouse.moveRandomly();
  1774. sleep(920 + random(10,34));
  1775. tabs.open(Tab.INVENTORY);
  1776. sleep(950 + random(100,400));
  1777. }
  1778. sleep(400 + random (100, 200));
  1779. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1780. {
  1781. sleep(400 + random (100, 200));
  1782. }
  1783. return 200 + gRandom(200, 400.0D);
  1784. }
  1785. return 200 + gRandom(200, 400.0D);
  1786. }
  1787.  
  1788. int clickOnRun() throws InterruptedException
  1789. {
  1790. if(interfaces.get(261) != null)
  1791. {
  1792. log("Clicking on run");
  1793. sleep(200);
  1794. interfaces.interactWithChild(261, 55, "Toggle Run");
  1795. sleep(400 + random (100, 200));
  1796. return 200 + gRandom(200, 400.0D);
  1797. }
  1798. return 200 + gRandom(200, 400.0D);
  1799. }
  1800.  
  1801. private void run()
  1802. throws InterruptedException
  1803. {
  1804. if(configs.isSet(173, 0))
  1805. {
  1806. Rectangle localRectangle = new Rectangle(570, 127, 20, 20);
  1807. mouse.click(new RectangleDestination(bot, localRectangle), false);
  1808.  
  1809. sleep(800);
  1810. }
  1811. }
  1812.  
  1813. int runToHouseThree() throws InterruptedException
  1814. {
  1815. if (randomPath == 0)
  1816. {
  1817. log("random = 0");
  1818. randomPath = random(1,4);
  1819. }
  1820. if(randomPath == 1)
  1821. {
  1822. localWalker.walkPath(pathToHouseThree);
  1823. sleep(100 + random (100, 200));
  1824. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1825. {
  1826. sleep(400 + random (100, 200));
  1827. }
  1828. return 200 + gRandom(200, 400.0D);
  1829. }
  1830. else if (randomPath == 2)
  1831. {
  1832. localWalker.walkPath(pathToHouseThree2);
  1833. sleep(100 + random (100, 200));
  1834. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1835. {
  1836. sleep(400 + random (100, 200));
  1837. }
  1838. return 200 + gRandom(200, 400.0D);
  1839. }
  1840. else if (randomPath == 3)
  1841. {
  1842. localWalker.walkPath(pathToHouseThree3);
  1843. sleep(100 + random (100, 200));
  1844. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1845. {
  1846. sleep(400 + random (100, 200));
  1847. }
  1848. return 200 + gRandom(200, 400.0D);
  1849. }
  1850. else if (randomPath == 4)
  1851. {
  1852. localWalker.walkPath(pathToHouseThree4);
  1853. sleep(100 + random (100, 200));
  1854. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1855. {
  1856. sleep(400 + random (100, 200));
  1857. }
  1858. return 200 + gRandom(200, 400.0D);
  1859. }
  1860. return 200 + gRandom(200, 400.0D);
  1861. }
  1862.  
  1863. int enterHouseThree() throws InterruptedException
  1864. {
  1865. RS2Object door = objects.closest("Door");
  1866. if(door != null)
  1867. {
  1868. if(door.isVisible())
  1869. {
  1870. log("door is visible, interacting");
  1871. door.interact("Open");
  1872. mouse.moveVerySlightly();
  1873. sleep(400 + random (100, 200));
  1874. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1875. {
  1876. sleep(400 + random (100, 200));
  1877. }
  1878. return 200 + gRandom(200, 400.0D);
  1879. }
  1880. }
  1881. return 200 + gRandom(200, 400.0D);
  1882. }
  1883.  
  1884. int talkToQuestGuide() throws InterruptedException
  1885. {
  1886. NPC quester = npcs.closest("Quest Guide");
  1887. camera.movePitch(gRandom(10,50));
  1888. if(quester != null)
  1889. {
  1890. if(quester.isVisible())
  1891. {
  1892. quester.interact("Talk-to");
  1893. mouse.moveVerySlightly();
  1894. sleep(400 + random (100, 200));
  1895. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1896. {
  1897. sleep(200 + random(100,200));
  1898. }
  1899. return 200 + gRandom(200, 400.0D);
  1900. }
  1901. }
  1902. return 200 + gRandom(200, 400.0D);
  1903. }
  1904.  
  1905. int clickOnQuests() throws InterruptedException
  1906. {
  1907. if(interfaces.get(548) != null)
  1908. {
  1909. log("Clicking on emotes tab");
  1910. interfaces.interactWithChild(548, 50, "Quest List");
  1911. mouse.moveVerySlightly();
  1912. sleep(400 + random (100, 200));
  1913. return 200 + gRandom(200, 400.0D);
  1914. }
  1915. return 200 + gRandom(200, 400.0D);
  1916. }
  1917.  
  1918. int goDownLadder() throws InterruptedException
  1919. {
  1920. localWalker.walk(new Position(3088,3120,0));
  1921. sleep(400 + random (100, 200));
  1922. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1923. {
  1924. sleep(200 + random(100,200));
  1925. }
  1926. RS2Object ladder = objects.closest("Ladder");
  1927. if(ladder != null)
  1928. {
  1929. if(ladder.isVisible())
  1930. {
  1931. log("ladder is visible, interacting");
  1932. ladder.interact("Climb-down");
  1933. mouse.moveVerySlightly();
  1934. sleep(400 + random (100, 200));
  1935. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1936. {
  1937. sleep(200 + random(100,200));
  1938. }
  1939. return 200 + gRandom(200, 400.0D);
  1940. }
  1941. }
  1942. return 200 + gRandom(200, 400.0D);
  1943. }
  1944.  
  1945. int walkToMiningInstructor() throws InterruptedException
  1946. {
  1947. localWalker.walkPath(pathToMiner);
  1948. sleep(400 + random (100, 200));
  1949. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1950. {
  1951. sleep(400 + random(200,400));
  1952. }
  1953. return 200 + gRandom(200, 400.0D);
  1954. }
  1955.  
  1956. int talkToMiningInstructor() throws InterruptedException
  1957. {
  1958. NPC miner = npcs.closest("Mining Instructor");
  1959. if(miner != null)
  1960. {
  1961. if(miner.isVisible())
  1962. {
  1963. log("miner exists and is visible, interacting");
  1964. miner.interact("Talk-to");
  1965. antiban();
  1966. sleep(400 + random (100, 200));
  1967. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1968. {
  1969. sleep(400 + random (100, 200));
  1970. }
  1971. return 200 + gRandom(200, 400.0D);
  1972. }
  1973. }
  1974. return 200 + gRandom(200, 400.0D);
  1975. }
  1976.  
  1977. int prospectTin() throws InterruptedException
  1978. {
  1979. localWalker.walk(new Position(3078,9504,0));
  1980. sleep(400 + random (100, 200));
  1981. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1982. {
  1983. sleep(400 + random(200,400));
  1984. }
  1985. RS2Object tin = objects.closest(10080);
  1986. if(tin != null)
  1987. {
  1988. if(tin.isVisible())
  1989. {
  1990. log("tin exists and is visible, prospecting");
  1991. tin.interact("Prospect");
  1992. sleep(400 + random (100, 200));
  1993. while(myPlayer().isMoving() || myPlayer().isAnimating())
  1994. {
  1995. sleep(400 + random (100, 200));
  1996. }
  1997. sleep(2000);
  1998. return 200 + gRandom(200, 400.0D);
  1999. }
  2000. }
  2001. return 200 + gRandom(200, 400.0D);
  2002. }
  2003.  
  2004. int prospectCopper() throws InterruptedException
  2005. {
  2006. RS2Object copper = objects.closest(10079);
  2007. localWalker.walk(new Position(3082,9501,0));
  2008. sleep(400 + random (100, 200));
  2009. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2010. {
  2011. sleep(400 + random (100, 200));
  2012. }
  2013. if(copper != null)
  2014. {
  2015. if(copper.isVisible())
  2016. {
  2017. log("copper exists and is visible, prospecting");
  2018. camera.toEntity(copper);
  2019. sleep(200 + random(100,250));
  2020. copper.interact("Prospect");
  2021. mouse.moveVerySlightly();
  2022. sleep(400 + random (100, 200));
  2023. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2024. {
  2025. sleep(400 + random(200,400));
  2026. }
  2027. sleep(2000);
  2028. return 200 + gRandom(200, 400.0D);
  2029. }
  2030. }
  2031. return 200 + gRandom(200, 400.0D);
  2032. }
  2033.  
  2034. int mineTin() throws InterruptedException
  2035. {
  2036. localWalker.walk(new Position(3078,9504,0));
  2037. sleep(400 + random (100, 200));
  2038. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2039. {
  2040. sleep(400 + random(200,400));
  2041. }
  2042. RS2Object tin = objects.closest(10080);
  2043. if(tin != null)
  2044. {
  2045. if(tin.isVisible())
  2046. {
  2047. log("tin exists and is visible, mining");
  2048. tin.interact("Mine");
  2049. mouse.moveVerySlightly();
  2050. sleep(400 + random (100, 200));
  2051. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2052. {
  2053. sleep(400 + random (100, 200));
  2054. }
  2055. sleep(2000);
  2056. return 200 + gRandom(200, 400.0D);
  2057. }
  2058. }
  2059. return 200 + gRandom(200, 400.0D);
  2060. }
  2061.  
  2062. int mineCopper() throws InterruptedException
  2063. {
  2064. RS2Object copper = objects.closest(10079);
  2065. localWalker.walk(new Position(3082,9501,0));
  2066. sleep(400 + random (100, 200));
  2067. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2068. {
  2069. sleep(400 + random (100, 200));
  2070. }
  2071. if(copper != null)
  2072. {
  2073. if(copper.isVisible())
  2074. {
  2075. log("copper exists and is visible, mining");
  2076. camera.toEntity(copper);
  2077. sleep(200 + random(100,250));
  2078. copper.interact("Mine");
  2079. mouse.moveVerySlightly();
  2080. sleep(400 + random (100, 200));
  2081. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2082. {
  2083. sleep(400 + random(200,400));
  2084. }
  2085. sleep(2000);
  2086. return 200 + gRandom(200, 400.0D);
  2087. }
  2088. }
  2089. return 200 + gRandom(200, 400.0D);
  2090. }
  2091.  
  2092. int smeltOre() throws InterruptedException
  2093. {
  2094. RS2Object furnace = objects.closest(10082);
  2095. localWalker.walk(new Position(3079,9498,0));
  2096. sleep(400 + random (100, 200));
  2097. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2098. {
  2099. sleep(400 + random (100, 200));
  2100. }
  2101. if(furnace != null)
  2102. {
  2103. if(furnace.isVisible())
  2104. {
  2105. log("furnace exists and is visible, interacting");
  2106. clickOnBag();
  2107. sleep(400 + random (100, 200));
  2108. inventory.interact("Use", "Tin ore");
  2109. sleep(400 + random (100, 200));
  2110. furnace.interact("Use");
  2111. sleep(400 + random (100, 200));
  2112. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2113. {
  2114. sleep(400 + random (100, 200));
  2115. }
  2116. return 200 + gRandom(200, 400.0D);
  2117. }
  2118. }
  2119. return 200 + gRandom(200, 400.0D);
  2120. }
  2121.  
  2122. int talkToMiner() throws InterruptedException
  2123. {
  2124. localWalker.walk(new Position(3079,9504,0));
  2125. sleep(200 + random (100, 200));
  2126. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2127. {
  2128. sleep(300 + random (100, 200));
  2129. }
  2130. NPC miner = npcs.closest("Mining Instructor");
  2131. if(miner != null)
  2132. {
  2133. if(miner.isVisible())
  2134. {
  2135. log("miner exists and is visible, interacting");
  2136. miner.interact("Talk-to");
  2137. mouse.moveVerySlightly();
  2138. sleep(200 + random (100, 200));
  2139. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2140. {
  2141. sleep(400 + random (100, 200));
  2142. }
  2143. return 200 + gRandom(200, 400.0D);
  2144. }
  2145. }
  2146. return 200 + gRandom(200, 400.0D);
  2147. }
  2148.  
  2149. int clickOnAnvil() throws InterruptedException
  2150. {
  2151. localWalker.walk(new Position(3082,9499,0));
  2152. sleep(200 + random (100, 200));
  2153. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2154. {
  2155. sleep(400 + random (100, 200));
  2156. }
  2157. RS2Object anvil = objects.closest("Anvil");
  2158. if(anvil != null)
  2159. {
  2160. if(anvil.isVisible())
  2161. {
  2162. inventory.interact("Use", "Bronze bar");
  2163. sleep(400 + random (100, 200));
  2164. anvil.interact("Use");
  2165. mouse.moveSlightly();
  2166. sleep(400 + random (100, 200));
  2167. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2168. {
  2169. sleep(400 + random (100, 200));
  2170. }
  2171. return 200 + gRandom(200, 400.0D);
  2172. }
  2173. }
  2174. inventory.interact("Use", "Bronze bar");
  2175. return 200 + gRandom(200, 400.0D);
  2176. }
  2177.  
  2178. int smithDagger() throws InterruptedException
  2179. {
  2180. if(interfaces.get(312) != null)
  2181. {
  2182. log("smithing screen visible, go go");
  2183. interfaces.interactWithChild(312, 2, "Smith 1");
  2184. mouse.moveVerySlightly();
  2185. sleep(400 + random (100, 200));
  2186. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2187. {
  2188. sleep(400 + random(200,400));
  2189. }
  2190. return 200 + gRandom(200, 400.0D);
  2191. }
  2192. return 200 + gRandom(200, 400.0D);
  2193. }
  2194.  
  2195. int walkToGateTwo() throws InterruptedException
  2196. {
  2197. localWalker.walk(new Position(3093,9503,0));
  2198. sleep(400 + random (100, 200));
  2199. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2200. {
  2201. sleep(400 + random(200,400));
  2202. }
  2203. return 200 + gRandom(200, 400.0D);
  2204. }
  2205.  
  2206. int goThroughGateTwo() throws InterruptedException
  2207. {
  2208. RS2Object gate = objects.closest("Gate");
  2209. if(gate != null)
  2210. {
  2211. if(gate.isVisible())
  2212. {
  2213. gate.interact("Open");
  2214. mouse.moveVerySlightly();
  2215. sleep(400 + random (100, 200));
  2216. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2217. {
  2218. sleep(400 + random(200,400));
  2219. }
  2220. return 200 + gRandom(200, 400.0D);
  2221. }
  2222. }
  2223. return 200 + gRandom(200, 400.0D);
  2224. }
  2225.  
  2226. int talkToCombatInstructor() throws InterruptedException
  2227. {
  2228. camera.movePitch(gRandom(10,50));
  2229. localWalker.walk(new Position(3104,9508,0));
  2230. sleep(400 + random (100, 200));
  2231. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2232. {
  2233. sleep(400 + random(200,400));
  2234. }
  2235. NPC combat = npcs.closest("Combat Instructor");
  2236. if(combat != null)
  2237. {
  2238. if(combat.isVisible())
  2239. {
  2240. log("combat instructor exists and is visible, interacting");
  2241. combat.interact("Talk-to");
  2242. sleep(400 + random (100, 200));
  2243. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2244. {
  2245. sleep(400 + random(200,400));
  2246. }
  2247. }
  2248. }
  2249. return 200 + gRandom(200, 400.0D);
  2250. }
  2251.  
  2252. int clickOnEquipment() throws InterruptedException
  2253. {
  2254. if(interfaces.get(548) != null)
  2255. {
  2256. log("Clicking on equipment tab");
  2257. interfaces.interactWithChild(548, 52, "Worn Equipment");
  2258. mouse.moveVerySlightly();
  2259. sleep(400 + random (100, 200));
  2260. return 200 + gRandom(200, 400.0D);
  2261. }
  2262. return 200 + gRandom(200, 400.0D);
  2263. }
  2264.  
  2265. int clickOnStats() throws InterruptedException
  2266. {
  2267. if(interfaces.get(387) != null)
  2268. {
  2269. log("Clicking on equipment Stats");
  2270. interfaces.interactWithChild(387, 17, "View Equipment Stats");
  2271. sleep(100 + random (100, 200));
  2272. return 200 + gRandom(200, 400.0D);
  2273. }
  2274. return 200 + gRandom(200, 400.0D);
  2275. }
  2276.  
  2277. int equipDagger() throws InterruptedException
  2278. {
  2279. log("equipping dagger");
  2280. inventory.interact("Equip", "Bronze dagger");
  2281. sleep(400 + random(200,300));
  2282. return 200 + gRandom(200, 400.0D);
  2283. }
  2284.  
  2285. int closeStats() throws InterruptedException
  2286. {
  2287. if(interfaces.get(84) != null)
  2288. {
  2289. log("Clicking on X, on equipment Stats");
  2290. interfaces.interactWithChild(84, 4, "close");
  2291. sleep(100 + random (100, 200));
  2292. return 200 + gRandom(200, 400.0D);
  2293. }
  2294. return 200 + gRandom(200, 400.0D);
  2295. }
  2296.  
  2297. int removeDagger() throws InterruptedException
  2298. {
  2299. if(equipment.isWieldingWeapon("Bronze dagger"))
  2300. {
  2301. log("taking off dagger");
  2302. equipment.unequip(EquipmentSlot.WEAPON, "Bronze dagger");
  2303. sleep(100 + random (100, 200));
  2304. return 200 + gRandom(200, 400.0D);
  2305. }
  2306. return 200 + gRandom(200, 400.0D);
  2307. }
  2308.  
  2309. int equipSwordAndShield() throws InterruptedException
  2310. {
  2311. log("Equipping sword");
  2312. inventory.interact("Wield", "Bronze sword");
  2313. sleep(400 + random(200,300));
  2314. log("Equipping shield");
  2315. inventory.interact("Wield", "Wooden shield");
  2316. sleep(100 + random (100, 200));
  2317. return 200 + gRandom(200, 400.0D);
  2318. }
  2319.  
  2320. int clickOnCombat() throws InterruptedException
  2321. {
  2322. if(interfaces.get(548) != null)
  2323. {
  2324. log("Clicking on combat options.");
  2325. interfaces.interactWithChild(548, 48, "Combat Options");
  2326. sleep(100 + random (100, 200));
  2327. return 200 + gRandom(200, 400.0D);
  2328. }
  2329. return 200 + gRandom(200, 400.0D);
  2330. }
  2331.  
  2332. int goThroughGateThree() throws InterruptedException
  2333. {
  2334. localWalker.walk(new Position(3111,9518,0));
  2335. sleep(400 + random (100, 200));
  2336. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2337. {
  2338. sleep(400 + random(200,400));
  2339. }
  2340. RS2Object gate = objects.closest("Gate");
  2341. if(gate != null)
  2342. {
  2343. if(gate.isVisible())
  2344. {
  2345. log("gate is visible, interacting");
  2346. gate.interact("Open");
  2347. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2348. {
  2349. sleep(400 + random(200,400));
  2350. }
  2351. return 200 + gRandom(200, 400.0D);
  2352. }
  2353. }
  2354. return 200 + gRandom(200, 400.0D);
  2355. }
  2356.  
  2357. int killRat() throws InterruptedException
  2358. {
  2359. NPC rat = npcs.closest("Giant rat");
  2360. if(rat != null)
  2361. {
  2362. if(rat.isVisible() && rat.isAttackable())
  2363. {
  2364. if(!myPlayer().isUnderAttack())
  2365. {
  2366. log("rat is visible and not under attack, kill!");
  2367. rat.interact("Attack");
  2368. mouse.moveSlightly();
  2369. sleep(400 + random (100, 200));
  2370. while(myPlayer().isMoving() || myPlayer().isAnimating() || myPlayer().isUnderAttack())
  2371. {
  2372. sleep(400 + random(200,400));
  2373. }
  2374. }
  2375. }
  2376. }
  2377. return 200 + gRandom(200, 400.0D);
  2378. }
  2379.  
  2380. int goBackThroughGateThree() throws InterruptedException
  2381. {
  2382. RS2Object gate = objects.closest("Gate");
  2383. if(gate != null)
  2384. {
  2385. if(gate.isVisible())
  2386. {
  2387. log("gate is visible, interacting");
  2388. gate.interact("Open");
  2389. sleep(800 + random (100, 200));
  2390. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2391. {
  2392. sleep(400 + random(200,400));
  2393. }
  2394. localWalker.walk(new Position(3106,9508,0));
  2395. sleep(400 + random (100, 200));
  2396. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2397. {
  2398. sleep(400 + random(200,400));
  2399. }
  2400. talkToCombatInstructor();
  2401. return 200 + gRandom(200, 400.0D);
  2402. }
  2403. }
  2404. return 200 + gRandom(200, 400.0D);
  2405. }
  2406.  
  2407. int equipRangeGear() throws InterruptedException
  2408. {
  2409. clickOnBag();
  2410. sleep(608);
  2411. log("Equipping bow");
  2412. inventory.interact("Wield", "Shortbow");
  2413. sleep(800 + random(200,300));
  2414. log("Equipping arrows");
  2415. inventory.interact("Wield", "Bronze arrow");
  2416. sleep(400 + random (100, 200));
  2417. localWalker.walk(new Position(3108,9512,0));
  2418. return 200 + gRandom(200, 400.0D);
  2419. }
  2420.  
  2421. int rangeRat() throws InterruptedException
  2422. {
  2423. NPC rat = npcs.closest("Giant rat");
  2424. if(rat != null)
  2425. {
  2426. if(rat.isVisible() && rat.isAttackable())
  2427. {
  2428. if(!rat.isInteracting(myPlayer()))
  2429. {
  2430. log("rat is visible and not under attack, kill!");
  2431. camera.toEntity(rat);
  2432. rat.interact("Attack");
  2433. antiban();
  2434. sleep(400 + random (100, 200));
  2435. while(myPlayer().isMoving() || myPlayer().isAnimating() || myPlayer().isUnderAttack())
  2436. {
  2437. sleep(400 + random(200,400));
  2438. }
  2439. }
  2440. }
  2441. }
  2442. return 200 + gRandom(200, 400.0D);
  2443. }
  2444.  
  2445. int walkToLadder() throws InterruptedException
  2446. {
  2447. localWalker.walkPath(pathToLadder);
  2448. sleep(400 + random (100, 200));
  2449. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2450. {
  2451. sleep(400 + random(200,400));
  2452. }
  2453. return 200 + gRandom(200, 400.0D);
  2454. }
  2455.  
  2456. int climbUpLadder() throws InterruptedException
  2457. {
  2458. RS2Object ladder = objects.closest("Ladder");
  2459. if(ladder != null)
  2460. {
  2461. if(ladder.isVisible())
  2462. {
  2463. log("ladder is visible, interacting");
  2464. ladder.interact("Climb-up");
  2465. mouse.moveVerySlightly();
  2466. sleep(400 + random (100, 200));
  2467. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2468. {
  2469. sleep(200 + random(100,200));
  2470. }
  2471. return 200 + gRandom(200, 400.0D);
  2472. }
  2473. }
  2474. return 200 + gRandom(200, 400.0D);
  2475. }
  2476.  
  2477. int walkToBank() throws InterruptedException
  2478. {
  2479. localWalker.walkPath(pathToBank);
  2480. sleep(400 + random (100, 200));
  2481. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2482. {
  2483. sleep(400 + random(200,400));
  2484. }
  2485. return 200 + gRandom(200, 400.0D);
  2486. }
  2487.  
  2488. int openBank() throws InterruptedException
  2489. {
  2490. RS2Object bankbooth = objects.closest(new String[] { "Bank booth" });
  2491. if (bankbooth != null)
  2492. {
  2493. if (bankbooth.isVisible())
  2494. {
  2495. bankbooth.interact("Use");
  2496. sleep(random(400, 700));
  2497. }
  2498. else
  2499. {
  2500. camera.toEntity(bankbooth);
  2501. }
  2502. }
  2503. return 200 + gRandom(200, 400.0D);
  2504. }
  2505.  
  2506. int closeBank() throws InterruptedException
  2507. {
  2508. log("closing the bank.");
  2509. Rectangle Rectangle1 = new Rectangle(479,14, 10, 10);
  2510. mouse.click(new RectangleDestination(bot, Rectangle1), false);
  2511. sleep(400 + random(200,400));
  2512. return 200 + gRandom(200, 400.0D);
  2513. }
  2514.  
  2515. int clickOnPoll() throws InterruptedException
  2516. {
  2517. camera.movePitch(gRandom(10,50));
  2518. localWalker.walk(new Position(3120,3121,0));
  2519. sleep(400 + random (100, 200));
  2520. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2521. {
  2522. sleep(400 + random(200,400));
  2523. }
  2524. RS2Object poll = objects.closest("Poll booth");
  2525. if(poll != null)
  2526. {
  2527. if(poll.isVisible())
  2528. {
  2529. log("poll is visible, interacting");
  2530. poll.interact("Use");
  2531. sleep(400 + random (100, 200));
  2532. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2533. {
  2534. sleep(200 + random(100,200));
  2535. }
  2536. return 200 + gRandom(200, 400.0D);
  2537. }
  2538. }
  2539. return 200 + gRandom(200, 400.0D);
  2540. }
  2541.  
  2542. int closePoll() throws InterruptedException
  2543. {
  2544. log("closing the poll window.");
  2545. Rectangle Rectangle1 = new Rectangle(482,17, 10, 10);
  2546. mouse.click(new RectangleDestination(bot, Rectangle1), false);
  2547. sleep(400 + random(200,400));
  2548. log("Go through next door.");
  2549. localWalker.walk(new Position(3124,3124,0));
  2550. sleep(400 + random (100, 200));
  2551. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2552. {
  2553. sleep(200 + random(100,200));
  2554. }
  2555. RS2Object door = objects.closest("Door");
  2556. if(door != null)
  2557. {
  2558. if(door.isVisible())
  2559. {
  2560. if(door.getPosition().getX() == 3125)
  2561. {
  2562. log("opening door to advisor");
  2563. door.interact("Open");
  2564. sleep(400 + random (100, 200));
  2565. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2566. {
  2567. sleep(200 + random(100,200));
  2568. }
  2569. return 200 + gRandom(200, 400.0D);
  2570. }
  2571. }
  2572. }
  2573. return 200 + gRandom(200, 400.0D);
  2574. }
  2575.  
  2576. int talkToFinancialAdvisor() throws InterruptedException
  2577. {
  2578. camera.movePitch(gRandom(10,50));
  2579. NPC cash = npcs.closest("Financial Advisor");
  2580. if(cash != null)
  2581. {
  2582. if(cash.isVisible())
  2583. {
  2584. log("talking to cash guy.");
  2585. cash.interact("Talk-to");
  2586. mouse.moveSlightly();
  2587. sleep(400 + random (100, 200));
  2588. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2589. {
  2590. sleep(200 + random(100,200));
  2591. }
  2592. return 200 + gRandom(200, 400.0D);
  2593. }
  2594. }
  2595. return 200 + gRandom(200, 400.0D);
  2596. }
  2597.  
  2598. int goThroughDoorThree() throws InterruptedException
  2599. {
  2600. localWalker.walk(new Position(3129,3124,0));
  2601. sleep(400 + random (100, 200));
  2602. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2603. {
  2604. sleep(200 + random(100,200));
  2605. }
  2606. RS2Object door = objects.closest("Door");
  2607. if(door != null)
  2608. {
  2609. if(door.isVisible())
  2610. {
  2611. log("opening door to leave advisor room.");
  2612. door.interact("Open");
  2613. sleep(400 + random (100, 200));
  2614. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2615. {
  2616. sleep(200 + random(100,200));
  2617. }
  2618. return 200 + gRandom(200, 400.0D);
  2619. }
  2620. }
  2621. return 200 + gRandom(200, 400.0D);
  2622. }
  2623.  
  2624. int walkToChurch() throws InterruptedException
  2625. {
  2626. localWalker.walkPath(pathToPriest);
  2627. sleep(400 + random (100, 200));
  2628. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2629. {
  2630. sleep(200 + random(100,200));
  2631. }
  2632. RS2Object open = objects.closest(7112);
  2633. RS2Object closed = objects.closest(7111);
  2634. if(open != null)
  2635. {
  2636. if(open.isVisible())
  2637. {
  2638. log("door is open, walking to priest");
  2639. localWalker.walk(new Position(3124,3106,0));
  2640. sleep(400 + random (100, 200));
  2641. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2642. {
  2643. sleep(200 + random(100,200));
  2644. }
  2645. return 200 + gRandom(200, 400.0D);
  2646. }
  2647. }
  2648. if(closed != null)
  2649. {
  2650. if(closed.isVisible())
  2651. {
  2652. log("doors closed, opening and walking to priest");
  2653. closed.interact("Open");
  2654. sleep(400 + random (100, 200));
  2655. localWalker.walk(new Position(3124,3106,0));
  2656. sleep(400 + random (100, 200));
  2657. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2658. {
  2659. sleep(200 + random(100,200));
  2660. }
  2661. return 200 + gRandom(200, 400.0D);
  2662. }
  2663. }
  2664. return 200 + gRandom(200, 400.0D);
  2665. }
  2666.  
  2667. int talkToBrother() throws InterruptedException
  2668. {
  2669. NPC bro = npcs.closest("Brother Brace");
  2670. if(bro != null)
  2671. {
  2672. if(bro.isVisible())
  2673. {
  2674. log("talking to priest.");
  2675. bro.interact("Talk-to");
  2676. mouse.moveVerySlightly();
  2677. sleep(200 + random (100, 200));
  2678. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2679. {
  2680. sleep(200 + random(100,200));
  2681. }
  2682. return 200 + gRandom(200, 400.0D);
  2683. }
  2684. }
  2685. return 200 + gRandom(200, 400.0D);
  2686. }
  2687.  
  2688. int clickOnPray() throws InterruptedException
  2689. {
  2690. if(interfaces.get(548) != null)
  2691. {
  2692. log("Clicking on pray list");
  2693. interfaces.interactWithChild(548, 53, "Prayer");
  2694. mouse.moveSlightly();
  2695. sleep(200 + random (100, 200));
  2696. return 200 + gRandom(200, 400.0D);
  2697. }
  2698. return 200 + gRandom(200, 400.0D);
  2699. }
  2700.  
  2701. int clickOnFriends() throws InterruptedException
  2702. {
  2703. if(interfaces.get(548) != null)
  2704. {
  2705. log("Clicking on friends list");
  2706. interfaces.interactWithChild(548, 32, "Friends List");
  2707. mouse.moveVerySlightly();
  2708. sleep(200 + random (100, 200));
  2709. return 200 + gRandom(200, 400.0D);
  2710. }
  2711. return 200 + gRandom(200, 400.0D);
  2712. }
  2713.  
  2714. int clickOnIgnore() throws InterruptedException
  2715. {
  2716. if(interfaces.get(548) != null)
  2717. {
  2718. log("Clicking on ignore list");
  2719. interfaces.interactWithChild(548, 33, "Ignore List");
  2720. mouse.moveSlightly();
  2721. sleep(200 + random (100, 200));
  2722. return 200 + gRandom(200, 400.0D);
  2723. }
  2724. return 200 + gRandom(200, 400.0D);
  2725. }
  2726.  
  2727. int goThroughDoorFour() throws InterruptedException
  2728. {
  2729. localWalker.walk(new Position(3122,3103,0));
  2730. sleep(200 + random (100, 200));
  2731. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2732. {
  2733. sleep(200 + random(100,200));
  2734. }
  2735. RS2Object door = objects.closest("Door");
  2736. if(door != null)
  2737. {
  2738. if(door.isVisible())
  2739. {
  2740. log("opening door to leave church.");
  2741. door.interact("Open");
  2742. sleep(200 + random (100, 200));
  2743. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2744. {
  2745. sleep(200 + random(100,200));
  2746. }
  2747. return 200 + gRandom(200, 400.0D);
  2748. }
  2749. }
  2750. return 200 + gRandom(200, 400.0D);
  2751. }
  2752.  
  2753. int walkToMage() throws InterruptedException
  2754. {
  2755. localWalker.walkPath(pathToMage);
  2756. sleep(200 + random (100, 200));
  2757. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2758. {
  2759. sleep(200 + random(100,200));
  2760. }
  2761. return 200 + gRandom(200, 400.0D);
  2762. }
  2763.  
  2764. int talkToMage() throws InterruptedException
  2765. {
  2766. NPC mage = npcs.closest("Magic Instructor");
  2767. if(mage != null)
  2768. {
  2769. if(mage.isVisible())
  2770. {
  2771. log("talking to magic instructor.");
  2772. mage.interact("Talk-to");
  2773. sleep(200 + random (100, 200));
  2774. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2775. {
  2776. sleep(200 + random(100,200));
  2777. }
  2778. return 200 + gRandom(200, 400.0D);
  2779. }
  2780. }
  2781. return 200 + gRandom(200, 400.0D);
  2782. }
  2783.  
  2784. int clickOnMagic() throws InterruptedException
  2785. {
  2786. if(interfaces.get(548) != null)
  2787. {
  2788. log("Clicking on pray list");
  2789. interfaces.interactWithChild(548, 54, "Magic");
  2790. mouse.moveSlightly();
  2791. sleep(200 + random (100, 200));
  2792. return 200 + gRandom(200, 400.0D);
  2793. }
  2794. return 200 + gRandom(200, 400.0D);
  2795. }
  2796.  
  2797. int castAtChicken() throws InterruptedException
  2798. {
  2799. NPC chicken = npcs.closest("Chicken");
  2800. localWalker.walk(new Position(3140,3091,0));
  2801. sleep(400 + random (100, 200));
  2802. clickOnMagic();
  2803. while(myPlayer().isMoving() || myPlayer().isAnimating())
  2804. {
  2805. sleep(200 + random(100,200));
  2806. }
  2807. if(interfaces.get(192) != null)
  2808. {
  2809. log("casting on chicken!");
  2810. interfaces.interactWithChild(218, 2, "Cast");
  2811. sleep(100 + gRandom(800, 300.0D));
  2812. chicken.interact("Cast");
  2813. antiban();
  2814. sleep(400 + random (100, 200));
  2815. }
  2816. return 200 + gRandom(200, 400.0D);
  2817. }
  2818.  
  2819. int stopScript() throws InterruptedException
  2820. {
  2821.  
  2822. log("Tutorial Island completed!");
  2823. log("Thanks for using a Pug script!");
  2824. stop();
  2825. stop();
  2826. return 100;
  2827. }
  2828.  
  2829. public void onPaint(Graphics2D g)
  2830. {
  2831. Graphics2D gr = g;
  2832. timeRan = System.currentTimeMillis() - this.timeBegan;
  2833. g.drawString("Time Taken So Far: " + ft(timeRan), 187, 290); // total time runnning
  2834. }
  2835.  
  2836. private String ft(long duration)
  2837. {
  2838. String res = "";
  2839. long days = TimeUnit.MILLISECONDS.toDays(duration);
  2840. long hours = TimeUnit.MILLISECONDS.toHours(duration)
  2841. - TimeUnit.DAYS.toHours(TimeUnit.MILLISECONDS.toDays(duration));
  2842. long minutes = TimeUnit.MILLISECONDS.toMinutes(duration)
  2843. - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS
  2844. .toHours(duration));
  2845. long seconds = TimeUnit.MILLISECONDS.toSeconds(duration)
  2846. - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS
  2847. .toMinutes(duration));
  2848. if (days == 0) {
  2849. res = (hours + ":" + minutes + ":" + seconds);
  2850. } else {
  2851. res = (days + ":" + hours + ":" + minutes + ":" + seconds);
  2852. }
  2853. return res;
  2854. }
  2855.  
  2856. public void antiban() throws InterruptedException
  2857. {
  2858. int b = random(2, 23);
  2859. switch (b) {
  2860. case 1:
  2861. if (random(0, 13) == 4) {
  2862. mouse.moveSlightly();
  2863. sleep(random(600, random(1200, 2000)));
  2864. mouse.moveRandomly();
  2865. }
  2866. break;
  2867. case 2:
  2868. if (random(1, 6) == 2) {
  2869. camera.movePitch(random(30, 70));
  2870. sleep(random(600, random(1200, 2000)));
  2871. }
  2872. break;
  2873. case 3:
  2874. if (random(0, 18) == 5) {
  2875. mouse.moveOutsideScreen();
  2876. sleep(random(600, random(1200, 2000)));
  2877. }
  2878. break;
  2879. case 4:
  2880. if (random(0, 19) == 13) {
  2881. camera.moveYaw(random(134, 280));
  2882. sleep(random(600, random(1200, 2000)));
  2883.  
  2884. }
  2885. break;
  2886. case 5:
  2887. if (random(0, 21) == 7) {
  2888. mouse.moveSlightly();
  2889. sleep(random(100, random(201, 275)));
  2890. }
  2891. case 6:
  2892. if (random(0, 21) == 8) {
  2893. mouse.moveVerySlightly();
  2894. sleep(random(100, random(201, 275)));
  2895. mouse.moveRandomly(random(30, 70));
  2896. }
  2897. case 7:
  2898. if (random(0, 21) == 9) {
  2899. mouse.moveRandomly();
  2900. sleep(random(100, random(201, 275)));
  2901. mouse.moveRandomly(random(30, 70));
  2902. }
  2903. default:
  2904. break;
  2905. }
  2906. }
  2907. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement