TheOnlyLite 0 Posted June 21, 2024 Hi, I have a general question about coding scripts for dreambot. I've been using switch with game conditions like Players.getLocal().isMoving() or furnace.exists() etc, to determine what sequence the script should be executing. I recently had to use a boolean to stop my cases from overlapping conditions and causing errors or the script to execute the wrong actions. Is this a good way to do this? Or is there a different method I could use to improve efficiency and not use 4-5 conditions to define a case? Thanks!
Veryan 1 Posted July 24, 2024 Another way to streamline it might be using a state machine pattern, where each state represents a specific task and the transition between states is based on game conditions.
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