Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Question Stop bot in tree bot

Joined
Jun 20, 2016
Messages
38
Hi There,

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

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

Thanks!
 
the awesome123man helped me out. :)

Pass instance of bot down to leaves and then bot.stop();
 
Java Warlord
Joined
Nov 17, 2014
Messages
4,906
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()
 
Top