Social Icons

Tuesday 6 August 2013

[Release] DarkBot | The ultimate tool in Minecraft automation | Multi-version support

DarkBot

After some newfound interest in Minecraft automation came about in this section (multiple threads on the subject), I decided that I would revive this project and release it once and for all, completely open source. This project is an attempt at artificial intelligence in Minecraft. It has many uses, aside from automation, including (completely) custom clients, server monitors, and more. Multi-protocol support was recently added, allowing the same version of the bot to run on different Minecraft versions (assuming that the corresponding protocol version provider is in the protocols/ directory).

Media

Sayaad wrote a schematic building task that works incredibly well:




Getting Started

With Eclipse: Requirements: JDK 7, Eclipse, EGit

Open Eclipse.
Right-click in the package explorer area and click Import...
Select Git > Projects from Git and click Next.
Select URI and click Next.
Paste the Git URL for DarkBot (Click here and click Next, then click Next again at the Branch Selection dialog.
Change the directory to [your eclipse workspace]/DarkBot (change the [] to the actual path to your workspace by clicking browse) and click Next.
Select Use the New Project wizard and click Finish.
In the New Project wizard, select Java Project and click Next.
Type in DarkBot (exact capitalization). If you typed it in properly and all previous steps have been followed, options in the wizard should disable themselves. Click Finish if this is the case.
Once cloned, expand the project in your package explorer. There will likely be a large amount of errors. Right-click "src" and click Build Path > Remove from Build Path. The folder src should move down below "JRE System Library" and all errors should disappear.
Expand src, then expand each folder within src. In each of these folders, right-click each folder (named java, resources, protocols, etc.) and click Build Path > Use as Source Folder.
Expand lib, right click every .jar file, and click Build Path > Add to Build Path.
Right-click build.xml and click Run As > Ant Build (the first option).
Wait for the build to complete and run DarkBot.jar from cmd with --help for args.
Hurray! The plus side to this method (though it may seem lengthier than the one below) is that you can right-click the project folder and click Team > Pull to get new updates. Make sure you run build.xml after every time you update.

Without Eclipse: Requirements: JDK 7, Apache Ant

Clone the project with git or download the source zip from the github page and extract it.
Open the folder and run build.xml (this may require cmd to execute).
Wait for the build to complete and run DarkBot.jar from cmd with --help for args.
Hurray! The downside to this is that you have to delete the folder and redo these steps every time you want to update.

To Run: Requirements: cmd / terminal

cd to the directory with DarkBot.jar ('cd path/to/DarkBot.jar' or 'cd C:\path\to\DarkBot.jar')
For CLI: run 'java -cp DarkBot.jar org.darkstorm.darkbot.mcspambot.DarkBotMC --help' for possible arguments, then repeat it without --help and instead options like --username and --password.
For CLI (spambot): run 'java -cp DarkBot.jar org.darkstorm.darkbot.mcspambot.DarkBotMCSpambot --help' for possible arguments, then repeat it without --help and instead required options.
For GUI: run 'java -cp DarkBot.jar org.darkstorm.darkbot.darkbotmc.DarkBotMC'

Fixing "JAVA_HOME does not point to the JDK" issues (for Eclipse):

Make sure you have JDK 7 installed.
Right-click the DarkBot project folder in Eclipse and click Build Path > Configure Build Path.
Make sure the Libraries tab is open, then select JRE System Library and click Edit.
Select alternate JRE and click Installed JREs.
If you see JDK 7 listed, select it and hit OK, otherwise click Search and browse to its folder in C:\Program Files\Java.
Hurray! Run build.xml again to verify that it works.

Source Location

The code is hosted on github: click here
Submit pull requests if you want to add/change things (new tasks, bug fixes, etc.).
If you have any questions, send me a PM, contact me on IRC in irc.rizon.net #darkstorm, or add me on skype at darkstorm652.

No comments:

Post a Comment