Jump to content

Bounty Hunter Skip


Recommended Posts

Posted

Hi all, i have written something very simple that attempts to skip a target if its not one of them listed in an array. I am trying to build the script but it does not show in the osbot client even when I refresh, is there something wrong with the coding that wont let me test it?? 

 

import org.osbot.rs07.api.filter.Filter;
import org.osbot.rs07.api.model.Player;
import org.osbot.rs07.api.ui.RS2Widget;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.utility.ConditionalSleep;

import java.util.Arrays;
import java.util.List;

public class wildyskiptargets extends Script {

    private final List<String> attackerBots = Arrays.asList("", "", "");
    private final List<String> attackedBots = Arrays.asList("", "", "", "");

    @Override
    public int onLoop() throws InterruptedException {

        RS2Widget target = getWidgets().singleFilter(90,
                w -> w != null && w.isVisible() && w.getMessage().equals(attackerBots));
        RS2Widget skipTarget = getWidgets().singleFilter(90,
                w -> w!= null & w.isVisible() && w.getInteractActions().length > 0);

        
        if (target != null && target.isVisible()){
            log("Target has been assigned");
            if (skipTarget.interact("Abandon target")){
                log("Skipping Target");
                new ConditionalSleep(5000, 1000) {
                    @Override
                    public boolean condition() throws InterruptedException {
                        return getDialogues().isPendingContinuation();
                    }
                }.sleep();
            }
        }
        


        return 2500;
    }

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...