Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • How do I stop a script with TaskNode?


    Xtra

    Recommended Posts

    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

    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

    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

    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

    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

    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

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.