Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How do you make a pixel based bot?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Hieroglyphics
I post too much
Reputation: 0

Joined: 06 Dec 2007
Posts: 2007
Location: Your bedroom

PostPosted: Mon Oct 06, 2008 5:49 pm    Post subject: How do you make a pixel based bot? Reply with quote

I don't get how you make a pixel based autopotter at all. I know how to get a pixel color and all that, but there can be many things of that color. I just don't get it. Can anybody explain to me?

By the way, I'm coding in delphi

_________________

Back to top
View user's profile Send private message AIM Address MSN Messenger
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Mon Oct 06, 2008 5:54 pm    Post subject: Re: How do you make a pixel based bot? Reply with quote

Hieroglyphics wrote:
I don't get how you make a pixel based autopotter at all. I know how to get a pixel color and all that, but there can be many things of that color. I just don't get it. Can anybody explain to me?

By the way, I'm coding in delphi


A Pixel - based thing, lets just say determines what amount of red, blue and green is at a certain xy.

This way, we can pixel pot, and go such.

Im not sure about delphi, but in C++ its GetPixel, which is stored in a COLORREF variable.

_________________
Back to top
View user's profile Send private message Send e-mail
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Mon Oct 06, 2008 6:04 pm    Post subject: Reply with quote

Each color holds a Red value, Green value and Blue value, all values can be a minimum of 0 and max of 255: Where 0, 0, 0 is black and 255, 255, 255 is White.

GetPixel gets the pixel at a specific cursor position which will give you unique pixel value.

You can compare that to color's or even compare the Red/Green/Blue values using GetRValue/GetGValue/GetBValue and compare those.

It's better to check for pixels that are more constant rather than one that is different in certain positions.

In MapleStory, it would make more sense to check the series of grey pixels seeing as there's only like 5 or 6, instead of trying it to compare it to a entire blue or red gradiant.

_________________
Back to top
View user's profile Send private message
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Mon Oct 06, 2008 6:32 pm    Post subject: Reply with quote

lurc wrote:
Each color holds a Red value, Green value and Blue value, all values can be a minimum of 0 and max of 255: Where 0, 0, 0 is black and 255, 255, 255 is White.

GetPixel gets the pixel at a specific cursor position which will give you unique pixel value.

You can compare that to color's or even compare the Red/Green/Blue values using GetRValue/GetGValue/GetBValue and compare those.

It's better to check for pixels that are more constant rather than one that is different in certain positions.

In MapleStory, it would make more sense to check the series of grey pixels seeing as there's only like 5 or 6, instead of trying it to compare it to a entire blue or red gradiant.


Ya, but in and ms autopotter, it would be equally efficient to check to see if a certain pixel is "red" (more red than the others). <---its like fool proof

_________________
Back to top
View user's profile Send private message Send e-mail
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Mon Oct 06, 2008 6:40 pm    Post subject: Reply with quote

You don't check the entire screen. You select points along the HP bar (Normally 10% intervals) and check to see if those points are grey or red.
_________________
Back to top
View user's profile Send private message
Hieroglyphics
I post too much
Reputation: 0

Joined: 06 Dec 2007
Posts: 2007
Location: Your bedroom

PostPosted: Mon Oct 06, 2008 7:09 pm    Post subject: Reply with quote

Ok I'm lost. As I said all I can do is find the red amount, green amount, and blue amount and the total color hex that the mouse is on or at a specified coordinate

Using Get Pixel then GetRValue and g and b of course :\

_________________

Back to top
View user's profile Send private message AIM Address MSN Messenger
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Mon Oct 06, 2008 7:22 pm    Post subject: Reply with quote

So use GetPixel on the fucking points on the HP bar. Then see if the value returned is equal to the value when it's red (meaning there's HP up to that point) or if it's equal to the value when it's gray (meaning there's no HP at that point).
_________________
Back to top
View user's profile Send private message
Hieroglyphics
I post too much
Reputation: 0

Joined: 06 Dec 2007
Posts: 2007
Location: Your bedroom

PostPosted: Mon Oct 06, 2008 7:46 pm    Post subject: Reply with quote

Ok, I think I got it. I will finish the rest of the trainer first before I go to that part though Thanks!
_________________

Back to top
View user's profile Send private message AIM Address MSN Messenger
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Mon Oct 06, 2008 7:54 pm    Post subject: Reply with quote

Hieroglyphics wrote:
Ok I'm lost. As I said all I can do is find the red amount, green amount, and blue amount and the total color hex that the mouse is on or at a specified coordinate

Using Get Pixel then GetRValue and g and b of course :\


That is all you need.

PColor = GetPixel()...blahblahblah
if (Red at PColor == 100 && blue at PColor == 0 && green at PColor == 0)

This is, of course not the right syntax, but the idea is the same.

_________________
Back to top
View user's profile Send private message Send e-mail
Hieroglyphics
I post too much
Reputation: 0

Joined: 06 Dec 2007
Posts: 2007
Location: Your bedroom

PostPosted: Mon Oct 06, 2008 8:23 pm    Post subject: Reply with quote

Ok I got it now, but there are at least like 5 different reds and greys in there. Do you have a list of all the colors so I can make it any of them. By the way kitterz I'm doing it in delphi Wink
_________________

Back to top
View user's profile Send private message AIM Address MSN Messenger
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Mon Oct 06, 2008 8:46 pm    Post subject: Reply with quote

Hieroglyphics wrote:
Ok I got it now, but there are at least like 5 different reds and greys in there. Do you have a list of all the colors so I can make it any of them. By the way kitterz I'm doing it in delphi Wink


I just picked a random red, blue and green value. You can set it to whatever you want, and the amount of red, blue and green differs according to pixel color.

1. A red pixel will have more red than grren and blue, etc
2. black will have 0,0,0 and white 255,255,255 (like lurc said)

This is an example in C++, though the concepts are the same.

Code:
   //Find Login Screen
   for (;;) {
      CColor = GetPix (GetDC(FindWindow("MapleStoryClass", NULL)),151,407 + YBase);
      if ((GetRValue(CColor) == 68) && (GetGValue(CColor) == 170) && (GetBValue(CColor) == 34)) {

         CColor = GetPix (GetDC(FindWindow("MapleStoryClass", NULL)),493,414 + YBase);
         if ((GetRValue(CColor) == 204) && (GetGValue(CColor) == 170) && (GetBValue(CColor) == 102)) {
      
            CColor = GetPix (GetDC(FindWindow("MapleStoryClass", NULL)),681,266 + YBase);   
            if ((GetRValue(CColor) == 34) && (GetGValue(CColor) == 17) && (GetBValue(CColor) == 0)) {
               break;
            }
         }
      }
      else {
         Sleep (100); //If Maple Closes B4 Login
      }
   }


This, in C++ is what I made to find the login screen of maple. (Donnt critisize my coding any1 =p)

To get the amount of red, blue and green at a pixel, make a program that outputs the colors whenever you, say press F1.
Code:

_________________
Back to top
View user's profile Send private message Send e-mail
Hieroglyphics
I post too much
Reputation: 0

Joined: 06 Dec 2007
Posts: 2007
Location: Your bedroom

PostPosted: Mon Oct 06, 2008 10:02 pm    Post subject: Reply with quote

Alright I made a timer that gives me the hex, but how come whenever I hover over Maplestory, the thing says its black after like a second after showing the colors. Also, I noticed that my screen resolution is different than other people, so how will I know what coord to put it on
_________________

Back to top
View user's profile Send private message AIM Address MSN Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Mon Oct 06, 2008 10:18 pm    Post subject: Reply with quote

Why not just use the RGB macro instead of that? So much simpler.

And why are you getting the DC OVER AND OVER AND OVER AND OVER?
Back to top
View user's profile Send private message
Hieroglyphics
I post too much
Reputation: 0

Joined: 06 Dec 2007
Posts: 2007
Location: Your bedroom

PostPosted: Mon Oct 06, 2008 10:38 pm    Post subject: Reply with quote

What?
_________________

Back to top
View user's profile Send private message AIM Address MSN Messenger
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Mon Oct 06, 2008 11:36 pm    Post subject: Reply with quote

why don't you get the pixel's color from a certain point at the hp bar,
after that create a thread that will get from the exact point the pixel's color again but to a different COLORREF variable
and then compare them each other like this
Code:

COLORREF color1,color2;
color1 = GetPixel(hdc,xPos,yPos); // hdc - device context of maple, xPos - X coord of certain point at hp bar, yPos - Y coord of certain point at hp bar

void AutoHPThread()
{
 bQuit = FALSE;
 while (!bQuit)
 {
  color2 = GetPixel(hdc,xPos,yPos); // same coordinates as color1
  if (color1 != color2)
  {
   _PostMessage(hWnd,WM_KEYDOWN,<YourHpVirtualKey>,(MapVirtualKey(<YourHpVirtualKey>,0)) << 16);
  }
 }
 ExitThread(0);
}

i guess it should work :S never tested it before

_________________
Stylo
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites