Xtra 31 Posted June 15, 2020 I am trying to stop my script in my node class after it achieves a certain goal or meets a condition. For example, when BankNode is called and it checks the bank to see if I have any steel bars left. If yes, smith. If no, stop. Thanks
wettofu 118 Posted June 15, 2020 i dont know if this works but i remember yeeter said that you could also use System.exit(1);
Xtra 31 Author Posted June 15, 2020 6 minutes ago, wettofu said: i dont know if this works but i remember yeeter said that you could also use System.exit(1); Thanks, that closes the client which is kinda half what I'm looking for, definitely better than just sitting there with the script running
Pseudo 179 Posted June 15, 2020 Your main script class has a method called 'stop()' which, you guessed it, stops the script.
Xtra 31 Author Posted June 15, 2020 15 minutes ago, Pseudo said: Your main script class has a method called 'stop()' which, you guessed it, stops the script. You can do this with TaskNode? It says it's an AbstractScript Runnable method
Pseudo 179 Posted June 15, 2020 2 minutes ago, Xtra said: You can do this with TaskNode? It says it's an AbstractScript Runnable method Oh no idea, I don't tend to use the TaskNode system, I tend to use my own framework. Failing that, I believe returning -1 in your scripts cycle will terminate.
Xtra 31 Author Posted June 15, 2020 3 minutes ago, Pseudo said: Oh no idea, I don't tend to use the TaskNode system, I tend to use my own framework. Failing that, I believe returning -1 in your scripts cycle will terminate. Cool that's just what I was looking for thanks. Works just how I wanted!
Aeglen 404 Posted June 16, 2020 That's a neat solution - another thing that doesn't seem to work in TaskNode is getRandomManager() - any suggestions?
Pseudo 179 Posted June 22, 2020 On 6/17/2020 at 12:11 AM, Aeglen said: That's a neat solution - another thing that doesn't seem to work in TaskNode is getRandomManager() - any suggestions? Does it not inherit it from AbstractScript?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.