Well, since kingnerd is being kingprocrastinator on releasing his bot, I figured I'd release mine.
This bot is meant either for helping with server administration (ie: backup/restore) or for personal use for accelerating & automating monotonous tasks (like digging holes) giving you more time to get creative.
Things the bot can do:
* Draw lines
* Draw cuboids (solid 2D or 3D areas). This means that you can draw cuboids out of blocks (ie: brick) or you can draw negative cuboids (ie: air) to flatten areas, etc.
* Copy & Paste 2D or 3D areas of the map from one part of the map to another, or due to how a chunk of the map is saved to your computer, to other servers.
* Backup & Restore parts of the map. You can selectively restore part of the map to say.. backup12, and then another part of the map to backup13.
* Sponge an area of the map by placing sponges every 5 blocks in 3 dimensions. Doesn't work the best right now since it won't place sponges inside of objects and so won't completely erase all of the water. Works somewhat with .restore in that you first place sponges with .sponge and then .restore them away.
* Erase blocks of a certain type from an area. This is what I'm using to get rid of sponges at the moment if I don't have an area .backup'd.
Example:
Long (9 minute) rambling video of me showing the features all the while spastically flailing the mouse around to induce seizures in the viewers. :
Features not shown:
.reset -- for when you mess up placing the brown mushroom to define a cuboid
.abort -- for when you want the bot to immediately stop what it's doing.
Once you have all of those installed, you can lunch the bot from the command line. Just follow the onscreen directions.
Configuring the bot: Limiting who can use the bot:
Create a users.txt file in the same directory as the script with the name of one allowed user per line. If the users.txt file does not exist, then anyone can use the bot. If it exists, then only the people named can use the bot.
Configuring some bot settings:
Open up the bot.py file with notepad and then at the very top, where it says 'User Configuration Section', you can edit some variables. Each variable has a little blurb next to it as to what it does. Do not change anything under the user configuration section part. I won't help you if you do :tongue.gif:
Help, it doesn't work: The bot doesn't connect
Run the bot from the command line (go to start-> run, type in 'cmd.exe' into the box that pops up. On win7 (and vista?) start->[search programs and files box...] and type in cmd.exe in there.
Once that's open, navigate to the directory where you placed the bot.exe. cd .. makes you go up a folder cd folder_name makes you go into that folder. You can type cd fol- and then hit tab and it'll auto complete.
Once you're in the same folder as the bot.exe, just type 'bot.exe' and then the program will start up and the window won't close once it stops running. Copy/paste everything you see in that window and then paste it in a message here and I'll try to figure out what is wrong with the bot.
However, before you do that, make sure you'd typed everything in correctly.
I want to change the server or I don't want to type (or paste) the server hash
Open up (or create info.txt if it doesn't exist yet) and then write in your information in this format: username-password-hash
Make sure to hit 'y' when it prompts you to store the information in plaintext on your computer (if you don't mind storing your minecraft password in a .txt on your computer) so you don't have to type in everything every time.
I may try to cobble together a GUI to ease this later.
I will also pipe all text to a log file for easier debugging later.
The bot gets kicked for building too fast
Edit config.py and set the build_time to be longer.
Someone else has a bot on the server and when I type .<command name here>, both bots response
Edit config.py and set CMD_PREFIX to some other letter
I don't like that the bot spams so much
Edit config.py and set SILENT_MODE to True (Note the capitalization)
How do I get the bot to move between maps on multi-world servers?
Use .say to force the bot to 'say' the command and thus be moved.
ie: .say /goto map4
I don't want anyone else to use this bot.
Edit users.txt and include one name per line of the people that you want to have access to the bot.
How does .copy/.paste work?
When using .copy, define a 3D (or 2D..) area by placing mushrooms at the diagonals of this space. That area will then be copied into a .chunk file on your computer.
When pasting, .paste will paste that chunk into the server. The orientation will be the same as the original object. You can gauge where from where the bot will start pasting by looking at the (x,y,z) coordinate (if you're using WoM). The bot starts pasting at the lowest x,y,z coordinate.
In conclusion:
If you're using this bot & want more features added to it, I can see what I can do about it.
If you really end up liking this bot, then I'll just say that I haven't bought minecraft yet and well... I hear there are big changes coming to minecraft and multiplayer survival could probably benefit from a bot in one way or another :wink.gif:
Thanks JonasQ/MrScarface of the Electronum servers for buying me a copy :3 I always knew my coding would bring me lots of money and fame (*cough*).
I already put the code in the original post. I'm working on detailed instructions on how to get it up & running at the moment. But the tl;dr version: download the 4 pieces of software that the bot uses, copy & paste the code to a file bot.py (or whatever.py) and then run it & follow the onscreen instructions.
Well, download the mechanize source, and then unzip it all into a directory. Next, open up the command line prompt and then browse to the directory that contains the mechanize code (cd .. makes you go up a directory, cd <dir name> makes you go into that directory). Once you're in the directory with the mechanize code, type 'python setup.py install' and hopefully it works for you :biggrin.gif:
Like I said, I'll try to get a py2exe version made or I'll try to remove some of the dependencies (for example, I don't really need numpy).
This looks like a very helpful bot. I, among some others I'm sure, have been spoiled by the commands available on custom servers such as mc#, d3, and icraft, and now unfortunately I can't build for **** without them. So this bot shall come in handy to me.
Ok, if you want to limit who can use the bot, create a "users.txt" file in the same directory as the bot and then add people's usernames, one per line. If the file doesn't exist, anyone can use it, if the file exists, then only the people named in the file can use it.
Well, it copies them just fine, it just doesn't know how to place them just yet. Doublestairs are special blocks that you just can't place into the game (ie: can't send a packet that says 'place double stair here' since you'll get kicked for placing in illegal block). The way to place double stairs is by placing two half-stair blocks on top of each other and I just haven't gotten around to coding that in yet.
Anyway, I've modified the bot so that it should work with MCZ servers now. Let's see what I broke with this update :|
Edit2: Should now be able to switch between maps (use .say /goto...)
Ok, I have EVERYTHING installed, and I still don't have a python.exe. I installed it to my desktop, so I have a folder on my desktop called Python-2.6. I looked inside, and no python.exe. But I installed twisted, zope, and mechanize, I just can't run the dang bot!
I know that you finally got it working, Z0mb1n3, but for others, I've made an executable version of the script so that you don't have go through the headache of installing all the dependencies. It's available in the first post.
Again, if there are bugs that you encounter, do tell :smile.gif:
I tried using the executable version. The bot joined the server than immediatly left. I managed to get the error it was:
File "gzip.pyo", line 255, in _read
File "gzip.pyo", line 156, in _read_gzip_header
exceptions.IOError: Not a gzipped file
Lost connection. Reason: [Failure instance: Traceback (failure with no frames):
<type 'exceptions.IOError'>: Not a gzipped file
]
Stored values found: using them. Delete info.txt to remove these.
Please wait. Loading
Running bot
Started to connect.
Connected.
Sending connection string
<Player 'UDbot' logged in.>
<Welcome to Dysgalt's D3 build server>
<Please give our site, http://theborderworlds.com a visit.>
User: [Please give our site, http:127], message: [//theborderworlds.com a visit.
]
Command: [//theborderworlds.com], Argument: [a visit.]
Joined server! Ver: 7, Name: Dysgalts D3 Build Server, Motd: Welcome! Please go
to the current main +hax, Your type: 0
Receiving level data
Downloading level, 8 complete.
Downloading level, 16 complete.
Downloading level, 25 complete.
Downloading level, 33 complete.
Downloading level, 41 complete.
Downloading level, 50 complete.
Downloading level, 58 complete.
Downloading level, 66 complete.
Downloading level, 75 complete.
Downloading level, 83 complete.
Downloading level, 91 complete.
Downloading level, 100 complete.
Level downloaded. Size: (64,128,64)
Writing 12288 bytes to out.gz
Traceback (most recent call last):
File "twisted\python\log.pyo", line 84, in callWithLogger
File "twisted\python\log.pyo", line 69, in callWithContext
File "twisted\python\context.pyo", line 59, in callWithContext
File "twisted\python\context.pyo", line 37, in callWithContext
--- <exception caught here> ---
File "twisted\internet\selectreactor.pyo", line 146, in _doReadOrWrite
File "twisted\internet\tcp.pyo", line 460, in doRead
File "bot2.py", line 1044, in dataReceived
File "bot2.py", line 1054, in process_data
File "bot2.py", line 1081, in dispatch_events
File "bot2.py", line 818, in onLevelEnd
File "gzip.pyo", line 212, in read
File "gzip.pyo", line 255, in _read
File "gzip.pyo", line 156, in _read_gzip_header
exceptions.IOError: Not a gzipped file
Lost connection. Reason: [Failure instance: Traceback (failure with no frames):
<type 'exceptions.IOError'>: Not a gzipped file
]
This bot is meant either for helping with server administration (ie: backup/restore) or for personal use for accelerating & automating monotonous tasks (like digging holes) giving you more time to get creative.
Things the bot can do:
* Draw lines
* Draw cuboids (solid 2D or 3D areas). This means that you can draw cuboids out of blocks (ie: brick) or you can draw negative cuboids (ie: air) to flatten areas, etc.
* Copy & Paste 2D or 3D areas of the map from one part of the map to another, or due to how a chunk of the map is saved to your computer, to other servers.
* Backup & Restore parts of the map. You can selectively restore part of the map to say.. backup12, and then another part of the map to backup13.
* Sponge an area of the map by placing sponges every 5 blocks in 3 dimensions. Doesn't work the best right now since it won't place sponges inside of objects and so won't completely erase all of the water. Works somewhat with .restore in that you first place sponges with .sponge and then .restore them away.
* Erase blocks of a certain type from an area. This is what I'm using to get rid of sponges at the moment if I don't have an area .backup'd.
Example:
Long (9 minute) rambling video of me showing the features all the while spastically flailing the mouse around to induce seizures in the viewers. :
.drawline @0:15
.goaway @1:00
.cuboid @1:05
.sponge @2:05
.erase @2:55
.copy @ 3:20
.paste @ 3:50
.backup @ 5:10
.restore @ 6:00
unflooding water & lava via .restore @ 6:40
Features not shown:
.reset -- for when you mess up placing the brown mushroom to define a cuboid
.abort -- for when you want the bot to immediately stop what it's doing.
Where to get the bot:
Download or check out (with svn) all of the files from here
Save them as something with the .py extension, install the dependencies, run it with python.
or
If you're a fan of downloading .exes from strangers on the internet, I then give you this file:
Insidebot in .exe form. Unzip it and then put it into a folder and then run bot2.exe
Manual Installation (if not using the .exe):
You need to have the following installed on your computer:
Python 2.6
Twisted for Python 2.6
zope.interface for python 2.6
mechanize (unfortunately the installation process is a bit more indepth..)
Once you have all of those installed, you can lunch the bot from the command line. Just follow the onscreen directions.
Configuring the bot:
Limiting who can use the bot:
Create a users.txt file in the same directory as the script with the name of one allowed user per line. If the users.txt file does not exist, then anyone can use the bot. If it exists, then only the people named can use the bot.
Configuring some bot settings:
Open up the bot.py file with notepad and then at the very top, where it says 'User Configuration Section', you can edit some variables. Each variable has a little blurb next to it as to what it does. Do not change anything under the user configuration section part. I won't help you if you do :tongue.gif:
Help, it doesn't work:
The bot doesn't connect
Run the bot from the command line (go to start-> run, type in 'cmd.exe' into the box that pops up. On win7 (and vista?) start->[search programs and files box...] and type in cmd.exe in there.
Once that's open, navigate to the directory where you placed the bot.exe.
cd .. makes you go up a folder
cd folder_name makes you go into that folder. You can type cd fol- and then hit tab and it'll auto complete.
Once you're in the same folder as the bot.exe, just type 'bot.exe' and then the program will start up and the window won't close once it stops running. Copy/paste everything you see in that window and then paste it in a message here and I'll try to figure out what is wrong with the bot.
However, before you do that, make sure you'd typed everything in correctly.
I want to change the server or I don't want to type (or paste) the server hash
Open up (or create info.txt if it doesn't exist yet) and then write in your information in this format:
username-password-hash
Make sure to hit 'y' when it prompts you to store the information in plaintext on your computer (if you don't mind storing your minecraft password in a .txt on your computer) so you don't have to type in everything every time.
I may try to cobble together a GUI to ease this later.
I will also pipe all text to a log file for easier debugging later.
The bot gets kicked for building too fast
Edit config.py and set the build_time to be longer.
Someone else has a bot on the server and when I type .<command name here>, both bots response
Edit config.py and set CMD_PREFIX to some other letter
I don't like that the bot spams so much
Edit config.py and set SILENT_MODE to True (Note the capitalization)
How do I get the bot to move between maps on multi-world servers?
Use .say to force the bot to 'say' the command and thus be moved.
ie: .say /goto map4
I don't want anyone else to use this bot.
Edit users.txt and include one name per line of the people that you want to have access to the bot.
How does .copy/.paste work?
When using .copy, define a 3D (or 2D..) area by placing mushrooms at the diagonals of this space. That area will then be copied into a .chunk file on your computer.
When pasting, .paste will paste that chunk into the server. The orientation will be the same as the original object. You can gauge where from where the bot will start pasting by looking at the (x,y,z) coordinate (if you're using WoM). The bot starts pasting at the lowest x,y,z coordinate.
In conclusion:
If you're using this bot & want more features added to it, I can see what I can do about it.
If you really end up liking this bot, then I'll just say that I haven't bought minecraft yet and well... I hear there are big changes coming to minecraft and multiplayer survival could probably benefit from a bot in one way or another :wink.gif:Thanks JonasQ/MrScarface of the Electronum servers for buying me a copy :3 I always knew my coding would bring me lots of money and fame (*cough*).
It's not like there aren't already bots out there that can do what mine can do... but better ;P
Like I said, I'll try to get a py2exe version made or I'll try to remove some of the dependencies (for example, I don't really need numpy).
Well.. you could try typing this at the prompt (while you are in the folder with the mechanize/setup.py)
cmd> c:/python26/python.exe setup.py install
(assuming you installed python2.6 to c:/python26/, which is the default.)
The file that you want is the r3.
Offtopic: Yeah, I always got excited about KingNerd's bot but it was never released.
Anyway, I've modified the bot so that it should work with MCZ servers now. Let's see what I broke with this update :|
Edit2: Should now be able to switch between maps (use .say /goto...)
Again, if there are bugs that you encounter, do tell :smile.gif:
Would you please start up the bot one more time and then paste me as much of the scrollback as you can?
Thanks!
Here is the whole thing, minus personal info: