Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.adi.AIO_FungalMage.Tasks;
- import com.adi.AIO_FungalMage.data.Items;
- import com.adi.AIO_FungalMage.data.SpellsEnum;
- import com.adi.API.AdiAPI;
- import com.adi.API.AdiHopping;
- import com.adi.API.AdiLodestones;
- import com.dogbot.api.commons.Area;
- import com.dogbot.api.commons.Tile;
- import com.dogbot.api.commons.Time;
- import com.dogbot.api.methods.*;
- import com.dogbot.api.methods.action.ActionOpcodes;
- import com.dogbot.api.methods.widget.BackpackTable;
- import com.dogbot.api.methods.widget.Bank;
- import com.dogbot.api.methods.widget.TableItem;
- import com.dogbot.client.wrappers.scene.Npc;
- import com.dogbot.client.wrappers.scene.Player;
- import com.dogbot.script.Task;
- import org.red.abyss.util.Equipment;
- import org.red.abyss.util.Health;
- import org.red.abyss.util.Lodestone;
- import java.util.Objects;
- public class Ghouling implements Task {
- private static Area ghoulArea = new Area(new Tile(3481, 3550, 0), new Tile(3519, 3523, 0));
- private AdiLodestones lodestones = new AdiLodestones();
- private Player me;
- private int[] eq = {Items.MONKFISH.getId(), Items.FIRE_RUNE.getId()};
- @Override
- public boolean validate() {
- me = Players.getLocal();
- return me != null && PlayerFacade.getLevel(PlayerFacade.MAGIC) < 62 && PlayerFacade.getLevel(PlayerFacade.DEFENCE) < 62;
- }
- @Override
- public void execute() {
- ClientConfiguration.setRenderingGame(false);
- if (ghoulArea.contains(me)) {
- if (BackpackTable.contains(Items.MONKFISH.getId())) {
- if (Health.getCurrentPercent() >= 50) {
- if (SpellsEnum.FIRE_BOLT.isSelected()) {
- if (me.getTargetIndex() == -1) {
- Npc npc = Npcs.getNearest((e) -> e.getName().equals("Ghoul") && Objects.equals(e.getTarget(), me));
- if (npc == null) {
- npc = Npcs.getNearest((e) -> e.getName().equals("Ghoul") && e.getTarget() == null && e.getAnimation() == -1);
- }
- if (npc != null) {
- Game.queueAction(10, npc);
- Time.await(() -> Players.getLocal().getTargetIndex() != -1, 2000);
- }
- }
- } else {
- /*Game.queueAction(ActionOpcodes.IF_BUTTONX1, 2, 33, 95748097);*/
- SpellsEnum.FIRE_BOLT.cast();
- Time.sleep(500);
- }
- } else {
- TableItem monkFish = BackpackTable.getFirst("Monkfish");
- if (monkFish != null) {
- int x = monkFish.getIndex();
- Game.queueAction(ActionOpcodes.IF_BUTTONX1, 1, x, 96534535);
- Time.sleep(500);
- }
- }
- } else {
- if (!AdiAPI.Canifis.contains(me)) {
- Movement.walkTo(AdiAPI.Canifis.getCenter());
- }
- }
- } else {
- if (AdiAPI.Canifis.contains(me)) {
- Game.getClient().printToConsole("ss" + (!BackpackTable.contains(Items.FIRE_RUNE.getId()) || !BackpackTable.contains(Items.MONKFISH.getId())));
- if (!BackpackTable.contains(Items.FIRE_RUNE.getId()) || !BackpackTable.contains(Items.MONKFISH.getId())) {
- if (AdiAPI.canifisBank.contains(me)) {
- if (Bank.isOpen()) {
- if (!BackpackTable.contains(Items.FIRE_RUNE.getId())) {
- Bank.withdrawAll(Items.FIRE_RUNE.getId());
- Time.sleep(750);
- } else if (!BackpackTable.contains(Items.MONKFISH.getId())) {
- Bank.withdrawAll(Items.MONKFISH.getId());
- Time.sleep(750);
- }
- } else {
- Npc banker = Npcs.getNearest("Banker");
- if (banker != null) {
- banker.interact(ActionOpcodes.OP_NPC1);
- Time.await(Bank::isOpen, 2000);
- }
- }
- } else {
- Movement.walkTo(AdiAPI.canifisBank.getCenter());
- Time.await(() -> !me.isMoving(), 2000);
- }
- } else {
- Movement.walkTo(ghoulArea.getCenter());
- Time.await(() -> !me.isMoving(), 2000);
- }
- } else {
- lodestones.teleportLodestones(Lodestone.CANIFIS);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement