Compot - Version 0.01

08/17/2009 17:07 Night Dragon#61
The updated versions that are available for download on the other pages are just peoples own work and progress on the bot and want to share their ideas. This thread was meant to inspire a discussion about making your own bot with the template that Gertos was so good to present to the community. This is by no means a download, compile, and start botting kind of project. The bot on the first page is just a template to show how to use the sendkeys to make the character move.
08/17/2009 17:33 Ripiz#62
Ok. Thank you for information. It makes more sense now

Edit:
I installed that Kernel thing, to send input to the game. However my antivirus detected Keylogger. Is it normal?
08/17/2009 17:50 Night Dragon#63
Quote:
Originally Posted by Ripiz View Post
Ok. Thank you for information. It makes more sense now

Edit:
I installed that Kernel thing, to send input to the game. However my antivirus detected Keylogger. Is it normal?
Its been known to happen. It is a kernel level keyboard driver so the AV might flag it as suspicious but it is guaranteed to be clean, as even the source code for it is available for download.
08/17/2009 18:17 raedon#64
I dont got problems whit AV, its safe to use.
08/17/2009 18:22 Ripiz#65
When I compiled and ran it, I had problems that Compot didn't detect my Rappelz window, but that one was easy to fix.
Also I noticed that it doesn't detect HP/MP, also I saw some people talking about it.
Not sure if it's fixed or not yet, but this should fix it:
Code:
        public static int AnalyseHeroHP()
        {
            Bitmap bild = Tools.GetBitmap(MainWindow.BasisX + 7, MainWindow.BasisY + 70, 200, 3);
//other code
Code:
        public static int AnalyseHeroMP()
        {
            Bitmap bild = Tools.GetBitmap(MainWindow.BasisX + 7, MainWindow.BasisY + 83, 200, 3);
//other code
Only offsets changed, they shouldn't change with different resolutions, just make sure you don't move Rappelz window after Compot has been started


EDIT:
To find out Mobs HP:
Put this attachment to same place as rappelz_window.bmp
You need two variables in MainWindow.cs:
Code:
        static public int MobWindowX;
        static public int MobWindowY;
Put this code into LogikTimer_Tick(), it will keep searching for mob info window:
Code:
                MainWindow.MobWindowX = 0;
                MainWindow.MobWindowY = 0;
                Bitmap bild = Tools.GetBitmap(0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Bottom - 300);
                Bitmap MobWindow = null;
                try { MobWindow = new Bitmap(@"..\..\bitmaps\MobWindow.bmp"); }
                catch { throw (new Exception("Can't open MobWindow.bmp")); }
                int x = 0;
                int y = 0;
                if (Tools.SucheBildimBild(bild, MobWindow, ref x, ref y) == true) {
                    Bitmap bild2 = Tools.GetBitmap(x, y, 20, 20);
                    MainWindow.mainWindow.pictureBox1.Image = bild2;
                    MainWindow.MobWindowX = x;
                    MainWindow.MobWindowY = y;
                }
Put this into Tools.cs:
Code:
        public static int AnalyzeMobHP() {
            if (MainWindow.MobWindowX < 1 || MainWindow.MobWindowY < 1) return -1;
            Bitmap bild = Tools.GetBitmap(MainWindow.MobWindowX + 5, MainWindow.MobWindowY+30, 200, 1);
            int black = 0;
            for (int q = 0; q < 200; q++) {
                Color c = bild.GetPixel(q, 0);
                if (c.B <= 50 && c.G <= 50 && c.R <= 50) black++;
            }
            double calc = 100 - (black * 100) / 200;
            return (int)calc;
        }
Now in MainWindow.cs use Tools.AnalyzeMobHP() to call procedure, it will return -1 if MobWindow not found, and number 0 to 100 would mean Mobs HP in %
Note: Tools.AnalyzeMobHP() must be called after code, which finds MobWindow, else if will identify grass as HP Bar
08/17/2009 21:04 Gertos#66
@Ripz:
It looks like you make good and fast progress.

From 'which one should I download' at 15:25
to the first source code post at 18:22 :D

Lets see what you post in a few days or weeks :D
08/18/2009 06:28 Ripiz#67
Can I post full source, instead of pieces of code I add?
08/18/2009 08:17 Gertos#68
sure, e.g. zip your full project and upload it here.

But please don't share binaries!
This keeps the amounts of users small we don't get blocked from GG so fast.
08/18/2009 09:59 Ripiz#69
I play more than work on the bot, but here's little update on the HP/MP calculation. For me it works perfect for Characters HP/MP, Pets HP/MP.
Code:
        public static int AnalyseHeroHP()
        {
            Bitmap bild = Tools.GetBitmap(MainWindow.BasisX + 7, MainWindow.BasisY + 70, 200, 1);
            int black = 0;
            for (int q = 0; q < bild.Width; q++) {
                Color c = bild.GetPixel(q, 0);
                if (c.B <= 60 && c.G <= 60 && c.R <= 60) black++;
            }
            return 100 - (black * 100) / bild.Width;
        }
        public static int AnalyseHeroMP()
        {
            Bitmap bild = Tools.GetBitmap(MainWindow.BasisX + 7, MainWindow.BasisY + 83, 200, 1);
            int black = 0;
            for (int q = 0; q < bild.Width; q++) {
                Color c = bild.GetPixel(q, 0);
                if (c.B <= 60 && c.G <= 60 && c.R <= 60) black++;
            }
            return 100 - (black * 100) / bild.Width;
        }
        public static int AnalysePetHP()
        {
            Bitmap bild = Tools.GetBitmap(MainWindow.BasisX + 43, MainWindow.BasisY + 137, 164, 1);
            int black = 0;
            for (int q = 0; q < bild.Width; q++) {
                Color c = bild.GetPixel(q, 0);
                if (c.B <= 60 && c.G <= 60 && c.R <= 60) black++;
            }
            return 100 - (black * 100) / bild.Width;
        }
        public static int AnalysePetMP()
        {
            Bitmap bild = Tools.GetBitmap(MainWindow.BasisX + 43, MainWindow.BasisY + 143, 164, 1);
            int black = 0;
            for (int q = 0; q < bild.Width; q++) {
                Color c = bild.GetPixel(q, 0);
                if (c.B <= 60 && c.G <= 60 && c.R <= 60) black++;
            }
            return 100 - (black * 100) / bild.Width;
        }
Don't forget that you have to call it!

Note: Wasn't able to post updated version of Mobs/Targets HP as I made many edits to the code in other places

Edit:
Should bot options be available in bots main window, or in code?
08/19/2009 17:22 Ripiz#70
Sorry for double post.

No one commented on my piece of code except GMs. 2nd code got somewhat ignored, no comments, whines - nothing!

Guess I won't post the bot then, got little piece of working code, it's running successfully and killing mobs
08/19/2009 19:24 Gertos#71
I think the most that had been active in the past days already have there own working bot :D

I still hope somebody builds a nice way to get a location without of the /position command.
e.g. by analysing the small map in the top right corner.

I am dreaming also of a bot that is able to do Ursa Caverns alone.
But I am far away from this at the moment :D
08/19/2009 20:10 KentuckyFC#72
Kevzor did make a good working bot with Location without the command /position
I think the compot is now a Pripot
08/20/2009 06:38 Ripiz#73
Quote:
Originally Posted by KentuckyFC View Post
Kevzor did make a good working bot with Location without the command /position
I think the compot is now a Pripot
If he based it off Compot, he shouldn't be able to sell it, however he is selling it. Isn't that against law?
Quote:
Originally Posted by Gertos View Post
I still hope somebody builds a nice way to get a location without of the /position command.
e.g. by analysing the small map in the top right corner.

I am dreaming also of a bot that is able to do Ursa Caverns alone.
But I am far away from this at the moment :D
Map quality too low to analyze it =/

Edit:
I downloaded his bot, however Kevzor failed badly XD You have to color pick, as he too nooby to find bars on himself, also it supports only single resolution, and you have to position window. It's more like autoclicker, than a bot.

I saw post about reading text in rappelz, such as mob names and etc. Any idea how to do that? Too lazy to search on myself XD
08/20/2009 08:29 Gertos#74
I don't think the map quality is to low for this.
But the map is generated from the real environment that is shrinked to a very small picture.
So the map looks always a bit diffrent and you can't do a simple pixel compare.
( I have already tried this ;D )
Maybe it works if you do some kind of statistic magic to get your relative movement.



About the read text function:
I have posed here a bit about my way.

[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]

There are other attemps to use some free OCR software, but I don't know how well they work.
I think the quality is maybe a lot better but the speed slower.
08/20/2009 17:16 robmonkey#75
well, just started my noob quest around Visual c# and the bot making industry...

And what about it, just after load the project, i debugged it and voilá ERRORS :)
hmm guess its about that kernell library, but i dont know where to put it, or where to load it.

Gives 4 errors 2x keyboard and 2x mouse.

Error 1 The type or namespace name 'KernelHotkey' could not be found (are you missing a using directive or an assembly reference?) C:\Program\Compot\KeyboardTools.cs 25 7 Compot

Just 1 more thing, i installed the kernell driver, guess its just the DLL that is missing somewhere.

Can anyone point me the right direction?
Guess it must be pretty simple stuff, but am new to this Visual c# programming.

Best regards to all