Bryno 21 Posted September 17, 2021 Hello fellow dreambot programmer! I am thinking of making a script inwhich it will do multiple different tasks... However, I can see this getting very deep and complex relatively quick. So I am asking for all tips/suggestions for trying to tackle this task with the most optimal and conventional ways of programming. My Idea was to have basically the Main class be: on Loop() { currentTask.loop(); } and then having an ArrayList<Tasks> and selecting a "currentTask" (which can be shuffled randomly in Main) and of course Tasks being an interface with the Loop(); and possibly other methods. Then I can easily create scripts like "KillCows" which will implement from Tasks Let me know what you guys think and your thoughts! Thanks.
camelCase 304 Posted September 17, 2021 i dont really understand the question so this might be way off, but it sounds like you're describing using TaskScript rather than AbstractScript bottom of this thread explains how to use task script
Bryno 21 Author Posted September 17, 2021 8 hours ago, camalCase said: i dont really understand the question so this might be way off, but it sounds like you're describing using TaskScript rather than AbstractScript bottom of this thread explains how to use task script Okay wow! Thanks for the great link! That's exactly what I was going to implement myself.. It looks like dreambot has already though of and implemented this system! The only issue I see is how can I manage the selecting of "nodes".. It states you just simply add the nods in onStart() and it will select the nodes for you using their priority system and such.. However, is there any way I can have full control of this selection process? And when it does make a selection on a node, it will go into its execution() loop. When does that come out? Also, how can I control it to stop that loop?
camelCase 304 Posted September 18, 2021 13 hours ago, Bryno said: However, is there any way I can have full control of this selection process? from task node you inherit public boolean accept() which you give the conditions for that node to run for example you have a banking node you want to run every time you have a full inv. do something like: public boolean accept() { return Inventory.isFull() } idk what more control youd want 13 hours ago, Bryno said: And when it does make a selection on a node, it will go into its execution() loop. When does that come out? Also, how can I control it to stop that loop? with a return statement. when you return it doesnt run execute() again, its checks what node is accepted and then runs execute for that node. hopefully that makes sense
Bryno 21 Author Posted September 18, 2021 9 hours ago, camalCase said: from task node you inherit public boolean accept() which you give the conditions for that node to run for example you have a banking node you want to run every time you have a full inv. do something like: public boolean accept() { return Inventory.isFull() } idk what more control youd want with a return statement. when you return it doesnt run execute() again, its checks what node is accepted and then runs execute for that node. hopefully that makes sense Awesome, that's all the information I needed Thanks again for all your knowledge
Recommended Posts
Archived
This topic is now archived and is closed to further replies.