Jump to content

Bounty Hunter Skip


investmentideas

Recommended Posts

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;
    }

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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