Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.78 KB | None | 0 0
  1. package com.adi.AIO_FungalMage.Tasks;
  2.  
  3. import com.adi.AIO_FungalMage.data.Items;
  4. import com.adi.AIO_FungalMage.data.SpellsEnum;
  5. import com.adi.API.AdiAPI;
  6. import com.adi.API.AdiHopping;
  7. import com.adi.API.AdiLodestones;
  8. import com.dogbot.api.commons.Area;
  9. import com.dogbot.api.commons.Tile;
  10. import com.dogbot.api.commons.Time;
  11. import com.dogbot.api.methods.*;
  12. import com.dogbot.api.methods.action.ActionOpcodes;
  13. import com.dogbot.api.methods.widget.BackpackTable;
  14. import com.dogbot.api.methods.widget.Bank;
  15. import com.dogbot.api.methods.widget.TableItem;
  16. import com.dogbot.client.wrappers.scene.Npc;
  17. import com.dogbot.client.wrappers.scene.Player;
  18. import com.dogbot.script.Task;
  19. import org.red.abyss.util.Equipment;
  20. import org.red.abyss.util.Health;
  21. import org.red.abyss.util.Lodestone;
  22.  
  23. import java.util.Objects;
  24.  
  25. public class Ghouling implements Task {
  26. private static Area ghoulArea = new Area(new Tile(3481, 3550, 0), new Tile(3519, 3523, 0));
  27. private AdiLodestones lodestones = new AdiLodestones();
  28. private Player me;
  29. private int[] eq = {Items.MONKFISH.getId(), Items.FIRE_RUNE.getId()};
  30.  
  31. @Override
  32. public boolean validate() {
  33.  
  34. me = Players.getLocal();
  35. return me != null && PlayerFacade.getLevel(PlayerFacade.MAGIC) < 62 && PlayerFacade.getLevel(PlayerFacade.DEFENCE) < 62;
  36. }
  37.  
  38. @Override
  39. public void execute() {
  40. ClientConfiguration.setRenderingGame(false);
  41. if (ghoulArea.contains(me)) {
  42. if (BackpackTable.contains(Items.MONKFISH.getId())) {
  43. if (Health.getCurrentPercent() >= 50) {
  44. if (SpellsEnum.FIRE_BOLT.isSelected()) {
  45. if (me.getTargetIndex() == -1) {
  46. Npc npc = Npcs.getNearest((e) -> e.getName().equals("Ghoul") && Objects.equals(e.getTarget(), me));
  47. if (npc == null) {
  48. npc = Npcs.getNearest((e) -> e.getName().equals("Ghoul") && e.getTarget() == null && e.getAnimation() == -1);
  49. }
  50. if (npc != null) {
  51. Game.queueAction(10, npc);
  52. Time.await(() -> Players.getLocal().getTargetIndex() != -1, 2000);
  53. }
  54. }
  55. } else {
  56. /*Game.queueAction(ActionOpcodes.IF_BUTTONX1, 2, 33, 95748097);*/
  57. SpellsEnum.FIRE_BOLT.cast();
  58. Time.sleep(500);
  59. }
  60. } else {
  61. TableItem monkFish = BackpackTable.getFirst("Monkfish");
  62. if (monkFish != null) {
  63. int x = monkFish.getIndex();
  64. Game.queueAction(ActionOpcodes.IF_BUTTONX1, 1, x, 96534535);
  65. Time.sleep(500);
  66. }
  67. }
  68.  
  69. } else {
  70. if (!AdiAPI.Canifis.contains(me)) {
  71. Movement.walkTo(AdiAPI.Canifis.getCenter());
  72. }
  73. }
  74. } else {
  75. if (AdiAPI.Canifis.contains(me)) {
  76. Game.getClient().printToConsole("ss" + (!BackpackTable.contains(Items.FIRE_RUNE.getId()) || !BackpackTable.contains(Items.MONKFISH.getId())));
  77. if (!BackpackTable.contains(Items.FIRE_RUNE.getId()) || !BackpackTable.contains(Items.MONKFISH.getId())) {
  78. if (AdiAPI.canifisBank.contains(me)) {
  79. if (Bank.isOpen()) {
  80. if (!BackpackTable.contains(Items.FIRE_RUNE.getId())) {
  81. Bank.withdrawAll(Items.FIRE_RUNE.getId());
  82. Time.sleep(750);
  83. } else if (!BackpackTable.contains(Items.MONKFISH.getId())) {
  84. Bank.withdrawAll(Items.MONKFISH.getId());
  85. Time.sleep(750);
  86. }
  87. } else {
  88. Npc banker = Npcs.getNearest("Banker");
  89. if (banker != null) {
  90. banker.interact(ActionOpcodes.OP_NPC1);
  91. Time.await(Bank::isOpen, 2000);
  92. }
  93. }
  94. } else {
  95. Movement.walkTo(AdiAPI.canifisBank.getCenter());
  96. Time.await(() -> !me.isMoving(), 2000);
  97. }
  98. } else {
  99. Movement.walkTo(ghoulArea.getCenter());
  100. Time.await(() -> !me.isMoving(), 2000);
  101. }
  102. } else {
  103. lodestones.teleportLodestones(Lodestone.CANIFIS);
  104. }
  105. }
  106. }
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement