1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question Stop bot in tree bot

Discussion in 'Developer Support' started by ColtKappa, Jan 2, 2017.

  1. ColtKappa

    Joined:
    Jun 20, 2016
    Messages:
    38
    Likes Received:
    16
    Hi There,

    When the bot reaches one of my leaves I want to terminate the script bot.

    I know the AbstractScript stop method exists but I'm unsure how to call it from a leaf?

    Thanks!
    --- Double Post Merged, Jan 2, 2017, Original Post Date: Jan 2, 2017 ---
    the awesome123man helped me out. :)

    Pass instance of bot down to leaves and then bot.stop();
     
  2. Savior

    Savior Java Warlord

    Joined:
    Nov 17, 2014
    Messages:
    4,906
    Likes Received:
    2,748
    Passing an instance down a tree can be annoying, it would be a lot easier to get the reference to the mainclass by using static API calls.
    Environment.getBot().stop()
     
    Swych and Serene like this.
  3. CoreBot

    CoreBot Making nice things

    Joined:
    Jun 7, 2019
    Messages:
    39
    Likes Received:
    21
    the .stop() is deprecated, what is the new version? :eek:

    Nvm,. found out that you had to give up a reason
     
    Swatarinaess likes this.

Share This Page

Loading...