Jump to content

[10 Minute Scripts] Make an AIO Agility Script in 10 Minutes???


Recommended Posts

Posted

Cool, thanks! Can you elaborate on this line?

Entity nextObj = getObjects().closest(obj -> Arrays.asList(names).contains(obj.getName()) &&
                Arrays.asList(actions).contains(obj.getActions()[0]) &&
                (getMap().canReach(obj) || obj.getName().equals("Crate")) &&
                !obj.equals(previous));

Why .contains(obj.getActions()[0])? Why the [0], that's got me stuck. What is it's purpose here?

Posted
1 hour ago, Athylus said:

Cool, thanks! Can you elaborate on this line?


Entity nextObj = getObjects().closest(obj -> Arrays.asList(names).contains(obj.getName()) &&
                Arrays.asList(actions).contains(obj.getActions()[0]) &&
                (getMap().canReach(obj) || obj.getName().equals("Crate")) &&
                !obj.equals(previous));

Why .contains(obj.getActions()[0])? Why the [0], that's got me stuck. What is it's purpose here?

so you begin from the first object from the array. that's how agility courses work

Posted
2 hours ago, Athylus said:

Cool, thanks! Can you elaborate on this line?


Entity nextObj = getObjects().closest(obj -> Arrays.asList(names).contains(obj.getName()) &&
                Arrays.asList(actions).contains(obj.getActions()[0]) &&
                (getMap().canReach(obj) || obj.getName().equals("Crate")) &&
                !obj.equals(previous));

Why .contains(obj.getActions()[0])? Why the [0], that's got me stuck. What is it's purpose here?

An object has some set of actions, for example: ["Jump-up", "Walk here", "Examine"]. For agility, we always want to do the first interaction which in most programming languages is the 0 element. So I check my list of actions contains the first action in the object's list of actions, if it does, then I know it is an agility obstacle and I should interact with it.

  • Like 1
  • 1 month later...
  • 2 months later...
Posted

Hi I am struggling a little bit with compiling.

I want this to pump indefinntly until I stop getting str xp witch should be every 5 mins, then it should continue to the next object which is the coke and fill up until it recieves a message to continue (which mean all spades full x 28) then should move on to fill the stove with coke and wait for another message to continue, once it sees the message it should go back to pumping until the xp stop and loop again.

 

public int onLoop() throws InterruptedException {
        int starting = getExperienceTracker().getGainedXP(Skill.STRENGTH);
        Entity nextObj = getObjects().closest(obj -> Arrays.asList(names).contains(obj.getName()) &&
                Arrays.asList(actions).contains(obj.getActions()[0]) && (getMap().canReach(obj)) && !obj.equals(previous));
        if (nextObj != null && myPlayer().getInteracting() == null && !getDialogues().isPendingContinuation()) {
            if (nextObj.interact(nextObj.getActions()[0])) {
                new ConditionalSleep(10000) {
                    @Override
                    public boolean condition() throws InterruptedException {
                        return getExperienceTracker().getGainedXP(Skill.STRENGTH) < starting;
                    }
                }.sleep();
            } if (getExperienceTracker().getGainedXP(Skill.STRENGTH) > starting){
                previous = nextObj;
            }
        }
        return 250;
    }

Please help.

  • 2 weeks later...
  • 1 month later...

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...