Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users

    Recommended Posts

    Posted

    How would i be able to persist a leaf or even branch in treescript?

    Say i want leaf A to take place once criteria X is met.
    I want leaf A to keep running until criteria Y is met.

    Examples of this logic is emptying the sack in motherlode mine

    Posted

    Think i figured it out:


     

        boolean shouldPersist = false;
        @Override
        public boolean isValid() {
    
            return (GetSackCapacity() < Calculations.random(28,34)  && !Inventory.isFull())|| shouldPersist || InventoryHasMlmReward();
        }
    
        @Override
        public int onLoop() {
    
            if(GetSackCapacity() <= 105) {
                shouldPersist = true;
            }
    	}

     

    Posted (edited)

    Assuming Criteria Y is never valid unless Criteria X is first valid

    You could set Leaf A's accept condition to be ((Criteria X) && (!Criteria Y))

     

    Specific to MLM what are your criteria you are trying to monitor/manage?

     

    Your boolean approach works too and may be better for monitoring the MLM sack since you can force it true, have it collect all the ore, then force it to false to go back to your miningLeaf

    Edited by Tweeboy
    Posted
    13 hours ago, Tweeboy said:

    Assuming Criteria Y is never valid unless Criteria X is first valid

    You could set Leaf A's accept condition to be ((Criteria X) && (!Criteria Y))

     

    Specific to MLM what are your criteria you are trying to monitor/manage?

     

    Your boolean approach works too and may be better for monitoring the MLM sack since you can force it true, have it collect all the ore, then force it to false to go back to your miningLeaf

     

     

    Quote

    Specific to MLM what are your criteria you are trying to monitor/manage?

    When the sack has +- 24 free slots I want to empty the sack completely.
    Similar to what my solution is; I needed a way of entering the leaf while using a conditional for exiting the leaf.

    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
    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.