urfate / afk-bot Goto Github PK
View Code? Open in Web Editor NEWFuncional minecraft AFK bot for servers. Anti-AFK, Auto-Auth, Microsoft/Offline accounts support.
License: MIT License
Funcional minecraft AFK bot for servers. Anti-AFK, Auto-Auth, Microsoft/Offline accounts support.
License: MIT License
Is your feature request related to a problem? Please describe.
I tried to AFK at monster farm while [anti-afk'].hit true.
However, the bot only swing arm but can't hit monsters so can't kill monsters.
Describe the solution you'd like
could the bot imitate the real hit?
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
I go to start in and it gives this error
`Error: Cannot find module '/home/runner/Afk-Bot-1/index.js'
Require stack:
`
my settings.json is
and i have via version and via backwards and via rewind instaled
`{
"bot-account": {
"username": "bot",
"password": "",
"type": ""
},
"server": {
"ip": "(i have this set correctly)",
"port": 55928,
"version": "1.19.3"
},
"position": {
"enabled": false,
"x": 0,
"y": 0,
"z": 0
},
"utils": {
"auto-auth": {
"enabled": true,
"password": "12345678"
},
"anti-afk": {
"enabled": true,
"sneak": false,
"jump": true,
"rotate": true,
"hit": {
"enabled": false,
"delay": 1000,
"attack-mobs": false
},
"circle-walk": {
"enabled": false,
"radius": 2
}
},
"chat-messages": {
"enabled": false,
"repeat": true,
"repeat-delay": 60,
"messages": [
"I'm a regular player ",
"My owner is urFate_ ",
"I want be alone ",
"Visit my GitHub page! (urFate/Afk-Bot)"
]
},
"chat-log": true,
"auto-reconnect": false,
"auto-reconnect-delay": 5000
}
}
`
Describe the bug
So i use cracked account and i have some sort of this
But the bot connects fine but when it says that it entered credentials but i dont get logged into... It shows this
Pls help
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
how can i do this
FIXED THIS ISSUE BY DELETING package-lock.json
urFate, please add package-lock.json to .gitignore
Describe the bug
It works, but when i send a message on my account, it crashes.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No Crash.
Bot config
"bot-account": {
"username": "verymuch",
"password": "your_password",
"type": "offline"
},
"server": {
"ip": "bullmastiff.aternos.host",
"port": 33832,
"version": "1.19.3"
},
"position": {
"enabled": true,
"x": -1812,
"y": 64,
"z": -1820
},
"utils": {
"auto-auth": {
"enabled": false,
"password": "12345678"
},
"anti-afk": {
"enabled": true,
"sneak": false,
"jump": true,
"rotate": true,
"hit": {
"enabled": true,
"delay": 1000,
"attack-mobs": true
},
"circle-walk": {
"enabled": false,
"radius": 2
}
},
"chat-messages": {
"enabled": false,
"repeat": true,
"repeat-delay": 60,
"messages": [
"I'm a regular player ",
"My owner is ravijol1 ",
"I want be alone "
]
},
"chat-log": false,
"auto-reconnect": true,
"auto-reconnect-delay": 5000
}
}
Additional context
[2023-02-28T14:49:24.514] [INFO] default - Bot joined to the server
[2023-02-28T14:49:24.517] [INFO] default - Starting moving to target location (-1812, 64, -1820)
[2023-02-28T14:49:24.785] [INFO] default - Bot arrived to target location. (-1811.6662679252106, 64.25220334025373, -1819.5)
C:\Users\liams\Desktop\Afk-Bot-1.3.3\node_modules\minecraft-protocol\src\transforms\framing.js:67
} else { throw e }
^
TypeError: Cannot read properties of undefined (reading 'formatString')
at ChatMessage.fromNetwork (C:\Users\liams\Desktop\Afk-Bot-1.3.3\node_modules\prismarine-chat\index.js:390:27)
at Client.<anonymous> (C:\Users\liams\Desktop\Afk-Bot-1.3.3\node_modules\mineflayer\lib\plugins\chat.js:121:25)
at Client.emit (node:events:513:28)
at Client.<anonymous> (C:\Users\liams\Desktop\Afk-Bot-1.3.3\node_modules\minecraft-protocol\src\client\chat.js:197:14)
at Client.emit (node:events:513:28)
at FullPacketParser.<anonymous> (C:\Users\liams\Desktop\Afk-Bot-1.3.3\node_modules\minecraft-protocol\src\client.js:91:12)
at FullPacketParser.emit (node:events:513:28)
at addChunk (C:\Users\liams\Desktop\Afk-Bot-1.3.3\node_modules\readable-stream\lib\_stream_readable.js:298:12)
at readableAddChunk (C:\Users\liams\Desktop\Afk-Bot-1.3.3\node_modules\readable-stream\lib\_stream_readable.js:280:11)
at Readable.push (C:\Users\liams\Desktop\Afk-Bot-1.3.3\node_modules\readable-stream\lib\_stream_readable.js:241:10)
Node.js v18.14.2
C:\Users\liams\Desktop\Afk-Bot-1.3.3>
Some servers u need to click i gui's to teleport n stuff ops this is not issue
the bot gets kicked for idle pretty sure aternos made it to where if you’re jumping it kicks you still.. there’s an easy fix put something like this
auto-walk
walk-forward: true
repeat: true
repeat-times: 999999
———————————————
or add mine or hit
auto-hit
auto-hit-enabled: true
hit-times: 999999999
—————
auto-mine
auto-mine-enabled: true
auto-mine-minutes: 99999999999
Is your feature request related to a problem? Please describe.
No, I just thought this may be handy for some players.
Describe the solution you'd like
The possibility to let the bot tp to a random person if it has permissions after some time that has been set.
Describe alternatives you've considered
N/A
N/A
Can a command be added to the chatbot so when you type and send it, like "status" it shows all info about the bot in game, like XP level, health, hunger, x y z position, and other useful information?
version:1.3.2
mc server version: 1.19.3
log:
crashed after running a while (at most 1 hour )
settings:
{
"bot-account": {
"username": "silenpen_jf",
"password": "",
"type": "mojang"
},
"server": {
"ip": "dx.coreages.com",
"port": 25565,
"version": "1.19.3"
},
"position": {
"enabled": false,
"x": 0,
"y": 0,
"z": 0
},
"utils": {
"auto-auth": {
"enabled": true,
"password": "whitealbum2"
},
"anti-afk": {
"enabled": true,
"sneak": false,
"jump": false,
"rotate": false,
"hit": {
"enabled": true,
"delay": 1000,
"attack-mobs": true
},
"circle-walk": {
"enabled": false,
"radius": 2
}
},
"chat-messages": {
"enabled": false,
"repeat": false,
"repeat-delay": 60,
"messages": [
"I'm an afk bot",
"My owner is jf",
"I want be alone "
]
},
"chat-log": false,
"auto-reconnect": true,
"auto-reconnect-delay": 5000
}
}
crashed on cloud server too. (The only difference is that "hit" is not enabled)
Describe the bug
Everytime the bot recieves chat, whether from the chat automation of the bot itself or other players, the bot crashes.
To Reproduce
Steps to reproduce the behavior:
Crash log
https://pastebin.com/hB7iZu0z
Expected behavior
The bot should run with no crashes.
Bot config
https://pastebin.com/cDzraSZH
how to make the bot run a command or a message when ever we want insted of just running it on the bot join
Is it possible to automate clicking a button when joining?
MC-Wither-sk > [BotLog] Bot joined to the server
MC-Wither-sk > [BotLog] Starting moving to target location (2304, 46, 824)
MC-Wither-sk > Error: write EPIPE
MC-Wither-sk > at afterWriteDispatched (node:internal/stream_base_commons:160:15)
MC-Wither-sk > at writeGeneric (node:internal/stream_base_commons:151:3)
MC-Wither-sk > at Socket._writeGeneric (node:net:795:11)
MC-Wither-sk > at Socket._write (node:net:807:8)
MC-Wither-sk > at writeOrBuffer (node:internal/streams/writable:390:12)
MC-Wither-sk > at _write (node:internal/streams/writable:331:10)
MC-Wither-sk > at Socket.Writable.write (node:internal/streams/writable:335:10)
MC-Wither-sk > at Framer.ondata (/home/botdiscord/Minecraft-wither-skeleton/node_modules/readable-stream/lib/_stream_readable.js:681:20)
MC-Wither-sk > at Framer.emit (node:events:390:28)
MC-Wither-sk > at addChunk (/home/botdiscord/Minecraft-wither-skeleton/node_modules/readable-stream/lib/_stream_readable.js:298:12) {
MC-Wither-sk > errno: -32,
MC-Wither-sk > code: 'EPIPE',
MC-Wither-sk > syscall: 'write'
MC-Wither-sk > }
MC-Wither-sk > [ERROR] write EPIPE
MC-Wither-sk > Error: Event blockUpdate:(1194, 62, 1356) did not fire within timeout of 5000ms
MC-Wither-sk > at onceWithCleanup (/home/botdiscord/Minecraft-wither-skeleton/node_modules/mineflayer/lib/promise_utils.js:62:26)
MC-Wither-sk > at placeBlockWithOptions (/home/botdiscord/Minecraft-wither-skeleton/node_modules/mineflayer/lib/plugins/place_block.js:13:36)
MC-Wither-sk > at runMicrotasks (<anonymous>)
MC-Wither-sk > at processTicksAndRejections (node:internal/process/task_queues:96:5)
MC-Wither-sk > at async EventEmitter.placeBlock (/home/botdiscord/Minecraft-wither-skeleton/node_modules/mineflayer/lib/plugins/place_block.js:24:5)
When I put the email and password login information in the file and then start it, it say that credentials are not correct.
Why it doesn't work
Logged, had a zombie nearby, died, used console to teleport the bot, died again, did this 2 more times. then it started to crash
Adding the log:
C:\MyGame\Afk-Bot-1.3.3>node .
[2023-02-17T14:19:50.931] [INFO] default - Bot joined to the server
[2023-02-17T14:19:50.934] [INFO] default - Starting moving to target location (-260, 46, -57)
Error: read ECONNRESET
at TCP.onStreamRead (node:internal/stream_base_commons:217:20) {
errno: -4077,
code: 'ECONNRESET',
syscall: 'read'
}
[2023-02-17T14:19:51.436] [ERROR] default - read ECONNRESET
[2023-02-17T14:19:57.731] [INFO] default - Bot joined to the server
[2023-02-17T14:19:57.732] [INFO] default - Starting moving to target location (-260, 46, -57)
Error: read ECONNRESET
at TCP.onStreamRead (node:internal/stream_base_commons:217:20) {
errno: -4077,
code: 'ECONNRESET',
syscall: 'read'
}
[2023-02-17T14:19:58.540] [ERROR] default - read ECONNRESET
[2023-02-17T14:20:05.043] [INFO] default - Bot joined to the server
[2023-02-17T14:20:05.044] [INFO] default - Starting moving to target location (-260, 46, -57)
Error: write ECONNABORTED
at afterWriteDispatched (node:internal/stream_base_commons:160:15)
at writeGeneric (node:internal/stream_base_commons:151:3)
at Socket._writeGeneric (node:net:930:11)
at Socket._write (node:net:942:8)
at writeOrBuffer (node:internal/streams/writable:392:12)
at _write (node:internal/streams/writable:333:10)
at Writable.write (node:internal/streams/writable:337:10)
at Framer.ondata (C:\MyGame\Afk-Bot-1.3.3\node_modules\minecraft-protocol\node_modules\readable-stream\lib\internal\streams\readable.js:662:22)
at Framer.emit (node:events:513:28)
at addChunk (C:\MyGame\Afk-Bot-1.3.3\node_modules\minecraft-protocol\node_modules\readable-stream\lib\internal\streams\readable.js:278:12) {
errno: -4079,
code: 'ECONNABORTED',
syscall: 'write'
}
[2023-02-17T14:20:05.683] [ERROR] default - write ECONNABORTED
[2023-02-17T14:20:11.862] [INFO] default - Bot joined to the server
[2023-02-17T14:20:11.863] [INFO] default - Starting moving to target location (-260, 46, -57)
C:\MyGame\Afk-Bot-1.3.3\bot.js:148
reasonText = reasonText.replace(/§./g, '');
^
TypeError: Cannot read properties of undefined (reading 'replace')
at EventEmitter. (C:\MyGame\Afk-Bot-1.3.3\bot.js:148:31)
at EventEmitter.emit (node:events:513:28)
at Client. (C:\MyGame\Afk-Bot-1.3.3\node_modules\mineflayer\lib\plugins\kick.js:5:9)
at Client.emit (node:events:513:28)
at FullPacketParser. (C:\MyGame\Afk-Bot-1.3.3\node_modules\minecraft-protocol\src\client.js:91:12)
at FullPacketParser.emit (node:events:513:28)
at addChunk (C:\MyGame\Afk-Bot-1.3.3\node_modules\readable-stream\lib_stream_readable.js:298:12)
at readableAddChunk (C:\MyGame\Afk-Bot-1.3.3\node_modules\readable-stream\lib_stream_readable.js:280:11)
at Readable.push (C:\MyGame\Afk-Bot-1.3.3\node_modules\readable-stream\lib_stream_readable.js:241:10)
at Transform.push (C:\MyGame\Afk-Bot-1.3.3\node_modules\readable-stream\lib_stream_transform.js:139:32)
Node.js v18.14.1
could you please give a better explanation on how to install and deploy the ### bot
I want to run this with my pc shutdown? What should i do
I left the type field and password fields blank and typed the username in the username field. The bot won't join the server, even though it is cracked. Is there a way to fix this?
is it possible to send a message/command
to chat?
Afk-Bot-1.3.0/node_modules/minecraft-protocol/src/createClient.js:28
if (!mcData) throw new Error(unsupported protocol version: ${optVersion}
)
^
Error: unsupported protocol version: 1.19.3
at Object.createClient (/home/krist/Desktop/share/yeetus/Afk-Bot-1.3.0/node_modules/minecraft-protocol/src/createClient.js:28:22)
at Object.createBot (/home/krist/Desktop/share/yeetus/Afk-Bot-1.3.0/node_modules/mineflayer/lib/loader.js:96:35)
at createBot (/home/krist/Desktop/share/yeetus/Afk-Bot-1.3.0/bot.js:12:27)
at Object. (/home/krist/Desktop/share/yeetus/Afk-Bot-1.3.0/bot.js:170:1)
at Module._compile (node:internal/modules/cjs/loader:1218:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
at Module.load (node:internal/modules/cjs/loader:1081:32)
at Module._load (node:internal/modules/cjs/loader:922:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47
Node.js v18.13.0
Downloaded latest version form releases and latest node js version
For some reason, minecraft mojang auth has been stopped, so I can't use this on my server without making myself not be able to play on the server. Is there a way to use microsoft account on a cracked server so that I don't have to use my own account?
The script cannot be used on my server. It displays:
[WARN] default - Bot was killed from the server Reason: This server has mods that require Forge to be installed on the client. Contact your server admin for more details.
Can this script support the forge server?
it says bot has been kicked from server add your serve rto your server list
Feature request:
digging selected blocks without moving.
hi, just wanted to let you know that this bot can support 1.18 if you just update your mineflayer version.
Just updated mine and the bot works perfectly
Receiving following error
Error: Cannot find module 'mineflayer'
Require stack:
- /home/runner/Afk-Bot/bot.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/runner/Afk-Bot/bot.js:1:20)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/home/runner/Afk-Bot/bot.js' ]
}
exit status 1
I am trying this Bot on repl it Please add a button for Heroku
Hi, I appreciate the work you have done in making this bot. Its pretty awesome but how can I get into other sub servers (bungee coord) with command like /server "server_name"
I tried using this with a server that is 1.19.3, but it doesn't work.
I've tried:
Updating all NPM/Node modules.
Didn't help sadly...
i logged in your program on my minecraft than i got a email there was a login from a nader location is that the bot ore a hacker?
Hey, having some error codes hitting me, wondering if you can read and tell me whats going on with it? Error code attached below
at checkStatus (C:\Users\harri\afk_bot\node_modules\minecraft-protocol\src\client\microsoftAuth.js:125:11)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Object.authenticatePassword (C:\Users\harri\afk_bot\node_modules\minecraft-protocol\src\client\microsoftAuth.js:81:34)
[ERROR] Too Many Requests
does this few times until it basically gives up
Hello!
So when i try run it i get
Error: Invalid credentials. Invalid username or password.
at call (/root/Afk-Bot/node_modules/yggdrasil/src/utils.js:35:40)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async auth (/root/Afk-Bot/node_modules/yggdrasil/src/Client.js:18:12)
[ERROR] Invalid credentials. Invalid username or password.
My settings.json looks like this
{
"bot-account": {
"username": "[email protected]",
"password": "password",
"type": "Microsoft"
},
The credentials are defiantly correct
Hello i wanted to ask where should i put node . command when i put it in minecraft it didnt work
Need the bot for 1.19
I have a second account I wanted to use for a bot here, which has already been migrated to Microsoft. The config is correct with my Microsoft email and password but no dice - always says incorrect username and password. I tried this by switching it to my Mojang account and it worked, but that's my main account. I migrated that account now (gonna have to do it eventually, anyways) to a different microsoft account but still, doesn't work. Any help here would be very much appreciated.
when any play says something the bot crashes and i get this error
Hint: hit control+c anytime to enter REPL.
Listening on port 8000
[2023-03-13T04:05:40.662] [INFO] default - Bot joined to the server
/home/runner/Afk-Bot/node_modules/prismarine-chat/index.js:390
const fstr = format.formatString
^
TypeError: Cannot read properties of undefined (reading 'formatString')
at ChatMessage.fromNetwork (/home/runner/Afk-Bot/node_modules/prismarine-chat/index.js:390:27)
at Client.<anonymous> (/home/runner/Afk-Bot/node_modules/mineflayer/lib/plugins/chat.js:121:25)
at Client.emit (node:events:513:28)
at Client.emit (node:domain:489:12)
at Client.<anonymous> (/home/runner/Afk-Bot/node_modules/minecraft-protocol/src/client/chat.js:197:14)
at Client.emit (node:events:513:28)
at Client.emit (node:domain:489:12)
at FullPacketParser.<anonymous> (/home/runner/Afk-Bot/node_modules/minecraft-protocol/src/client.js:91:12)
at FullPacketParser.emit (node:events:513:28)
Node.js v18.12.1
repl process died unexpectedly: exit status 1
(To exit
for example on (work on) city builds, hollow out plots, mines, etc
I have tried to create two different folders, but there is an error when running, is there any way to open multiple accounts at once?
I am having a problem with aternos server, the bot is still getting kicked even though i am using anti afk and its jumping. It gets kicked again and again and then banned. I think maybe the antiafk needs an upgrade such as the should should be able to move randomly anywhere.
Add 1.19 version support
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.