Guest User

Untitled

a guest
Jan 11th, 2017
589
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 217.28 KB | None | 0 0
  1. import java.awt.event.KeyEvent;
  2. import java.util.Random;
  3. import org.osbot.rs07.api.map.Position;
  4. import org.osbot.rs07.api.model.NPC;
  5. import org.osbot.rs07.api.model.RS2Object;
  6. import org.osbot.rs07.api.ui.EquipmentSlot;
  7. import org.osbot.rs07.api.ui.RS2Widget;
  8. import org.osbot.rs07.api.ui.Spells;
  9. import org.osbot.rs07.api.ui.Tab;
  10. import org.osbot.rs07.script.Script;
  11. import org.osbot.rs07.script.ScriptManifest;
  12. import org.osbot.rs07.utility.ConditionalSleep;
  13.  
  14. @ScriptManifest(author = "", info = "", logo = "", name = "AutoFarm", version = 0)
  15. public class AutoFarm extends Script {
  16.  
  17.  
  18. String[] options = {"I've played in the past, but not recently.", "Nothing, thanks.", "Nope, I'm ready to move on!", "Yes."};
  19.  
  20.  
  21. @Override
  22. public int onLoop() throws InterruptedException {
  23.  
  24.  
  25. if (getConfigs().get(281) == 1000) {
  26.  
  27. } else {
  28. if (inDialogue()) {
  29. if (isPendingClickContinue()) {
  30. clickContinue();
  31. } else {
  32. if (isPendingContinue()) {
  33. pressContinue();
  34. } else {
  35. if (isPendingOption()) {
  36. selectOptions(options);
  37. sleep(loopTime());
  38. }
  39. }
  40. }
  41. } else {
  42. if (getConfigs().get(281) == 0) {
  43. RS2Widget characterScreen = getWidgets().get(269, 96);
  44. RS2Widget characterScreenAccept = getWidgets().get(269, 99);
  45. if (characterScreen != null && characterScreen.isVisible()) {
  46. if (characterScreenAccept != null && characterScreenAccept.isVisible()) {
  47. if (characterScreenAccept.interact()) {
  48. new ConditionalSleep(random(3600, 6300)) {
  49. @Override
  50. public boolean condition() throws InterruptedException {
  51. RS2Widget characterScreen = getWidgets().get(269, 96);
  52. return characterScreen == null;
  53. }
  54. }.sleep();
  55. }
  56. }
  57. } else {
  58. NPC guide = getNpcs().getAll().stream().filter(o -> o.getName().equals("RuneScape Guide") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  59. if (guide != null && !myPlayer().isMoving()) {
  60. if (guide.interact("Talk-to")) {
  61. new ConditionalSleep(random(3600, 6300)) {
  62. @Override
  63. public boolean condition() throws InterruptedException {
  64. return inDialogue();
  65. }
  66. }.sleep();
  67. }
  68. }
  69. }
  70. } else {
  71. if (getConfigs().get(281) == 3) {
  72. if (getTabs().open(Tab.SETTINGS)) {
  73. new ConditionalSleep(random(3600, 6300)) {
  74. @Override
  75. public boolean condition() throws InterruptedException {
  76. return getTabs().getOpen() == Tab.SETTINGS;
  77. }
  78. }.sleep();
  79. }
  80. } else {
  81. if (getConfigs().get(281) == 7) {
  82. NPC guide = getNpcs().getAll().stream().filter(o -> o.getName().equals("RuneScape Guide") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  83. if (guide != null && !myPlayer().isMoving()) {
  84. if (guide.interact("Talk-to")) {
  85. new ConditionalSleep(random(3600, 6300)) {
  86. @Override
  87. public boolean condition() throws InterruptedException {
  88. return inDialogue();
  89. }
  90. }.sleep();
  91. }
  92. }
  93. } else {
  94. if (getConfigs().get(281) == 10) {
  95. RS2Object guideDoor = getObjects().getAll().stream().filter(o -> o.getName().equals("Door") && o.hasAction("Open") && o.getPosition().getX() == 3098 && o.getPosition().getY() == 3107).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  96. if (guideDoor != null && !myPlayer().isMoving()) {
  97. if (guideDoor.interact("Open")) {
  98. new ConditionalSleep(random(3600, 6300)) {
  99. @Override
  100. public boolean condition() throws InterruptedException {
  101. return myPlayer().isMoving();
  102. }
  103. }.sleep();
  104. }
  105. }
  106. } else {
  107. if (getConfigs().get(281) == 20) {
  108. NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  109. if (expert != null && !myPlayer().isMoving()) {
  110. if (expert.interact("Talk-to")) {
  111. new ConditionalSleep(random(3600, 6300)) {
  112. @Override
  113. public boolean condition() throws InterruptedException {
  114. return inDialogue();
  115. }
  116. }.sleep();
  117. }
  118. }
  119. } else {
  120. if (getConfigs().get(281) == 30) {
  121. if (getTabs().open(Tab.INVENTORY)) {
  122. new ConditionalSleep(random(3600, 6300)) {
  123. @Override
  124. public boolean condition() throws InterruptedException {
  125. return getTabs().getOpen() == Tab.INVENTORY;
  126. }
  127. }.sleep();
  128. }
  129. } else {
  130. if (getConfigs().get(281) == 40) {
  131. if (getTabs().getOpen() == Tab.INVENTORY) {
  132. if (getInventory().contains("Bronze axe") && getInventory().contains("Tinderbox")) {
  133. RS2Object tree = getObjects().getAll().stream().filter(o -> o.getName().equals("Tree") && o.hasAction("Chop down")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  134. if (tree != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  135. if (tree.interact("Chop down")) {
  136. new ConditionalSleep(random(3600, 6300)) {
  137. @Override
  138. public boolean condition() throws InterruptedException {
  139. return myPlayer().isAnimating();
  140. }
  141. }.sleep();
  142. }
  143. }
  144. } else {
  145. NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  146. if (expert != null && !myPlayer().isMoving()) {
  147. if (expert.interact("Talk-to")) {
  148. new ConditionalSleep(random(3600, 6300)) {
  149. @Override
  150. public boolean condition() throws InterruptedException {
  151. return inDialogue();
  152. }
  153. }.sleep();
  154. }
  155. }
  156. }
  157. } else {
  158. if (getTabs().open(Tab.INVENTORY)) {
  159. new ConditionalSleep(random(3600, 6300)) {
  160. @Override
  161. public boolean condition() throws InterruptedException {
  162. return getTabs().getOpen() == Tab.INVENTORY;
  163. }
  164. }.sleep();
  165. }
  166. }
  167. } else {
  168. if (getConfigs().get(281) == 50) {
  169. if (getTabs().getOpen() == Tab.INVENTORY) {
  170. if (getInventory().contains("Logs")) {
  171. if (getInventory().contains("Tinderbox")) {
  172. if (!myPlayer().isMoving() && !myPlayer().isAnimating()) {
  173. if (getInventory().isItemSelected()) {
  174. if (getInventory().getSelectedItemName().equals("Logs")) {
  175. if (getInventory().interact("Use", "Tinderbox")) {
  176. new ConditionalSleep(random(3600, 6300)) {
  177. @Override
  178. public boolean condition() throws InterruptedException {
  179. return myPlayer().isAnimating();
  180. }
  181. }.sleep();
  182. }
  183. } else {
  184. if (getInventory().deselectItem()) {
  185. new ConditionalSleep(random(3600, 6300)) {
  186. @Override
  187. public boolean condition() throws InterruptedException {
  188. return !getInventory().isItemSelected();
  189. }
  190. }.sleep();
  191. }
  192. }
  193. } else {
  194. if (getInventory().interact("Use", "Logs")) {
  195. new ConditionalSleep(random(3600, 6300)) {
  196. @Override
  197. public boolean condition() throws InterruptedException {
  198. return getInventory().isItemSelected();
  199. }
  200. }.sleep();
  201. }
  202. }
  203. }
  204. } else {
  205. NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  206. if (expert != null && !myPlayer().isMoving()) {
  207. if (expert.interact("Talk-to")) {
  208. new ConditionalSleep(random(3600, 6300)) {
  209. @Override
  210. public boolean condition() throws InterruptedException {
  211. return inDialogue();
  212. }
  213. }.sleep();
  214. }
  215. }
  216. }
  217. } else {
  218. if (getInventory().contains("Bronze axe")) {
  219. RS2Object tree = getObjects().getAll().stream().filter(o -> o.getName().equals("Tree") && o.hasAction("Chop down")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  220. if (tree != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  221. if (tree.interact("Chop down")) {
  222. new ConditionalSleep(random(3600, 6300)) {
  223. @Override
  224. public boolean condition() throws InterruptedException {
  225. return myPlayer().isAnimating();
  226. }
  227. }.sleep();
  228. }
  229. }
  230. } else {
  231. NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  232. if (expert != null && !myPlayer().isMoving()) {
  233. if (expert.interact("Talk-to")) {
  234. new ConditionalSleep(random(3600, 6300)) {
  235. @Override
  236. public boolean condition() throws InterruptedException {
  237. return inDialogue();
  238. }
  239. }.sleep();
  240. }
  241. }
  242. }
  243. }
  244. } else {
  245. if (getTabs().open(Tab.INVENTORY)) {
  246. new ConditionalSleep(random(3600, 6300)) {
  247. @Override
  248. public boolean condition() throws InterruptedException {
  249. return getTabs().getOpen() == Tab.INVENTORY;
  250. }
  251. }.sleep();
  252. }
  253. }
  254. } else {
  255. if (getConfigs().get(281) == 60) {
  256. if (getTabs().open(Tab.SKILLS)) {
  257. new ConditionalSleep(random(3600, 6300)) {
  258. @Override
  259. public boolean condition() throws InterruptedException {
  260. return getTabs().getOpen() == Tab.SKILLS;
  261. }
  262. }.sleep();
  263. }
  264. } else {
  265. if (getConfigs().get(281) == 70) {
  266. if (getTabs().getOpen() == Tab.INVENTORY) {
  267. NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  268. if (expert != null && !myPlayer().isMoving()) {
  269. if (expert.interact("Talk-to")) {
  270. new ConditionalSleep(random(3600, 6300)) {
  271. @Override
  272. public boolean condition() throws InterruptedException {
  273. return inDialogue();
  274. }
  275. }.sleep();
  276. }
  277. }
  278. } else {
  279. if (getTabs().open(Tab.INVENTORY)) {
  280. new ConditionalSleep(random(3600, 6300)) {
  281. @Override
  282. public boolean condition() throws InterruptedException {
  283. return getTabs().getOpen() == Tab.INVENTORY;
  284. }
  285. }.sleep();
  286. }
  287. }
  288. } else {
  289. if (getConfigs().get(281) == 80) {
  290. NPC fish = getNpcs().getAll().stream().filter(o -> o.getName().equals("Fishing spot") && o.hasAction("Net")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  291. if (getTabs().getOpen() == Tab.INVENTORY) {
  292. if (getInventory().contains("Small fishing net")) {
  293. if (fish != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  294. if (fish.interact("Net")) {
  295. new ConditionalSleep(random(3600, 6300)) {
  296. @Override
  297. public boolean condition() throws InterruptedException {
  298. return myPlayer().isAnimating();
  299. }
  300. }.sleep();
  301. }
  302. }
  303. } else {
  304. NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  305. if (expert != null && !myPlayer().isMoving()) {
  306. if (expert.interact("Talk-to")) {
  307. new ConditionalSleep(random(3600, 6300)) {
  308. @Override
  309. public boolean condition() throws InterruptedException {
  310. return inDialogue();
  311. }
  312. }.sleep();
  313. }
  314. }
  315. }
  316. } else {
  317. if (getTabs().open(Tab.INVENTORY)) {
  318. new ConditionalSleep(random(3600, 6300)) {
  319. @Override
  320. public boolean condition() throws InterruptedException {
  321. return getTabs().getOpen() == Tab.INVENTORY;
  322. }
  323. }.sleep();
  324. }
  325. }
  326. } else {
  327. if (getConfigs().get(281) == 90) {
  328. if (getTabs().getOpen() == Tab.INVENTORY) {
  329. if (getInventory().contains("Raw shrimps") && getInventory().getAmount("Raw shrimps") >= 2) {
  330. RS2Object fire = getObjects().getAll().stream().filter(o -> o.getName().equals("Fire")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  331. if (fire == null) {
  332. if (getInventory().contains("Logs")) {
  333. if (getInventory().contains("Tinderbox")) {
  334. if (!myPlayer().isMoving() && !myPlayer().isAnimating()) {
  335. if (getInventory().isItemSelected()) {
  336. if (getInventory().getSelectedItemName().equals("Logs")) {
  337. if (getInventory().interact("Use", "Tinderbox")) {
  338. new ConditionalSleep(random(3600, 6300)) {
  339. @Override
  340. public boolean condition() throws InterruptedException {
  341. return myPlayer().isAnimating();
  342. }
  343. }.sleep();
  344. }
  345. } else {
  346. if (getInventory().deselectItem()) {
  347. new ConditionalSleep(random(3600, 6300)) {
  348. @Override
  349. public boolean condition() throws InterruptedException {
  350. return !getInventory().isItemSelected();
  351. }
  352. }.sleep();
  353. }
  354. }
  355. } else {
  356. if (getInventory().interact("Use", "Logs")) {
  357. new ConditionalSleep(random(3600, 6300)) {
  358. @Override
  359. public boolean condition() throws InterruptedException {
  360. return getInventory().isItemSelected();
  361. }
  362. }.sleep();
  363. }
  364. }
  365. }
  366. } else {
  367. NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  368. if (expert != null && !myPlayer().isMoving()) {
  369. if (expert.interact("Talk-to")) {
  370. new ConditionalSleep(random(3600, 6300)) {
  371. @Override
  372. public boolean condition() throws InterruptedException {
  373. return inDialogue();
  374. }
  375. }.sleep();
  376. }
  377. }
  378. }
  379. } else {
  380. if (getInventory().contains("Bronze axe")) {
  381. RS2Object tree = getObjects().getAll().stream().filter(o -> o.getName().equals("Tree") && o.hasAction("Chop down")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  382. if (tree != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  383. if (tree.interact("Chop down")) {
  384. new ConditionalSleep(random(3600, 6300)) {
  385. @Override
  386. public boolean condition() throws InterruptedException {
  387. return myPlayer().isAnimating();
  388. }
  389. }.sleep();
  390. }
  391. }
  392. } else {
  393. NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  394. if (expert != null && !myPlayer().isMoving()) {
  395. if (expert.interact("Talk-to")) {
  396. new ConditionalSleep(random(3600, 6300)) {
  397. @Override
  398. public boolean condition() throws InterruptedException {
  399. return inDialogue();
  400. }
  401. }.sleep();
  402. }
  403. }
  404. }
  405. }
  406. } else {
  407. if (!myPlayer().isMoving() && !myPlayer().isAnimating()) {
  408. if (getInventory().isItemSelected()) {
  409. if (getInventory().getSelectedItemName().equals("Raw shrimps")) {
  410. if (fire.interact("Use")) {
  411. new ConditionalSleep(random(3600, 6300)) {
  412. @Override
  413. public boolean condition() throws InterruptedException {
  414. return myPlayer().isAnimating();
  415. }
  416. }.sleep();
  417. }
  418. } else {
  419. if (getInventory().deselectItem()) {
  420. new ConditionalSleep(random(3600, 6300)) {
  421. @Override
  422. public boolean condition() throws InterruptedException {
  423. return !getInventory().isItemSelected();
  424. }
  425. }.sleep();
  426. }
  427. }
  428. } else {
  429. if (getInventory().interact("Use", "Raw shrimps")) {
  430. new ConditionalSleep(random(3600, 6300)) {
  431. @Override
  432. public boolean condition() throws InterruptedException {
  433. return getInventory().isItemSelected();
  434. }
  435. }.sleep();
  436. }
  437. }
  438. }
  439. }
  440. } else {
  441. NPC fish = getNpcs().getAll().stream().filter(o -> o.getName().equals("Fishing spot") && o.hasAction("Net")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  442. if (getInventory().contains("Small fishing net")) {
  443. if (fish != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  444. if (fish.interact("Net")) {
  445. new ConditionalSleep(random(3600, 6300)) {
  446. @Override
  447. public boolean condition() throws InterruptedException {
  448. return myPlayer().isAnimating();
  449. }
  450. }.sleep();
  451. }
  452. }
  453. } else {
  454. NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  455. if (expert != null && !myPlayer().isMoving()) {
  456. if (expert.interact("Talk-to")) {
  457. new ConditionalSleep(random(3600, 6300)) {
  458. @Override
  459. public boolean condition() throws InterruptedException {
  460. return inDialogue();
  461. }
  462. }.sleep();
  463. }
  464. }
  465. }
  466. }
  467. } else {
  468. if (getTabs().open(Tab.INVENTORY)) {
  469. new ConditionalSleep(random(3600, 6300)) {
  470. @Override
  471. public boolean condition() throws InterruptedException {
  472. return getTabs().getOpen() == Tab.INVENTORY;
  473. }
  474. }.sleep();
  475. }
  476. }
  477. } else {
  478. if (getConfigs().get(281) == 110) {
  479. if (getTabs().getOpen() == Tab.INVENTORY) {
  480. if (getInventory().contains("Raw shrimps") && getInventory().getAmount("Raw shrimps") >= 1) {
  481. RS2Object fire = getObjects().getAll().stream().filter(o -> o.getName().equals("Fire")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  482. if (fire == null) {
  483. if (getInventory().contains("Logs")) {
  484. if (getInventory().contains("Tinderbox")) {
  485. if (!myPlayer().isMoving() && !myPlayer().isAnimating()) {
  486. if (getInventory().isItemSelected()) {
  487. if (getInventory().getSelectedItemName().equals("Logs")) {
  488. if (getInventory().interact("Use", "Tinderbox")) {
  489. new ConditionalSleep(random(3600, 6300)) {
  490. @Override
  491. public boolean condition() throws InterruptedException {
  492. return myPlayer().isAnimating();
  493. }
  494. }.sleep();
  495. }
  496. } else {
  497. if (getInventory().deselectItem()) {
  498. new ConditionalSleep(random(3600, 6300)) {
  499. @Override
  500. public boolean condition() throws InterruptedException {
  501. return !getInventory().isItemSelected();
  502. }
  503. }.sleep();
  504. }
  505. }
  506. } else {
  507. if (getInventory().interact("Use", "Logs")) {
  508. new ConditionalSleep(random(3600, 6300)) {
  509. @Override
  510. public boolean condition() throws InterruptedException {
  511. return getInventory().isItemSelected();
  512. }
  513. }.sleep();
  514. }
  515. }
  516. }
  517. } else {
  518. NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  519. if (expert != null && !myPlayer().isMoving()) {
  520. if (expert.interact("Talk-to")) {
  521. new ConditionalSleep(random(3600, 6300)) {
  522. @Override
  523. public boolean condition() throws InterruptedException {
  524. return inDialogue();
  525. }
  526. }.sleep();
  527. }
  528. }
  529. }
  530. } else {
  531. if (getInventory().contains("Bronze axe")) {
  532. RS2Object tree = getObjects().getAll().stream().filter(o -> o.getName().equals("Tree") && o.hasAction("Chop down")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  533. if (tree != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  534. if (tree.interact("Chop down")) {
  535. new ConditionalSleep(random(3600, 6300)) {
  536. @Override
  537. public boolean condition() throws InterruptedException {
  538. return myPlayer().isAnimating();
  539. }
  540. }.sleep();
  541. }
  542. }
  543. } else {
  544. NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  545. if (expert != null && !myPlayer().isMoving()) {
  546. if (expert.interact("Talk-to")) {
  547. new ConditionalSleep(random(3600, 6300)) {
  548. @Override
  549. public boolean condition() throws InterruptedException {
  550. return inDialogue();
  551. }
  552. }.sleep();
  553. }
  554. }
  555. }
  556. }
  557. } else {
  558. if (!myPlayer().isMoving() && !myPlayer().isAnimating()) {
  559. if (getInventory().isItemSelected()) {
  560. if (fire != null && getInventory().getSelectedItemName().equals("Raw shrimps")) {
  561. if (fire.interact("Use")) {
  562. new ConditionalSleep(random(3600, 6300)) {
  563. @Override
  564. public boolean condition() throws InterruptedException {
  565. return myPlayer().isAnimating();
  566. }
  567. }.sleep();
  568. }
  569. } else {
  570. if (getInventory().deselectItem()) {
  571. new ConditionalSleep(random(3600, 6300)) {
  572. @Override
  573. public boolean condition() throws InterruptedException {
  574. return !getInventory().isItemSelected();
  575. }
  576. }.sleep();
  577. }
  578. }
  579. } else {
  580. if (getInventory().interact("Use", "Raw shrimps")) {
  581. new ConditionalSleep(random(3600, 6300)) {
  582. @Override
  583. public boolean condition() throws InterruptedException {
  584. return getInventory().isItemSelected();
  585. }
  586. }.sleep();
  587. }
  588. }
  589. }
  590. }
  591. } else {
  592. NPC fish = getNpcs().getAll().stream().filter(o -> o.getName().equals("Fishing spot") && o.hasAction("Net")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  593. if (getInventory().contains("Small fishing net")) {
  594. if (fish != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  595. if (fish.interact("Net")) {
  596. new ConditionalSleep(random(3600, 6300)) {
  597. @Override
  598. public boolean condition() throws InterruptedException {
  599. return myPlayer().isAnimating();
  600. }
  601. }.sleep();
  602. }
  603. }
  604. } else {
  605. NPC expert = getNpcs().getAll().stream().filter(o -> o.getName().equals("Survival Expert") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  606. if (expert != null && !myPlayer().isMoving()) {
  607. if (expert.interact("Talk-to")) {
  608. new ConditionalSleep(random(3600, 6300)) {
  609. @Override
  610. public boolean condition() throws InterruptedException {
  611. return inDialogue();
  612. }
  613. }.sleep();
  614. }
  615. }
  616. }
  617. }
  618. } else {
  619. if (getTabs().open(Tab.INVENTORY)) {
  620. new ConditionalSleep(random(3600, 6300)) {
  621. @Override
  622. public boolean condition() throws InterruptedException {
  623. return getTabs().getOpen() == Tab.INVENTORY;
  624. }
  625. }.sleep();
  626. }
  627. }
  628. } else {
  629. if (getConfigs().get(281) == 120) {
  630. if (getTabs().getOpen() == Tab.INVENTORY) {
  631. RS2Object gate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3089 && (o.getPosition().getY() == 3091 || o.getPosition().getY() == 3092)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  632. if (gate != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  633. if (gate.interact("Open")) {
  634. new ConditionalSleep(random(3600, 6300)) {
  635. @Override
  636. public boolean condition() throws InterruptedException {
  637. return myPlayer().isMoving();
  638. }
  639. }.sleep();
  640. }
  641. }
  642. } else {
  643. if (getTabs().open(Tab.INVENTORY)) {
  644. new ConditionalSleep(random(3600, 6300)) {
  645. @Override
  646. public boolean condition() throws InterruptedException {
  647. return getTabs().getOpen() == Tab.INVENTORY;
  648. }
  649. }.sleep();
  650. }
  651. }
  652. } else {
  653. if (getConfigs().get(281) == 130) {
  654. if (getTabs().getOpen() == Tab.INVENTORY) {
  655. RS2Object chefDoor_0 = getObjects().getAll().stream().filter(o -> o.getName().equals("Door") && o.hasAction("Open") && o.getPosition().getX() == 3079 && o.getPosition().getY() == 3084).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  656. if (chefDoor_0 != null && !myPlayer().isMoving()) {
  657. if (chefDoor_0.interact("Open")) {
  658. new ConditionalSleep(random(3600, 6300)) {
  659. @Override
  660. public boolean condition() throws InterruptedException {
  661. return myPlayer().isMoving();
  662. }
  663. }.sleep();
  664. }
  665. }
  666. } else {
  667. if (getTabs().open(Tab.INVENTORY)) {
  668. new ConditionalSleep(random(3600, 6300)) {
  669. @Override
  670. public boolean condition() throws InterruptedException {
  671. return getTabs().getOpen() == Tab.INVENTORY;
  672. }
  673. }.sleep();
  674. }
  675. }
  676. } else {
  677. if (getConfigs().get(281) == 140) {
  678. if (getTabs().getOpen() == Tab.INVENTORY) {
  679. NPC chef = getNpcs().getAll().stream().filter(o -> o.getName().equals("Master Chef") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  680. if (chef != null && !myPlayer().isMoving()) {
  681. if (chef.interact("Talk-to")) {
  682. new ConditionalSleep(random(3600, 6300)) {
  683. @Override
  684. public boolean condition() throws InterruptedException {
  685. return inDialogue();
  686. }
  687. }.sleep();
  688. }
  689. }
  690. } else {
  691. if (getTabs().open(Tab.INVENTORY)) {
  692. new ConditionalSleep(random(3600, 6300)) {
  693. @Override
  694. public boolean condition() throws InterruptedException {
  695. return getTabs().getOpen() == Tab.INVENTORY;
  696. }
  697. }.sleep();
  698. }
  699. }
  700. } else {
  701. if (getConfigs().get(281) == 150) {
  702. if (getTabs().getOpen() == Tab.INVENTORY) {
  703. if (getInventory().contains("Pot of flour") && getInventory().contains("Bucket of water")) {
  704. if (!myPlayer().isMoving() && !myPlayer().isAnimating()) {
  705. if (getInventory().isItemSelected()) {
  706. if (getInventory().getSelectedItemName().equals("Pot of flour")) {
  707. if (getInventory().interact("Use", "Bucket of water")) {
  708. new ConditionalSleep(random(3600, 6300)) {
  709. @Override
  710. public boolean condition() throws InterruptedException {
  711. return getInventory().contains("Bread dough");
  712. }
  713. }.sleep();
  714. }
  715. } else {
  716. if (getInventory().deselectItem()) {
  717. new ConditionalSleep(random(3600, 6300)) {
  718. @Override
  719. public boolean condition() throws InterruptedException {
  720. return !getInventory().isItemSelected();
  721. }
  722. }.sleep();
  723. }
  724. }
  725. } else {
  726. if (getInventory().interact("Use", "Pot of flour")) {
  727. new ConditionalSleep(random(3600, 6300)) {
  728. @Override
  729. public boolean condition() throws InterruptedException {
  730. return getInventory().isItemSelected();
  731. }
  732. }.sleep();
  733. }
  734. }
  735. }
  736. } else {
  737. NPC chef = getNpcs().getAll().stream().filter(o -> o.getName().equals("Master Chef") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  738. if (chef != null && !myPlayer().isMoving()) {
  739. if (chef.interact("Talk-to")) {
  740. new ConditionalSleep(random(3600, 6300)) {
  741. @Override
  742. public boolean condition() throws InterruptedException {
  743. return inDialogue();
  744. }
  745. }.sleep();
  746. }
  747. }
  748. }
  749. } else {
  750. if (getTabs().open(Tab.INVENTORY)) {
  751. new ConditionalSleep(random(3600, 6300)) {
  752. @Override
  753. public boolean condition() throws InterruptedException {
  754. return getTabs().getOpen() == Tab.INVENTORY;
  755. }
  756. }.sleep();
  757. }
  758. }
  759. } else {
  760. if (getConfigs().get(281) == 160) {
  761. if (getTabs().getOpen() == Tab.INVENTORY) {
  762. if (getInventory().contains("Bread dough")) {
  763. RS2Object range = getObjects().getAll().stream().filter(o -> o.getName().equals("Range") && o.hasAction("Use")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  764. if (range != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  765. if (getInventory().isItemSelected()) {
  766. if (getInventory().getSelectedItemName().equals("Bread dough")) {
  767. if (range.interact("Use")) {
  768. new ConditionalSleep(random(3600, 6300)) {
  769. @Override
  770. public boolean condition() throws InterruptedException {
  771. return myPlayer().isAnimating();
  772. }
  773. }.sleep();
  774. }
  775. } else {
  776. if (getInventory().deselectItem()) {
  777. new ConditionalSleep(random(3600, 6300)) {
  778. @Override
  779. public boolean condition() throws InterruptedException {
  780. return !getInventory().isItemSelected();
  781. }
  782. }.sleep();
  783. }
  784. }
  785. } else {
  786. if (getInventory().interact("Use", "Bread dough")) {
  787. new ConditionalSleep(random(3600, 6300)) {
  788. @Override
  789. public boolean condition() throws InterruptedException {
  790. return getInventory().isItemSelected();
  791. }
  792. }.sleep();
  793. }
  794. }
  795. }
  796. } else {
  797. if (getInventory().contains("Pot of flour") && getInventory().contains("Bucket of water")) {
  798. if (!myPlayer().isMoving() && !myPlayer().isAnimating()) {
  799. if (getInventory().isItemSelected()) {
  800. if (getInventory().getSelectedItemName().equals("Pot of flour")) {
  801. if (getInventory().interact("Use", "Bucket of water")) {
  802. new ConditionalSleep(random(3600, 6300)) {
  803. @Override
  804. public boolean condition() throws InterruptedException {
  805. return getInventory().contains("Bread dough");
  806. }
  807. }.sleep();
  808. }
  809. } else {
  810. if (getInventory().deselectItem()) {
  811. new ConditionalSleep(random(3600, 6300)) {
  812. @Override
  813. public boolean condition() throws InterruptedException {
  814. return !getInventory().isItemSelected();
  815. }
  816. }.sleep();
  817. }
  818. }
  819. } else {
  820. if (getInventory().interact("Use", "Pot of flour")) {
  821. new ConditionalSleep(random(3600, 6300)) {
  822. @Override
  823. public boolean condition() throws InterruptedException {
  824. return getInventory().isItemSelected();
  825. }
  826. }.sleep();
  827. }
  828. }
  829. }
  830. } else {
  831. NPC chef = getNpcs().getAll().stream().filter(o -> o.getName().equals("Master Chef") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  832. if (chef != null && !myPlayer().isMoving()) {
  833. if (chef.interact("Talk-to")) {
  834. new ConditionalSleep(random(3600, 6300)) {
  835. @Override
  836. public boolean condition() throws InterruptedException {
  837. return inDialogue();
  838. }
  839. }.sleep();
  840. }
  841. }
  842. }
  843. }
  844. } else {
  845. if (getTabs().open(Tab.INVENTORY)) {
  846. new ConditionalSleep(random(3600, 6300)) {
  847. @Override
  848. public boolean condition() throws InterruptedException {
  849. return getTabs().getOpen() == Tab.INVENTORY;
  850. }
  851. }.sleep();
  852. }
  853. }
  854. } else {
  855. if (getConfigs().get(281) == 170) {
  856. if (getTabs().open(Tab.MUSIC)) {
  857. new ConditionalSleep(random(3600, 6300)) {
  858. @Override
  859. public boolean condition() throws InterruptedException {
  860. return getTabs().getOpen() == Tab.MUSIC;
  861. }
  862. }.sleep();
  863. }
  864. } else {
  865. if (getConfigs().get(281) == 180) {
  866. RS2Object chefDoor_1 = getObjects().getAll().stream().filter(o -> o.getName().equals("Door") && o.hasAction("Open") && o.getPosition().getX() == 3072 && o.getPosition().getY() == 3090).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  867. if (chefDoor_1 != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  868. if (chefDoor_1.interact("Open")) {
  869. new ConditionalSleep(random(3600, 6300)) {
  870. @Override
  871. public boolean condition() throws InterruptedException {
  872. return myPlayer().isMoving();
  873. }
  874. }.sleep();
  875. }
  876. }
  877. } else {
  878. if (getConfigs().get(281) == 183) {
  879. if (getTabs().open(Tab.EMOTES)) {
  880. new ConditionalSleep(random(3600, 6300)) {
  881. @Override
  882. public boolean condition() throws InterruptedException {
  883. return getTabs().getOpen() == Tab.EMOTES;
  884. }
  885. }.sleep();
  886. }
  887. } else {
  888. if (getConfigs().get(281) == 187) {
  889. if (getTabs().getOpen() == Tab.EMOTES) {
  890. if (!myPlayer().isAnimating() && getWidgets().getAll().stream().filter(w -> w.getSpriteIndex1() >= 700 && w.getSpriteIndex1() <= 717 && w.isVisible()).findAny().orElse(null).interact()) {
  891. new ConditionalSleep(random(3600, 6300)) {
  892. @Override
  893. public boolean condition() throws InterruptedException {
  894. return myPlayer().isAnimating();
  895. }
  896. }.sleep();
  897. }
  898. } else {
  899. if (getTabs().open(Tab.EMOTES)) {
  900. new ConditionalSleep(random(3600, 6300)) {
  901. @Override
  902. public boolean condition() throws InterruptedException {
  903. return getTabs().getOpen() == Tab.EMOTES;
  904. }
  905. }.sleep();
  906. }
  907. }
  908. } else {
  909. if (getConfigs().get(281) == 190) {
  910. if (getTabs().open(Tab.SETTINGS)) {
  911. new ConditionalSleep(random(3600, 6300)) {
  912. @Override
  913. public boolean condition() throws InterruptedException {
  914. return getTabs().getOpen() == Tab.SETTINGS;
  915. }
  916. }.sleep();
  917. }
  918. } else {
  919. if (getConfigs().get(281) == 200) {
  920. if (getSettings().setRunning(true)) {
  921. new ConditionalSleep(random(3600, 6300)) {
  922. @Override
  923. public boolean condition() throws InterruptedException {
  924. return getSettings().isRunning();
  925. }
  926. }.sleep();
  927. }
  928. } else {
  929. if (getConfigs().get(281) == 210) {
  930. RS2Object questDoor = getObjects().getAll().stream().filter(o -> o.getName().equals("Door") && o.hasAction("Open") && o.getPosition().getX() == 3086 && o.getPosition().getY() == 3126).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  931. if (questDoor != null && questDoor.getPosition().isOnMiniMap(getBot()) && !myPlayer().isMoving()) {
  932. if (questDoor.interact("Open")) {
  933. new ConditionalSleep(random(3600, 6300)) {
  934. @Override
  935. public boolean condition() throws InterruptedException {
  936. return myPlayer().isMoving();
  937. }
  938. }.sleep();
  939. }
  940. } else {
  941. getWalking().walk(questDoor);
  942. }
  943. } else {
  944. if (getConfigs().get(281) == 220) {
  945. NPC quest = getNpcs().getAll().stream().filter(o -> o.getName().equals("Quest Guide") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  946. if (quest != null && !myPlayer().isMoving()) {
  947. if (quest.interact("Talk-to")) {
  948. new ConditionalSleep(random(3600, 6300)) {
  949. @Override
  950. public boolean condition() throws InterruptedException {
  951. return inDialogue();
  952. }
  953. }.sleep();
  954. }
  955. }
  956. } else {
  957. if (getConfigs().get(281) == 230) {
  958. if (getTabs().open(Tab.QUEST)) {
  959. new ConditionalSleep(random(3600, 6300)) {
  960. @Override
  961. public boolean condition() throws InterruptedException {
  962. return getTabs().getOpen() == Tab.QUEST;
  963. }
  964. }.sleep();
  965. }
  966. } else {
  967. if (getConfigs().get(281) == 240) {
  968. NPC quest = getNpcs().getAll().stream().filter(o -> o.getName().equals("Quest Guide") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  969. if (quest != null && !myPlayer().isMoving()) {
  970. if (quest.interact("Talk-to")) {
  971. new ConditionalSleep(random(3600, 6300)) {
  972. @Override
  973. public boolean condition() throws InterruptedException {
  974. return inDialogue();
  975. }
  976. }.sleep();
  977. }
  978. }
  979. } else {
  980. if (getConfigs().get(281) == 250) {
  981. RS2Object questLadder = getObjects().getAll().stream().filter(o -> o.getName().equals("Ladder") && o.hasAction("Climb-down") && o.getPosition().getX() == 3088 && o.getPosition().getY() == 3119).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  982. if (questLadder != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  983. if (questLadder.interact("Climb-down")) {
  984. new ConditionalSleep(random(3600, 6300)) {
  985. @Override
  986. public boolean condition() throws InterruptedException {
  987. return myPlayer().isAnimating();
  988. }
  989. }.sleep();
  990. }
  991. }
  992. } else {
  993. if (getConfigs().get(281) == 260) {
  994. if (getTabs().getOpen() == Tab.INVENTORY) {
  995. NPC mining = getNpcs().getAll().stream().filter(o -> o.getName().equals("Mining Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  996. if (mining == null) {
  997. RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  998. if (!myPlayer().isMoving()) {
  999. getWalking().walk(tin);
  1000. }
  1001. } else {
  1002. if (!myPlayer().isMoving()) {
  1003. if (mining.interact("Talk-to")) {
  1004. new ConditionalSleep(random(3600, 6300)) {
  1005. @Override
  1006. public boolean condition() throws InterruptedException {
  1007. return inDialogue();
  1008. }
  1009. }.sleep();
  1010. }
  1011. }
  1012. }
  1013. } else {
  1014. if (getTabs().open(Tab.INVENTORY)) {
  1015. new ConditionalSleep(random(3600, 6300)) {
  1016. @Override
  1017. public boolean condition() throws InterruptedException {
  1018. return getTabs().getOpen() == Tab.INVENTORY;
  1019. }
  1020. }.sleep();
  1021. }
  1022. }
  1023. } else {
  1024. if (getConfigs().get(281) == 270) {
  1025. RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1026. if (tin != null && !myPlayer().isMoving()) {
  1027. if (tin.interact("Prospect")) {
  1028. new ConditionalSleep(random(3600, 6300)) {
  1029. @Override
  1030. public boolean condition() throws InterruptedException {
  1031. return getConfigs().get(281) != 270;
  1032. }
  1033. }.sleep();
  1034. }
  1035. }
  1036. } else {
  1037. if (getConfigs().get(281) == 280) {
  1038. RS2Object copper = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10079).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1039. if (copper != null && !myPlayer().isMoving()) {
  1040. if (copper.interact("Prospect")) {
  1041. new ConditionalSleep(random(3600, 6300)) {
  1042. @Override
  1043. public boolean condition() throws InterruptedException {
  1044. return getConfigs().get(281) != 280;
  1045. }
  1046. }.sleep();
  1047. }
  1048. }
  1049. } else {
  1050. if (getConfigs().get(281) == 290) {
  1051. if (getTabs().getOpen() == Tab.INVENTORY) {
  1052. NPC mining = getNpcs().getAll().stream().filter(o -> o.getName().equals("Mining Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  1053. if (mining == null) {
  1054. RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1055. if (!myPlayer().isMoving()) {
  1056. getWalking().walk(tin);
  1057. }
  1058. } else {
  1059. if (!myPlayer().isMoving()) {
  1060. if (mining.interact("Talk-to")) {
  1061. new ConditionalSleep(random(3600, 6300)) {
  1062. @Override
  1063. public boolean condition() throws InterruptedException {
  1064. return inDialogue();
  1065. }
  1066. }.sleep();
  1067. }
  1068. }
  1069. }
  1070. } else {
  1071. if (getTabs().open(Tab.INVENTORY)) {
  1072. new ConditionalSleep(random(3600, 6300)) {
  1073. @Override
  1074. public boolean condition() throws InterruptedException {
  1075. return getTabs().getOpen() == Tab.INVENTORY;
  1076. }
  1077. }.sleep();
  1078. }
  1079. }
  1080. } else {
  1081. if (getConfigs().get(281) == 300) {
  1082. if (getTabs().getOpen() == Tab.INVENTORY) {
  1083. if (getInventory().contains("Bronze pickaxe")) {
  1084. RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1085. if (tin != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  1086. if (tin.interact("Mine")) {
  1087. new ConditionalSleep(random(3600, 6300)) {
  1088. @Override
  1089. public boolean condition() throws InterruptedException {
  1090. return myPlayer().isAnimating();
  1091. }
  1092. }.sleep();
  1093. }
  1094. }
  1095. } else {
  1096. NPC mining = getNpcs().getAll().stream().filter(o -> o.getName().equals("Mining Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  1097. if (mining == null) {
  1098. RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1099. if (!myPlayer().isMoving()) {
  1100. getWalking().walk(tin);
  1101. }
  1102. } else {
  1103. if (!myPlayer().isMoving()) {
  1104. if (mining.interact("Talk-to")) {
  1105. new ConditionalSleep(random(3600, 6300)) {
  1106. @Override
  1107. public boolean condition() throws InterruptedException {
  1108. return inDialogue();
  1109. }
  1110. }.sleep();
  1111. }
  1112. }
  1113. }
  1114. }
  1115. } else {
  1116. if (getTabs().open(Tab.INVENTORY)) {
  1117. new ConditionalSleep(random(3600, 6300)) {
  1118. @Override
  1119. public boolean condition() throws InterruptedException {
  1120. return getTabs().getOpen() == Tab.INVENTORY;
  1121. }
  1122. }.sleep();
  1123. }
  1124. }
  1125. } else {
  1126. if (getConfigs().get(281) == 310) {
  1127. if (getTabs().getOpen() == Tab.INVENTORY) {
  1128. if (getInventory().contains("Bronze pickaxe")) {
  1129. RS2Object copper = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10079).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1130. if (copper != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  1131. if (copper.interact("Mine")) {
  1132. new ConditionalSleep(random(3600, 6300)) {
  1133. @Override
  1134. public boolean condition() throws InterruptedException {
  1135. return myPlayer().isAnimating();
  1136. }
  1137. }.sleep();
  1138. }
  1139. }
  1140. } else {
  1141. NPC mining = getNpcs().getAll().stream().filter(o -> o.getName().equals("Mining Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  1142. if (mining == null) {
  1143. RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1144. if (!myPlayer().isMoving()) {
  1145. getWalking().walk(tin);
  1146. }
  1147. } else {
  1148. if (!myPlayer().isMoving()) {
  1149. if (mining.interact("Talk-to")) {
  1150. new ConditionalSleep(random(3600, 6300)) {
  1151. @Override
  1152. public boolean condition() throws InterruptedException {
  1153. return inDialogue();
  1154. }
  1155. }.sleep();
  1156. }
  1157. }
  1158. }
  1159. }
  1160. } else {
  1161. if (getTabs().open(Tab.INVENTORY)) {
  1162. new ConditionalSleep(random(3600, 6300)) {
  1163. @Override
  1164. public boolean condition() throws InterruptedException {
  1165. return getTabs().getOpen() == Tab.INVENTORY;
  1166. }
  1167. }.sleep();
  1168. }
  1169. }
  1170. } else {
  1171. if (getConfigs().get(281) == 320) {
  1172. if (getTabs().getOpen() == Tab.INVENTORY) {
  1173. if (getInventory().contains("Copper ore") && getInventory().contains("Tin ore")) {
  1174. RS2Object furnace = getObjects().getAll().stream().filter(o -> o.getName().equals("Furnace") && o.hasAction("Use")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1175. if (furnace != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  1176. if (getInventory().isItemSelected()) {
  1177. if (getInventory().getSelectedItemName().equals("Copper ore")) {
  1178. if (furnace.interact("Use")) {
  1179. new ConditionalSleep(random(3600, 6300)) {
  1180. @Override
  1181. public boolean condition() throws InterruptedException {
  1182. return myPlayer().isAnimating();
  1183. }
  1184. }.sleep();
  1185. }
  1186. } else {
  1187. if (getInventory().deselectItem()) {
  1188. new ConditionalSleep(random(3600, 6300)) {
  1189. @Override
  1190. public boolean condition() throws InterruptedException {
  1191. return !getInventory().isItemSelected();
  1192. }
  1193. }.sleep();
  1194. }
  1195. }
  1196. } else {
  1197. if (getInventory().interact("Use", "Copper ore")) {
  1198. new ConditionalSleep(random(3600, 6300)) {
  1199. @Override
  1200. public boolean condition() throws InterruptedException {
  1201. return getInventory().isItemSelected();
  1202. }
  1203. }.sleep();
  1204. }
  1205. }
  1206. }
  1207. } else {
  1208. if (getInventory().contains("Bronze pickaxe")) {
  1209. if (getInventory().contains("Copper ore")) {
  1210. if (!getInventory().contains("Tin ore")) {
  1211. RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1212. if (tin != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  1213. if (tin.interact("Mine")) {
  1214. new ConditionalSleep(random(3600, 6300)) {
  1215. @Override
  1216. public boolean condition() throws InterruptedException {
  1217. return myPlayer().isAnimating();
  1218. }
  1219. }.sleep();
  1220. }
  1221. }
  1222. }
  1223. } else {
  1224. RS2Object copper = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10079).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1225. if (copper != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  1226. if (copper.interact("Mine")) {
  1227. new ConditionalSleep(random(3600, 6300)) {
  1228. @Override
  1229. public boolean condition() throws InterruptedException {
  1230. return myPlayer().isAnimating();
  1231. }
  1232. }.sleep();
  1233. }
  1234. }
  1235. }
  1236. } else {
  1237. NPC mining = getNpcs().getAll().stream().filter(o -> o.getName().equals("Mining Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  1238. if (mining == null) {
  1239. RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1240. if (!myPlayer().isMoving()) {
  1241. getWalking().walk(tin);
  1242. }
  1243. } else {
  1244. if (!myPlayer().isMoving()) {
  1245. if (mining.interact("Talk-to")) {
  1246. new ConditionalSleep(random(3600, 6300)) {
  1247. @Override
  1248. public boolean condition() throws InterruptedException {
  1249. return inDialogue();
  1250. }
  1251. }.sleep();
  1252. }
  1253. }
  1254. }
  1255. }
  1256. }
  1257. } else {
  1258. if (getTabs().open(Tab.INVENTORY)) {
  1259. new ConditionalSleep(random(3600, 6300)) {
  1260. @Override
  1261. public boolean condition() throws InterruptedException {
  1262. return getTabs().getOpen() == Tab.INVENTORY;
  1263. }
  1264. }.sleep();
  1265. }
  1266. }
  1267. } else {
  1268. if (getConfigs().get(281) == 330) {
  1269. NPC mining = getNpcs().getAll().stream().filter(o -> o.getName().equals("Mining Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  1270. if (mining == null) {
  1271. RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1272. if (!myPlayer().isMoving()) {
  1273. getWalking().walk(tin);
  1274. }
  1275. } else {
  1276. if (!myPlayer().isMoving()) {
  1277. if (mining.interact("Talk-to")) {
  1278. new ConditionalSleep(random(3600, 6300)) {
  1279. @Override
  1280. public boolean condition() throws InterruptedException {
  1281. return inDialogue();
  1282. }
  1283. }.sleep();
  1284. }
  1285. }
  1286. }
  1287. } else {
  1288. if (getConfigs().get(281) == 340) {
  1289. if (getTabs().getOpen() == Tab.INVENTORY) {
  1290. if (getInventory().contains("Hammer") && getInventory().contains("Bronze bar")) {
  1291. RS2Object anvil = getObjects().getAll().stream().filter(o -> o.getName().equals("Anvil") && o.hasAction("Smith")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1292. if (anvil != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  1293. if (anvil.interact("Smith")) {
  1294. new ConditionalSleep(random(3600, 6300)) {
  1295. @Override
  1296. public boolean condition() throws InterruptedException {
  1297. RS2Widget smith = getWidgets().get(312, 2);
  1298. return smith != null && smith.isVisible();
  1299. }
  1300. }.sleep();
  1301. }
  1302. }
  1303. } else {
  1304. if (getInventory().contains("Hammer")) {
  1305. if (!getInventory().contains("Bronze bar")) {
  1306. if (getInventory().contains("Copper ore") && getInventory().contains("Tin ore")) {
  1307. RS2Object furnace = getObjects().getAll().stream().filter(o -> o.getName().equals("Furnace") && o.hasAction("Use")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1308. if (furnace != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  1309. if (getInventory().isItemSelected()) {
  1310. if (getInventory().getSelectedItemName().equals("Copper ore")) {
  1311. if (furnace.interact("Use")) {
  1312. new ConditionalSleep(random(3600, 6300)) {
  1313. @Override
  1314. public boolean condition() throws InterruptedException {
  1315. return myPlayer().isAnimating();
  1316. }
  1317. }.sleep();
  1318. }
  1319. } else {
  1320. if (getInventory().deselectItem()) {
  1321. new ConditionalSleep(random(3600, 6300)) {
  1322. @Override
  1323. public boolean condition() throws InterruptedException {
  1324. return !getInventory().isItemSelected();
  1325. }
  1326. }.sleep();
  1327. }
  1328. }
  1329. } else {
  1330. if (getInventory().interact("Use", "Copper ore")) {
  1331. new ConditionalSleep(random(3600, 6300)) {
  1332. @Override
  1333. public boolean condition() throws InterruptedException {
  1334. return getInventory().isItemSelected();
  1335. }
  1336. }.sleep();
  1337. }
  1338. }
  1339. }
  1340. } else {
  1341. if (getInventory().contains("Bronze pickaxe")) {
  1342. if (getInventory().contains("Copper ore")) {
  1343. if (!getInventory().contains("Tin ore")) {
  1344. RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1345. if (tin != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  1346. if (tin.interact("Mine")) {
  1347. new ConditionalSleep(random(3600, 6300)) {
  1348. @Override
  1349. public boolean condition() throws InterruptedException {
  1350. return myPlayer().isAnimating();
  1351. }
  1352. }.sleep();
  1353. }
  1354. }
  1355. }
  1356. } else {
  1357. RS2Object copper = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10079).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1358. if (copper != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  1359. if (copper.interact("Mine")) {
  1360. new ConditionalSleep(random(3600, 6300)) {
  1361. @Override
  1362. public boolean condition() throws InterruptedException {
  1363. return myPlayer().isAnimating();
  1364. }
  1365. }.sleep();
  1366. }
  1367. }
  1368. }
  1369. } else {
  1370. NPC mining = getNpcs().getAll().stream().filter(o -> o.getName().equals("Mining Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  1371. if (mining == null) {
  1372. RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1373. if (!myPlayer().isMoving()) {
  1374. getWalking().walk(tin);
  1375. }
  1376. } else {
  1377. if (!myPlayer().isMoving()) {
  1378. if (mining.interact("Talk-to")) {
  1379. new ConditionalSleep(random(3600, 6300)) {
  1380. @Override
  1381. public boolean condition() throws InterruptedException {
  1382. return inDialogue();
  1383. }
  1384. }.sleep();
  1385. }
  1386. }
  1387. }
  1388. }
  1389. }
  1390. }
  1391. } else {
  1392. NPC mining = getNpcs().getAll().stream().filter(o -> o.getName().equals("Mining Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  1393. if (mining == null) {
  1394. RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1395. if (!myPlayer().isMoving()) {
  1396. getWalking().walk(tin);
  1397. }
  1398. } else {
  1399. if (!myPlayer().isMoving()) {
  1400. if (mining.interact("Talk-to")) {
  1401. new ConditionalSleep(random(3600, 6300)) {
  1402. @Override
  1403. public boolean condition() throws InterruptedException {
  1404. return inDialogue();
  1405. }
  1406. }.sleep();
  1407. }
  1408. }
  1409. }
  1410. }
  1411. }
  1412. } else {
  1413. if (getTabs().open(Tab.INVENTORY)) {
  1414. new ConditionalSleep(random(3600, 6300)) {
  1415. @Override
  1416. public boolean condition() throws InterruptedException {
  1417. return getTabs().getOpen() == Tab.INVENTORY;
  1418. }
  1419. }.sleep();
  1420. }
  1421. }
  1422. } else {
  1423. if (getConfigs().get(281) == 350) {
  1424. if (getTabs().getOpen() == Tab.INVENTORY) {
  1425. if (getInventory().contains("Hammer") && getInventory().contains("Bronze bar")) {
  1426. RS2Widget smith = getWidgets().get(312, 2);
  1427. if (smith != null && smith.isVisible()) {
  1428. if (smith.interact()) {
  1429. new ConditionalSleep(random(3600, 6300)) {
  1430. @Override
  1431. public boolean condition() throws InterruptedException {
  1432. return myPlayer().isAnimating();
  1433. }
  1434. }.sleep();
  1435. }
  1436. } else {
  1437. RS2Object anvil = getObjects().getAll().stream().filter(o -> o.getName().equals("Anvil") && o.hasAction("Smith")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1438. if (anvil != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  1439. if (anvil.interact("Smith")) {
  1440. new ConditionalSleep(random(3600, 6300)) {
  1441. @Override
  1442. public boolean condition() throws InterruptedException {
  1443. RS2Widget smith = getWidgets().get(312, 2);
  1444. return smith != null && smith.isVisible();
  1445. }
  1446. }.sleep();
  1447. }
  1448. }
  1449. }
  1450. } else {
  1451. if (getInventory().contains("Hammer")) {
  1452. if (!getInventory().contains("Bronze bar")) {
  1453. if (getInventory().contains("Copper ore") && getInventory().contains("Tin ore")) {
  1454. RS2Object furnace = getObjects().getAll().stream().filter(o -> o.getName().equals("Furnace") && o.hasAction("Use")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1455. if (furnace != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  1456. if (getInventory().isItemSelected()) {
  1457. if (getInventory().getSelectedItemName().equals("Copper ore")) {
  1458. if (furnace.interact("Use")) {
  1459. new ConditionalSleep(random(3600, 6300)) {
  1460. @Override
  1461. public boolean condition() throws InterruptedException {
  1462. return myPlayer().isAnimating();
  1463. }
  1464. }.sleep();
  1465. }
  1466. } else {
  1467. if (getInventory().deselectItem()) {
  1468. new ConditionalSleep(random(3600, 6300)) {
  1469. @Override
  1470. public boolean condition() throws InterruptedException {
  1471. return !getInventory().isItemSelected();
  1472. }
  1473. }.sleep();
  1474. }
  1475. }
  1476. } else {
  1477. if (getInventory().interact("Use", "Copper ore")) {
  1478. new ConditionalSleep(random(3600, 6300)) {
  1479. @Override
  1480. public boolean condition() throws InterruptedException {
  1481. return getInventory().isItemSelected();
  1482. }
  1483. }.sleep();
  1484. }
  1485. }
  1486. }
  1487. } else {
  1488. if (getInventory().contains("Bronze pickaxe")) {
  1489. if (getInventory().contains("Copper ore")) {
  1490. if (!getInventory().contains("Tin ore")) {
  1491. RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1492. if (tin != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  1493. if (tin.interact("Mine")) {
  1494. new ConditionalSleep(random(3600, 6300)) {
  1495. @Override
  1496. public boolean condition() throws InterruptedException {
  1497. return myPlayer().isAnimating();
  1498. }
  1499. }.sleep();
  1500. }
  1501. }
  1502. }
  1503. } else {
  1504. RS2Object copper = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10079).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1505. if (copper != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  1506. if (copper.interact("Mine")) {
  1507. new ConditionalSleep(random(3600, 6300)) {
  1508. @Override
  1509. public boolean condition() throws InterruptedException {
  1510. return myPlayer().isAnimating();
  1511. }
  1512. }.sleep();
  1513. }
  1514. }
  1515. }
  1516. } else {
  1517. NPC mining = getNpcs().getAll().stream().filter(o -> o.getName().equals("Mining Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  1518. if (mining == null) {
  1519. RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1520. if (!myPlayer().isMoving()) {
  1521. getWalking().walk(tin);
  1522. }
  1523. } else {
  1524. if (!myPlayer().isMoving()) {
  1525. if (mining.interact("Talk-to")) {
  1526. new ConditionalSleep(random(3600, 6300)) {
  1527. @Override
  1528. public boolean condition() throws InterruptedException {
  1529. return inDialogue();
  1530. }
  1531. }.sleep();
  1532. }
  1533. }
  1534. }
  1535. }
  1536. }
  1537. }
  1538. } else {
  1539. NPC mining = getNpcs().getAll().stream().filter(o -> o.getName().equals("Mining Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  1540. if (mining == null) {
  1541. RS2Object tin = getObjects().getAll().stream().filter(o -> o.getName().equals("Rocks") && o.hasAction("Mine") && o.getId() == 10080).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1542. if (!myPlayer().isMoving()) {
  1543. getWalking().walk(tin);
  1544. }
  1545. } else {
  1546. if (!myPlayer().isMoving()) {
  1547. if (mining.interact("Talk-to")) {
  1548. new ConditionalSleep(random(3600, 6300)) {
  1549. @Override
  1550. public boolean condition() throws InterruptedException {
  1551. return inDialogue();
  1552. }
  1553. }.sleep();
  1554. }
  1555. }
  1556. }
  1557. }
  1558. }
  1559. } else {
  1560. if (getTabs().open(Tab.INVENTORY)) {
  1561. new ConditionalSleep(random(3600, 6300)) {
  1562. @Override
  1563. public boolean condition() throws InterruptedException {
  1564. return getTabs().getOpen() == Tab.INVENTORY;
  1565. }
  1566. }.sleep();
  1567. }
  1568. }
  1569. } else {
  1570. if (getConfigs().get(281) == 360) {
  1571. RS2Object miningGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3094 && (o.getPosition().getY() == 9503 || o.getPosition().getY() == 9502)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1572. if (miningGate != null && miningGate.getPosition().isOnMiniMap(getBot())) {
  1573. if (!myPlayer().isMoving()) {
  1574. if (miningGate.interact("Open")) {
  1575. new ConditionalSleep(random(3600, 6300)) {
  1576. @Override
  1577. public boolean condition() throws InterruptedException {
  1578. return myPlayer().isMoving();
  1579. }
  1580. }.sleep();
  1581. }
  1582. }
  1583. } else {
  1584. getWalking().walk(miningGate);
  1585. }
  1586. } else {
  1587. if (getConfigs().get(281) == 370) {
  1588. if (getTabs().getOpen() == Tab.INVENTORY) {
  1589. NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  1590. if (combat != null && !myPlayer().isMoving()) {
  1591. if (combat.interact("Talk-to")) {
  1592. new ConditionalSleep(random(3600, 6300)) {
  1593. @Override
  1594. public boolean condition() throws InterruptedException {
  1595. return inDialogue();
  1596. }
  1597. }.sleep();
  1598. }
  1599. }
  1600. } else {
  1601. if (getTabs().open(Tab.INVENTORY)) {
  1602. new ConditionalSleep(random(3600, 6300)) {
  1603. @Override
  1604. public boolean condition() throws InterruptedException {
  1605. return getTabs().getOpen() == Tab.INVENTORY;
  1606. }
  1607. }.sleep();
  1608. }
  1609. }
  1610. } else {
  1611. if (getConfigs().get(281) == 390) {
  1612. if (getTabs().open(Tab.EQUIPMENT)) {
  1613. new ConditionalSleep(random(3600, 6300)) {
  1614. @Override
  1615. public boolean condition() throws InterruptedException {
  1616. return getTabs().getOpen() == Tab.EQUIPMENT;
  1617. }
  1618. }.sleep();
  1619. }
  1620. } else {
  1621. if (getConfigs().get(281) == 400) {
  1622. RS2Widget equipmentScreen = getWidgets().get(84, 1);
  1623. if (equipmentScreen != null && equipmentScreen.isVisible()) {
  1624.  
  1625. } else {
  1626. if (getTabs().getOpen() == Tab.EQUIPMENT) {
  1627. RS2Widget equipmentButton = getWidgets().get(387, 17, 7);
  1628. if (equipmentButton != null && equipmentButton.isVisible()) {
  1629. if (equipmentButton.interact()) {
  1630. new ConditionalSleep(random(3600, 6300)) {
  1631. @Override
  1632. public boolean condition() throws InterruptedException {
  1633. RS2Widget equipmentScreen = getWidgets().get(84, 1);
  1634. return equipmentScreen != null && equipmentScreen.isVisible();
  1635. }
  1636. }.sleep();
  1637. }
  1638. }
  1639. } else {
  1640. if (getTabs().open(Tab.EQUIPMENT)) {
  1641. new ConditionalSleep(random(3600, 6300)) {
  1642. @Override
  1643. public boolean condition() throws InterruptedException {
  1644. return getTabs().getOpen() == Tab.EQUIPMENT;
  1645. }
  1646. }.sleep();
  1647. }
  1648. }
  1649. }
  1650. } else {
  1651. if (getConfigs().get(281) == 405) {
  1652. if (getInventory().contains("Bronze dagger")) {
  1653. if (getEquipment().equip(EquipmentSlot.WEAPON, "Bronze dagger")) {
  1654. new ConditionalSleep(random(3600, 6300)) {
  1655. @Override
  1656. public boolean condition() throws InterruptedException {
  1657. return getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Bronze dagger");
  1658. }
  1659. }.sleep();
  1660. }
  1661. } else {
  1662. RS2Widget equipmentScreen = getWidgets().get(84, 1);
  1663. if (equipmentScreen != null && equipmentScreen.isVisible()) {
  1664. RS2Widget equipmentScreenClose = getWidgets().get(84, 4);
  1665. if (equipmentScreenClose != null && equipmentScreenClose.isVisible()) {
  1666. if (equipmentScreenClose.interact()) {
  1667. new ConditionalSleep(random(3600, 6300)) {
  1668. @Override
  1669. public boolean condition() throws InterruptedException {
  1670. RS2Widget equipmentScreen = getWidgets().get(84, 1);
  1671. return equipmentScreen == null;
  1672. }
  1673. }.sleep();
  1674. }
  1675. }
  1676. } else {
  1677. NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  1678. if (combat != null && !myPlayer().isMoving()) {
  1679. if (combat.interact("Talk-to")) {
  1680. new ConditionalSleep(random(3600, 6300)) {
  1681. @Override
  1682. public boolean condition() throws InterruptedException {
  1683. return inDialogue();
  1684. }
  1685. }.sleep();
  1686. }
  1687. }
  1688. }
  1689. }
  1690. } else {
  1691. if (getConfigs().get(281) == 410) {
  1692. NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  1693. if (combat != null && !myPlayer().isMoving()) {
  1694. if (combat.interact("Talk-to")) {
  1695. new ConditionalSleep(random(3600, 6300)) {
  1696. @Override
  1697. public boolean condition() throws InterruptedException {
  1698. return inDialogue();
  1699. }
  1700. }.sleep();
  1701. }
  1702. }
  1703. } else {
  1704. if (getConfigs().get(281) == 420) {
  1705. if (getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Bronze sword")) {
  1706. if (getEquipment().isWearingItem(EquipmentSlot.SHIELD, "Wooden shield")) {
  1707.  
  1708. } else {
  1709. if (getTabs().getOpen() == Tab.INVENTORY) {
  1710. if (getInventory().contains("Wooden shield")) {
  1711. if (getEquipment().equip(EquipmentSlot.SHIELD, "Wooden shield")) {
  1712. new ConditionalSleep(random(3600, 6300)) {
  1713. @Override
  1714. public boolean condition() throws InterruptedException {
  1715. return getEquipment().isWearingItem(EquipmentSlot.SHIELD, "Wooden shield");
  1716. }
  1717. }.sleep();
  1718. }
  1719. } else {
  1720. NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  1721. if (combat != null && !myPlayer().isMoving()) {
  1722. if (combat.interact("Talk-to")) {
  1723. new ConditionalSleep(random(3600, 6300)) {
  1724. @Override
  1725. public boolean condition() throws InterruptedException {
  1726. return inDialogue();
  1727. }
  1728. }.sleep();
  1729. }
  1730. }
  1731. }
  1732. } else {
  1733. if (getTabs().open(Tab.INVENTORY)) {
  1734. new ConditionalSleep(random(3600, 6300)) {
  1735. @Override
  1736. public boolean condition() throws InterruptedException {
  1737. return getTabs().getOpen() == Tab.INVENTORY;
  1738. }
  1739. }.sleep();
  1740. }
  1741. }
  1742. }
  1743. } else {
  1744. if (getTabs().getOpen() == Tab.INVENTORY) {
  1745. if (getInventory().contains("Bronze sword")) {
  1746. if (getEquipment().equip(EquipmentSlot.WEAPON, "Bronze sword")) {
  1747. new ConditionalSleep(random(3600, 6300)) {
  1748. @Override
  1749. public boolean condition() throws InterruptedException {
  1750. return getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Bronze sword");
  1751. }
  1752. }.sleep();
  1753. }
  1754. } else {
  1755. NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  1756. if (combat != null && !myPlayer().isMoving()) {
  1757. if (combat.interact("Talk-to")) {
  1758. new ConditionalSleep(random(3600, 6300)) {
  1759. @Override
  1760. public boolean condition() throws InterruptedException {
  1761. return inDialogue();
  1762. }
  1763. }.sleep();
  1764. }
  1765. }
  1766. }
  1767. } else {
  1768. if (getTabs().open(Tab.INVENTORY)) {
  1769. new ConditionalSleep(random(3600, 6300)) {
  1770. @Override
  1771. public boolean condition() throws InterruptedException {
  1772. return getTabs().getOpen() == Tab.INVENTORY;
  1773. }
  1774. }.sleep();
  1775. }
  1776. }
  1777. }
  1778. } else {
  1779. if (getConfigs().get(281) == 430) {
  1780. if (getTabs().open(Tab.ATTACK)) {
  1781. new ConditionalSleep(random(3600, 6300)) {
  1782. @Override
  1783. public boolean condition() throws InterruptedException {
  1784. return getTabs().getOpen() == Tab.ATTACK;
  1785. }
  1786. }.sleep();
  1787. }
  1788. } else {
  1789. if (getConfigs().get(281) == 440) {
  1790. if (getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Bronze sword")) {
  1791. if (getEquipment().isWearingItem(EquipmentSlot.SHIELD, "Wooden shield")) {
  1792. NPC rat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Giant rat") && o.hasAction("Attack") && o.getInteracting() == null && o.getHealthPercent() > 0 && o.isAttackable() && !o.isUnderAttack()).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  1793. if (rat == null) {
  1794.  
  1795. } else {
  1796. if (getMap().canReach(rat)) {
  1797.  
  1798. } else {
  1799. RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1800. if (ratGate != null && !myPlayer().isMoving()) {
  1801. if (ratGate.interact("Open")) {
  1802. new ConditionalSleep(random(3600, 6300)) {
  1803. @Override
  1804. public boolean condition() throws InterruptedException {
  1805. return myPlayer().isMoving();
  1806. }
  1807. }.sleep();
  1808. }
  1809. }
  1810. }
  1811. }
  1812. } else {
  1813. if (getTabs().getOpen() == Tab.INVENTORY) {
  1814. if (getInventory().contains("Wooden shield")) {
  1815. if (getEquipment().equip(EquipmentSlot.SHIELD, "Wooden shield")) {
  1816. new ConditionalSleep(random(3600, 6300)) {
  1817. @Override
  1818. public boolean condition() throws InterruptedException {
  1819. return getEquipment().isWearingItem(EquipmentSlot.SHIELD, "Wooden shield");
  1820. }
  1821. }.sleep();
  1822. }
  1823. } else {
  1824. NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  1825. if (combat != null && !myPlayer().isMoving()) {
  1826. if (combat.interact("Talk-to")) {
  1827. new ConditionalSleep(random(3600, 6300)) {
  1828. @Override
  1829. public boolean condition() throws InterruptedException {
  1830. return inDialogue();
  1831. }
  1832. }.sleep();
  1833. }
  1834. }
  1835. }
  1836. } else {
  1837. if (getTabs().open(Tab.INVENTORY)) {
  1838. new ConditionalSleep(random(3600, 6300)) {
  1839. @Override
  1840. public boolean condition() throws InterruptedException {
  1841. return getTabs().getOpen() == Tab.INVENTORY;
  1842. }
  1843. }.sleep();
  1844. }
  1845. }
  1846. }
  1847. } else {
  1848. if (getTabs().getOpen() == Tab.INVENTORY) {
  1849. if (getInventory().contains("Bronze sword")) {
  1850. if (getEquipment().equip(EquipmentSlot.WEAPON, "Bronze sword")) {
  1851. new ConditionalSleep(random(3600, 6300)) {
  1852. @Override
  1853. public boolean condition() throws InterruptedException {
  1854. return getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Bronze sword");
  1855. }
  1856. }.sleep();
  1857. }
  1858. } else {
  1859. NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  1860. if (combat != null && !myPlayer().isMoving()) {
  1861. if (combat.interact("Talk-to")) {
  1862. new ConditionalSleep(random(3600, 6300)) {
  1863. @Override
  1864. public boolean condition() throws InterruptedException {
  1865. return inDialogue();
  1866. }
  1867. }.sleep();
  1868. }
  1869. }
  1870. }
  1871. } else {
  1872. if (getTabs().open(Tab.INVENTORY)) {
  1873. new ConditionalSleep(random(3600, 6300)) {
  1874. @Override
  1875. public boolean condition() throws InterruptedException {
  1876. return getTabs().getOpen() == Tab.INVENTORY;
  1877. }
  1878. }.sleep();
  1879. }
  1880. }
  1881. }
  1882. } else {
  1883. if (getConfigs().get(281) == 450) {
  1884. if (getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Bronze sword")) {
  1885. if (getEquipment().isWearingItem(EquipmentSlot.SHIELD, "Wooden shield")) {
  1886. NPC rat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Giant rat") && o.hasAction("Attack") && o.getInteracting() == null && o.getHealthPercent() > 0 && o.isAttackable() && !o.isUnderAttack()).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  1887. if (rat == null) {
  1888.  
  1889. } else {
  1890. if (getMap().canReach(rat)) {
  1891. if (!myPlayer().isMoving() && !myPlayer().isUnderAttack()) {
  1892. if (rat.interact("Attack")) {
  1893. new ConditionalSleep(random(3600, 6300)) {
  1894. @Override
  1895. public boolean condition() throws InterruptedException {
  1896. return myPlayer().isUnderAttack();
  1897. }
  1898. }.sleep();
  1899. }
  1900. }
  1901. } else {
  1902. RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1903. if (ratGate != null && !myPlayer().isMoving()) {
  1904. if (ratGate.interact("Open")) {
  1905. new ConditionalSleep(random(3600, 6300)) {
  1906. @Override
  1907. public boolean condition() throws InterruptedException {
  1908. return myPlayer().isMoving();
  1909. }
  1910. }.sleep();
  1911. }
  1912. }
  1913. }
  1914. }
  1915. } else {
  1916. if (getTabs().getOpen() == Tab.INVENTORY) {
  1917. if (getInventory().contains("Wooden shield")) {
  1918. if (getEquipment().equip(EquipmentSlot.SHIELD, "Wooden shield")) {
  1919. new ConditionalSleep(random(3600, 6300)) {
  1920. @Override
  1921. public boolean condition() throws InterruptedException {
  1922. return getEquipment().isWearingItem(EquipmentSlot.SHIELD, "Wooden shield");
  1923. }
  1924. }.sleep();
  1925. }
  1926. } else {
  1927. NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  1928. if (combat != null && getMap().canReach(combat) && !myPlayer().isMoving()) {
  1929. if (combat.interact("Talk-to")) {
  1930. new ConditionalSleep(random(3600, 6300)) {
  1931. @Override
  1932. public boolean condition() throws InterruptedException {
  1933. return inDialogue();
  1934. }
  1935. }.sleep();
  1936. }
  1937. } else {
  1938. RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1939. if (ratGate != null && !myPlayer().isMoving()) {
  1940. if (ratGate.interact("Open")) {
  1941. new ConditionalSleep(random(3600, 6300)) {
  1942. @Override
  1943. public boolean condition() throws InterruptedException {
  1944. return myPlayer().isMoving();
  1945. }
  1946. }.sleep();
  1947. }
  1948. }
  1949. }
  1950. }
  1951. } else {
  1952. if (getTabs().open(Tab.INVENTORY)) {
  1953. new ConditionalSleep(random(3600, 6300)) {
  1954. @Override
  1955. public boolean condition() throws InterruptedException {
  1956. return getTabs().getOpen() == Tab.INVENTORY;
  1957. }
  1958. }.sleep();
  1959. }
  1960. }
  1961. }
  1962. } else {
  1963. if (getTabs().getOpen() == Tab.INVENTORY) {
  1964. if (getInventory().contains("Bronze sword")) {
  1965. if (getEquipment().equip(EquipmentSlot.WEAPON, "Bronze sword")) {
  1966. new ConditionalSleep(random(3600, 6300)) {
  1967. @Override
  1968. public boolean condition() throws InterruptedException {
  1969. return getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Bronze sword");
  1970. }
  1971. }.sleep();
  1972. }
  1973. } else {
  1974. NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  1975. if (combat != null && getMap().canReach(combat) && !myPlayer().isMoving()) {
  1976. if (combat.interact("Talk-to")) {
  1977. new ConditionalSleep(random(3600, 6300)) {
  1978. @Override
  1979. public boolean condition() throws InterruptedException {
  1980. return inDialogue();
  1981. }
  1982. }.sleep();
  1983. }
  1984. } else {
  1985. RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  1986. if (ratGate != null && !myPlayer().isMoving()) {
  1987. if (ratGate.interact("Open")) {
  1988. new ConditionalSleep(random(3600, 6300)) {
  1989. @Override
  1990. public boolean condition() throws InterruptedException {
  1991. return myPlayer().isMoving();
  1992. }
  1993. }.sleep();
  1994. }
  1995. }
  1996. }
  1997. }
  1998. } else {
  1999. if (getTabs().open(Tab.INVENTORY)) {
  2000. new ConditionalSleep(random(3600, 6300)) {
  2001. @Override
  2002. public boolean condition() throws InterruptedException {
  2003. return getTabs().getOpen() == Tab.INVENTORY;
  2004. }
  2005. }.sleep();
  2006. }
  2007. }
  2008. }
  2009. } else {
  2010. if (getConfigs().get(281) == 460) {
  2011. if (getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Bronze sword")) {
  2012. if (getEquipment().isWearingItem(EquipmentSlot.SHIELD, "Wooden shield")) {
  2013. NPC rat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Giant rat") && o.hasAction("Attack") && o.getInteracting() == null && o.getHealthPercent() > 0 && o.isAttackable() && !o.isUnderAttack()).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  2014. if (rat == null) {
  2015.  
  2016. } else {
  2017. if (getMap().canReach(rat)) {
  2018. if (!myPlayer().isMoving() && !myPlayer().isUnderAttack()) {
  2019. if (rat.interact("Attack")) {
  2020. new ConditionalSleep(random(3600, 6300)) {
  2021. @Override
  2022. public boolean condition() throws InterruptedException {
  2023. return myPlayer().isUnderAttack();
  2024. }
  2025. }.sleep();
  2026. }
  2027. }
  2028. } else {
  2029. RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2030. if (ratGate != null && !myPlayer().isMoving()) {
  2031. if (ratGate.interact("Open")) {
  2032. new ConditionalSleep(random(3600, 6300)) {
  2033. @Override
  2034. public boolean condition() throws InterruptedException {
  2035. return myPlayer().isMoving();
  2036. }
  2037. }.sleep();
  2038. }
  2039. }
  2040. }
  2041. }
  2042. } else {
  2043. if (getTabs().getOpen() == Tab.INVENTORY) {
  2044. if (getInventory().contains("Wooden shield")) {
  2045. if (getEquipment().equip(EquipmentSlot.SHIELD, "Wooden shield")) {
  2046. new ConditionalSleep(random(3600, 6300)) {
  2047. @Override
  2048. public boolean condition() throws InterruptedException {
  2049. return getEquipment().isWearingItem(EquipmentSlot.SHIELD, "Wooden shield");
  2050. }
  2051. }.sleep();
  2052. }
  2053. } else {
  2054. NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  2055. if (combat != null && getMap().canReach(combat) && !myPlayer().isMoving()) {
  2056. if (combat.interact("Talk-to")) {
  2057. new ConditionalSleep(random(3600, 6300)) {
  2058. @Override
  2059. public boolean condition() throws InterruptedException {
  2060. return inDialogue();
  2061. }
  2062. }.sleep();
  2063. }
  2064. } else {
  2065. RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2066. if (ratGate != null && !myPlayer().isMoving()) {
  2067. if (ratGate.interact("Open")) {
  2068. new ConditionalSleep(random(3600, 6300)) {
  2069. @Override
  2070. public boolean condition() throws InterruptedException {
  2071. return myPlayer().isMoving();
  2072. }
  2073. }.sleep();
  2074. }
  2075. }
  2076. }
  2077. }
  2078. } else {
  2079. if (getTabs().open(Tab.INVENTORY)) {
  2080. new ConditionalSleep(random(3600, 6300)) {
  2081. @Override
  2082. public boolean condition() throws InterruptedException {
  2083. return getTabs().getOpen() == Tab.INVENTORY;
  2084. }
  2085. }.sleep();
  2086. }
  2087. }
  2088. }
  2089. } else {
  2090. if (getTabs().getOpen() == Tab.INVENTORY) {
  2091. if (getInventory().contains("Bronze sword")) {
  2092. if (getEquipment().equip(EquipmentSlot.WEAPON, "Bronze sword")) {
  2093. new ConditionalSleep(random(3600, 6300)) {
  2094. @Override
  2095. public boolean condition() throws InterruptedException {
  2096. return getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Bronze sword");
  2097. }
  2098. }.sleep();
  2099. }
  2100. } else {
  2101. NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  2102. if (combat != null && getMap().canReach(combat) && !myPlayer().isMoving()) {
  2103. if (combat.interact("Talk-to")) {
  2104. new ConditionalSleep(random(3600, 6300)) {
  2105. @Override
  2106. public boolean condition() throws InterruptedException {
  2107. return inDialogue();
  2108. }
  2109. }.sleep();
  2110. }
  2111. } else {
  2112. RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2113. if (ratGate != null && !myPlayer().isMoving()) {
  2114. if (ratGate.interact("Open")) {
  2115. new ConditionalSleep(random(3600, 6300)) {
  2116. @Override
  2117. public boolean condition() throws InterruptedException {
  2118. return myPlayer().isMoving();
  2119. }
  2120. }.sleep();
  2121. }
  2122. }
  2123. }
  2124. }
  2125. } else {
  2126. if (getTabs().open(Tab.INVENTORY)) {
  2127. new ConditionalSleep(random(3600, 6300)) {
  2128. @Override
  2129. public boolean condition() throws InterruptedException {
  2130. return getTabs().getOpen() == Tab.INVENTORY;
  2131. }
  2132. }.sleep();
  2133. }
  2134. }
  2135. }
  2136. } else {
  2137. if (getConfigs().get(281) == 470) {
  2138. NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  2139. if (combat != null && getMap().canReach(combat) && !myPlayer().isMoving()) {
  2140. if (combat.interact("Talk-to")) {
  2141. new ConditionalSleep(random(3600, 6300)) {
  2142. @Override
  2143. public boolean condition() throws InterruptedException {
  2144. return inDialogue();
  2145. }
  2146. }.sleep();
  2147. }
  2148. } else {
  2149. RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2150. if (ratGate != null && !myPlayer().isMoving()) {
  2151. if (ratGate.interact("Open")) {
  2152. new ConditionalSleep(random(3600, 6300)) {
  2153. @Override
  2154. public boolean condition() throws InterruptedException {
  2155. return myPlayer().isMoving();
  2156. }
  2157. }.sleep();
  2158. }
  2159. }
  2160. }
  2161. } else {
  2162. if (getConfigs().get(281) == 480) {
  2163. if (getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Shortbow")) {
  2164. if (getEquipment().isWearingItem(EquipmentSlot.ARROWS, "Bronze arrow")) {
  2165. NPC rat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Giant rat") && o.hasAction("Attack") && o.getInteracting() == null && o.getHealthPercent() > 0 && o.isAttackable() && !o.isUnderAttack()).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  2166. if (rat != null && myPlayer().getInteracting() == null && !myPlayer().isMoving()) {
  2167. if (rat.interact("Attack")) {
  2168. new ConditionalSleep(random(3600, 6300)) {
  2169. @Override
  2170. public boolean condition() throws InterruptedException {
  2171. return myPlayer().isUnderAttack();
  2172. }
  2173. }.sleep();
  2174. }
  2175. }
  2176. } else {
  2177. if (getTabs().getOpen() == Tab.INVENTORY) {
  2178. if (getInventory().contains("Bronze arrow")) {
  2179. if (getEquipment().equip(EquipmentSlot.ARROWS, "Bronze arrow")) {
  2180. new ConditionalSleep(random(3600, 6300)) {
  2181. @Override
  2182. public boolean condition() throws InterruptedException {
  2183. return getEquipment().isWearingItem(EquipmentSlot.ARROWS, "Bronze arrow");
  2184. }
  2185. }.sleep();
  2186. }
  2187. } else {
  2188. NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  2189. if (combat != null && getMap().canReach(combat) && !myPlayer().isMoving()) {
  2190. if (combat.interact("Talk-to")) {
  2191. new ConditionalSleep(random(3600, 6300)) {
  2192. @Override
  2193. public boolean condition() throws InterruptedException {
  2194. return inDialogue();
  2195. }
  2196. }.sleep();
  2197. }
  2198. } else {
  2199. RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2200. if (ratGate != null && !myPlayer().isMoving()) {
  2201. if (ratGate.interact("Open")) {
  2202. new ConditionalSleep(random(3600, 6300)) {
  2203. @Override
  2204. public boolean condition() throws InterruptedException {
  2205. return myPlayer().isMoving();
  2206. }
  2207. }.sleep();
  2208. }
  2209. }
  2210. }
  2211. }
  2212. } else {
  2213. if (getTabs().open(Tab.INVENTORY)) {
  2214. new ConditionalSleep(random(3600, 6300)) {
  2215. @Override
  2216. public boolean condition() throws InterruptedException {
  2217. return getTabs().getOpen() == Tab.INVENTORY;
  2218. }
  2219. }.sleep();
  2220. }
  2221. }
  2222. }
  2223. } else {
  2224. if (getTabs().getOpen() == Tab.INVENTORY) {
  2225. if (getInventory().contains("Shortbow")) {
  2226. if (getEquipment().equip(EquipmentSlot.WEAPON, "Shortbow")) {
  2227. new ConditionalSleep(random(3600, 6300)) {
  2228. @Override
  2229. public boolean condition() throws InterruptedException {
  2230. return getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Shortbow");
  2231. }
  2232. }.sleep();
  2233. }
  2234. } else {
  2235. NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  2236. if (combat != null && getMap().canReach(combat) && !myPlayer().isMoving()) {
  2237. if (combat.interact("Talk-to")) {
  2238. new ConditionalSleep(random(3600, 6300)) {
  2239. @Override
  2240. public boolean condition() throws InterruptedException {
  2241. return inDialogue();
  2242. }
  2243. }.sleep();
  2244. }
  2245. } else {
  2246. RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2247. if (ratGate != null && !myPlayer().isMoving()) {
  2248. if (ratGate.interact("Open")) {
  2249. new ConditionalSleep(random(3600, 6300)) {
  2250. @Override
  2251. public boolean condition() throws InterruptedException {
  2252. return myPlayer().isMoving();
  2253. }
  2254. }.sleep();
  2255. }
  2256. }
  2257. }
  2258. }
  2259. } else {
  2260. if (getTabs().open(Tab.INVENTORY)) {
  2261. new ConditionalSleep(random(3600, 6300)) {
  2262. @Override
  2263. public boolean condition() throws InterruptedException {
  2264. return getTabs().getOpen() == Tab.INVENTORY;
  2265. }
  2266. }.sleep();
  2267. }
  2268. }
  2269. }
  2270. } else {
  2271. if (getConfigs().get(281) == 490) {
  2272. if (getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Shortbow")) {
  2273. if (getEquipment().isWearingItem(EquipmentSlot.ARROWS, "Bronze arrow")) {
  2274. NPC rat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Giant rat") && o.hasAction("Attack") && o.getInteracting() == null && o.getHealthPercent() > 0 && o.isAttackable() && !o.isUnderAttack()).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  2275. if (rat != null && myPlayer().getInteracting() == null && !myPlayer().isMoving()) {
  2276. if (rat.interact("Attack")) {
  2277. new ConditionalSleep(random(3600, 6300)) {
  2278. @Override
  2279. public boolean condition() throws InterruptedException {
  2280. return myPlayer().isUnderAttack();
  2281. }
  2282. }.sleep();
  2283. }
  2284. }
  2285. } else {
  2286. if (getTabs().getOpen() == Tab.INVENTORY) {
  2287. if (getInventory().contains("Bronze arrow")) {
  2288. if (getEquipment().equip(EquipmentSlot.ARROWS, "Bronze arrow")) {
  2289. new ConditionalSleep(random(3600, 6300)) {
  2290. @Override
  2291. public boolean condition() throws InterruptedException {
  2292. return getEquipment().isWearingItem(EquipmentSlot.ARROWS, "Bronze arrow");
  2293. }
  2294. }.sleep();
  2295. }
  2296. } else {
  2297. NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  2298. if (combat != null && getMap().canReach(combat) && !myPlayer().isMoving()) {
  2299. if (combat.interact("Talk-to")) {
  2300. new ConditionalSleep(random(3600, 6300)) {
  2301. @Override
  2302. public boolean condition() throws InterruptedException {
  2303. return inDialogue();
  2304. }
  2305. }.sleep();
  2306. }
  2307. } else {
  2308. RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2309. if (ratGate != null && !myPlayer().isMoving()) {
  2310. if (ratGate.interact("Open")) {
  2311. new ConditionalSleep(random(3600, 6300)) {
  2312. @Override
  2313. public boolean condition() throws InterruptedException {
  2314. return myPlayer().isMoving();
  2315. }
  2316. }.sleep();
  2317. }
  2318. }
  2319. }
  2320. }
  2321. } else {
  2322. if (getTabs().open(Tab.INVENTORY)) {
  2323. new ConditionalSleep(random(3600, 6300)) {
  2324. @Override
  2325. public boolean condition() throws InterruptedException {
  2326. return getTabs().getOpen() == Tab.INVENTORY;
  2327. }
  2328. }.sleep();
  2329. }
  2330. }
  2331. }
  2332. } else {
  2333. if (getTabs().getOpen() == Tab.INVENTORY) {
  2334. if (getInventory().contains("Shortbow")) {
  2335. if (getEquipment().equip(EquipmentSlot.WEAPON, "Shortbow")) {
  2336. new ConditionalSleep(random(3600, 6300)) {
  2337. @Override
  2338. public boolean condition() throws InterruptedException {
  2339. return getEquipment().isWearingItem(EquipmentSlot.WEAPON, "Shortbow");
  2340. }
  2341. }.sleep();
  2342. }
  2343. } else {
  2344. NPC combat = getNpcs().getAll().stream().filter(o -> o.getName().equals("Combat Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  2345. if (combat != null && getMap().canReach(combat) && !myPlayer().isMoving()) {
  2346. if (combat.interact("Talk-to")) {
  2347. new ConditionalSleep(random(3600, 6300)) {
  2348. @Override
  2349. public boolean condition() throws InterruptedException {
  2350. return inDialogue();
  2351. }
  2352. }.sleep();
  2353. }
  2354. } else {
  2355. RS2Object ratGate = getObjects().getAll().stream().filter(o -> o.getName().equals("Gate") && o.hasAction("Open") && o.getPosition().getX() == 3111 && (o.getPosition().getY() == 9518 || o.getPosition().getY() == 9519)).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2356. if (ratGate != null && !myPlayer().isMoving()) {
  2357. if (ratGate.interact("Open")) {
  2358. new ConditionalSleep(random(3600, 6300)) {
  2359. @Override
  2360. public boolean condition() throws InterruptedException {
  2361. return myPlayer().isMoving();
  2362. }
  2363. }.sleep();
  2364. }
  2365. }
  2366. }
  2367. }
  2368. } else {
  2369. if (getTabs().open(Tab.INVENTORY)) {
  2370. new ConditionalSleep(random(3600, 6300)) {
  2371. @Override
  2372. public boolean condition() throws InterruptedException {
  2373. return getTabs().getOpen() == Tab.INVENTORY;
  2374. }
  2375. }.sleep();
  2376. }
  2377. }
  2378. }
  2379. } else {
  2380. if (getConfigs().get(281) == 500) {
  2381. RS2Object ratLadder = getObjects().getAll().stream().filter(o -> o.getName().equals("Ladder") && o.hasAction("Climb-up") && o.getPosition().getX() == 3111 && o.getPosition().getY() == 9526).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2382. if (ratLadder != null && ratLadder.getPosition().isOnMiniMap(getBot()) && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  2383. if (ratLadder.interact("Climb-up")) {
  2384. new ConditionalSleep(random(3600, 6300)) {
  2385. @Override
  2386. public boolean condition() throws InterruptedException {
  2387. return myPlayer().isAnimating();
  2388. }
  2389. }.sleep();
  2390. }
  2391. } else {
  2392. getWalking().walk(ratLadder);
  2393. }
  2394. } else {
  2395. if (getConfigs().get(281) == 510) {
  2396. RS2Object booth = getObjects().getAll().stream().filter(o -> o.getName().equals("Bank booth") && o.hasAction("Use")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2397. if (booth != null && !myPlayer().isMoving()) {
  2398. if (booth.interact("Use")) {
  2399. new ConditionalSleep(random(3600, 6300)) {
  2400. @Override
  2401. public boolean condition() throws InterruptedException {
  2402. return inDialogue();
  2403. }
  2404. }.sleep();
  2405. }
  2406. }
  2407. } else {
  2408. if (getConfigs().get(281) == 520) {
  2409. if (getBank().isOpen()) {
  2410. if (getBank().close()) {
  2411. new ConditionalSleep(random(3600, 6300)) {
  2412. @Override
  2413. public boolean condition() throws InterruptedException {
  2414. return !getBank().isOpen();
  2415. }
  2416. }.sleep();
  2417. }
  2418. } else {
  2419. RS2Object pollBooth = getObjects().getAll().stream().filter(o -> o.getName().equals("Poll booth") && o.hasAction("Use")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2420. if (pollBooth != null && !myPlayer().isMoving()) {
  2421. if (pollBooth.interact("Use")) {
  2422. new ConditionalSleep(random(3600, 6300)) {
  2423. @Override
  2424. public boolean condition() throws InterruptedException {
  2425. return inDialogue();
  2426. }
  2427. }.sleep();
  2428. }
  2429. }
  2430. }
  2431. } else {
  2432. if (getConfigs().get(281) == 525) {
  2433. RS2Widget pollScreen = getWidgets().get(310, 2);
  2434. RS2Widget pollScreenClose = getWidgets().get(310, 2, 11);
  2435. if (pollScreen != null && pollScreen.isVisible()) {
  2436. if (pollScreenClose != null && pollScreenClose.isVisible()) {
  2437. if (pollScreenClose.interact()) {
  2438. new ConditionalSleep(random(3600, 6300)) {
  2439. @Override
  2440. public boolean condition() throws InterruptedException {
  2441. RS2Widget pollScreen = getWidgets().get(310, 2);
  2442. return pollScreen == null;
  2443. }
  2444. }.sleep();
  2445. }
  2446. }
  2447. } else {
  2448. RS2Object financialdoor_0 = getObjects().getAll().stream().filter(o -> o.getName().equals("Door") && o.hasAction("Open") && o.getPosition().getX() == 3125 && o.getPosition().getY() == 3124).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2449. if (financialdoor_0 != null && !myPlayer().isMoving()) {
  2450. if (financialdoor_0.interact("Open")) {
  2451. new ConditionalSleep(random(3600, 6300)) {
  2452. @Override
  2453. public boolean condition() throws InterruptedException {
  2454. return myPlayer().isMoving();
  2455. }
  2456. }.sleep();
  2457. }
  2458. }
  2459. }
  2460. } else {
  2461. if (getConfigs().get(281) == 530) {
  2462. NPC financial = getNpcs().getAll().stream().filter(o -> o.getName().equals("Financial Advisor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  2463. if (financial != null && !myPlayer().isMoving()) {
  2464. if (financial.interact("Talk-to")) {
  2465. new ConditionalSleep(random(3600, 6300)) {
  2466. @Override
  2467. public boolean condition() throws InterruptedException {
  2468. return inDialogue();
  2469. }
  2470. }.sleep();
  2471. }
  2472. }
  2473. } else {
  2474. if (getConfigs().get(281) == 540) {
  2475. RS2Object financialdoor_1 = getObjects().getAll().stream().filter(o -> o.getName().equals("Door") && o.hasAction("Open") && o.getPosition().getX() == 3130 && o.getPosition().getY() == 3124).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2476. if (financialdoor_1 != null && !myPlayer().isMoving()) {
  2477. if (financialdoor_1.interact("Open")) {
  2478. new ConditionalSleep(random(3600, 6300)) {
  2479. @Override
  2480. public boolean condition() throws InterruptedException {
  2481. return myPlayer().isMoving();
  2482. }
  2483. }.sleep();
  2484. }
  2485. }
  2486. } else {
  2487. if (getConfigs().get(281) == 550) {
  2488. NPC monk = getNpcs().getAll().stream().filter(o -> o.getName().equals("Brother Brace") && o.hasAction("Talk-to") && o.getInteracting() == null && o.getHealthPercent() > 0 && o.isAttackable() && !o.isUnderAttack()).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  2489. if (monk == null) {
  2490. RS2Object brotherPlant = getObjects().getAll().stream().filter(o -> o.getName().equals("Plant") && o.getX() == 3131 && o.getPosition().getY() == 3108).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2491. if (brotherPlant != null && !myPlayer().isMoving()) {
  2492. getWalking().walk(brotherPlant);
  2493. }
  2494. } else {
  2495. if (getMap().canReach(monk)) {
  2496. if (!myPlayer().isMoving()) {
  2497. if (monk.interact("Talk-to")) {
  2498. new ConditionalSleep(random(3600, 6300)) {
  2499. @Override
  2500. public boolean condition() throws InterruptedException {
  2501. return inDialogue();
  2502. }
  2503. }.sleep();
  2504. }
  2505. }
  2506. } else {
  2507. RS2Object largeDoor = getObjects().getAll().stream().filter(o -> o.getName().equals("Large door") && o.hasAction("Open")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2508. if (largeDoor != null && !myPlayer().isMoving()) {
  2509. if (largeDoor.interact("Open")) {
  2510. new ConditionalSleep(random(3600, 6300)) {
  2511. @Override
  2512. public boolean condition() throws InterruptedException {
  2513. return getMap().canReach(monk);
  2514. }
  2515. }.sleep();
  2516. }
  2517. }
  2518. }
  2519. }
  2520. } else {
  2521. if (getConfigs().get(281) == 560) {
  2522. if (getTabs().open(Tab.PRAYER)) {
  2523. new ConditionalSleep(random(3600, 6300)) {
  2524. @Override
  2525. public boolean condition() throws InterruptedException {
  2526. return getTabs().getOpen() == Tab.PRAYER;
  2527. }
  2528. }.sleep();
  2529. }
  2530. } else {
  2531. if (getConfigs().get(281) == 570) {
  2532. NPC monk = getNpcs().getAll().stream().filter(o -> o.getName().equals("Brother Brace") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  2533. if (monk == null) {
  2534. RS2Object brotherPlant = getObjects().getAll().stream().filter(o -> o.getName().equals("Plant") && o.getX() == 3131 && o.getPosition().getY() == 3108).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2535. if (brotherPlant != null && !myPlayer().isMoving()) {
  2536. getWalking().walk(brotherPlant);
  2537. }
  2538. } else {
  2539. if (getMap().canReach(monk)) {
  2540. if (!myPlayer().isMoving()) {
  2541. if (monk.interact("Talk-to")) {
  2542. new ConditionalSleep(random(3600, 6300)) {
  2543. @Override
  2544. public boolean condition() throws InterruptedException {
  2545. return inDialogue();
  2546. }
  2547. }.sleep();
  2548. }
  2549. }
  2550. } else {
  2551. RS2Object largeDoor = getObjects().getAll().stream().filter(o -> o.getName().equals("Large door") && o.hasAction("Open")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2552. if (largeDoor != null && !myPlayer().isMoving()) {
  2553. if (largeDoor.interact("Open")) {
  2554. new ConditionalSleep(random(3600, 6300)) {
  2555. @Override
  2556. public boolean condition() throws InterruptedException {
  2557. return getMap().canReach(monk);
  2558. }
  2559. }.sleep();
  2560. }
  2561. }
  2562. }
  2563. }
  2564. } else {
  2565. if (getConfigs().get(281) == 580) {
  2566. if (getTabs().open(Tab.FRIENDS)) {
  2567. new ConditionalSleep(random(3600, 6300)) {
  2568. @Override
  2569. public boolean condition() throws InterruptedException {
  2570. return getTabs().getOpen() == Tab.FRIENDS;
  2571. }
  2572. }.sleep();
  2573. }
  2574. } else {
  2575. if (getConfigs().get(281) == 590) {
  2576. if (getTabs().open(Tab.IGNORES)) {
  2577. new ConditionalSleep(random(3600, 6300)) {
  2578. @Override
  2579. public boolean condition() throws InterruptedException {
  2580. return getTabs().getOpen() == Tab.IGNORES;
  2581. }
  2582. }.sleep();
  2583. }
  2584. } else {
  2585. if (getConfigs().get(281) == 600) {
  2586. NPC monk = getNpcs().getAll().stream().filter(o -> o.getName().equals("Brother Brace") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  2587. if (monk == null) {
  2588. RS2Object brotherPlant = getObjects().getAll().stream().filter(o -> o.getName().equals("Plant") && o.getX() == 3131 && o.getPosition().getY() == 3108).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2589. if (brotherPlant != null && !myPlayer().isMoving()) {
  2590. getWalking().walk(brotherPlant);
  2591. }
  2592. } else {
  2593. if (getMap().canReach(monk)) {
  2594. if (!myPlayer().isMoving()) {
  2595. if (monk.interact("Talk-to")) {
  2596. new ConditionalSleep(random(3600, 6300)) {
  2597. @Override
  2598. public boolean condition() throws InterruptedException {
  2599. return inDialogue();
  2600. }
  2601. }.sleep();
  2602. }
  2603. }
  2604. } else {
  2605. RS2Object largeDoor = getObjects().getAll().stream().filter(o -> o.getName().equals("Large door") && o.hasAction("Open")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2606. if (largeDoor != null && !myPlayer().isMoving()) {
  2607. if (largeDoor.interact("Open")) {
  2608. new ConditionalSleep(random(3600, 6300)) {
  2609. @Override
  2610. public boolean condition() throws InterruptedException {
  2611. return getMap().canReach(monk);
  2612. }
  2613. }.sleep();
  2614. }
  2615. }
  2616. }
  2617. }
  2618. } else {
  2619. if (getConfigs().get(281) == 610) {
  2620. RS2Object brotherDoor = getObjects().getAll().stream().filter(o -> o.getName().equals("Door") && o.hasAction("Open") && o.getPosition().getX() == 3122 && o.getPosition().getY() == 3102).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2621. if (brotherDoor != null && !myPlayer().isMoving()) {
  2622. if (brotherDoor.interact("Open")) {
  2623. new ConditionalSleep(random(3600, 6300)) {
  2624. @Override
  2625. public boolean condition() throws InterruptedException {
  2626. return myPlayer().isMoving();
  2627. }
  2628. }.sleep();
  2629. }
  2630. }
  2631. } else {
  2632. if (getConfigs().get(281) == 620) {
  2633. NPC magic = getNpcs().getAll().stream().filter(o -> o.getName().equals("Magic Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  2634. if (magic == null) {
  2635. RS2Object charms = getObjects().getAll().stream().filter(o -> o.getName().equals("Charms")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2636. if (charms != null && !myPlayer().isMoving()) {
  2637. getWalking().walk(charms);
  2638. }
  2639. } else {
  2640. if (magic.interact("Talk-to")) {
  2641. new ConditionalSleep(random(3600, 6300)) {
  2642. @Override
  2643. public boolean condition() throws InterruptedException {
  2644. return inDialogue();
  2645. }
  2646. }.sleep();
  2647. }
  2648. }
  2649. } else {
  2650. if (getConfigs().get(281) == 630) {
  2651. if (getTabs().open(Tab.MAGIC)) {
  2652. new ConditionalSleep(random(3600, 6300)) {
  2653. @Override
  2654. public boolean condition() throws InterruptedException {
  2655. return getTabs().getOpen() == Tab.MAGIC;
  2656. }
  2657. }.sleep();
  2658. }
  2659. } else {
  2660. if (getConfigs().get(281) == 640) {
  2661. NPC magic = getNpcs().getAll().stream().filter(o -> o.getName().equals("Magic Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  2662. if (magic == null) {
  2663. RS2Object charms = getObjects().getAll().stream().filter(o -> o.getName().equals("Charms")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2664. if (charms != null && !myPlayer().isMoving()) {
  2665. getWalking().walk(charms);
  2666. }
  2667. } else {
  2668. if (magic.interact("Talk-to")) {
  2669. new ConditionalSleep(random(3600, 6300)) {
  2670. @Override
  2671. public boolean condition() throws InterruptedException {
  2672. return inDialogue();
  2673. }
  2674. }.sleep();
  2675. }
  2676. }
  2677. } else {
  2678. if (getConfigs().get(281) == 650) {
  2679. if (getInventory().contains("Air rune")) {
  2680. if (getInventory().contains("Mind rune")) {
  2681. if (myPlayer().getPosition().equals(new Position(3139, 3091, 0))) {
  2682. NPC chicken = getNpcs().getAll().stream().filter(o -> o.getName().equals("Chicken") && o.hasAction("Attack") && o.getInteracting() == null && o.getHealthPercent() > 0 && o.isAttackable() && !o.isUnderAttack()).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  2683. if (chicken != null && !myPlayer().isMoving() && !myPlayer().isAnimating()) {
  2684. if (getMagic().castSpellOnEntity(Spells.NormalSpells.WIND_STRIKE, chicken)) {
  2685. new ConditionalSleep(random(3600, 6300)) {
  2686. @Override
  2687. public boolean condition() throws InterruptedException {
  2688. return myPlayer().isAnimating();
  2689. }
  2690. }.sleep();
  2691. }
  2692. }
  2693. } else {
  2694. if (!myPlayer().isMoving()) {
  2695. if (new Position(3139, 3091, 0).interact(getBot(), "Walk here")) {
  2696. new ConditionalSleep(random(3600, 6300)) {
  2697. @Override
  2698. public boolean condition() throws InterruptedException {
  2699. return myPlayer().isMoving();
  2700. }
  2701. }.sleep();
  2702. }
  2703. }
  2704. }
  2705. } else {
  2706. if (getTabs().getOpen() == Tab.INVENTORY) {
  2707. NPC magic = getNpcs().getAll().stream().filter(o -> o.getName().equals("Magic Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  2708. if (magic == null) {
  2709. RS2Object charms = getObjects().getAll().stream().filter(o -> o.getName().equals("Charms")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2710. if (charms != null && !myPlayer().isMoving()) {
  2711. getWalking().walk(charms);
  2712. }
  2713. } else {
  2714. if (magic.interact("Talk-to")) {
  2715. new ConditionalSleep(random(3600, 6300)) {
  2716. @Override
  2717. public boolean condition() throws InterruptedException {
  2718. return inDialogue();
  2719. }
  2720. }.sleep();
  2721. }
  2722. }
  2723. } else {
  2724. if (getTabs().open(Tab.INVENTORY)) {
  2725. new ConditionalSleep(random(3600, 6300)) {
  2726. @Override
  2727. public boolean condition() throws InterruptedException {
  2728. return getTabs().getOpen() == Tab.INVENTORY;
  2729. }
  2730. }.sleep();
  2731. }
  2732. }
  2733. }
  2734. } else {
  2735. if (getTabs().getOpen() == Tab.INVENTORY) {
  2736. NPC magic = getNpcs().getAll().stream().filter(o -> o.getName().equals("Magic Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  2737. if (magic == null) {
  2738. RS2Object charms = getObjects().getAll().stream().filter(o -> o.getName().equals("Charms")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2739. if (charms != null && !myPlayer().isMoving()) {
  2740. getWalking().walk(charms);
  2741. }
  2742. } else {
  2743. if (magic.interact("Talk-to")) {
  2744. new ConditionalSleep(random(3600, 6300)) {
  2745. @Override
  2746. public boolean condition() throws InterruptedException {
  2747. return inDialogue();
  2748. }
  2749. }.sleep();
  2750. }
  2751. }
  2752. } else {
  2753. if (getTabs().open(Tab.INVENTORY)) {
  2754. new ConditionalSleep(random(3600, 6300)) {
  2755. @Override
  2756. public boolean condition() throws InterruptedException {
  2757. return getTabs().getOpen() == Tab.INVENTORY;
  2758. }
  2759. }.sleep();
  2760. }
  2761. }
  2762. }
  2763. } else {
  2764. if (getConfigs().get(281) == 670) {
  2765. NPC magic = getNpcs().getAll().stream().filter(o -> o.getName().equals("Magic Instructor") && o.hasAction("Talk-to")).min((n1, n2) -> Integer.compare(getMap().distance(n1), getMap().distance(n2))).orElse(null);
  2766. if (magic == null) {
  2767. RS2Object charms = getObjects().getAll().stream().filter(o -> o.getName().equals("Charms")).min((o1, o2) -> Integer.compare(getMap().distance(o1), getMap().distance(o2))).orElse(null);
  2768. if (charms != null && !myPlayer().isMoving()) {
  2769. getWalking().walk(charms);
  2770. }
  2771. } else {
  2772. if (magic.interact("Talk-to")) {
  2773. new ConditionalSleep(random(3600, 6300)) {
  2774. @Override
  2775. public boolean condition() throws InterruptedException {
  2776. return inDialogue();
  2777. }
  2778. }.sleep();
  2779. }
  2780. }
  2781. }
  2782. }
  2783. }
  2784. }
  2785. }
  2786. }
  2787. }
  2788. }
  2789. }
  2790. }
  2791. }
  2792. }
  2793. }
  2794. }
  2795. }
  2796. }
  2797. }
  2798. }
  2799. }
  2800. }
  2801. }
  2802. }
  2803. }
  2804. }
  2805. }
  2806. }
  2807. }
  2808. }
  2809. }
  2810. }
  2811. }
  2812. }
  2813. }
  2814. }
  2815. }
  2816. }
  2817. }
  2818. }
  2819. }
  2820. }
  2821. }
  2822. }
  2823. }
  2824. }
  2825. }
  2826. }
  2827. }
  2828. }
  2829. }
  2830. }
  2831. }
  2832. }
  2833. }
  2834. }
  2835. }
  2836. }
  2837. }
  2838. }
  2839. }
  2840. }
  2841. }
  2842. }
  2843. }
  2844. }
  2845. }
  2846. }
  2847. }
  2848. }
  2849. }
  2850. }
  2851. }
  2852. }
  2853. }
  2854.  
  2855.  
  2856. return loopTime();
  2857. }
  2858.  
  2859. public void selectOptions(String... options) throws InterruptedException {
  2860. for (String option : options) {
  2861. RS2Widget widget = getWidgets().getAll().stream().filter(w -> w.getMessage().equals(option) && w.isVisible()).findAny().orElse(null);
  2862. if (widget == null) {
  2863.  
  2864. } else {
  2865. getKeyboard().typeString("" + widget.getThirdLevelId());
  2866. sleep(loopTime());
  2867. }
  2868. }
  2869. }
  2870.  
  2871. public boolean inDialogue() {
  2872. return (getWidgets().get(162, 546) != null && getWidgets().get(162, 546).isVisible()) || (getWidgets().getAll().stream().filter(w -> w.getMessage().equals("Select an Option") && w.isVisible()).findAny().orElse(null) != null) || (getWidgets().getAll().stream().filter(w -> w.getMessage().equals("Click here to continue") && w.isVisible()).findAny().orElse(null) != null) || (getWidgets().getAll().stream().filter(w -> w.getMessage().equals("Click to continue") && w.isVisible()).findAny().orElse(null) != null);
  2873. }
  2874. public boolean isPendingOption() {
  2875. return getWidgets().getAll().stream().filter(w -> w.getSpriteIndex1() == 301 && w.isVisible()).findAny().orElse(null) != null;
  2876. }
  2877.  
  2878. public boolean isPendingClickContinue() {
  2879. return getWidgets().getAll().stream().filter(w -> w.getMessage().equals("Click to continue") && w.isVisible()).findAny().orElse(null) != null;
  2880. }
  2881.  
  2882. public boolean isPendingContinue() {
  2883. return getWidgets().getAll().stream().filter(w -> w.getMessage().equals("Click here to continue") && w.isVisible()).findAny().orElse(null) != null;
  2884. }
  2885.  
  2886. public void clickContinue() {
  2887. getWidgets().getAll().stream().filter(w -> w.getMessage().equals("Click to continue") && w.isVisible()).findAny().orElse(null).interact();
  2888. }
  2889.  
  2890. public void pressContinue() {
  2891. getKeyboard().pressKey(KeyEvent.VK_SPACE);
  2892. }
  2893.  
  2894. public int loopTime() {
  2895. int delay = 0;
  2896. Random r = new Random();
  2897. while (delay <= 0) {
  2898. delay = (int) Math.round(r.nextGaussian() * 100 + 250);
  2899. }
  2900. return delay;
  2901. }
Advertisement
Add Comment
Please, Sign In to add comment