Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2015
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.64 KB | None | 0 0
  1. import java.awt.Graphics;
  2.  
  3. import org.dreambot.api.methods.Calculations;
  4. import org.dreambot.api.methods.dialogues.Dialogues;
  5. import org.dreambot.api.methods.map.Tile;
  6. import org.dreambot.api.methods.walking.impl.Walking;
  7. import org.dreambot.api.script.AbstractScript;
  8. import org.dreambot.api.script.ScriptManifest;
  9. import org.dreambot.api.script.Category;
  10. import org.dreambot.api.wrappers.interactive.GameObject;
  11. import org.dreambot.api.wrappers.interactive.NPC;
  12.  
  13. @ScriptManifest(author = "Soapy", name = "X-mas event 2k15 enjoy m8 v2.0", version = 1.0, description = "xmas", category = Category.MONEYMAKING)
  14. public class main extends AbstractScript {
  15.  
  16. // Walking walk;
  17.  
  18. String STATE = "Setting up...";
  19. String prevState = "";
  20. boolean FourthAnti = false;
  21. boolean FourthGift = false;
  22. Tile fally, santa;
  23. Tile varrock, vCastle;
  24. Tile secondFloorDoor, secondFloorLadder;
  25. Tile thirdFloorDoor, thirdFloorLadder, antiSanta;
  26. Tile k1, k2, k3, k4;
  27. Tile lummy;
  28. GameObject door, stairs, presentTable, ladder, machine, crates;
  29.  
  30. NPC santaNPC;
  31. NPC antiSantaNPC;
  32. NPC npcK1, npcK2, npcK3, npcK4;
  33.  
  34. boolean search = false;
  35.  
  36. public void onStart() {
  37. STATE = "Setup Tiles";
  38. fally = new Tile(2965, 3367);
  39. santa = new Tile(2974, 3342);
  40.  
  41. varrock = new Tile(3210, 3431);
  42. vCastle = new Tile(3213, 3472);
  43. secondFloorDoor = new Tile(3218, 3472);
  44. secondFloorLadder = new Tile(3223, 3472);
  45. thirdFloorLadder = new Tile(3223, 3472);
  46. thirdFloorDoor = new Tile(3219, 3472);
  47. antiSanta = new Tile(3212, 3472);
  48. k1 = new Tile(3219, 3424);
  49. k2 = new Tile(3215, 3418);
  50. k3 = new Tile(3239, 3396);
  51. k4 = new Tile(3244, 3393);
  52. lummy = new Tile(3221, 3218);
  53. STATE = "Setup WAlking";
  54. getWalking().setRunThreshold(35);
  55. STATE = "start";
  56. }
  57.  
  58. public void onExit() {
  59.  
  60. }
  61.  
  62. @Override
  63. public int onLoop() {
  64. // check if near lummy, check previous step and restart from before.
  65. if (lummy.distance(getLocalPlayer()) < 50) {
  66. prevState = STATE;
  67. // if(STATE.equals("Kid_4") || STATE.equals("Kid_3")) {
  68. //
  69. // } else if(STATE.equals("Third_child") || STATE.equals("Fourth_child")) {
  70. //
  71. // }
  72. STATE = "Walk_to_varrock";
  73.  
  74.  
  75. }else {
  76. if (getLocalPlayer().getZ() == 3) {
  77. stairs = getGameObjects().closest("Staircase");
  78. while (!stairs.exists())
  79. stairs = getGameObjects().closest("Staircase");
  80. wait(400);
  81. stairs.interact("Climb-down");
  82. wait(2000);
  83. }
  84.  
  85. switch (STATE) {
  86. case "start":
  87. STATE = "Walking_to_falador";
  88. break;
  89. case "Walking_to_falador":
  90. walkToFalador();
  91. break;
  92. case "Walking_to_santa":
  93. walkToSanta();
  94. break;
  95. case "Dialogue_1":
  96. firstDialogueSanta();
  97. break;
  98. case "Walk_to_varrock":
  99. walkToVarrock();
  100. break;
  101. case "Walk_to_varrock_castle":
  102. walkToVarrockCastle();
  103. break;
  104. case "Walk_to_anti_santa":
  105. walkToAntiSanta();
  106. break;
  107. case "Dialogue_2":
  108. secondDialogue();
  109. break;
  110. case "Leave_anti_santa":
  111. leaveAntiSanta();
  112. break;
  113. case "Talk_to_first_kid":
  114. firstChildAntiGift();
  115. break;
  116. case "Second_child":
  117. secondChildAntiGift();
  118. break;
  119. case "Third_child":
  120. thirdChildAntiGift();
  121. break;
  122. case "Fourth_child":
  123. fourthChildAntiGift();
  124. break;
  125. case "Walk_to_varrock2":
  126. walkToVarrock2();
  127. break;
  128. case "Walk_to_varrock_castle2":
  129. walkToVarrockCastle2();
  130. break;
  131. case "Walk_to_anti_santa2":
  132. walkToAntiSanta2();
  133. break;
  134. case "Finish_anti":
  135. finishAntiDialogue();
  136. break;
  137. case "Leave_anti2":
  138. leaveAntiSanta2();
  139. break;
  140. case "Walk_to_fally":
  141. walkToFally();
  142. break;
  143. case "Walk_to_santa_2":
  144. walkToSanta();
  145. break;
  146. case "Talk_to_santa_2":
  147. talkToSanta2();
  148. break;
  149. case "varrock2":
  150. walkToVarrock();
  151. break;
  152. case "First_child_gift":
  153. firstChildGift();
  154. break;
  155. case "Second_child_gift":
  156. secondChildGift();
  157. break;
  158. case "Kid_3":
  159. thirdChildGift();
  160. break;
  161. case "Kid_4":
  162. fourthChildGift();
  163. break;
  164. case "Walk_to_falador_final":
  165. walkToFalador();
  166. break;
  167. case "Walk_to_santa_final":
  168. walkToSanta();
  169. break;
  170. case "Final_dialogue":
  171. lastTalk();
  172. break;
  173. }
  174. }
  175. // return Calculations.random(100, 200);
  176. return 0;
  177. }
  178.  
  179. public void onPaint(Graphics g) {
  180. g.drawString("State: " + STATE, 100, 100);
  181. g.drawString("Search: " + search, 100, 200);
  182. }
  183.  
  184. public void walkToFalador() {
  185. getWalking().walk(fally);
  186. if (fally.distance(getLocalPlayer()) < 8)
  187. if (STATE.equals("Walk_to_falador_final"))
  188. STATE = "Walk_to_santa_final";
  189. else if(prevState.equals("Third_child") || prevState.equals("Fourth_child"))
  190. STATE = "Walking_to_santa";
  191. else
  192. STATE = "Walking_to_santa";
  193. }
  194.  
  195. public void walkToSanta() {
  196. getWalking().walkExact(santa);
  197. if (santa.distance(getLocalPlayer()) < 5)
  198. if (STATE.equals("Walk_to_santa_2"))
  199. STATE = "Talk_to_santa_2";
  200. else if (STATE.equals("Walk_to_santa_final"))
  201. STATE = "Final_dialogue";
  202. else if(prevState.equals("Third_child") || prevState.equals("Fourth_child"))
  203. STATE = "Talk_to_santa_2";
  204. else
  205. STATE = "Dialogue_1";
  206. }
  207.  
  208. public void firstDialogueSanta() {
  209.  
  210. walkToSanta();
  211. santaNPC = getNpcs().closest("Santa Claus");
  212. wait(600);
  213. santaNPC.interact("Talk-to");
  214. wait(1000);
  215. while (!getDialogues().inDialogue()) {
  216. santaNPC = getNpcs().closest("Santa Claus");
  217. wait(500);
  218. santaNPC.interact("Talk-to");
  219. wait(900);
  220. }
  221. getDialogues().clickContinue();
  222. wait(700);
  223. getDialogues().clickContinue();
  224. wait(700);
  225. getDialogues().clickContinue();
  226. wait(750);
  227. getDialogues().clickOption(1);
  228. wait(700);
  229. getDialogues().clickContinue();
  230. wait(700);
  231. getDialogues().clickContinue();
  232. wait(700);
  233. getDialogues().clickOption(1);
  234. wait(750);
  235. getDialogues().clickContinue();
  236. wait(700);
  237. getDialogues().clickContinue();
  238. wait(700);
  239. getDialogues().clickContinue();
  240. wait(700);
  241. getDialogues().clickContinue();
  242. wait(700);
  243. getDialogues().clickContinue();
  244. STATE = "Walk_to_varrock";
  245.  
  246. }
  247.  
  248. public void walkToVarrock() {
  249. getWalking().walk(varrock);
  250. if (varrock.distance(getLocalPlayer()) < 5)
  251. if (STATE.equals("varrock2"))
  252. STATE = "First_child_gift";
  253. else if(prevState.equals("Third_child") || prevState.equals("Fourth_child"))
  254. STATE = "Walking_to_falador";
  255. else
  256. STATE = "Walk_to_varrock_castle";
  257. }
  258.  
  259. public void walkToVarrockCastle() {
  260. getWalking().walkExact(vCastle);
  261. if (vCastle.distance(getLocalPlayer()) < 3)
  262. STATE = "Walk_to_anti_santa";
  263. }
  264.  
  265. public void walkToAntiSanta() {
  266. stairs = getGameObjects().closest("Staircase");
  267. while (!stairs.exists())
  268. stairs = getGameObjects().closest("Staircase");
  269. wait(400);
  270. stairs.interact("Climb-up");
  271. wait(2000);
  272. while (getLocalPlayer().getZ() < 1) {
  273. stairs = getGameObjects().closest("Staircase");
  274. wait(200);
  275. stairs.interact("Climb-up");
  276. wait(200);
  277. }
  278. while ((secondFloorDoor.distance(getLocalPlayer()) > 2)) {
  279. getWalking().walkExact(secondFloorDoor);
  280. wait(500);
  281. }
  282. wait(400);
  283. door = getGameObjects().closest("Door");
  284. while (!door.exists())
  285. door = getGameObjects().closest("Door");
  286. wait(100);
  287. door.interact("Open");
  288. wait(600);
  289. while (secondFloorLadder.distance(getLocalPlayer()) > 2) {
  290. wait(500);
  291. getWalking().walkExact(secondFloorLadder);
  292. }
  293. wait(700);
  294. ladder = getGameObjects().closest("Ladder");
  295. while (!ladder.exists())
  296. ladder = getGameObjects().closest("Ladder");
  297. wait(150);
  298. ladder.interact("Climb-up");
  299. wait(800);
  300. while (thirdFloorDoor.distance(getLocalPlayer()) > 2) {
  301. getWalking().walkExact(thirdFloorDoor);
  302. wait(500);
  303. }
  304. wait(1000);
  305. door = getGameObjects().closest("Door");
  306. while (!door.exists())
  307. door = getGameObjects().closest("Door");
  308. door.interact("Open");
  309. wait(1000);
  310. while (antiSanta.distance(getLocalPlayer()) > 3) {
  311. getWalking().walkExact(antiSanta);
  312. wait(500);
  313. }
  314. STATE = "Dialogue_2";
  315. }
  316.  
  317. public void secondDialogue() {
  318. if(!FourthAnti) {
  319. search = true;
  320. antiSantaNPC = getNpcs().closest("Anti-Santa");
  321. wait(600);
  322. antiSantaNPC.interact("Talk-to");
  323. wait(1000);
  324. while (!antiSantaNPC.exists()) {
  325. search = true;
  326. antiSantaNPC = getNpcs().closest("Anti-Santa");
  327. wait(500);
  328. }
  329. search = false;
  330. antiSantaNPC.interact("Talk-to");
  331. // while(!getDialogues().inDialogue()) {
  332. // antiSantaNPC = getNpcs().closest("Anti-Santa");
  333. // wait(600);
  334. // antiSantaNPC.interact("Talk-to");
  335. // wait(900);
  336. // }
  337. wait(900);
  338. getDialogues().clickContinue();
  339. wait(900);
  340. getDialogues().clickOption(1);
  341. wait(900);
  342. getDialogues().clickContinue();
  343. wait(900);
  344. getDialogues().clickContinue();
  345. wait(900);
  346. getDialogues().clickOption(1);
  347. wait(900);
  348. getDialogues().clickContinue();
  349. wait(900);
  350. getDialogues().clickContinue();
  351. wait(900);
  352. getDialogues().clickOption(2);
  353. wait(900);
  354. getDialogues().clickContinue();
  355. wait(900);
  356. getDialogues().clickContinue();
  357. wait(900);
  358. getDialogues().clickContinue();
  359. wait(900);
  360. getDialogues().clickContinue();
  361. wait(900);
  362. if (getDialogues().inDialogue())
  363. getDialogues().clickContinue();
  364. wait(950);
  365. }
  366. presentTable = getGameObjects().closest("Table");
  367. while (!presentTable.exists())
  368. presentTable = getGameObjects().closest("Table");
  369. wait(500);
  370. presentTable.interact("Take-present");
  371. wait(1000);
  372. presentTable.interact("Take-present");
  373. wait(700);
  374. presentTable.interact("Take-present");
  375. wait(700);
  376. presentTable.interact("Take-present");
  377. wait(700);
  378. crates = getGameObjects().closest("Crate");
  379. while (!crates.exists())
  380. crates = getGameObjects().closest("Crate");
  381. wait(500);
  382. crates.interact("Search");
  383. wait(800);
  384. if(!FourthAnti) {
  385. antiSantaNPC = getNpcs().closest("Anti-Santa");
  386. antiSantaNPC.interact("Talk-to");
  387. wait(1000);
  388. while (!antiSantaNPC.exists()) {
  389. antiSantaNPC = getNpcs().closest("Anti-Santa");
  390. wait(500);
  391. }
  392. antiSantaNPC.interact("Talk-to");
  393. // while(!getDialogues().inDialogue()) {
  394. // antiSantaNPC = getNpcs().closest("Anti-Santa");
  395. // antiSantaNPC.interact("Talk-to");
  396. // wait(1000);
  397. // }
  398. wait(1000);
  399. getDialogues().clickContinue();
  400. wait(600);
  401. getDialogues().clickContinue();
  402. wait(600);
  403. getDialogues().clickContinue();
  404. wait(600);
  405. getDialogues().clickContinue();
  406. wait(600);
  407. getDialogues().clickContinue();
  408. wait(600);
  409. getDialogues().clickContinue();
  410. wait(600);
  411. }
  412. STATE = "Leave_anti_santa";
  413. }
  414.  
  415. public void leaveAntiSanta() {
  416. while (thirdFloorDoor.distance(getLocalPlayer()) > 2) {
  417. getWalking().walkExact(thirdFloorDoor);
  418. wait(500);
  419. }
  420. door = getGameObjects().closest("Door");
  421. door.interact("Open");
  422. wait(600);
  423. while (thirdFloorLadder.distance(getLocalPlayer()) > 2) {
  424. getWalking().walkExact(thirdFloorLadder);
  425. wait(500);
  426. }
  427. ladder = getGameObjects().closest("Ladder");
  428. ladder.interact("Climb-down");
  429. wait(900);
  430. while (secondFloorDoor.distance(getLocalPlayer()) > 2) {
  431. getWalking().walkExact(secondFloorDoor);
  432. wait(500);
  433. }
  434. door = getGameObjects().closest("Door");
  435. door.interact("Open");
  436. wait(500);
  437. stairs = getGameObjects().closest("Staircase");
  438. stairs.interact("Climb-down");
  439. wait(600);
  440. while (varrock.distance(getLocalPlayer()) > 2) {
  441. getWalking().walkExact(varrock);
  442. wait(500);
  443. }
  444. if(FourthAnti) {
  445. STATE = "Fourth_child";
  446. FourthAnti = false;
  447. } else
  448. STATE = "Talk_to_first_kid";
  449. }
  450.  
  451. public void firstChildAntiGift() {
  452. while (k1.distance(getLocalPlayer()) > 2) {
  453. getWalking().walkExact(k1);
  454. wait(500);
  455. }
  456. getWalking().walkExact(k1);
  457. npcK1 = getNpcs().closest("Happy Gnome Child");
  458. npcK1.interact("Talk-to");
  459. wait(800);
  460. getDialogues().clickContinue();
  461. wait(400);
  462. getDialogues().clickOption(2);
  463. wait(600);
  464. getDialogues().clickContinue();
  465. wait(400);
  466. getDialogues().clickContinue();
  467. wait(400);
  468. getDialogues().clickOption(1);
  469. wait(600);
  470. getDialogues().clickContinue();
  471. wait(400);
  472. getDialogues().clickContinue();
  473. wait(400);
  474. getDialogues().clickOption(1);
  475. wait(600);
  476. getDialogues().clickContinue();
  477. wait(400);
  478. getDialogues().clickContinue();
  479. wait(400);
  480. npcK1 = getNpcs().closest("Crying gnome child");
  481. wait(400);
  482. npcK1.interact("Collect-tears");
  483. wait(800);
  484. STATE = "Second_child";
  485. }
  486.  
  487. public void secondChildAntiGift() {
  488. kid2Door();
  489. while (k2.distance(getLocalPlayer()) > 2) {
  490. getWalking().walkExact(k2);
  491. wait(500);
  492. }
  493. wait(400);
  494. npcK2 = getNpcs().closest("Happy child");
  495. npcK2.interact("Talk-to");
  496. wait(800);
  497. getDialogues().clickContinue();
  498. wait(400);
  499. getDialogues().clickOption(2);
  500. wait(600);
  501. getDialogues().clickContinue();
  502. wait(400);
  503. getDialogues().clickContinue();
  504. wait(400);
  505. getDialogues().clickOption(1);
  506. wait(600);
  507. getDialogues().clickContinue();
  508. wait(400);
  509. getDialogues().clickContinue();
  510. wait(400);
  511. getDialogues().clickOption(1);
  512. wait(600);
  513. getDialogues().clickContinue();
  514. wait(400);
  515. getDialogues().clickContinue();
  516. wait(400);
  517. npcK2 = getNpcs().closest("Crying child");
  518. npcK2.interact("Collect-tears");
  519. wait(750);
  520. STATE = "Third_child";
  521. }
  522.  
  523. public void thirdChildAntiGift() {
  524. while (k3.distance(getLocalPlayer()) > 1) {
  525. getWalking().walkExact(k3);
  526. wait(500);
  527. }
  528. kid3Door();
  529. while (k3.distance(getLocalPlayer()) > 1) {
  530. getWalking().walkExact(k3);
  531. wait(500);
  532. }
  533. npcK3 = getNpcs().closest("Happy child");
  534. npcK3.interact("Talk-to");
  535. wait(600);
  536. getDialogues().clickContinue();
  537. wait(400);
  538. getDialogues().clickOption(2);
  539. wait(600);
  540. getDialogues().clickContinue();
  541. wait(400);
  542. getDialogues().clickContinue();
  543. wait(400);
  544. getDialogues().clickOption(1);
  545. wait(650);
  546. getDialogues().clickContinue();
  547. wait(400);
  548. getDialogues().clickContinue();
  549. wait(400);
  550. getDialogues().clickOption(1);
  551. wait(650);
  552. getDialogues().clickContinue();
  553. wait(400);
  554. getDialogues().clickContinue();
  555. wait(400);
  556. npcK3 = getNpcs().closest("Crying child");
  557. npcK3.interact("Collect-tears");
  558. wait(800);
  559. STATE = "Fourth_child";
  560. }
  561.  
  562. public void fourthChildAntiGift() {
  563. kid4Door();
  564. while (k4.distance(getLocalPlayer()) > 2) {
  565. getWalking().walkExact(k4);
  566. wait(500);
  567. kid4Door();
  568. }
  569. npcK4 = getNpcs().closest("Happy child");
  570. npcK4.interact("Talk-to");
  571. wait(650);
  572. getDialogues().clickContinue();
  573. wait(400);
  574. getDialogues().clickOption(2);
  575. wait(650);
  576. getDialogues().clickContinue();
  577. wait(400);
  578. getDialogues().clickContinue();
  579. wait(400);
  580. getDialogues().clickOption(1);
  581. wait(650);
  582. getDialogues().clickContinue();
  583. wait(400);
  584. getDialogues().clickContinue();
  585. wait(400);
  586. getDialogues().clickOption(1);
  587. wait(650);
  588. getDialogues().clickContinue();
  589. wait(400);
  590. getDialogues().clickContinue();
  591. wait(400);
  592. npcK4 = getNpcs().closest("Crying child");
  593. npcK4.interact("Collect-tears");
  594. wait(700);
  595. STATE = "Walk_to_varrock2";
  596. }
  597.  
  598. public void walkToVarrock2() {
  599. getWalking().walk(varrock);
  600. if (varrock.distance(getLocalPlayer()) < 5)
  601. STATE = "Walk_to_varrock_castle2";
  602. }
  603.  
  604. public void walkToVarrockCastle2() {
  605. getWalking().walkExact(vCastle);
  606. if (vCastle.distance(getLocalPlayer()) < 3)
  607. STATE = "Walk_to_anti_santa2";
  608. }
  609.  
  610. public void walkToAntiSanta2() {
  611. while (getLocalPlayer().getZ() == 0) {
  612. stairs = getGameObjects().closest("Staircase");
  613. wait(400);
  614. stairs.interact("Climb-up");
  615. wait(900);
  616. }
  617. while ((secondFloorDoor.distance(getLocalPlayer()) > 2)) {
  618. getWalking().walkExact(secondFloorDoor);
  619. wait(500);
  620. }
  621. wait(400);
  622. door = getGameObjects().closest("Door");
  623. wait(250);
  624. door.interact("Open");
  625. wait(600);
  626. while (secondFloorLadder.distance(getLocalPlayer()) > 2) {
  627. wait(500);
  628. getWalking().walkExact(secondFloorLadder);
  629. }
  630. wait(700);
  631. while (getLocalPlayer().getZ() == 1) {
  632. ladder = getGameObjects().closest("Ladder");
  633. wait(150);
  634. ladder.interact("Climb-up");
  635. wait(800);
  636. }
  637. while (thirdFloorDoor.distance(getLocalPlayer()) > 2) {
  638. getWalking().walkExact(thirdFloorDoor);
  639. wait(500);
  640. }
  641. wait(1000);
  642. door = getGameObjects().closest("Door");
  643. door.interact("Open");
  644. wait(1000);
  645. while (antiSanta.distance(getLocalPlayer()) > 3) {
  646. getWalking().walkExact(antiSanta);
  647. wait(500);
  648. }
  649. STATE = "Finish_anti";
  650. }
  651.  
  652. public void finishAntiDialogue() {
  653. antiSantaNPC = getNpcs().closest("Anti-Santa");
  654. while (!antiSantaNPC.exists())
  655. antiSantaNPC = getNpcs().closest("Anti-Santa");
  656. antiSantaNPC.interact("Talk-to");
  657. wait(800);
  658. while (!getDialogues().inDialogue()) {
  659. antiSantaNPC = getNpcs().closest("Anti-Santa");
  660. wait(400);
  661. antiSantaNPC.interact("Talk-to");
  662. }
  663. wait(800);
  664. getDialogues().clickContinue();
  665. wait(600);
  666. getDialogues().clickContinue();
  667. wait(600);
  668. getDialogues().clickContinue();
  669. wait(600);
  670.  
  671. machine = getGameObjects().closest("Anti-Santa's machine");
  672. wait(500);
  673. while (!machine.exists()) {
  674. machine = getGameObjects().closest("Anti-Santa's machine");
  675. wait(500);
  676. }
  677. machine.interact("Operate");
  678. wait(1000);
  679. getDialogues().clickContinue();
  680. wait(650);
  681. getDialogues().clickContinue();
  682. wait(600);
  683. getDialogues().clickContinue();
  684. wait(1000);
  685.  
  686. antiSantaNPC.interact("Talk-to");
  687. wait(600);
  688. while (!getDialogues().inDialogue()) {
  689. wait(600);
  690. antiSantaNPC = getNpcs().closest("Anti-Santa");
  691. wait(500);
  692. antiSantaNPC.interact("Talk-to");
  693.  
  694. }
  695.  
  696. wait(800);
  697. getDialogues().clickContinue();
  698. wait(600);
  699. getDialogues().clickContinue();
  700. wait(600);
  701. getDialogues().clickContinue();
  702. wait(600);
  703. getDialogues().clickContinue();
  704. wait(600);
  705. getDialogues().clickContinue();
  706. wait(600);
  707. getDialogues().clickContinue();
  708. wait(600);
  709. STATE = "Leave_anti2";
  710. }
  711.  
  712. public void leaveAntiSanta2() {
  713. while (thirdFloorDoor.distance(getLocalPlayer()) > 2) {
  714. getWalking().walkExact(thirdFloorDoor);
  715. wait(500);
  716. }
  717. door = getGameObjects().closest("Door");
  718. door.interact("Open");
  719. wait(600);
  720. while (thirdFloorLadder.distance(getLocalPlayer()) > 2) {
  721. getWalking().walkExact(thirdFloorLadder);
  722. wait(500);
  723. }
  724. ladder = getGameObjects().closest("Ladder");
  725. ladder.interact("Climb-down");
  726. wait(900);
  727. while (secondFloorDoor.distance(getLocalPlayer()) > 2) {
  728. getWalking().walkExact(secondFloorDoor);
  729. wait(500);
  730. }
  731. door = getGameObjects().closest("Door");
  732. door.interact("Open");
  733. wait(500);
  734. stairs = getGameObjects().closest("Staircase");
  735. stairs.interact("Climb-down");
  736. wait(600);
  737. while (varrock.distance(getLocalPlayer()) > 3) {
  738. getWalking().walkExact(varrock);
  739. wait(500);
  740. }
  741. STATE = "Walk_to_fally";
  742. }
  743.  
  744. public void walkToFally() {
  745. getWalking().walk(fally);
  746. if (fally.distance(getLocalPlayer()) < 8)
  747. STATE = "Walk_to_santa_2";
  748. }
  749.  
  750. public void talkToSanta2() {
  751. santaNPC = getNpcs().closest("Santa Claus");
  752. santaNPC.interact("Talk-to");
  753. wait(700);
  754. while (!getDialogues().inDialogue()) {
  755. santaNPC = getNpcs().closest("Santa Claus");
  756. wait(500);
  757. santaNPC.interact("Talk-to");
  758. wait(1000);
  759. }
  760. getDialogues().clickContinue();
  761. wait(600);
  762. getDialogues().clickContinue();
  763. wait(650);
  764. getDialogues().clickContinue();
  765. wait(1000);
  766. getDialogues().clickContinue();
  767. wait(1000);
  768. getDialogues().clickContinue();
  769. wait(1000);
  770. getDialogues().clickContinue();
  771. wait(1000);
  772. getDialogues().clickContinue();
  773. wait(800);
  774. getDialogues().clickContinue();
  775. wait(1000);
  776. getDialogues().clickContinue();
  777. wait(1000);
  778. getDialogues().clickContinue();
  779. wait(1000);
  780. getDialogues().clickContinue();
  781. wait(1000);
  782. getDialogues().clickContinue();
  783. wait(1000);
  784.  
  785. Tile getPresents = new Tile(2977, 3339);
  786.  
  787. while (getPresents.distance(getLocalPlayer()) > 2) {
  788. getWalking().walkExact(getPresents);
  789. wait(500);
  790. }
  791. wait(600);
  792. presentTable = getGameObjects().closest("Table");
  793. wait(500);
  794. while (!presentTable.exists()) {
  795. presentTable = getGameObjects().closest("Table");
  796. wait(500);
  797. }
  798. presentTable.interact("Take-present");
  799. wait(800);
  800. presentTable.interact("Take-present");
  801. wait(800);
  802. presentTable.interact("Take-present");
  803. wait(800);
  804. presentTable.interact("Take-present");
  805. wait(800);
  806. STATE = "varrock2";
  807. }
  808.  
  809. public void firstChildGift() {
  810. while (k1.distance(getLocalPlayer()) > 2) {
  811. getWalking().walkExact(k1);
  812. wait(500);
  813. }
  814. npcK1 = getNpcs().closest("Crying gnome child");
  815. npcK1.interact("Talk-to");
  816. wait(1000);
  817. getDialogues().clickContinue();
  818. wait(700);
  819. getDialogues().clickOption(1);
  820. wait(1000);
  821. getDialogues().clickContinue();
  822. wait(700);
  823. getDialogues().clickContinue();
  824. wait(700);
  825. getDialogues().clickContinue();
  826. wait(700);
  827. getDialogues().clickContinue();
  828. wait(700);
  829. getDialogues().clickContinue();
  830. wait(700);
  831. STATE = "Second_child_gift";
  832. }
  833.  
  834. public void secondChildGift() {
  835. getWalking().walkExact(k2);
  836. kid2Door();
  837. while (k2.distance(getLocalPlayer()) > 2) {
  838. getWalking().walkExact(k2);
  839. wait(500);
  840. }
  841. npcK2 = getNpcs().closest("Crying child");
  842. npcK2.interact("Talk-to");
  843. wait(1000);
  844. getDialogues().clickContinue();
  845. wait(700);
  846. getDialogues().clickOption(1);
  847. wait(700);
  848. getDialogues().clickContinue();
  849. wait(700);
  850. getDialogues().clickContinue();
  851. wait(700);
  852. getDialogues().clickContinue();
  853. wait(700);
  854. getDialogues().clickContinue();
  855. wait(700);
  856. STATE = "Kid_3";
  857. }
  858.  
  859. public void thirdChildGift() {
  860. while (k3.distance(getLocalPlayer()) > 1) {
  861. getWalking().walkExact(k3);
  862. wait(500);
  863. }
  864. kid3Door();
  865. while (k3.distance(getLocalPlayer()) > 1) {
  866. getWalking().walkExact(k3);
  867. wait(500);
  868. }
  869. npcK3 = getNpcs().closest("Crying child");
  870. npcK3.interact("Talk-to");
  871. wait(1000);
  872. while (!getDialogues().inDialogue()) {
  873. npcK3 = getNpcs().closest("Crying child");
  874. wait(500);
  875. npcK3.interact("Talk-to");
  876. wait(900);
  877. }
  878. getDialogues().clickContinue();
  879. wait(800);
  880. getDialogues().clickOption(1);
  881. wait(800);
  882. getDialogues().clickContinue();
  883. wait(800);
  884. getDialogues().clickContinue();
  885. wait(800);
  886. getDialogues().clickContinue();
  887. wait(800);
  888. getDialogues().clickContinue();
  889. wait(700);
  890. STATE = "Kid_4";
  891. }
  892.  
  893. public void fourthChildGift() {
  894. while (k4.distance(getLocalPlayer()) > 2) {
  895. getWalking().walkExact(k4);
  896. }
  897. kid4Door();
  898. while (k4.distance(getLocalPlayer()) > 2) {
  899. getWalking().walkExact(k4);
  900. }
  901. kid4Door();
  902. while (k4.distance(getLocalPlayer()) > 1) {
  903. getWalking().walkExact(k4);
  904. }
  905. npcK4 = getNpcs().closest("Crying child");
  906. wait(500);
  907. npcK4.interact("Talk-to");
  908. wait(1000);
  909. while (!getDialogues().inDialogue()) {
  910. npcK4 = getNpcs().closest("Crying child");
  911. wait(500);
  912. npcK4.interact("Talk-to");
  913. wait(1000);
  914. }
  915. wait(1000);
  916. getDialogues().clickContinue();
  917. wait(800);
  918. getDialogues().clickOption(1);
  919. wait(800);
  920. getDialogues().clickContinue();
  921. wait(800);
  922. getDialogues().clickContinue();
  923. wait(800);
  924. getDialogues().clickContinue();
  925. wait(800);
  926. getDialogues().clickContinue();
  927. wait(700);
  928. STATE = "Walk_to_falador_final";
  929. }
  930.  
  931. public void lastTalk() {
  932. santaNPC = getNpcs().closest("Santa Claus");
  933. santaNPC.interact("Talk-to");
  934. wait(800);
  935. while (!getDialogues().inDialogue()) {
  936. santaNPC = getNpcs().closest("Santa Claus");
  937. wait(500);
  938. santaNPC.interact("Talk-to");
  939. wait(500);
  940. }
  941. getDialogues().clickContinue();
  942. wait(700);
  943. getDialogues().clickContinue();
  944. wait(700);
  945. getDialogues().clickContinue();
  946. wait(3000);
  947. // cutscene
  948. getDialogues().clickContinue();
  949. wait(800);
  950. getDialogues().clickContinue();
  951. wait(800);
  952. getDialogues().clickContinue();
  953. wait(3000);
  954. // cutscene
  955. getDialogues().clickContinue();
  956. wait(3000);
  957. // cutscene
  958. getDialogues().clickContinue();
  959. wait(5000);
  960. // cs(long)
  961. getDialogues().clickContinue();
  962. wait(700);
  963. getDialogues().clickContinue();
  964. wait(2000);
  965. // cs
  966. getDialogues().clickContinue();
  967. wait(700);
  968. getDialogues().clickContinue();
  969. wait(700);
  970. getDialogues().clickContinue();
  971. wait(700);
  972. getDialogues().clickContinue();
  973. wait(700);
  974. getDialogues().clickContinue();
  975. wait(2500);
  976. // cs
  977. santaNPC.interact("Talk-to");
  978. wait(800);
  979. while (!getDialogues().inDialogue()) {
  980. santaNPC = getNpcs().closest("Santa Claus");
  981. wait(500);
  982. santaNPC.interact("Talk-to");
  983. wait(500);
  984. }
  985. wait(200);
  986. getDialogues().clickContinue();
  987. wait(700);
  988. getDialogues().clickContinue();
  989. wait(700);
  990. getDialogues().clickContinue();
  991. wait(700);
  992. getDialogues().clickContinue();
  993. wait(700);
  994. }
  995.  
  996. public void wait(int x) {
  997. x = (int) ((Math.random() * ((x + (x * .1)) - (x * 9))) + (x * 9) * (1.1));
  998. try {
  999. Thread.sleep(x);
  1000. } catch (InterruptedException e) {
  1001. }
  1002. }
  1003.  
  1004. public void kid2Door() {
  1005. Tile nDoor = new Tile(3217, 3420);
  1006. while (nDoor.distance(getLocalPlayer()) > 2) {
  1007. getWalking().walkExact(nDoor);
  1008. wait(300);
  1009. }
  1010. door = getGameObjects().closest("Door");
  1011. door.interact("Open");
  1012. }
  1013.  
  1014. public void kid3Door() {
  1015. Tile nDoor = new Tile(3239, 3391);
  1016. while (nDoor.distance(getLocalPlayer()) > 2) {
  1017. getWalking().walkExact(nDoor);
  1018. wait(300);
  1019. }
  1020. door = getGameObjects().closest("Door");
  1021. door.interact("Open");
  1022. }
  1023.  
  1024. public void kid4Door() {
  1025. Tile nDoor = new Tile(3242, 3396);
  1026. while (nDoor.distance(getLocalPlayer()) > 2) {
  1027. getWalking().walkExact(nDoor);
  1028. wait(300);
  1029. }
  1030. door = getGameObjects().closest("Door");
  1031. door.interact("Open");
  1032. }
  1033.  
  1034. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement