Compot - Version 0.01

08/07/2009 19:24 buhguy#46
ok what is an IDE?

and i cant change it in the Compot.csproj because it dosent alow me to type in any of the spaces.
08/07/2009 20:16 Gertos#47
@buhguy:
IDE = Integrated Development Environment, ( Integrierte Entwicklungsumgebung)

So the IDE is a special tool that 'converts' an Source-Code File into a usable program ( EXE-File)

In this case are we using the Program 'Visual C# Express' as a Free IDE.
The link is inside of the download file.

This project is not a simple 'download' the file, press Key x-y-z and start the program.
This is more a tool-box with some functions that give a person with a basic understanding of programming a way to build his own personal bot.

Several have already reach the goal of a working bot, so it is possible!

I am sure they all have invested several hours with reading and testing till they have reach this step.


But somebody who knows nothing about programing has with the current version no chance to get the bot working!
Maybe a later version of this tool will be easier to setup.

The current veriosn in the frist post is more a Demo that let your character run in a circle a few times.
08/07/2009 20:17 Night Dragon#48
Quote:
Originally Posted by buhguy View Post
ok what is an IDE?

and i cant change it in the Compot.csproj because it dosent alow me to type in any of the spaces.
IDE = Integrated Development Environment.. its the program that you use to make the programs.. like Visual Studio C# 2005.

Which editor are you using to edit the .csproj files?
08/07/2009 21:04 buhguy#49
im useing the free one Gertos posted.

ive got the basic program to open its still fudgeing up with the device drivers though.

Edit: so im asumeing that the keyboard values need to be changed to english since they apear to be in german?
08/07/2009 22:26 Gertos#50
Quote:
Originally Posted by buhguy View Post
ive got the basic program to open its still fudgeing up with the device drivers though.
So you downloaded Visual Basic Express ?
That is the wrong version , you need the C# one.

(( Basic and C# are two different programming languages. ))
08/08/2009 03:43 buhguy#51
no its the C#
08/08/2009 14:06 gabriel_cucick#52
Quote:
Originally Posted by buhguy View Post
im useing the free one Gertos posted.

ive got the basic program to open its still fudgeing up with the device drivers though.

Edit: so im asumeing that the keyboard values need to be changed to english since they apear to be in german?
go and see the #17 post ^^
08/12/2009 00:32 hoopyfrood#53
I've been messing around with OCR, i have a small method to avoid bottraps which does fine for now, but i want more.

I started out with Tesseract, mostly because its freely available instead of M$'s MODI (depends on M$ Office installation). Tesseract can only read uncompressed tiff. This required some searching cause the default bild.Save("tmp.tif", ImageFormat.Tiff) saves compressed, i stole this method from the internet:
Code:
public static void saveUncompressedTiff(Bitmap bild)
            {
                ImageCodecInfo myImageCodecInfo;
                System.Drawing.Imaging.Encoder myEncoder;
                EncoderParameter myEncoderParameter;
                EncoderParameters myEncoderParameters;

                // Get an ImageCodecInfo object that represents the TIFFcodec.
                myImageCodecInfo = GetEncoder(ImageFormat.Tiff);

                // Create an Encoder object based on the GUID
                // for the Compression parameter category.
                myEncoder = System.Drawing.Imaging.Encoder.Compression;

                // Create an EncoderParameters object.
                // An EncoderParameters object has an array of EncoderParameter
                // objects. In this case, there is only one
                // EncoderParameter object in the array.
                myEncoderParameters = new EncoderParameters(1);

                // Save the bitmap as a TIFF file with no compression.
                myEncoderParameter = new EncoderParameter(myEncoder, (long)System.Drawing.Imaging.EncoderValue.CompressionNone);
                myEncoderParameters.Param[0] = myEncoderParameter;

                bild.Save("tmp.tif", myImageCodecInfo, myEncoderParameters);
            }

         public static ImageCodecInfo GetEncoder(ImageFormat format)
            {

                ImageCodecInfo[] codecs = ImageCodecInfo.GetImageDecoders();

                foreach (ImageCodecInfo codec in codecs)
                {
                    if (codec.FormatID == format.Guid)
                    {
                        return codec;
                    }
                }
                return null;
            }
But my experiments gave very poor results, even with the size of the image tripled. after that i started experimenting with MODI. That was as simple as adding a reference to the Microsoft Office Document Imaging 12.0 Type Library. The following code takes a file from disk and passes on what it reads.
Code:
public static bool BottrapFound()
       {
           // Get the bmp we're gonna read
           Bitmap bild = Tools.GetBitmap(MainWindow.BasisX + 486, MainWindow.BasisY + 26, 180, 15);
           // Make it twice as big, MODI wont recognize anything otherwise
           using (Graphics g = Graphics.FromImage((Image)bild))
               g.DrawImage(bild, 0, 0, 360, 30);
        
           // Since MODI seems only be able to read from disk...
           // bild.Save("tmp.tif", ImageFormat.Tiff); -> compressed we need uncompressed
           saveUncompressedTiff(bild);
           System.Threading.Thread.Sleep(500);
           // Initialize word(s) we're getting
           string strText = "";
           bool ReturnValue = false;
           // Instantiate the MODI.Document object
           MODI.Document md = new MODI.Document();
           // The Create method grabs the picture from
           // disk snd prepares for OCR.
           md.Create(@"tmp.tif");
           // Do the OCR.
           md.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true);
           // Get the first (and only image)
           MODI.Image image = (MODI.Image)md.Images[0];
           // Get the layout.
           MODI.Layout layout = image.Layout;
           // Loop through the words.
           for (int j = 0; j < layout.Words.Count; j++)
           {
               // Get this word.
               MODI.Word word = (MODI.Word)layout.Words[j];
               // Add a blank space to separate words.
               if (strText.Length > 0)
               {
                   strText += " ";
               }
               // Add the word.
               strText += word.Text;
           }
           // Close the MODI.Document object.
           md.Close(false);
           switch(strText)
           {
               case "Moon Rabbit":
               case "Tamias":
               case "Megaloceros":
                   //MainWindow.AddToProtokoll(strText + " found!");
                   ReturnValue = true;
                   break;
               default:
                   break;
           }
           return ReturnValue;
       }
This code doesn't work! I know MODI reads the generated image correct, cause it can read it in M$ Document Imaging application. I need some help here... First of, is there a way to get rid of the writing and reading from disk, which makes the whole process far too slow. We need to do this in memory to get it fast enough. It worked with the tiff, not sure if a double or tripled bmp will be read too. Anyone can help me out here?
08/12/2009 04:48 tamzorz#54
First of all, thanks for sharing these stuff with us :) Anyhow, here's my problem...
I've managed to create the program after a bit reading and doing stuff. After publishing the program, I got an error with a bitmap file. Also, while I was getting "int" code error. Yet , my bot seems to be not attacking around so far but running around circles. Also, it didn't type "/dance" automatically. Any advises if I skipped anything or so?
08/12/2009 19:46 Gertos#55
@tamzorz:
You don't need to publish the program.
Just compile it and take a look into your bin folder ( e.g. ...\Compot\bin\Debug )
You will find a EXE file there.

The Problem with the bitmap is a side effect from the publishing.
The Tool needs the file ..\Compot\bitmaps\rappelz_icon.bmp so it is able to find the rappelz window.
Because of this the '/dance' command may failed, because the tool was not able to active the window before it writes the '/dance' string.

My early version of the tool is not able to attack.
It is just a demo how to send keys and mouse data to the game.

But some have already extend my version to a attacking bot.
I am sure they will post the source-Code sooner or later here :D


Or play around a bit with the source-code :D it is not so hard to implement a TAB-F1 Bot ;D
08/14/2009 00:21 tamzorz#56
At last, I managed to get it working :D Now I need to get it attacking around.. Thanks for teh tip :P
08/16/2009 01:56 raedon#57
Hi guys, Gertos, ur code are awsome very usefull y only want to say thanks and bring help to anyone u want make a good and usefull bot, i got knowledge on c# and i got the source code of somes bots published here. If u want my help pm me or post here.

lets do a good bot guys.

GL.
08/17/2009 14:03 Ripiz#58
Where is latest version of this project? First post seems to have for download, but later there were posts of 'updated' versions so I'm not sure which one is the latest.
Thank you
08/17/2009 14:48 KentuckyFC#59
Nobody must post his version so theres a free release time of the bot
08/17/2009 15:25 Ripiz#60
I mean, on first page there is attachment to download Compot. However on 2nd and 3rd page there are more download of it, is it like updated version? Or I can download it from first page and I have pretty much everything except bot logic?