Xtra 31 Share 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 Link to comment Share on other sites More sharing options...
wettofu 109 Share Posted June 15, 2020 i dont know if this works but i remember yeeter said that you could also use System.exit(1); Link to comment Share on other sites More sharing options...
Xtra 31 Author Share 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 Link to comment Share on other sites More sharing options...
Pseudo 179 Share Posted June 15, 2020 Your main script class has a method called 'stop()' which, you guessed it, stops the script. Link to comment Share on other sites More sharing options...
Xtra 31 Author Share 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 Link to comment Share on other sites More sharing options...
Pseudo 179 Share 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. Link to comment Share on other sites More sharing options...
Xtra 31 Author Share 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! Link to comment Share on other sites More sharing options...
Aeglen 282 Share Posted June 16, 2020 That's a neat solution - another thing that doesn't seem to work in TaskNode is getRandomManager() - any suggestions? Link to comment Share on other sites More sharing options...
Pseudo 179 Share 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? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.