Multiple JS #2264
Answered
by
rom1504
nicksharma0
asked this question in
Q&A
Multiple JS
#2264
Replies: 3 comments 5 replies
-
Do a loop
…On Sun, Oct 17, 2021, 03:41 Yanique1 ***@***.***> wrote:
So again, I'm new to mineflayer and coding in general.
Basically I'm trying to make multiple bots login at once and type a
command, I got them all to do this but it's very long and time consuming,
and I know there is an easier way I'm just not sure how to do it.
Here's my code:
const mineflayer = require('mineflayer')
let bot1 = mineflayer.createBot({
host: 'Jartex.fun',
version: '1.8',
username: 'T0RCHWOOD01'
})
let bot2 = mineflayer.createBot({
host: 'Jartex.fun',
version: '1.8',
username: 'T0RCHWOOD02'
})
let bot3 = mineflayer.createBot({
host: 'Jartex.fun',
version: '1.8',
username: 'T0RCHWOOD03'
})
let bot4 = mineflayer.createBot({
host: 'Jartex.fun',
version: '1.8',
username: 'T0RCHWOOD04'
})
let bot5 = mineflayer.createBot({
host: 'Jartex.fun',
version: '1.8',
username: 'T0RCHWOOD05'
})
let bot6 = mineflayer.createBot({
host: 'Jartex.fun',
version: '1.8',
username: 'T0RCHWOOD06'
})
let bot7 = mineflayer.createBot({
host: 'Jartex.fun',
version: '1.8',
username: 'T0RCHWOOD07'
})
let bot8 = mineflayer.createBot({
host: 'Jartex.fun',
version: '1.8',
username: 'T0RCHWOOD08'
})
let bot9 = mineflayer.createBot({
host: 'Jartex.fun',
version: '1.8',
username: 'T0RCHWOOD09'
})
let bot10 = mineflayer.createBot({
host: 'Jartex.fun',
version: '1.8',
username: 'T0RCHWOOD10'
})
let bot11 = mineflayer.createBot({
host: 'Jartex.fun',
version: '1.8',
username: 'T0RCHWOOD11'
})
let bot12 = mineflayer.createBot({
host: 'Jartex.fun',
version: '1.8',
username: 'T0RCHWOOD12'
})
let bot13 = mineflayer.createBot({
host: 'Jartex.fun',
version: '1.8',
username: 'T0RCHWOOD13'
})
let bot14 = mineflayer.createBot({
host: 'Jartex.fun',
version: '1.8',
username: 'T0RCHWOOD14'
})
let bot15 = mineflayer.createBot({
host: 'Jartex.fun',
version: '1.8',
username: 'T0RCHWOOD15'
})
let bot16 = mineflayer.createBot({
host: 'Jartex.fun',
version: '1.8',
username: 'T0RCHWOOD16'
})
let bot17 = mineflayer.createBot({
host: 'Jartex.fun',
version: '1.8',
username: 'T0RCHWOOD17'
})
let bot18 = mineflayer.createBot({
host: 'Jartex.fun',
version: '1.8',
username: 'T0RCHWOOD18'
})
let bot19 = mineflayer.createBot({
host: 'Jartex.fun',
version: '1.8',
username: 'T0RCHWOOD19'
})
let bot20 = mineflayer.createBot({
host: 'Jartex.fun',
version: '1.8',
username: 'T0RCHWOOD20'
})
bot1.on('login', async =>{
bot1.chat('/login T0RCH#321')
bot1.chat('/server immortal')
})
bot2.on('login', async =>{
bot2.chat('/login T0RCH#321')
bot2.chat('/server immortal')
})
bot3.on('login', async =>{
bot3.chat('/login T0RCH#321')
bot3.chat('/server immortal')
})
bot4.on('login', async =>{
bot4.chat('/login T0RCH#321')
bot4.chat('/server immortal')
})
bot5.on('login', async =>{
bot5.chat('/login T0RCH#321')
bot5.chat('/server immortal')
})
bot6.on('login', async =>{
bot6.chat('/login T0RCH#321')
bot6.chat('/server immortal')
})
bot7.on('login', async =>{
bot7.chat('/login T0RCH#321')
bot7.chat('/server immortal')
})
bot8.on('login', async =>{
bot8.chat('/login T0RCH#321')
bot8.chat('/server immortal')
})
bot9.on('login', async =>{
bot9.chat('/login T0RCH#321')
bot9.chat('/server immortal')
})
bot10.on('login', async =>{
bot10.chat('/login T0RCH#321')
bot10.chat('/server immortal')
})
bot11.on('login', async =>{
bot11.chat('/login T0RCH#321')
bot11.chat('/server immortal')
})
bot12.on('login', async =>{
bot12.chat('/login T0RCH#321')
bot12.chat('/server immortal')
})
bot13.on('login', async =>{
bot13.chat('/login T0RCH#321')
bot13.chat('/server immortal')
})
bot14.on('login', async =>{
bot14.chat('/login T0RCH#321')
bot14.chat('/server immortal')
})
bot15.on('login', async =>{
bot15.chat('/login T0RCH#321')
bot15.chat('/server immortal')
})
bot16.on('login', async =>{
bot16.chat('/login T0RCH#321')
bot16.chat('/server immortal')
})
bot17.on('login', async =>{
bot17.chat('/login T0RCH#321')
bot17.chat('/server immortal')
})
bot18.on('login', async =>{
bot18.chat('/login T0RCH#321')
bot18.chat('/server immortal')
})
bot19.on('login', async =>{
bot19.chat('/login T0RCH#321')
bot19.chat('/server immortal')
})
bot20.on('login', async =>{
bot20.chat('/login T0RCH#321')
bot20.chat('/server immortal')
})
How would you be able to simplify this? As right now I'm changing every line of code.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2264>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAR437S4LHRHBPCL4R3IQ23UHISTZANCNFSM5GEH2V5Q>
.
|
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
rom1504
-
I've gotten the joining bots to work, they all join but I am not so sure on the chatting part, how to make them chat all at once.
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Try with |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So again, I'm new to mineflayer and coding in general.
Basically I'm trying to make multiple bots login at once and type a command, I got them all to do this but it's very long and time consuming, and I know there is an easier way I'm just not sure how to do it.
Here's my code:
Beta Was this translation helpful? Give feedback.
All reactions