Bot Running multiple tasks or scripts #1833
Unanswered
DannSystems
asked this question in
Q&A
Replies: 1 comment
-
Not quite. Use the examples to teach yourself how to use the API, but don't copy and paste it. You'll have to design your own implementation that can perform multiple actions based on how you see the examples working. You'll have to know when to activate and deactivate different parts of your bot based on what it's doing and know how that connects to other working parts. For example, you can listen for when a player says something in chat and work that way. bot.on('chat', (username, message) => {
if (message === 'jump') {
stopMining()
startJumping()
} else if (message === 'dig') {
stopJumping()
startMining()
}
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So I want my bot to do multiple things are run multiple scripts as shown in the examples part of github, do i just add all the code to the 1 main file?
Beta Was this translation helpful? Give feedback.
All reactions