Advertisement
iant06

Untitled

Nov 13th, 2015
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.79 KB | None | 0 0
  1. package scripts.clues;
  2.  
  3. import java.awt.Color;
  4. import java.awt.Font;
  5. import java.awt.Graphics;
  6. import java.awt.Graphics2D;
  7. import java.awt.Point;
  8. import java.text.DecimalFormat;
  9. import java.util.HashMap;
  10.  
  11. import org.tribot.api.General;
  12. import org.tribot.api.Timing;
  13. import org.tribot.api.types.generic.Condition;
  14. import org.tribot.api.types.generic.Filter;
  15. import org.tribot.api.util.ABCUtil;
  16. import org.tribot.api2007.Banking;
  17. import org.tribot.api2007.Camera;
  18. import org.tribot.api2007.Combat;
  19. import org.tribot.api2007.Equipment;
  20. import org.tribot.api2007.Game;
  21. import org.tribot.api2007.Inventory;
  22. import org.tribot.api2007.NPCChat;
  23. import org.tribot.api2007.Objects;
  24. import org.tribot.api2007.Options;
  25. import org.tribot.api2007.Player;
  26. import org.tribot.api2007.Walking;
  27. import org.tribot.api2007.WebWalking;
  28. import org.tribot.api2007.types.RSItem;
  29. import org.tribot.api2007.types.RSObject;
  30. import org.tribot.api2007.types.RSObjectDefinition;
  31. import org.tribot.api2007.types.RSTile;
  32. import org.tribot.api2007.util.ThreadSettings;
  33. import org.tribot.script.EnumScript;
  34. import org.tribot.script.ScriptManifest;
  35. import org.tribot.script.interfaces.MouseActions;
  36. import org.tribot.script.interfaces.Painting;
  37.  
  38. import scripts.clues.types.AcquiringMethod;
  39. import scripts.clues.types.CrypticClue;
  40. import scripts.clues.types.EmoteClue;
  41. import scripts.clues.types.State;
  42. import scripts.clues.types.TeleportLocation;
  43. import scripts.clues.types.TeleportMethod;
  44. import scripts.methods.Methods;
  45.  
  46. @ScriptManifest(authors = { "iant06" }, category = "Money Making", name = "iClueSolver")
  47.  
  48. public class Main extends EnumScript<State> implements Painting, MouseActions {
  49.  
  50. private final ABCUtil abc = new ABCUtil();
  51. private final DecimalFormat decimalFormat = new DecimalFormat("#.##");
  52.  
  53. private State state;
  54. private AcquiringMethod acquiringMethod;
  55. private TeleportMethod teleportMethod;
  56. private ClueTask clueTask;
  57. private ClueScroll clueScroll;
  58. private Teleporting teleporting;
  59. private Bank bank;
  60. private GUI gui;
  61. private Profile profile;
  62. private HamDungeon hamDungeon;
  63. private Equipped equipped;
  64. private RewardGUI rewardGui;
  65.  
  66. private int foodAmount;
  67. private int cluesSolved = 0;
  68. private int made;
  69. private int loss;
  70. private long last_busy_time = 0L;
  71.  
  72. private boolean clueSolved;
  73. private boolean paintHidden = false;
  74. private boolean isEndScript = false;
  75.  
  76. private String foodName = "Lobster";
  77. private String status;
  78. private String name;
  79.  
  80. private HashMap<Integer, Reward> itemsWon = new HashMap<Integer, Reward>();
  81.  
  82. @Override
  83. public State getInitialState() {
  84. setName(Player.getRSPlayer().getName());
  85. setStatus("Initializing");
  86.  
  87. println("Starting script for: " + getName());
  88.  
  89. if(gui == null) {
  90. setGui(new GUI(this));
  91. }
  92.  
  93. while(gui.isVisible()) {
  94. sleep(40, 80);
  95. }
  96.  
  97. println("Hunting Clues using: " + Methods.correctCapitalization(getAcquiringMethod().toString()));
  98. println("Teleporting using: " + Methods.correctCapitalization(getTeleportMethod().toString()));
  99. println("Bringing " + getFoodAmount() + " " + getFoodName() + " for food.");
  100. println("Eating food if HP is below " + abc.INT_TRACKER.NEXT_EAT_AT.next() + "%");
  101.  
  102. if(teleporting == null) {
  103. setTeleporting(new Teleporting(this));
  104. }
  105.  
  106. if(clueScroll == null) {
  107. setClueScroll(new ClueScroll(this));
  108. }
  109.  
  110. if(bank == null) {
  111. setBank(new Bank(this));
  112. }
  113.  
  114. if(hamDungeon == null) {
  115. setHamDungeon(new HamDungeon(this));
  116. }
  117.  
  118. if(equipped == null) {
  119. setEquipped(new Equipped(this));
  120. }
  121.  
  122. ThreadSettings.get().setClickingAPIUseDynamic(true);
  123. General.useAntiBanCompliance(true);
  124. getEquipped().setEquipment();
  125.  
  126. if(getClueScroll().hasClue()) {
  127. setState(State.SOLVING_CLUE);
  128. return State.SOLVING_CLUE;
  129. }
  130.  
  131. if(Locations.inHamDungeon()) {
  132. setState(State.AQUIRING_CLUE);
  133. return State.AQUIRING_CLUE;
  134. }
  135.  
  136. if(getBank().hasRequiredItems()) {
  137. setState(State.WALKING_TO_CLUE_LOCATION);
  138. return State.WALKING_TO_CLUE_LOCATION;
  139. }
  140.  
  141. setState(State.BANKING);
  142. return State.BANKING;
  143. }
  144.  
  145. @Override
  146. public State handleState(State state) {
  147.  
  148. if(isEndScript()) {
  149. Thread.currentThread().interrupt();
  150. return null;
  151. }
  152.  
  153. if(hasLowHealth())
  154. eatFood();
  155.  
  156. if(getClueScroll().isItemInterface()) {
  157. NPCChat.clickContinue(true);
  158. setClueTask(null);
  159. setState(State.SOLVING_CLUE);
  160. return State.SOLVING_CLUE;
  161. }
  162.  
  163. if(getClueScroll().isRewardInterface()) {
  164. setState(State.BANKING);
  165. return State.BANKING;
  166. }
  167.  
  168. if(!getEquipped().hasNecklace() || !getEquipped().hasRing()) {
  169. println("Out of Duel ring or Games necklace.");
  170. setState(State.BANKING);
  171. }
  172.  
  173. if(Game.getRunEnergy() >= abc.INT_TRACKER.NEXT_RUN_AT.next()) {
  174. Options.setRunOn(true);
  175. abc.INT_TRACKER.NEXT_RUN_AT.reset();
  176. }
  177.  
  178. state = getState() != null ? getState() : getInitialState();
  179.  
  180. RSTile pos = Player.getPosition();
  181.  
  182. switch(state) {
  183.  
  184. case AQUIRING_CLUE:
  185.  
  186. getEquipped().checkEquipment();
  187. getBank().setBankTeleport(false);
  188.  
  189. if(getClueScroll().hasClue()) {
  190. if(getAcquiringMethod().equals(AcquiringMethod.THIEVING))
  191. dropJunk();
  192. setState(State.SOLVING_CLUE);
  193. return State.SOLVING_CLUE;
  194. }
  195.  
  196. if(!Locations.inHamDungeon()) {
  197. setState(State.WALKING_TO_CLUE_LOCATION);
  198. return State.WALKING_TO_CLUE_LOCATION;
  199. }
  200.  
  201. if (pos.getX() > 3182 && pos.getY() < 9614) {
  202. getHamDungeon().pickJailDoor();
  203. return State.AQUIRING_CLUE;
  204. }
  205.  
  206. if(Inventory.isFull()) {
  207. if(getAcquiringMethod().equals(AcquiringMethod.THIEVING))
  208. dropJunk();
  209. else
  210. eatFood();
  211. return State.AQUIRING_CLUE;
  212. }
  213.  
  214. if(!getClueScroll().foundClueScroll()) {
  215. if(getAcquiringMethod().equals(AcquiringMethod.COMBAT))
  216. getHamDungeon().attackHamGuard();
  217. else
  218. getHamDungeon().pickpocketHamMember();
  219. }
  220.  
  221. return State.AQUIRING_CLUE;
  222.  
  223. case BANKING:
  224.  
  225. getEquipped().checkEquipment();
  226.  
  227. if(Locations.CRAFTING_GUILD_AREA.contains(pos)
  228. || Locations.MONASTERY_AREA.contains(pos)) {
  229.  
  230. getBank().setBankTeleport(true);
  231. getTeleporting().teleportTo(TeleportLocation.FALADOR);
  232. return State.BANKING;
  233.  
  234. }
  235.  
  236. if(getBank().checkPlane())
  237. return State.BANKING;
  238.  
  239. if(!getBank().isBankTeleport()) {
  240.  
  241. if(Locations.inHamDungeon()) {
  242. getHamDungeon().leaveDungeon();
  243. return State.BANKING;
  244. }
  245.  
  246. int faladorTeleportDistance = Locations.FALADOR_TELEPORT_AREA.getRandomTile().distanceTo(pos);
  247. int closestBankDistance = getBank().getClosestBankDistance();
  248.  
  249. if(closestBankDistance < faladorTeleportDistance && closestBankDistance < 100) {
  250. println("Teleport Distance("+faladorTeleportDistance+") is greater than Closest Bank Distance("+closestBankDistance+").");
  251. getBank().setBankTeleport(true);
  252. return State.BANKING;
  253. }
  254.  
  255. if(faladorTeleportDistance > 30 && !Banking.isInBank()
  256. || pos.getPlane() > 0) {
  257. getBank().setBankTeleport(true);
  258. getTeleporting().teleportTo(TeleportLocation.FALADOR);
  259. return State.BANKING;
  260. }
  261. }
  262.  
  263. if(!Banking.isInBank()) {
  264. setStatus("Walking to Bank");
  265. WebWalking.walkToBank();
  266. return State.BANKING;
  267. }
  268.  
  269. if(getBank().openBank()) {
  270.  
  271. if(getBank().withdrawRequiredItems()) {
  272.  
  273. Banking.close();
  274.  
  275. if(!getClueScroll().hasClue() && !getClueScroll().hasCasket()) {
  276. setState(State.WALKING_TO_CLUE_LOCATION);
  277. return State.WALKING_TO_CLUE_LOCATION;
  278. } else {
  279. setState(State.SOLVING_CLUE);
  280. return State.SOLVING_CLUE;
  281. }
  282. }
  283. }
  284. return State.BANKING;
  285.  
  286. case SOLVING_CLUE:
  287.  
  288. getBank().setBankTeleport(false);
  289. if(!getClueScroll().hasClue() && !getClueScroll().hasCasket()) {
  290. setState(State.BANKING);
  291. return State.BANKING;
  292. }
  293.  
  294. if(Player.getRSPlayer().isInCombat() && Locations.inHamDungeon())
  295. return State.SOLVING_CLUE;
  296.  
  297. if(getClueScroll().isItemInterface()) {
  298. NPCChat.clickContinue(true);
  299. setClueTask(null);
  300. return State.SOLVING_CLUE;
  301. }
  302.  
  303. if(getClueScroll().isRewardInterface()) {
  304. setClueTask(null);
  305. getEquipped().checkEquipment();
  306. setState(State.BANKING);
  307. return State.BANKING;
  308. }
  309.  
  310. if(getClueScroll().hasCasket()) {
  311. getClueScroll().openCasket();
  312. return State.SOLVING_CLUE;
  313. }
  314.  
  315. if(getClueScroll().hasClue()) {
  316. getClueScroll().readClue();
  317. return State.SOLVING_CLUE;
  318. }
  319.  
  320. return State.SOLVING_CLUE;
  321.  
  322. case WALKING_TO_CLUE_LOCATION:
  323. getEquipped().checkEquipment();
  324. getBank().setBankTeleport(false);
  325.  
  326. if(Banking.isBankScreenOpen()) {
  327. Banking.close();
  328. return State.WALKING_TO_CLUE_LOCATION;
  329. }
  330.  
  331. if(Locations.inHamDungeon()) {
  332. setState(State.AQUIRING_CLUE);
  333. return State.AQUIRING_CLUE;
  334. }
  335.  
  336. int distanceToTrapdoor = Locations.TRAPDOOR_TILE.distanceTo(pos);
  337. if(distanceToTrapdoor > 100) {
  338. getTeleporting().teleportTo(TeleportLocation.LUMBRIDGE);
  339. return State.WALKING_TO_CLUE_LOCATION;
  340. }
  341.  
  342. if(distanceToTrapdoor > 4) {
  343. setStatus("Walking to Trapdoor");
  344. WebWalking.walkTo(Locations.TRAPDOOR_TILE);
  345. return State.WALKING_TO_CLUE_LOCATION;
  346. }
  347.  
  348. if(getHamDungeon().pickTrapdoorLock()) {
  349. setState(State.AQUIRING_CLUE);
  350. return State.AQUIRING_CLUE;
  351. }
  352.  
  353. return State.WALKING_TO_CLUE_LOCATION;
  354.  
  355. }
  356. return getState();
  357. }
  358.  
  359.  
  360. public boolean eatFood() {
  361. if (getFoodAmount() == 0) {
  362. return true;
  363. }
  364.  
  365. RSItem[] items = Inventory.find(getFoodName());
  366. if (items.length > 0) {
  367.  
  368. RSItem food = items[0];
  369. int foodCount = Inventory.getCount(getFoodName());
  370. setStatus("Eating Food");
  371.  
  372. General.sleep(abc.DELAY_TRACKER.ITEM_INTERACTION.next());
  373. abc.DELAY_TRACKER.ITEM_INTERACTION.reset();
  374.  
  375. abc.INT_TRACKER.NEXT_EAT_AT.reset();
  376.  
  377. if (food.click("Eat")) {
  378.  
  379. if(Timing.waitCondition(new Condition() {
  380.  
  381. @Override
  382. public boolean active() {
  383. return !hasItem(getFoodName(), foodCount);
  384. }
  385.  
  386. }, General.random(4000, 6000))) {
  387. setLoss(getLoss() + Constants.LOBSTER_PRICE);
  388. return true;
  389. }
  390.  
  391. }
  392. } else {
  393. dropJunk();
  394. setStatus("Out of Food");
  395. setState(State.BANKING);
  396. }
  397. return false;
  398. }
  399.  
  400. public boolean hasAction(RSObjectDefinition def, String action) {
  401.  
  402. if(def == null)
  403. return false;
  404.  
  405. String[] actions = def.getActions();
  406. if(actions == null || actions.length == 0)
  407. return false;
  408.  
  409. for(String s : actions)
  410. if(s.contains(action))
  411. return true;
  412.  
  413. return false;
  414. }
  415.  
  416.  
  417. public boolean climb(boolean up) {
  418.  
  419. if(getClueScroll().isRewardInterface()) {
  420. setClueTask(null);
  421. setState(State.BANKING);
  422. return true;
  423. }
  424.  
  425. if(getClueScroll().isItemInterface()) {
  426. setClueTask(null);
  427. return true;
  428. }
  429.  
  430. RSTile pos = Player.getPosition();
  431. int plane = pos.getPlane();
  432. String action = up ? "Climb-up" : "Climb-down";
  433.  
  434. RSObject[] objects = Objects.findNearest(64, new Filter<RSObject>() {
  435.  
  436. @Override
  437. public boolean accept(RSObject o) {
  438.  
  439. RSObjectDefinition def = o.getDefinition();
  440. if(def == null)
  441. return false;
  442.  
  443. return hasAction(def, action);
  444. }
  445.  
  446. });
  447.  
  448. if(objects.length > 0) {
  449.  
  450. RSObject object = objects[0];
  451. RSObjectDefinition def = object.getDefinition();
  452.  
  453. if(def == null)
  454. return false;
  455.  
  456. setStatus(action + " " + def.getName());
  457.  
  458. RSTile objectPos = object.getPosition();
  459.  
  460. moveCamera(objectPos);
  461.  
  462. if(objectPos.distanceTo(pos) > 3 || !object.isOnScreen()) {
  463.  
  464. RSTile destination = Game.getDestination();
  465.  
  466. if(destination == null || !destination.equals(object)) {
  467.  
  468. if(!Player.isMoving()) {
  469.  
  470. abc.waitNewOrSwitchDelay(last_busy_time, false);
  471.  
  472. if(plane == 0)
  473. WebWalking.walkTo(object);
  474. else
  475. Methods.walkPath(Walking.generateStraightPath(object));
  476.  
  477. last_busy_time = System.currentTimeMillis();
  478. }
  479. }
  480. }
  481.  
  482. if(objectPos.distanceTo(pos) <= 10) {
  483.  
  484. abc.waitNewOrSwitchDelay(last_busy_time, false);
  485.  
  486. if(object.click(action)) {
  487.  
  488. if(Timing.waitCondition(new Condition() {
  489.  
  490. @Override
  491. public boolean active() {
  492. return Player.getPosition().getPlane() != plane;
  493. }
  494.  
  495. }, General.random(4000, 6000))) {
  496. last_busy_time = System.currentTimeMillis();
  497. return true;
  498. }
  499. }
  500.  
  501. }
  502. } else
  503. println("Can't find object to climb.");
  504.  
  505. return Player.getPosition().getPlane() != plane
  506. || Locations.inDungeonArea(getClueTask());
  507. }
  508.  
  509. public boolean walkObjective(ClueTask task, RSTile walkLocation, boolean useWebWalking) {
  510.  
  511. RSTile destination = Game.getDestination();
  512.  
  513. if(destination == null || !destination.equals(walkLocation))
  514. if(!useWebWalking(task, walkLocation) || !useWebWalking)
  515. return Methods.walkPath(Locations.getPath(task, walkLocation));
  516. else
  517. return WebWalking.walkTo(walkLocation);
  518.  
  519. return false;
  520. }
  521.  
  522. public boolean useWebWalking(ClueTask task, RSTile walkLocation) {
  523. if(walkLocation.getPlane() > 0)
  524. return false;
  525.  
  526. if(task != null) {
  527.  
  528. CrypticClue cryptic = task.getCrypticClue();
  529.  
  530. if(cryptic != null)
  531. if(cryptic.equals(CrypticClue.DIGSITE_CENTRE_BUSH))
  532. return false;
  533.  
  534. EmoteClue emote = task.getEmoteClue();
  535.  
  536. if(emote != null)
  537. if(emote.equals(EmoteClue.EXAM_ROOM_CLAP)
  538. || emote.equals(EmoteClue.FISHING_TRAWLER_PIER_PANIC)
  539. || emote.equals(EmoteClue.FALADOR_GEM_STORE_WAVE))
  540. return false;
  541. }
  542.  
  543. return true;
  544. }
  545.  
  546. public boolean moveCamera(RSTile tile) {
  547. if (!tile.isOnScreen()) {
  548. setStatus("Turning Camera");
  549. Camera.turnToTile(tile);
  550. }
  551. return tile.isOnScreen();
  552. }
  553.  
  554. public boolean hasLowHealth() {
  555. return Combat.getHPRatio() <= abc.INT_TRACKER.NEXT_EAT_AT.next();
  556. }
  557.  
  558. public boolean hasMinimumFood() {
  559. if(getFoodAmount() > 0)
  560. if(!hasItem(getFoodName(), 2))
  561. return false;
  562.  
  563. return true;
  564. }
  565.  
  566. public boolean hasItem(int id, int amount) {
  567. if(Inventory.getCount(id) < amount)
  568. return false;
  569.  
  570. return true;
  571. }
  572.  
  573. public boolean hasItem(String id, int amount) {
  574. if(Inventory.getCount(id) < amount)
  575. return false;
  576.  
  577. return true;
  578. }
  579.  
  580. public boolean dropJunk() {
  581. setStatus("Dropping Junk Items");
  582. Inventory.dropAllExcept(getRequiredInventoryItems());
  583. return true;
  584. }
  585.  
  586. public String[] getRequiredInventoryItems() {
  587.  
  588. String[] invItems = Constants.INVENTORY_ITEMS;
  589. String[] teleports = getTeleportMethod().equals(TeleportMethod.TABS)
  590. ? Constants.TABS : Constants.RUNES;
  591. String[] reqItems = new String[4];
  592. String[] equipment = new String[getEquipped().getPlayerEquipment().size()];
  593. String[] requiredInventoryItems = new String[invItems.length + reqItems.length
  594. + equipment.length + Constants.RUNES.length + Constants.EMOTE_EQUIPMENT.length + 10];
  595. int index = 0;
  596. int eIndex = 0;
  597. int tIndex = 0;
  598.  
  599. //set equipment array
  600. for(int i = 0; i < equipment.length; i++) {
  601. equipment[i] = getEquipped().getPlayerEquipment().get(i);
  602. }
  603.  
  604. //add inventory items to array
  605. for(int i = 0; i < invItems.length; i++) {
  606. requiredInventoryItems[i] = invItems[i];
  607. index = i;
  608. }
  609.  
  610. index++;
  611.  
  612. // add food to array
  613. requiredInventoryItems[index] = getFoodName();
  614.  
  615. index++;
  616.  
  617. // add teleports to array
  618. int start = index;
  619. for(int i = start; i < start + teleports.length; i++) {
  620. requiredInventoryItems[i] = teleports[tIndex++];
  621. index = i;
  622. }
  623.  
  624. index++;
  625.  
  626. //add start equipment to array
  627. start = index;
  628. for(int i = start; i < start + equipment.length; i++) {
  629. if(!Equipment.isEquipped(equipment[eIndex])) {
  630. requiredInventoryItems[i] = equipment[eIndex];
  631. }
  632. eIndex++;
  633. index = i;
  634. }
  635.  
  636. index++;
  637.  
  638. //add emote equipment to array
  639. if(getClueTask() != null) {
  640.  
  641. EmoteClue e = getClueTask().getEmoteClue();
  642. if(e != null) {
  643.  
  644. int length = e.getItems().length;
  645. int reqIndex = 0;
  646. start = index;
  647.  
  648. for(int i = start; i < start + length; i++) {
  649. requiredInventoryItems[i] = e.getItems()[reqIndex++];
  650. index = i;
  651. }
  652. }
  653. }
  654.  
  655. return requiredInventoryItems;
  656. }
  657.  
  658. @Override
  659. public void onPaint(Graphics g) {
  660. if(!isPaintHidden()) {
  661. int solved = (int) getCluesSolved();
  662. double solveHr = (double) (solved / ((getRunningTime()) / 3600000D));
  663. ((Graphics2D)g).drawImage(Constants.PAINT_IMG, 7, 330, null);
  664. g.setColor(Color.WHITE);
  665. g.setFont(new Font("Arial", Font.BOLD, 14));
  666. g.drawString(Timing.msToString(getRunningTime()), 125, 404);
  667. g.drawString(solved + " (" + (decimalFormat.format(solveHr)) + ")", 125, 426);
  668. g.drawString(getStatus(), 125, 451);
  669. String type = "None";
  670. String taskName = "None";
  671. if(getClueTask() != null) {
  672. if(getClueTask().getCrypticClue() != null) {
  673. type = "Cryptic";
  674. taskName = getClueTask().getCrypticClue().toString();
  675. } else if(getClueTask().getEmoteClue() != null) {
  676. type = "Emote";
  677. taskName = getClueTask().getEmoteClue().toString();
  678. } else if(getClueTask().getDigLocation() != null) {
  679. type = "Map";
  680. taskName = getClueTask().getDigLocation().toString();
  681. }
  682. }
  683. g.drawString(type, 411, 432);
  684. g.drawString(Methods.correctCapitalization(taskName), 411, 408);
  685. g.setFont(new Font("Arial", Font.PLAIN, 10));
  686. g.drawString("HIDE PAINT", 292, 465);
  687. g.drawString("SHOW REWARDS", 370, 465);
  688. g.drawString("CHANGE ACQUIRING METHOD", 120, 465);
  689. g.drawString(Constants.VERSION, 345, 365);
  690. } else {
  691. g.setFont(new Font("Arial", Font.PLAIN, 10));
  692. g.drawString("SHOW PAINT", 292, 465);
  693. }
  694. }
  695.  
  696. public State getState() {
  697. return state;
  698. }
  699.  
  700. public void setState(State state) {
  701. this.state = state;
  702. }
  703.  
  704. public ClueTask getClueTask() {
  705. return clueTask;
  706. }
  707.  
  708. public void setClueTask(ClueTask clueTask) {
  709. if(clueTask == null) {
  710. getClueScroll().setTeleported(false);
  711. getClueScroll().setEmoteTeleport(false);
  712. getClueScroll().setNpcClicks(0);
  713. getClueScroll().setEmoteClicks(0);
  714. getBank().setBankTeleport(false);
  715. getEquipped().checkEquipment();
  716. }
  717. this.clueTask = clueTask;
  718. }
  719.  
  720. public ClueScroll getClueScroll() {
  721. return clueScroll;
  722. }
  723.  
  724. public void setClueScroll(ClueScroll clueScroll) {
  725. this.clueScroll = clueScroll;
  726. }
  727.  
  728. public boolean isClueSolved() {
  729. return clueSolved;
  730. }
  731.  
  732. public void setClueSolved(boolean solvedClue) {
  733. this.clueSolved = solvedClue;
  734. }
  735.  
  736. public Teleporting getTeleporting() {
  737. return teleporting;
  738. }
  739.  
  740. public void setTeleporting(Teleporting teleporting) {
  741. this.teleporting = teleporting;
  742. }
  743.  
  744. public int getCluesSolved() {
  745. return cluesSolved;
  746. }
  747.  
  748. public void setCluesSolved(int cluesSolved) {
  749. this.cluesSolved = cluesSolved;
  750. }
  751.  
  752. public String getStatus() {
  753. return status;
  754. }
  755.  
  756. public void setStatus(String status) {
  757. this.status = status;
  758. }
  759.  
  760. public Bank getBank() {
  761. return bank;
  762. }
  763.  
  764. public void setBank(Bank bank) {
  765. this.bank = bank;
  766. }
  767.  
  768. public int getMade() {
  769. return made;
  770. }
  771.  
  772. public void setMade(int made) {
  773. this.made = made;
  774. }
  775.  
  776. public int getLoss() {
  777. return loss;
  778. }
  779.  
  780. public void setLoss(int loss) {
  781. this.loss = loss;
  782. }
  783.  
  784. public HashMap<Integer, Reward> getItemsWon() {
  785. return itemsWon;
  786. }
  787.  
  788. public void setItemsWon(HashMap<Integer, Reward> itemsWon) {
  789. this.itemsWon = itemsWon;
  790. }
  791.  
  792. public AcquiringMethod getAcquiringMethod() {
  793. return acquiringMethod;
  794. }
  795.  
  796. public void setAcquiringMethod(AcquiringMethod acquiringMethod) {
  797. this.acquiringMethod = acquiringMethod;
  798. }
  799.  
  800. public TeleportMethod getTeleportMethod() {
  801. return teleportMethod;
  802. }
  803.  
  804. public void setTeleportMethod(TeleportMethod teleportMethod) {
  805. this.teleportMethod = teleportMethod;
  806. }
  807.  
  808. public String getFoodName() {
  809. return foodName;
  810. }
  811.  
  812. public void setFoodName(String foodName) {
  813. this.foodName = foodName;
  814. }
  815.  
  816. public int getFoodAmount() {
  817. return foodAmount;
  818. }
  819.  
  820. public void setFoodAmount(int foodAmount) {
  821. this.foodAmount = foodAmount;
  822. }
  823.  
  824. public GUI getGui() {
  825. return gui;
  826. }
  827.  
  828. public void setGui(GUI gui) {
  829. this.gui = gui;
  830. }
  831.  
  832. public Profile getProfile() {
  833. return profile;
  834. }
  835.  
  836. public void setProfile(Profile profile) {
  837. this.profile = profile;
  838. }
  839.  
  840. public HamDungeon getHamDungeon() {
  841. return hamDungeon;
  842. }
  843.  
  844. public void setHamDungeon(HamDungeon hamDungeon) {
  845. this.hamDungeon = hamDungeon;
  846. }
  847.  
  848. public Equipped getEquipped() {
  849. return equipped;
  850. }
  851.  
  852. public void setEquipped(Equipped equipped) {
  853. this.equipped = equipped;
  854. }
  855.  
  856. public RewardGUI getRewardGui() {
  857. return rewardGui;
  858. }
  859.  
  860. public void setRewardGui(RewardGUI rewardGui) {
  861. this.rewardGui = rewardGui;
  862. }
  863.  
  864. public String getName() {
  865. return name;
  866. }
  867.  
  868. public void setName(String name) {
  869. this.name = name;
  870. }
  871.  
  872. public boolean isPaintHidden() {
  873. return paintHidden;
  874. }
  875.  
  876. public void setPaintHidden(boolean paintHidden) {
  877. this.paintHidden = paintHidden;
  878. }
  879.  
  880. @Override
  881. public void mouseClicked(Point e, int button, boolean isBot) {
  882. // hide paint
  883. if(e.getX() >= Constants.PAINT_CLICK_X[0] && e.getX() <= Constants.PAINT_CLICK_X[1]
  884. && e.getY() >= Constants.PAINT_CLICK_Y[0] && e.getY() <= Constants.PAINT_CLICK_Y[1]) {
  885. if(button == 1 && !isBot) {
  886. if(isPaintHidden()) {
  887. println("Showing Paint!");
  888. setPaintHidden(false);
  889. } else {
  890. println("Hiding Paint!");
  891. setPaintHidden(true);
  892. }
  893. }
  894. }
  895.  
  896. // show rewards
  897. if(e.getX() >= Constants.PAINT_CLICK_X[2] && e.getX() <= Constants.PAINT_CLICK_X[3]
  898. && e.getY() >= Constants.PAINT_CLICK_Y[2] && e.getY() <= Constants.PAINT_CLICK_Y[3]) {
  899. if(button == 1 && !isBot) {
  900. if(getRewardGui() != null) {
  901. getRewardGui().dispose();
  902. setRewardGui(null);
  903. }
  904. setRewardGui(new RewardGUI(this));
  905. println("Showing Rewards List!");
  906. }
  907. }
  908.  
  909. // change acquiring method
  910. if(e.getX() >= Constants.PAINT_CLICK_X[4] && e.getX() <= Constants.PAINT_CLICK_X[5]
  911. && e.getY() >= Constants.PAINT_CLICK_Y[4] && e.getY() <= Constants.PAINT_CLICK_Y[5]) {
  912. if(button == 1 && !isBot) {
  913. if(getAcquiringMethod().equals(AcquiringMethod.COMBAT)) {
  914. println("Changing Acquiring Method to Thieving!");
  915. setAcquiringMethod(AcquiringMethod.THIEVING);
  916. } else {
  917. println("Changing Acquiring Method to Combat!");
  918. setAcquiringMethod(AcquiringMethod.COMBAT);
  919. }
  920. }
  921. }
  922.  
  923. }
  924.  
  925. @Override
  926. public void mouseDragged(Point arg0, int arg1, boolean arg2) {
  927. }
  928.  
  929. @Override
  930. public void mouseMoved(Point arg0, boolean arg1) {
  931. }
  932.  
  933. @Override
  934. public void mouseReleased(Point arg0, int arg1, boolean arg2) {
  935. }
  936.  
  937. public String[] getTribotUsers() {
  938. return tribotUsers;
  939. }
  940.  
  941. public void setTribotUsers(String[] tribotUsers) {
  942. this.tribotUsers = tribotUsers;
  943. }
  944.  
  945. public boolean isEndScript() {
  946. return isEndScript;
  947. }
  948.  
  949. public void setEndScript(boolean isEndScript) {
  950. this.isEndScript = isEndScript;
  951. }
  952.  
  953. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement