Luxe 83 Posted May 10, 2024 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
Luxe 83 Author Posted May 10, 2024 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; } }
Tweeboy 20 Posted May 10, 2024 (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 May 10, 2024 by Tweeboy
Luxe 83 Author Posted May 11, 2024 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now