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 


[Solved] GetPixel help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Deve
Expert Cheater
Reputation: 0

Joined: 20 Jan 2007
Posts: 245
Location: Stockholm, Sweden

PostPosted: Sun Mar 15, 2009 10:15 am    Post subject: [Solved] GetPixel help Reply with quote

Hello all,

Im trying to make a autopotter in C# for Dekaron but i dont know how to get the pixels from:


but when i use:
Code:
            IntPtr WindowHandle = FindWindow("Renderer", "Dekaron");
            backred = GetPixel(GetDC(WindowHandle), 745, 935); //HP
            backblue = GetPixel(GetDC(WindowHandle), 615, 950); //MP

the value stays the same when i consume my mana below that point.

Solution?

_________________


Leecher.


Last edited by Deve on Sun Mar 15, 2009 6:05 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
AlbanainRetard
Master Cheater
Reputation: 0

Joined: 02 Nov 2008
Posts: 494
Location: Canada eh?

PostPosted: Sun Mar 15, 2009 11:51 am    Post subject: Re: [C#]GetPixel help Reply with quote

develito wrote:
Hello all,

Im trying to make a autopotter in C# for Dekaron but i dont know how to get the pixels from:


but when i use:
Code:
            IntPtr WindowHandle = FindWindow("Renderer", "Dekaron");
            backred = GetPixel(GetDC(WindowHandle), 745, 935); //HP
            backblue = GetPixel(GetDC(WindowHandle), 615, 950); //MP

the value stays the same when i consume my mana below that point.

Solution?


Are you 100% the Class name is right? Then just use a class name. Also check if there are any "Preventions" from using a straight forward GetPixel if so try to bypass. (I don't play)

Also you may of got the wrong color by one pixel, take a screen shot find the point in paint and get the color value.

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

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Mar 15, 2009 11:52 am    Post subject: Reply with quote

Is the game protected? (GameGuard, HackShield, XTrap?)
Back to top
View user's profile Send private message
Deve
Expert Cheater
Reputation: 0

Joined: 20 Jan 2007
Posts: 245
Location: Stockholm, Sweden

PostPosted: Sun Mar 15, 2009 11:57 am    Post subject: Reply with quote

dnsi0 wrote:
Is the game protected? (GameGuard, HackShield, XTrap?)


The real game is but im playing on a private server so no.

and AlbanainRetard, what bypass? the one that 4ng3licDew used?

_________________


Leecher.
Back to top
View user's profile Send private message MSN Messenger
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Mar 15, 2009 11:58 am    Post subject: Reply with quote

develito wrote:
dnsi0 wrote:
Is the game protected? (GameGuard, HackShield, XTrap?)


The real game is but im playing on a private server so no.

and AlbanainRetard, what bypass? the one that 4ng3licDew used?


Good. Then check if GetPixel is actually returning anything.
Back to top
View user's profile Send private message
AlbanainRetard
Master Cheater
Reputation: 0

Joined: 02 Nov 2008
Posts: 494
Location: Canada eh?

PostPosted: Sun Mar 15, 2009 11:59 am    Post subject: Reply with quote

develito wrote:
dnsi0 wrote:
Is the game protected? (GameGuard, HackShield, XTrap?)


The real game is but im playing on a private server so no.

and AlbanainRetard, what bypass? the one that 4ng3licDew used?


Well if your testing were it is using GameGaurd just jump the first five bytes if not then check if you got the right color.

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

Joined: 20 Jan 2007
Posts: 245
Location: Stockholm, Sweden

PostPosted: Sun Mar 15, 2009 12:07 pm    Post subject: Reply with quote

I made a simple label to show me the value
Code:
            label4.Text = Convert.ToString(backblue);


and it shows me 4344134. I used the sampler in Paint.NET and can't find eny RGB values to 43, 44, 134

_________________


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

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Sun Mar 15, 2009 12:26 pm    Post subject: Re: [C#]GetPixel help Reply with quote

develito wrote:
Hello all,

Im trying to make a autopotter in C# for Dekaron but i dont know how to get the pixels from:


but when i use:
Code:
            IntPtr WindowHandle = FindWindow("Renderer", "Dekaron");
            backred = GetPixel(GetDC(WindowHandle), 745, 935); //HP
            backblue = GetPixel(GetDC(WindowHandle), 615, 950); //MP

the value stays the same when i consume my mana below that point.

Solution?


Use some error checking! Make sure that each thing returned from a API is usable and was successful! Then you will find out your problem!

I too think it's with the FindWindow();

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

Joined: 20 Jan 2007
Posts: 245
Location: Stockholm, Sweden

PostPosted: Sun Mar 15, 2009 3:40 pm    Post subject: Reply with quote

I remade the autopotter in C++ because it feels easier, i've got everything working with the GetPixel but now im missing a check.

Something to constantly check the RGB values, timer?
i have never seen codes for a timer in C++ so any tips?

_________________


Leecher.
Back to top
View user's profile Send private message MSN Messenger
`unknown
Grandmaster Cheater
Reputation: 0

Joined: 20 Nov 2006
Posts: 658
Location: You lost the game.

PostPosted: Sun Mar 15, 2009 4:05 pm    Post subject: Reply with quote

I think you need to call GetDC() outside of the GetPixel, that is how I did mine. GetDC(NULL) for fullscreen, otherwise use the window handle of the app you want to get the pixel of.
Back to top
View user's profile Send private message MSN Messenger
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sun Mar 15, 2009 4:28 pm    Post subject: Reply with quote

`unknown wrote:
I think you need to call GetDC() outside of the GetPixel, that is how I did mine. GetDC(NULL) for fullscreen, otherwise use the window handle of the app you want to get the pixel of.


No you don't.

They work the same way.
Back to top
View user's profile Send private message
Deve
Expert Cheater
Reputation: 0

Joined: 20 Jan 2007
Posts: 245
Location: Stockholm, Sweden

PostPosted: Sun Mar 15, 2009 4:39 pm    Post subject: Reply with quote

So, tips for making a check for RGB values?
_________________


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

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sun Mar 15, 2009 5:10 pm    Post subject: Reply with quote

develito wrote:
I remade the autopotter in C++ because it feels easier, i've got everything working with the GetPixel but now im missing a check.

Something to constantly check the RGB values, timer?
i have never seen codes for a timer in C++ so any tips?


SetTimer()



Also, you can use the RGB macro for the sake of ease.

COLORREF butt = GetPixel(hdc, 50, 50);
if(butt == RGB(255, 255, 255)){
//do something neat
}
Back to top
View user's profile Send private message
Deve
Expert Cheater
Reputation: 0

Joined: 20 Jan 2007
Posts: 245
Location: Stockholm, Sweden

PostPosted: Sun Mar 15, 2009 6:04 pm    Post subject: Reply with quote

Thank you everyone for your help.

Since i only use the potter while i play so the easiest solution was:
Code:
if(GetAsyncKeyState(VK_F8))
   {
      while(DekaronWindow==GetForegroundWindow())
      {
         //autopot code
      }
      Sleep(500);
   }

_________________


Leecher.
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
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