Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

Minebot [Discontinued]


  • This topic is locked This topic is locked
369 replies to this topic

#1

umby24
    umby24

    Gold Miner

  • Members
  • 371 posts

Posted 11 March 2010 - 01:06 AM

https://sourceforge....ojects/minebot/


VB Minebot

version 2.5

By Umby24 (Wandering Scripter)

----------
What is VB Minebot?
----------
VB Minebot is a program written in Visual Basic.NET to connect to, and interact with Minecraft servers.
----------

----------
What can VB Minebot do?
----------
VB Minebot is under active devolopment, so this list could change soon. But here is the current feature list:

- Supports Minecraft Packet Protocol version 7
- can talk on servers via the textbox at the bottom on the programs UI.
- can change location to move around the server
- can place a block of almost any kind, in any place you would like.
- can open/close your server jail, while you are in -- or outside of your server
- Name the bot whatever you like (If verify-names is off)
- Follow any player around via !Follow (It will follow whoever types !follow)
- View online players via !Players (Only for those on admin list)
- Command Alia's for !follow, !closejail and !openjail added
- Jail blocks are now unlimited, make as many jail blocks as your heart desires!
- Make the bot say whatever you like, from in-game! just use !Say [message]
- Choose to use verify-names on, or off.
- Server bookmarks, for ease of logging on to your favorite servers
- !Spat, Spam's a specified amount of stone in the air, mainly for blob survival.
- Bot admin form, for ease of managing your bots approved users
- Remember me option so you don't have to worry about typing your login every time
- Build objects made in .txt files
- Log the chat thats going on in your server
- Follow around other players
- Parses color codes, and views them bot-side.
- Can count down to annouce an event
- Can evaluate simple expressiosns via VBScript (!eval, !eval2)
- Accepts commands from D3 server global chat
- Scripting support via VBScript. 4 examples files included. -- NEW --
- run scripts at certain events. -- NEW --
---------

---------
Changes:
---------
- Scripting support has been updated with events, and I fixed a few bugs around the house.

---------
Full Commands List:
---------
!say [message] - Makes the bot say [message]
!count [number] [message] - Makes the bot count down from [number] and then say [message]
!f [name] - Follows [name]
!build [name] - Builds from [name].txt
!xbuild [name] - builds from [name].txt
!head [0-255] - Changes the heads position to [0-255]. 128 is upside down.
!spat [number of blocks] - Spams [number of blocks] in the air, at the highest point in the map.
!eval [expression or sub] - Evaluates expression, Or runs sub from inside bot, or from script
!eval2 [expression or function] - Same as !eval, only it returns a value
!closejail / !cj - Closes the set jail blocks.
!van - Turns on vanilla build mode, so that !build and !xbuild build slower, for vanilla servers.
!info - Tells you the version of the bot.
!openjail / !oj - Opens the set jail blocks
!players - returns a list of players the bot can see.
!follow / !f - Follows whoever said !f / !follow
---------

---------
How to:
---------
===
Use Minebot's Scripting support
===
  Alright so this is going to be your crash course on VBScript, with a few examples here and there

So for some basic VB Script stuff, I would reccommend you look here: http://msdn.microsof... ... tt(v=VS.85).aspx

That will give you the basic understanding of VBScript, as well as a reference to its built-in functions.

Now for a few more examples, you can look at the 4 files that I included in the /scripts/ folder.

Ok, so all code for the scripts *must* be placed in either a Sub, or a function. otherwise it will just run
the second that the bot loads it.

if it is placed in a sub or function, you can call the script to run, by using the !eval command.

For example, if I have a sub called pie, any admin can then run that script by typing !eval pie
The bot would then run all code in the pie sub.

This can also be done for functions. Note that all functions require parentethes for the arugements, whileas
subs are kind of touchy. sometimes they need them, other times not. How will you know? simple, it will give you an error :P

If it is a function, to see the return value you may want to use !eval2 functionname

Included there is a scripting.txt file. This will show you the exposed variables, and functions that you
can use in your scripts. In the included examples you will find the most used one to be sendmessage.
which as the name implies, makes the bot send a chat message.

Notice that you *will* at one time or another come across an error of some kind, but never fear.
First google, and if you can't find an answer, THEN you can post on the minecraft forum topic for help.

Now also note that all the scripts are in .vbs files, and you can have as many subs and functions as you want per file.

Also note that any sub or function in the files can call other subs and functions from the script files.

I actually do this with the buildletters script, I call the refresh sub many times to keep the bots location updated.

You can add and delete modules from the module management window, from File > Manage Modules.

anyways thats the small crash course on how to use the scripting, enjoy and if I can make it any more clear for you
please ask.


========================

===
Use the Jail Open/Close feature
===

This function is -- as I see it, moderately hard to set up.
But once it IS set up, it is a nice feature to have.

This allows you to delete/place as many blocks as you want with the press of a button / type of a command.

You can set as many as you want.

First, you will need to goto your jail, on normal minecraft (or the WoM Client, whichever you prefer)
then delete out your blocks, and open a notepad, or something simular.

on the Minebot, goto extra > Dev Mode or press alt + E + D, This will enable devoloper mode.

Then, place the blocks back, it doesn't matter what material they are, we will make them adminium soon.

for each of the blocks you place, you should get something like this:

Got Change @ -3328,19456,-17664

for each block you place. This is the X,Y,Z position of the block you just placed.

once you have this for all of the blocks you wish to place, you can turn off dev mode.

(Same way you turned it on)

Now open up the Set Jail dialog. (Extra > Set Jail, or Alt + E + S)

You will now have 1 row of X,Y,Z boxes.

For each of the blocks positions you have, enter the X, Y, Z into the boxes, then press the + button.

When you are done, press the Done button, and your jail blocks will be set.

From here on out you may press the open or close jail button on the extra menu to open or close the jail.


======================




===
Using the Command Based Open/Close Jail function
===

For obvious reasons, the commands !openjail and !Closejail cannot be left unprotected.

So, in the file menu, you will see an option, "Admins list"

Using this, you can set the list of autorized users that can use the above commands.


to enable umby24 and Inaba to access the command, you would press 'Add Admin' then Inaba
Then add admin again, then umby24
(Not case sensitive)


once you have added the admins, X out the form

then the program will add all the users listed, to the autorized users list.

Now any of the autorized users may type !Openjail or !Closejail in chat to open/close the jail.
(Or !oj , !Cj )

====

=====
Using !Follow
=====

Again, as with the !openjail and !Closejail commands, this command will only work for those added
to the bot's admin list. But, whoever types !Follow (So long they are on the playerlist on the left)
will automatically be followed around by the bot.

(You can also type !f)

Also, new in 2.2, you may type !f [name] to make the bot follow around [name]

So if I wanted to make it follow RonJoe around, I would type
!f RonJoe

and it would start following him around.

====

=====
Using !Say
=====

This command will make your bot say something. for example, to make your bot say "Hello" you would type (from your minecraft client):
!say Hello

Also, there is some advanced usage of it, This is only if the server your on supports it (Because many servers block it, or even kick the bot)
But, it can be used in a D3 server, you can use color codes in your !say message.

so, for example, if you did

!say *4Hello

The bot would reply hello, in red text.

====

====
Using !spat
====

This command will spam stone in the air, and was made to be used for blob survival games in D3 Servers.
To use, simply type !spat [number of blocks]
for example, !Spat 128  would spam (if your lucky) 128 blocks of stone in the air.
==================

===
Using !Build or !Xbuild
===
Once you have prepared a file with the correct data in it that will allow the bot
to build, simply type !build [name of text file WITHOUT extention]
This also supports sub-folders of the folder the bot is placed in.
so, for example, if I were to type

!build pie

it would open the text file pie.txt in the same directory as the Minebot.exe
then it would parse it, and build it at the bots current location

you could also do

!build objects\pie

if you had the pie.txt in a sub-folder named objects.

See the included pie.txt and minebot.txt for how to use the .txt files to build
objects

New in 2.2, with the same usage, is !Xbuild

===============

===
Using Chat Logging
===
There is no in-game command to begin logging, to begin logging you must do so from
the bots user-interface.

It is under the menu strip at the top Extra > Start Logging and Extra > Stop logging

when the logging starts, it will begin to dump every message the bot receives into
a text file, 'Log.txt' in the same directory as the bot.

Each message will have a time and date stamp on it.

========

===
Using !count
===
This should be pretty simple, but just in case:
!count [Number to count from] [Message to show when done]

This should accept color codes as well.

so for example:

!count 5 !SPLEEF!

would cause the bot to say this (with 1 second between each number)

Bot: 5
Bot: 4
Bot: 3
Bot: 2
Bot: 1
Bot: 0
Bot: !SPLEEF!

Simple enough, eh?

===================

===
Using !Eval and !Eval2
===
!Eval and !eval2 are commands for evaluating VBScript functions. There are 2 different
Evals as you can see.

!eval -- sets values, so for example, to change the title of the minebot program
you could type !Eval form.text = "Hello world!"

and the text that says "Visual basic minebot" would change to "Hello world!"


(See scripting.txt for more functions and such)

!eval2 -- Evaluates an expression, or runs a function, and returns a value.

so for example you could type !eval2 form.text  and the bot would return: "Visual basic minebot"



--
Simple enough, yet can be powerful as well.
--
===================





===
FAQ
===

Q: After updating the bot to version 1.0, my jail doesn't open and close right!

A: Due to some improvements in code, you will need to get the position of your jail blocks and set them again
Follow the procedure outlined above.

Q: I can't use any commands! (!Follow, !Players, !Openjail, !Closejail)

A: You need to add yourself to the admin list.

Q: When the bot logs in my main MC account gets disconnected from the server! (Or vice-versa)

A: Servers can only have one connection per minecraft account, So you need another seperate minecraft account for the bot, unless of course you have

verify names off, in which case you can uncheck the log-on to minecraft.net checkbox in the login box.

Q: The bot crashes right away, it doesn't even load!

A: You don't have MSWINSCK Installed, you may install it using this: http://www.mediafire.com/?cdb1wdggymj If you are on windows vista or 7, you may need to
run as admin.

-------------
FAQ Sub-section: building with .txt files
-------------

Q: The bot stops building at some point in the middle of the build. the .txt file is all there, I don't know whats wrong!

A: Check the spaces at the end of each line. each line must be the length as the width as set at the top of the .txt file. If you need to visualize this,
You may add a 'S' in place of a space, and the bot will read it just the same.

Either this, or you did not set the height/Width params correctly. Remember that it is..

&[Height],[Width]:

or.. in other words:   &[y],[x]:

Note that as of version 2.4, the bot will attempt to ignore this issue, and move on as normal.


Q: Can I add comments to my .txt files?

A: Absolutely. just make sure the line the comment is on starts with a - (Minus sign), and the bot will skip right past it.




------------------
Posted Image

D3 Server! [Advanced, Custom physics / Anti-Greif / RP]
Server Status: Posted Image

Register or log in to remove.

#2

umby24
    umby24

    Gold Miner

  • Members
  • 371 posts

Posted 12 March 2010 - 03:20 AM

Alright. Thanks to some help from friends --

VB Minebot is in progress.

Current objective: Get it to work with protocol version 7 of minecraft.

When I can get it to log on at least, I will make a sourceforge page for it, and I will release the source.

Progress: Got server handshake, send player handshake is done, working on setting location, and filtering un-needed packet noise.
Posted Image

D3 Server! [Advanced, Custom physics / Anti-Greif / RP]
Server Status: Posted Image

#3

Varriount

Posted 12 March 2010 - 03:38 AM

What server will this work on?
Remember that even old echoes can create new harmonies.
Who sits down and writes maniacle laughter?

#4

umby24
    umby24

    Gold Miner

  • Members
  • 371 posts

Posted 12 March 2010 - 04:15 AM

any server with verify names set to off.

if I can actually figure out how to parse the play.jsp url's, then it should be all of them.

My priority list is to get it working, and get it the ability to talk at first. then i will look into getting the URL's de-coded so you can just pop in a URL, enter a username, and hit connect.

After that I will look into whatever features people suggest, but most likely the ability to move around, and if can get it right (Which would probably take ALOT of work) would be to make it be a time bot, to display the time, in real time.

I'll just have to see how far it goes, and if I can get some more people who would like to help out, I could use a few extra hands..
Posted Image

D3 Server! [Advanced, Custom physics / Anti-Greif / RP]
Server Status: Posted Image

#5

Ulrich200

Posted 12 March 2010 - 05:16 AM

unby24, you can't actually parse the urls, as they are an MD5 hash. instead you must get the bot to login to minecraft.net, use an HttpWebRequest and sort through the HTML to get the parameters for the Java applet. There you will find the IP and port.
Minecraft Name: KakashiSuno

I'm known as Kakashi, Kaka, KS, and the Coal Ninja =)

#6

umby24
    umby24

    Gold Miner

  • Members
  • 371 posts

Posted 12 March 2010 - 10:56 PM

Ah, I see. thanks for the info -- though i would need info on how to do this of course..
Posted Image

D3 Server! [Advanced, Custom physics / Anti-Greif / RP]
Server Status: Posted Image

#7

umby24
    umby24

    Gold Miner

  • Members
  • 371 posts

Posted 13 March 2010 - 01:48 AM

Alright, got it to log onto my minerCPP server, my MCSharp Server, and the original minecraft server.

Doesn't work so well with fCraft, but w/e

Screenshot (Very rough, alot of stuff here is just for testing)

Posted Image
Posted Image

D3 Server! [Advanced, Custom physics / Anti-Greif / RP]
Server Status: Posted Image

#8

Varriount

Posted 13 March 2010 - 01:53 AM

Any planned features besides the ones above?
Remember that even old echoes can create new harmonies.
Who sits down and writes maniacle laughter?

#9

umby24
    umby24

    Gold Miner

  • Members
  • 371 posts

Posted 13 March 2010 - 02:25 AM

I want to add a level dumper (shouldn't be too hard), and a general server info shower in the tray, so you don't have to be signed on all the time..
Posted Image

D3 Server! [Advanced, Custom physics / Anti-Greif / RP]
Server Status: Posted Image

#10

Varriount

Posted 13 March 2010 - 04:03 AM

A way to use certian key combinations or just talking would be nice, as some server's consoles cannot be typed to, so you have to go into minecraft to announce something.
Remember that even old echoes can create new harmonies.
Who sits down and writes maniacle laughter?

#11

umby24
    umby24

    Gold Miner

  • Members
  • 371 posts

Posted 13 March 2010 - 04:16 AM

That can be done, I can even add in a "/Say mode" to where you type a message, and it auto adds the /say in front of it to talk as server.

But at this point, I have just worked on it for 5 hours. Non stop. and what have I accomplished?  It can send messages, change location (But the location is off, and this is what i was working on, for example, if I type loaction X: 1, Y: 1, Z: 1 into the bot, it moves the bot to location (as read from the WoM Client..) 8.0, 8.0, 7.1
It can view incoming messages, But does not always pick them up.
So I could use any help that can be given..
Posted Image

D3 Server! [Advanced, Custom physics / Anti-Greif / RP]
Server Status: Posted Image

#12

Ulrich200

Posted 13 March 2010 - 04:40 AM

the position isn't sent as block coordinates, for whatever reason.

here's what MCSharp uses to send/receive positions

		byte[] HTNO(ushort x)
		{
			byte[] y = BitConverter.GetBytes(x); Array.Reverse(y); return y;
		}
		ushort NTHO(byte[] x, int offset)
		{
			byte[] y = new byte[2];
			Buffer.BlockCopy(x, offset, y, 0, 2); Array.Reverse(y);
			return BitConverter.ToUInt16(y, 0);
		}
		byte[] HTNO(short x)
		{
			byte[] y = BitConverter.GetBytes(x); Array.Reverse(y); return y;
		}

HTNO = Host to Network Order
NTHO = Network to Host Order

hope this helps

EDIT: BlockChanges are encoded the same way.
Minecraft Name: KakashiSuno

I'm known as Kakashi, Kaka, KS, and the Coal Ninja =)

#13

umby24
    umby24

    Gold Miner

  • Members
  • 371 posts

Posted 13 March 2010 - 06:04 AM

I'm not so good with C Sharp, so its kind of confusing.

Though i do see some functions that VB has.

Anyways

https://sourceforge....ojects/minebot/

uploaded there (Source forge is a pain to use, not sure how well it will work out xD)

but all the code is in the form1.vb file.
Posted Image

D3 Server! [Advanced, Custom physics / Anti-Greif / RP]
Server Status: Posted Image

#14

unison
    unison

    Redstone Miner

  • Members
  • 688 posts

Posted 14 March 2010 - 05:41 AM

I will give you a small tip about player locations. They are not kept the same way as block coordinates are. For example, a player and a block at 100, 100, 100, are actually in two very different locations. The block is at literal 100, 100, 100. However, player location is actually broken into 32 mini-blocks, per literal block. So, if you want to lower the player position by 1 literal block, you actually want to lower it by 32.

#15

FalleM
    FalleM

    Zombie Killer

  • Members
  • 160 posts

Posted 14 March 2010 - 12:47 PM

I've recently tried to get my copy of Botler working, and have failed miserably. Now, the reason that I want (and need) a bot for my server, is to easily open and close my jail for trusted users, when no OPs are on.

Botler does this - but again, I cant get it to work. If you could add a similar function for your bot (Build jail, open/close jail at command), I would be forever gratefull.

Oh, and the interface looks awesome. I am actually tired of dealing with CMD windows all the time.
THIS IS A SIGNATURE

#16

Isythos
    Isythos

    Iron Miner

  • Members
  • 283 posts

Posted 14 March 2010 - 01:55 PM

FalleM bottler only supports Myne and a couple of custom servers now. If you use vanilla it gets kicked for cheating

Btw: How exactly does this connect to a server atm?

#17

FalleM
    FalleM

    Zombie Killer

  • Members
  • 160 posts

Posted 14 March 2010 - 02:31 PM

Isythos said:

FalleM bottler only supports Myne and a couple of custom servers now. If you use vanilla it gets kicked for cheating

Btw: How exactly does this connect to a server atm?

This can not be true. I have had another Botler on my server before, and while it did not function perfectly, atleast it logged on. I can not make my copy do this.
THIS IS A SIGNATURE

#18

Isythos
    Isythos

    Iron Miner

  • Members
  • 283 posts

Posted 14 March 2010 - 03:03 PM

Oh it can't even connect to the server? I can get it to connect but it mostly gets kicked if I give it a command cause of notches anti cheat stuff.

#19

umby24
    umby24

    Gold Miner

  • Members
  • 371 posts

Posted 14 March 2010 - 05:05 PM

The interface is still very rough, and changes alot so I can get things right, I will look into the location thing, though the bot does not seem to like decimal points, it just rounds them.

This bot currently connects to servers using the protocol outlined in the minepedia dev resources, but does not work if you try on a verify-names server, because it does not get the salt of the server (The log on auth code) which i currently have set as "asdf".

I can delete and set blocks, so it should not be an issue to have a open/close jail button, i will see once i can get it a bit more stable.

I am quite tired of cmd windows as well..

and thanks for the info unison, i will work with it a bit.

other than that my main issue is packet arrivals.

The come in slow sometimes and ends up to where the bot doesn't get all of them.

if the bot did get all of them, i could dump maps with no problem...

EDIT: Working on beautifying it a bit, as well as adding a few nice features.

Figured out that with the exception of block location 0,0,0, every blocks location (x, y, or z) goes up by 256.

so to place a block at 0,1,0   it would be 0,256,0

or 2,1,1 would be 512,256,256

with this i am going to add a block placing ability, and a block removing ability.

Thanks to this I am going to try and make a jail opening/closing command for the bot.

The setup for this could seem a bit complicated, so i will include a readme in the next release.

The locations are a bit different, I am using the type short for the location x,y,z coordinates, but each 1 block for location, is equal to 8. (as shown from the WoM Client), as well as being equal to a very rough 8 actual blocks.
Posted Image

D3 Server! [Advanced, Custom physics / Anti-Greif / RP]
Server Status: Posted Image

#20

umby24
    umby24

    Gold Miner

  • Members
  • 371 posts

Posted 15 March 2010 - 06:03 AM

kk, Rather big update here:

-- UI Redesigned, ALOT cleaner.

-- Added disconnect, reconnect options
-- added ability to change the bots name
-- Added ability to open/close jail by means of button from program, or command in-game, up to 4 blocks.
-- Added ability to set every kind of block.
-- Color codes are stripped to clean up the chat
-- Added Devolper mode, to show the more technical stuff such as block changes when enabled.
-- Added a readme.txt to the main zip file on sourceforge to explain how to use.
Posted Image

D3 Server! [Advanced, Custom physics / Anti-Greif / RP]
Server Status: Posted Image