Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.3 kB
5
Indexable
Never
package Tasks;

import clanwars.RezzCW;
import org.powbot.api.*;
import org.powbot.api.rt4.*;
import utils.Task;

import static org.powbot.api.rt4.Game.tab;

public class test1 extends Task {
    RezzCW main;
    Tasks.Constants c;

    public test1(RezzCW main) {
        super();
        super.name = "ddbot";
        this.main = main;
    }

    @Override
    public boolean activate() {
        return Players.stream().within(15).filter(p -> p.overheadMessage() == "Greet me").isNotEmpty();

    }

    @Override
    public void execute() {
        Player p = Players.stream().name(main.me).filter(player -> player.interacting().equals(Actor.getNil())
                && !player.healthBarVisible()).nearest().first();
        if (p != Player.getNil()) {
            if (p.inViewport()) {
                    p.interact("Follow", p.name());
                    Condition.wait(() -> Players.local().interacting().name().equals(p.name()), 50, 30);
                Input.sendln("hello");
                tab(Game.Tab.EMOTES);
                int specWidget = 109;
                int specComponent = 14;
                Widgets.widget(specWidget).component(specComponent).click();
                } else {
                    Camera.turnTo(p);
                }
        }
    }
}