Creating an Interactive Bot

Discussion in 'Programming' started by Qruet, May 17, 2017.

  1. I have an alternate minecraft account that I use to test my plugins but I also would like to turn it into a bot that can join any server, interact in chat (not spam) move around and perhaps assist me in minigames etc. I need some way of having a bot capable of understanding its surroundings and interact to certain messages in chat. For example, messages that may include the bot's name in chat etc would act as a keyword and therefore reply to that message. I know bots in the past have been used for hostile reasons, to spam and grief/lag servers. I'm on the contrary want this to simply be a fun personal project where I can have a fun interactive bot that doesn't do anything hostile and that other players may have fun interacting with. My goal is to hopefully change this alternate account of mine into some sort of AI. It will be difficult and I know will take a while but I know this will be a huge gain in my programming experiences. I want this project to primarily evolve around java although I've created something before that read the logs from the client reading chat and then using java bot to control my mouse and type in chat a message as a reply. It was very inefficient since this ran externally outside the client and was pretty slow, and is incapable of understanding its surroundings (blocks/obstacles) in the minecraft environment. I want to make more of a mod or maybe make use of how perhaps hacked clients are made since I know some hacked clients contain combat bots that move around and fight. I'd like to learn how this is done so that I can create one that is capable of fighting in pvp arenas (without some sort of kill aura) as well as preform actions such as breaking blocks, crafting, mining, and moving around and talking in chat. I'd like to know though where to begin. Should I learn to create a mod that allows my account to interact with its environment automatically, or should I create some sort of hacked client however instead of hacks it's simply preforming certain actions that automatically are run when certain events are fired. I'm kind of lost right now, and I need an idea of where to start.
    ~Geekles
     
  2. Macro / Keybind Mod can do most of the things you listed
     
  3. Not what I had in mind at all, and doesn't do really what I want.
    A.) It's simply a mod that allows you to create multiple relatively simple macros.
    B.) This is a personal project and I want to learn from it. I don't want something that's already been created for me and I simply use it's ingame gui to make changes
    C.) Yeah, it probably can be made to type things in chat, teleport to places but that's not what I mean by movement or interact in chat. I want my alternate account (without any human interaction) to move around a map, interact with players in chat, and simply map out its surroundings. The Macro/Keybind mod wouldn't allow me to do any of this except run a command over and over again without any real intput and generating its own output.

    ~Geekles
     
  4. With the scripting capability in the mod you can get the id of a block at a position, listen for chat messages and respond, use regex functions, etc
     
  5. Oh Boy! Another Bot ** Why Me spigot, WHY ME **
    Most of this junk is gonna cost money if you want it made, and not little money, THOUSANDS
     
  6. I'll take a look see if I can actually use it, what you say I guess makes sense if you can read blocks around it however I feel like this is defeating the purpose of this project. I want to get the entire learning experience from this and not just use some mod to get this done. Even though I may need to do some additional programming to work alongside with this mod. I'm assuming a simply macro to do tasks like hold left click to break blocks etc. However I'd like to run these commands somehow within the launcher rather simply running code outside the launcher to work with the mod running with the launcher.
    ~Geekles
     
  7. Didn't understand your comment exactly. But the point of this isn't to ask someone else to make it for me. I'm curious as to where to start to be able to create a bot. Also if you had read carefully there is no hostile intention with this project. If I really wanted to I could go ahead look up how to make a bot to grief servers. However my idea is to create something interactive, fun, and helpful. Far as I can tell there haven't been that many projects related to what I'm attempting to do.
     
  8. I'm beginning to learn how to develop mods. Hopefully I'll get the hang of it soon. I've noticed also people create custom entities that interact with its environment. However rather then creating a new entity, I'd simply like to control a player. So using my old bought alt account, I'd install my own mod onto it and then by saying certain phrases in chat it'd preform certain tasks, or simply preform these tasks automatically. So if the player is attacked by a mob I'd like to detect this, figure out what mob had attacked it, and then fight the mob in a certain way. I believe mods are capable of doing this since I found this post http://www.minecraftforum.net/forum...ical-intelligence-in-video-games-where-are-we. I believe this is actually an alternate account using the mod to preform the tasks rather then the mod simply creating a custom entity. The problem with creating custom entities would mean limiting the possibility of testing the AI in new environments among other players on other servers. The mod should be like optifine where players using the mod can still join servers without the mod installed on the servers. This is why I need it to control the player which I'm hoping someone can provide me with some sort of api, tutorial etc as to where to start. I may look into creating entity ai's and see if there is a way to just simply control a player rather then creating an entity.
    ~Geekles
     
  9. Optic_Fusion1

    Resource Staff


    1.Messages that may include the bot's name in chat - Check to see if the message continues the bot's name, if it does choose from a list of responses randomly..or learn how to make something like cleverbot where it learns by what is said..Depending on how you have it learn, it might require a decent amount of storage...
    2.Move around..check in a certain radius of the bot..if it's a valid position/block..move there
    Example
    grass then air above it and air above that = valid
    lava then air above it and air above that - does the bot have a block? if so can it place the block? if so place it and move there, if not don't

    Assisting you in minigames will require some kind of AI learning capability - I do not know of any API's or anything like that java or minecraft
    You could possibly hard code it...however it's best that you don't

    Pvp bots most likely check the surrounding area looking for certain entities..if there is one..it faces it and attacks..

    breaking blocks - check the block - check the tool if the tool is able to break it..use whatever method.. for spigot it would be
    Block block = <codehere>
    block.breakNaturally()
    same with mining btw

    crafting - is it by a crafting table? if not then dont craft if it is..simply check it's inventory if it can craft it..do so..you can make this system better in many ways like storing each item with a certain number 0-100 the higher the number the more important it is, or something..theres probably better ways

    Most of the thing you want can be done with spigot...You just have to figure out how to code it all properly..