Coder Social home page Coder Social logo

mc-bots's People

Contributors

crpmax avatar isu-kim avatar norbiros avatar sans404-dev avatar shayangsh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mc-bots's Issues

Bot unable to login

Hello, I am trying to use this to stress test my server and every time I run it, I get the following error:

[10:55:45] INFO | Login failed: Invalid login session.
com.github.steveice10.mc.auth.exception.request.InvalidCredentialsException:
at com.github.steveice10.mc.auth.util.HTTP.checkForError(HTTP.java:97)
at com.github.steveice10.mc.auth.util.HTTP.makeRequest(HTTP.java:75)
at com.github.steveice10.mc.auth.service.SessionService.joinServer(SessionService.java:68)
at com.github.steveice10.mc.protocol.ClientListener.packetReceived(ClientListener.java:66)
at com.github.steveice10.packetlib.event.session.PacketReceivedEvent.call(PacketReceivedEvent.java:51)
at com.github.steveice10.packetlib.tcp.TcpSession.callEvent(TcpSession.java:149)
at com.github.steveice10.packetlib.tcp.TcpSession.channelRead0(TcpSession.java:364)
at com.github.steveice10.packetlib.tcp.TcpSession.channelRead0(TcpSession.java:36)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:321)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:295)
at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:321)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:295)
at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:321)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:295)
at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:829)
[10:55:45] INFO |
[10:55:45] INFO | Bot with MainListener removed
[10:55:45] ERROR | All bots disconnected, exiting

For context, I am running my server in a docker container with a custom port. I am able to connect to the server using the minecraft client but the bots refuse to connect to the server.

building problem

Initialized native services in: /root/.gradle/native
The client will now receive all logging from the daemon (pid: 586242). The daemon log file: /root/.gradle/daemon/6.4.1/daemon-586242.out.log
Starting 5th build in daemon [uptime: 5 mins 15.803 secs, performance: 97%, non-heap usage: 24% of 268,4 MB]
Using 3 worker leases.
Starting Build
Settings evaluated using settings file '/root/mc-bots/settings.gradle'.
Projects loaded. Root project using build file '/root/mc-bots/build.gradle'.
Included projects: [root project 'mc-bots']

> Configure project :
Evaluating root project 'mc-bots' using build file '/root/mc-bots/build.gradle'.
All projects evaluated.
Selected primary task 'build' from project :
Tasks to be executed: [task ':compileJava', task ':processResources', task ':classes', task ':jar', task ':assemble', task ':compileTestJava', task ':processTestResources', task ':testClasses', task ':test', task ':check', task ':build']
Tasks that were excluded: []
:compileJava (Thread[Execution worker for ':',5,main]) started.

> Task :compileJava FAILED
Caching disabled for task ':compileJava' because:
  Build cache is disabled
Task ':compileJava' is not up-to-date because:
  Task has failed previously.
The input changes require a full rebuild for incremental task ':compileJava'.
Full recompilation is required because no incremental change information is available. This is usually caused by clean builds or changing compiler arguments.
Compiling with JDK Java compiler API.
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/Bot.java:4: error: package com.github.steveice10.mc.protocol.packet.ingame.clientbound does not exist
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundLoginPacket;
                                                                  ^
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/Bot.java:5: error: package com.github.steveice10.mc.protocol.packet.ingame.serverbound does not exist
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.ServerboundChatPacket;
                                                                  ^
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/MainListener.java:3: error: package com.github.steveice10.mc.protocol.packet.ingame.clientbound does not exist
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundChatPacket;
                                                                  ^
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/Bot.java:41: error: method does not override or implement a method from a supertype
                @Override
                ^
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/Bot.java:43: error: cannot find symbol
                    if (packet instanceof ClientboundLoginPacket) {
                                          ^
  symbol: class ClientboundLoginPacket
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/Bot.java:69: error: cannot find symbol
        client.send(new ServerboundChatPacket(text));
                        ^
  symbol:   class ServerboundChatPacket
  location: class Bot
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/MainListener.java:11: error: MainListener is not abstract and does not override abstract method packetSent(PacketSentEvent) in SessionListener
public class MainListener implements SessionListener {
       ^
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/MainListener.java:17: error: method does not override or implement a method from a supertype
    @Override
    ^
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/MainListener.java:19: error: cannot find symbol
        if(packet instanceof ClientboundChatPacket) {
                             ^
  symbol:   class ClientboundChatPacket
  location: class MainListener
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/MainListener.java:20: error: cannot find symbol
            Component message = ((ClientboundChatPacket) packet).getMessage();
                                  ^
  symbol:   class ClientboundChatPacket
  location: class MainListener
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/MainListener.java:38: error: method does not override or implement a method from a supertype
    @Override
    ^
11 errors
:compileJava (Thread[Execution worker for ':',5,main]) completed. Took 0.378 secs.

FAILURE: Build failed with an exception.```

Not connecting

So when i do the command to get bots to join my server it just gives this error
Capture56

Feature request [BOT LEAVE/REJOIN AND COMMAND PREFIXES]

Since bot control may be getting added, here's another cool feature related to that:

Whenever controlling a single bot, something I'd also like to see is to make that specific bot leave or rejoin the server.
A command like leave or rejoin would be fine, but since it can cause some misunderstandings, there should be a prefix for all bot commands. An example is !. Commands would look like this: !ctrl, !leave and !rejoin.

Rejoin โ‰  Autorejoin

Autorejoin automatically rejoins if the bot gets kicked, and rejoin just rejoins by itself.

Examples

!leave - All bots leave the server, or a single bot if controlling it with ctrl
!rejoin - All bots leave the server (bot names may be saved to memory or to a temporary file), and they join back, unless only one is under control

Yeah, I know it's a lot, and this is my third suggestion, but I'm completely filled with them. I love this project and I'd love to support it.
If you don't mind, I'll keep posting suggestions until I'm out of them.

Bots disconnecting??

So I have used Java before I have the command and everything and proxies. I tested it on my own server, Nothing happened I checked command prompt and the proxies were working the accounts were being made although a few seconds later they 'disconnected' then the the command would end saying all bots disconnected.
Java -jar mc.jar -s (the ip) -p MCBOT_ -c 5 -t SOCKS4 -l socks4.txt -r
This is the command I used and 333 of the proxies were working.
And my java its the the on the latest version, and im using windows 10

Feature request [SINGLE-BOT CONTROL]

The feature to only control a single bot would be really useful.

By typing in chat something like "ctrl BotName1", an user should only type commands/messages as that bot. Then, by typing "ctrl" without any arguments, it should control all bots again.

That's only what I imagine it would be like though. If you have any better ideas, use those.
This would also be really useful when testing features in the server while under stress.

400 players test crash

I'd like to simulate 400 concurrent players on my test server for an issue with my plugin: kangarko/ChatControl-Red#1566 (comment)

I am using the following startup flag for bots to connect to BungeeCord:

java -jar -Xms8G -Xmx8G mc-bots-1.1.0.jar -s localhost:25577 -d 10 11 -r -x -c 400

Which results to around 100 bots connecting to the proxy before dropping off and stabilizing at around 20:

a

Why is that? Too little memory? I have a machine with 64gb at my disposal, how much RAM do you think I need to set?

But I do think that the dropoff is a bug, can you please have a look?

Thanks!
Matej

Comments

I recommend removing annotated parts such as
" //Log.info(Arrays.toString(message.getWith().toArray()));
//msg = String.format(msg, );
//return msg;
" which are completely useless here.

Online mode token

is it possible to give a bot a token? i dont know if there is a command or config file to do this

Not working for me

Hi, I'm running this locally (on the same machine as the server) with the following command:

java -jar mc-bots-1.1.0.jar -d 10 11 -s localhost:30067 -r -p BOT_ -c 1

I get the following output:

[00:58:28] INFO | IP: 127.0.0.1
[00:58:28] INFO | Port: 30067
[00:58:28] INFO | Count: 1
[00:58:28] INFO | Creating bot BOT_Zdeslava
[00:58:28] INFO | MainListener registered for: BOT_Zdeslava
[00:58:58] INFO | 
[00:58:58] INFO | BOT_Zdeslava disconnected
[00:58:58] INFO |  -> Connection closed.
[00:58:58] INFO | 
[00:58:58] INFO | Bot with MainListener removed
[00:58:58] ERROR | All bots disconnected, exiting

My server logs are as follows:

[00:58:58] [Server thread/INFO]: com.mojang.authlib.GameProfile@42e3e93e[id=<null>,name=BOT_Zdeslava,properties={},legacy=false] (/127.0.0.1:46439) lost connection: Timed out

Am I doing something incorrect here? Maybe there is some config in my server that is causing problems but I'm not sure what that would be...

Suggestion

I've noticed that there is no way to change IPs when testing with those bots, so, can we have an switch to make bots disconnect right after conecting? My server limits to 3 connections through one IP.

And thanks for the awesome tool!

errors while using proxies

there's errors when the proxy is not working and the bot with the main listener never joins if the proxy is not working

How to use proxy?

i want stress test my server but that only join from my ip not from proxy. i setup a startup correctly using proxy. but not working
can give me some example?

max bots is 1000

max bots is 1000
anything higher just wont join, no matter how long I wait

1.16.5

Is it possible to upgrade it to the new verison ?

Custom Commands

Hi! I am working on a project in which I will be creating a localhost website with all the features that mcstorm.io provides. Since I am a developer of javascript I used mineflayer api, the worst drop back about that api is it doesn't support 1.19.2/1 right now. So, kindly tell me the possible way for making your bots do custom actions like moving . Thanks :)

1.17.1

Can this be used on 1.17 - 1.17.1? Thanks!

I need someone to type this god damn command for me

idek this crap and also who ever is gonna type the command for me the file is the latest and i have another question DO I NEED A PROXY if not im happy if so the idk how to do anything on here but i need someones help lol and i dont need instructions bc ive read EVERYTHING HERE im just need a command and a answer

Add proxy support

Hello,
This program needs to adapt proxy support because it will help server owners when the test server has "connection-throttle"

1.18.x

please add support for 1.18 :)

Unable to send commands and messages

After entering the server with the robot, enter the registration command but display "please enable chat" and "chat is disabled in the client". How can I turn it on

Feature request [AUTORESPAWN/AUTORECONNECT]

Autorespawn / Autoreconnect

Whenever I kill the bots, they don't respawn, and they can't send any messages neither.

A feature where the bots could respawn automatically with a customizable time delay like on joining would be useful. Autorejoin too, if it kicks you by accident or by any reason.

Example of how it'd look (with arguments):

Autorespawn

-ar 2000 - Automatically respawns with 2 second delay

Autorejoin

-aj 3000 - Automatically rejoins with the same bot account in 3 seconds of being kicked

By the way, I'm just a beginner in coding, so I don't know why --nicks has two dashes. I think because it's multiple characters? In that case, use --ar and --aj instead of -ar and -aj.

Again, just to clarify, that's only what I imagine it would be like though. If you have any better ideas, use those.

Using - inside the ip of the server

So, i'm a developer for a little server me and my friends own and they don't know how to get the numeric ip for the server (goofy ahh hosting) so we want to use the domain of the server which looks something like this: xxxx.xxxx-xxxxxxxx.xx
There is a - in there which makes the program crash, any ideas on how i could implement myself that or just wait for an update?

Solved

after gradlew or gradlew build show me this error. Please can you help me?

Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain

Getting this error

Creating bot mYKjm2WEShJt1xIf
[22:20:55] INFO | MainListener registered for: mYKjm2WEShJt1xIf
[22:20:55] INFO |
[22:20:55] INFO | mYKjm2WEShJt1xIf disconnected
[22:20:55] INFO | -> com.github.steveice10.mc.protocol.data.UnexpectedEncryptionException: Cannot reply to ClientboundHelloPacket without profile and access token.
com.github.steveice10.mc.protocol.data.UnexpectedEncryptionException: Cannot reply to ClientboundHelloPacket without profile and access token.
at com.github.steveice10.mc.protocol.ClientListener.packetReceived(ClientListener.java:55)
at com.github.steveice10.packetlib.tcp.TcpSession.callPacketReceived(TcpSession.java:156)
at com.github.steveice10.packetlib.tcp.TcpSession.channelRead0(TcpSession.java:377)
at com.github.steveice10.packetlib.tcp.TcpSession.channelRead0(TcpSession.java:28)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)
[22:20:55] INFO |
[22:20:55] INFO | Bot with MainListener removed
[22:20:55] ERROR | All bots disconnected, exiting

Proxy switching

  1. load proxies from a file or url
  2. select a random one
  3. use it
  4. repeat

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.