Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Rappelz
You last visited: Today at 21:03

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Es läuft ...

Discussion on Es läuft ... within the Rappelz forum part of the MMORPGs category.

Reply
 
Old 07/05/2009, 23:00   #46
 
Gertos's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 404
Received Thanks: 120
Quote:
Originally Posted by meilleur View Post
I want to use the commande /position, how can i make my bot read this ?
Create a Bitmap from the Screen and run an analyse logic on the Bitmap.

I have notice some things that makes this process easier.

1. The font is using just ONE Color. ( e.g. the Box on the top is using diffrent gray values )
2. The position of the diffrent lines is always the same



Process-Logik:

1. Just get the pixel with the color that you want and make them black.
2. Make all other Colors White.
3. Try to sepearte the diffrent charaters. e.g. by finding a Column that is white.


Bitmap 1

Code:
.................
.X............x..
.X...............
.X......xxx...x..
.X.....xx  x..x..
.X.....xxxxx..x..
.X.....x......x..
.Xxxxx..xxx...x..
.................
Bitmap 2
Split in 3 picutures by removing all unecessary white lines
Code:
-------......---.
-X....-......-x-.
-X....--------.-.
-X....-.xxx.--x-.
-X....-xx  x--x-.
-X....-xxxxx--x-.
-X....-x....--x-.
-Xxxxx-.xxx.--x-.
----------------.
Picture 1

Code:
X....
X....
X....
X....
X....
X....
Xxxxx
Picture 2

Code:
.xxx.
xx  x
xxxxx
x....
.xxx.
Compare the Picutre with a Database and ask the user for an letter , if you have found a unknowen one.
Somethimes there is no full white Column between two letters, so you have to 'train' the logik a bit that is learns all necessary words.


I hope this rough concept leads you in the right direction
Gertos is offline  
Thanks
1 User
Old 07/05/2009, 23:18   #47
 
elite*gold: 0
Join Date: Dec 2007
Posts: 111
Received Thanks: 17
Quote:
Originally Posted by Gertos View Post
Create a Bitmap from the Screen and run an analyse logic on the Bitmap.

I have notice some things that makes this process easier.

1. The font is using just ONE Color. ( e.g. the Box on the top is using diffrent gray values )
2. The position of the diffrent lines is always the same



Process-Logik:

1. Just get the pixel with the color that you want and make them black.
2. Make all other Colors White.
3. Try to sepearte the diffrent charaters. e.g. by finding a Column that is white.


Bitmap 1

Code:
.................
.X............x..
.X...............
.X......xxx...x..
.X.....xx  x..x..
.X.....xxxxx..x..
.X.....x......x..
.Xxxxx..xxx...x..
.................
Bitmap 2
Split in 3 picutures by removing all unecessary white lines
Code:
-------......---.
-X....-......-x-.
-X....--------.-.
-X....-.xxx.--x-.
-X....-xx  x--x-.
-X....-xxxxx--x-.
-X....-x....--x-.
-Xxxxx-.xxx.--x-.
----------------.
Picture 1

Code:
X....
X....
X....
X....
X....
X....
Xxxxx
Picture 2

Code:
.xxx.
xx  x
xxxxx
x....
.xxx.
Compare the Picutre with a Database and ask the user for an letter , if you have found a unknowen one.
Somethimes there is no full white Column between two letters, so you have to 'train' the logik a bit that is learns all necessary words.


I hope this rough concept leads you in the right direction
Thank very much for help
When I creat a bitmap to analyse it I use getpixel/setpixel right?and in tow dimension I gues and that will be very slow
I never used the bitmap method before, I know that there is an aleternative method by pointer
meilleur is offline  
Old 07/06/2009, 01:50   #48
 
Gertos's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 404
Received Thanks: 120
no GetPixel and SetPixel is to slow.

There are better/faster functions available for this.

I have posted an example here:



Check this post as well

It contains some ultra fast code ( for C# ) to do some work with a Bitmap.
Gertos is offline  
Old 07/06/2009, 23:08   #49
 
elite*gold: 0
Join Date: Dec 2007
Posts: 111
Received Thanks: 17
Thank you for you help Gertos
meilleur is offline  
Old 07/07/2009, 23:36   #50
 
elite*gold: 0
Join Date: Dec 2007
Posts: 111
Received Thanks: 17
I found OCR programme that have an amazing accuracy but it is trial 100 file, in the website you can download the demo and sample code source, this last is it usable or just sample?
meilleur is offline  
Thanks
1 User
Old 07/08/2009, 01:05   #51
 
Night Dragon's Avatar
 
elite*gold: 20
Join Date: Apr 2007
Posts: 581
Received Thanks: 253
Quote:
Originally Posted by meilleur View Post
I found OCR programme that have an amazing accuracy but it is trial 100 file, in the website you can download the demo and sample code source, this last is it usable or just sample?
Hmmm.. they call it a 'sample code' and yet in C# the code appears to be a fully functioning script. They even give comments on each section and give the code to use their dll. Even better yet (I can't believe this XD) they included the command to show how many samples you have left on your license. They basically just handed over the keys lmao.

Good find meilleur!! I will play with this some more when I have more time.
Night Dragon is offline  
Old 07/08/2009, 02:29   #52
 
elite*gold: 0
Join Date: Dec 2007
Posts: 111
Received Thanks: 17
I founed one fully fonctionel(not trial ^^), it is a sourceCode in vb6, I tried it with bmp 100% accuracy
Attached Files
File Type: rar tocr14.rar (62.5 KB, 18 views)
meilleur is offline  
Old 07/08/2009, 11:42   #53
 
elite*gold: 0
Join Date: Jun 2008
Posts: 9
Received Thanks: 1
You can use MODI from micro$oft office 2003 it works too, that's what i did
i'll still have a look at this one
Altaric2 is offline  
Old 07/08/2009, 14:17   #54
 
elite*gold: 0
Join Date: Dec 2007
Posts: 111
Received Thanks: 17
Quote:
Originally Posted by Altaric2 View Post
You can use MODI from micro$oft office 2003 it works too, that's what i did
i'll still have a look at this one
I know that exist in office but never used it
meilleur is offline  
Old 07/10/2009, 20:33   #55
 
elite*gold: 0
Join Date: Dec 2007
Posts: 111
Received Thanks: 17
I tried the MODI and It havn't worked with my Bmp
meilleur is offline  
Old 07/10/2009, 21:30   #56
 
Gertos's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 404
Received Thanks: 120
for me this sounds like breaking a butterfly on a wheel.
Do you really need a full OCR program just to read some character from the screen ?

An easy pattern compare can do the same in my opinion.
Gertos is offline  
Old 07/10/2009, 22:09   #57
 
elite*gold: 0
Join Date: Dec 2007
Posts: 111
Received Thanks: 17
Quote:
Originally Posted by Gertos View Post
for me this sounds like breaking a butterfly on a wheel.
Do you really need a full OCR program just to read some character from the screen ?

An easy pattern compare can do the same in my opinion.
Following what you wrote I just need to compare char not need to read it.If I want to correct the position how I can do ?
meilleur is offline  
Old 07/10/2009, 23:15   #58
 
Gertos's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 404
Received Thanks: 120
maybe it is the best if I post some sample code:

I hope you understand a bit German

Code:
        public Dictionary<string, string> OCR_Table;

       public static Bitmap GetBitmap(int x, int y, int dx, int dy)
        {
            Bitmap screenCopy = new Bitmap(dx, dy); 
            using (Graphics gdest = Graphics.FromImage(screenCopy)) 

            using (Graphics gsrc = Graphics.FromHwnd(IntPtr.Zero)) 
            { 
                IntPtr hSrcDC = gsrc.GetHdc(); 
                IntPtr hDC = gdest.GetHdc(); 
                int retval = BitBlt(hDC, 0, 0, dx, dy, hSrcDC, x, y, (int)CopyPixelOperation.SourceCopy); 

                gdest.ReleaseHdc(); 
                gsrc.ReleaseHdc(); 
            }

            return screenCopy;

        }

        private string AnalyseNPC_Name_Phase2(int Mode, Bitmap bild, int x, int y, int x2, int y2)
        {
            // Bild abmalen und ins log schreiben 

            string Zeile = "";


            for (int yy = y; yy <= y2; yy++)
            {
                for (int xx = x; xx <= x2; xx++)
                {
                    Color c = bild.GetPixel(xx, yy);

                    if (Mode == 0)
                    {
                        if (c.B < 80 && c.R < 80 & c.G < 80)
                            Zeile += "X";
                        else if (c.B < 100 && c.R < 100 & c.G < 100)
                            Zeile += "x";
                        else if (c.B < 120 && c.R < 120 & c.G < 120)
                            Zeile += "+";
                        else if (c.B < 140 && c.R < 140 & c.G < 140)
                            Zeile += ".";
                        else
                            Zeile += "_";
                    }
                    else
                    {
                        if (c.B > 100 && c.R > 100 & c.G > 100)
                            Zeile += "X";
                        else
                            Zeile += "_";

                    }

                }
                Zeile += "\n";
            }
            //AddToProtokoll(Zeile);

            // 
            string Buchstabe;
            if (OCR_Table.TryGetValue(Zeile, out Buchstabe) == false)
            {
                if (LearnMode == true)
                {
                    // Dialog anzeigen
                    OCR_Ask_for_Letter dlg = new OCR_Ask_for_Letter();
                    dlg.richTextBox1.AppendText(Zeile);
                    dlg.ShowDialog();
                    Buchstabe = dlg.textBox1.Text;

                    if (Buchstabe.Length > 0)
                    {
                        OCR_Table.Add(Zeile, Buchstabe);
                    }
                }
                else
                    Buchstabe = "?";
            }

            return Buchstabe;
        }


        private string AnalyseNPC_Name_Phase1(int Mode, Bitmap bild)
        {
            // 1. Bild in Buchstaben trennen
            string erg = "";
            bool inBuchstabe = false;
            int minX = 9999;
            int minY = 9999;
            int maxY = -1;

            int UngueltigeZeichenFaktor = 0;

            for (int x = 0; x < bild.Width; x++)
            {
                bool SchwarzFlag = false;
                for (int y = 0; y < bild.Height; y++)
                {
                    // stehen in der aktuellen Row Daten ?
                    Color c = bild.GetPixel(x, y);

                    if (Mode == 0)
                    {
                        // Schwarze Schrift auf grauem grund
                        if (c.B < 100 && c.R < 100 & c.G < 100)
                        {
                            SchwarzFlag = true;
                            if (y < minY) minY = y;
                            if (y > maxY) maxY = y;
                            if (x < minX) minX = x;
                            inBuchstabe = true;
                        }
                    }
                    else
                    {
                        // weiße schrift auf schwarzem grund
                        if (c.B > 100 && c.R > 100 & c.G > 100)
                        {
                            SchwarzFlag = true;
                            if (y < minY) minY = y;
                            if (y > maxY) maxY = y;
                            if (x < minX) minX = x;
                            inBuchstabe = true;
                        }

                    }

                }
                if ((SchwarzFlag == false) && (inBuchstabe == true))
                {
                    // erste leere Reihe hinter einem Buchstaben gefunden
                    string text = "Phase 1: x:" + minX.ToString() + "-" + x.ToString() + " y:" + minY.ToString() + "-" + maxY.ToString() + "\n";
                    //AddToProtokoll(text);

                    string Zeichen = AnalyseNPC_Name_Phase2(Mode, bild, minX, minY, x, maxY);
                    erg += Zeichen;

                    if (Zeichen == "?")
                        UngueltigeZeichenFaktor -= 1;
                    else
                        UngueltigeZeichenFaktor += 1;



                    // alles wieder auf Anfang
                    minX = 9999; minY = 9999; maxY = -1; inBuchstabe = false;
                }
            }


            if (UngueltigeZeichenFaktor < 0)    // um zufallstreffer zu vermeiden.
                erg = "";

            // AddToProtokoll(">>>:" + erg + "\n");

            return erg;
        }



        private string AnalyseNPC_Name(int Mode  /* 0 = normaler Text , 1 = xp in % ( sw hintergrund bei ws schrift ) */)
        {
            Bitmap bild=null;
            if (Mode == 0)
            {
                bild = Tools.GetBitmap(BasisX + 743, BasisY + 22, 185, 13);
            }
            else if (Mode == 1)
            {
                bild = Tools.GetBitmap(BasisX + 6, BasisY + 94, 40, 9);
            }

            // MainWindow.mainWindow.pictureBox1.Image = bild;


            string erg = AnalyseNPC_Name_Phase1(Mode, bild);

            return erg;
        }
This is an very easy Bitmap to String Converter.

Function AnalyseNPC_Name_Phase1() is splitting the text into single charaters.

Function AnalyseNPC_Name_Phase2() is converting the bitmap of a single character into a string and stores in a Dictionary.

The LearnMode variable controlls if the code is in bot-mode or in learning Mode.
In LearnMode it will ask the user for unknowen letters with an dialog.

Not in the example is the code for saving the OCR_Table Dictionary and the Dialog that asks the User for a Charater in the case it found something new.
Gertos is offline  
Old 07/11/2009, 03:39   #59
 
elite*gold: 0
Join Date: Dec 2007
Posts: 111
Received Thanks: 17
Quote:
Originally Posted by Gertos View Post
maybe it is the best if I post some sample code:

I hope you understand a bit German

Code:
        public Dictionary<string, string> OCR_Table;

       public static Bitmap GetBitmap(int x, int y, int dx, int dy)
        {
            Bitmap screenCopy = new Bitmap(dx, dy); 
            using (Graphics gdest = Graphics.FromImage(screenCopy)) 

            using (Graphics gsrc = Graphics.FromHwnd(IntPtr.Zero)) 
            { 
                IntPtr hSrcDC = gsrc.GetHdc(); 
                IntPtr hDC = gdest.GetHdc(); 
                int retval = BitBlt(hDC, 0, 0, dx, dy, hSrcDC, x, y, (int)CopyPixelOperation.SourceCopy); 

                gdest.ReleaseHdc(); 
                gsrc.ReleaseHdc(); 
            }

            return screenCopy;

        }

        private string AnalyseNPC_Name_Phase2(int Mode, Bitmap bild, int x, int y, int x2, int y2)
        {
            // Bild abmalen und ins log schreiben 

            string Zeile = "";


            for (int yy = y; yy <= y2; yy++)
            {
                for (int xx = x; xx <= x2; xx++)
                {
                    Color c = bild.GetPixel(xx, yy);

                    if (Mode == 0)
                    {
                        if (c.B < 80 && c.R < 80 & c.G < 80)
                            Zeile += "X";
                        else if (c.B < 100 && c.R < 100 & c.G < 100)
                            Zeile += "x";
                        else if (c.B < 120 && c.R < 120 & c.G < 120)
                            Zeile += "+";
                        else if (c.B < 140 && c.R < 140 & c.G < 140)
                            Zeile += ".";
                        else
                            Zeile += "_";
                    }
                    else
                    {
                        if (c.B > 100 && c.R > 100 & c.G > 100)
                            Zeile += "X";
                        else
                            Zeile += "_";

                    }

                }
                Zeile += "\n";
            }
            //AddToProtokoll(Zeile);

            // 
            string Buchstabe;
            if (OCR_Table.TryGetValue(Zeile, out Buchstabe) == false)
            {
                if (LearnMode == true)
                {
                    // Dialog anzeigen
                    OCR_Ask_for_Letter dlg = new OCR_Ask_for_Letter();
                    dlg.richTextBox1.AppendText(Zeile);
                    dlg.ShowDialog();
                    Buchstabe = dlg.textBox1.Text;

                    if (Buchstabe.Length > 0)
                    {
                        OCR_Table.Add(Zeile, Buchstabe);
                    }
                }
                else
                    Buchstabe = "?";
            }

            return Buchstabe;
        }


        private string AnalyseNPC_Name_Phase1(int Mode, Bitmap bild)
        {
            // 1. Bild in Buchstaben trennen
            string erg = "";
            bool inBuchstabe = false;
            int minX = 9999;
            int minY = 9999;
            int maxY = -1;

            int UngueltigeZeichenFaktor = 0;

            for (int x = 0; x < bild.Width; x++)
            {
                bool SchwarzFlag = false;
                for (int y = 0; y < bild.Height; y++)
                {
                    // stehen in der aktuellen Row Daten ?
                    Color c = bild.GetPixel(x, y);

                    if (Mode == 0)
                    {
                        // Schwarze Schrift auf grauem grund
                        if (c.B < 100 && c.R < 100 & c.G < 100)
                        {
                            SchwarzFlag = true;
                            if (y < minY) minY = y;
                            if (y > maxY) maxY = y;
                            if (x < minX) minX = x;
                            inBuchstabe = true;
                        }
                    }
                    else
                    {
                        // weiße schrift auf schwarzem grund
                        if (c.B > 100 && c.R > 100 & c.G > 100)
                        {
                            SchwarzFlag = true;
                            if (y < minY) minY = y;
                            if (y > maxY) maxY = y;
                            if (x < minX) minX = x;
                            inBuchstabe = true;
                        }

                    }

                }
                if ((SchwarzFlag == false) && (inBuchstabe == true))
                {
                    // erste leere Reihe hinter einem Buchstaben gefunden
                    string text = "Phase 1: x:" + minX.ToString() + "-" + x.ToString() + " y:" + minY.ToString() + "-" + maxY.ToString() + "\n";
                    //AddToProtokoll(text);

                    string Zeichen = AnalyseNPC_Name_Phase2(Mode, bild, minX, minY, x, maxY);
                    erg += Zeichen;

                    if (Zeichen == "?")
                        UngueltigeZeichenFaktor -= 1;
                    else
                        UngueltigeZeichenFaktor += 1;



                    // alles wieder auf Anfang
                    minX = 9999; minY = 9999; maxY = -1; inBuchstabe = false;
                }
            }


            if (UngueltigeZeichenFaktor < 0)    // um zufallstreffer zu vermeiden.
                erg = "";

            // AddToProtokoll(">>>:" + erg + "\n");

            return erg;
        }



        private string AnalyseNPC_Name(int Mode  /* 0 = normaler Text , 1 = xp in % ( sw hintergrund bei ws schrift ) */)
        {
            Bitmap bild=null;
            if (Mode == 0)
            {
                bild = Tools.GetBitmap(BasisX + 743, BasisY + 22, 185, 13);
            }
            else if (Mode == 1)
            {
                bild = Tools.GetBitmap(BasisX + 6, BasisY + 94, 40, 9);
            }

            // MainWindow.mainWindow.pictureBox1.Image = bild;


            string erg = AnalyseNPC_Name_Phase1(Mode, bild);

            return erg;
        }
This is an very easy Bitmap to String Converter.

Function AnalyseNPC_Name_Phase1() is splitting the text into single charaters.

Function AnalyseNPC_Name_Phase2() is converting the bitmap of a single character into a string and stores in a Dictionary.

The LearnMode variable controlls if the code is in bot-mode or in learning Mode.
In LearnMode it will ask the user for unknowen letters with an dialog.

Not in the example is the code for saving the OCR_Table Dictionary and the Dialog that asks the User for a Charater in the case it found something new.
Merci Gretos. I fear that the problem it is not with german as I can use translator but with c# I have to understand it and translate it to vb6 and I think I have just have to learn another langage a modern one, I discovred the image treatment domain in programmation and i loved it especially OCR
meilleur is offline  
Old 07/12/2009, 23:22   #60
 
elite*gold: 0
Join Date: Dec 2007
Posts: 111
Received Thanks: 17
I started programming c# with mono (.net compiler) in ubuntu (Linux distribution), if I want to export my project in MV2008(or inverse) will I have problem with compatibility?
meilleur is offline  
Reply


Similar Threads Similar Threads
NT Bot läuft nun ! Nur ein Problem !
02/13/2009 - Diablo 2 - 0 Replies
Tach ! Ja habe endlich mein NT Bot zum laufen bekommen :) Nun nächstes Problem hoffe es weiß einer *gg* Jo er telet hin aber killt sie nicht ! Kennt sich einer aus? greetz !
awesom-o es läuft nix
10/30/2008 - Diablo 2 - 1 Replies
also ich komm damit irgendwie net klar. bin wohl zu blond oder so. aber alles ganz genau so gemacht mit vm und awesom und und und wie es im guide hier auf der seite angegeben ist. hab in der einen ini meinen acc, pw und char eingetragen. alles fertig. wenn ich den bot dann starten will klicke ich auf die ao.exe .. ist doch richtig oder?? naja dann öffnet sich auf jedenfall redvex und ich kann starten sagen.
2.4 Emu läuft nicht
04/30/2008 - WoW Private Server - 1 Replies
Hallo , ich habe mir den 2.4 Ascent Emu runtergeladen , Installiert doch man kann ihn nicht starten. Ich bin kein kleines Kiddy dass es nicht schafft , habe bei den anderen Emus auch keine Probleme gehabt nur gibt es bei diesem keine Startdatei .. mfg Van Helsing



All times are GMT +1. The time now is 21:03.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.