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 


getPixel

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
GenericDM
How do I cheat?
Reputation: 0

Joined: 01 Apr 2018
Posts: 8

PostPosted: Sun May 06, 2018 12:50 pm    Post subject: getPixel Reply with quote

I'm using getpixel to return an RGB value from the game i'm in, but when I use it, it only returns 7-8 digit numbers instead of 9 digits or 3 values like i was expecting. How do I use this properly?
Back to top
View user's profile Send private message
ParkourPenguin
Grandmaster Cheater Supreme
Reputation: 65

Joined: 06 Jul 2014
Posts: 1999
Location: Arcadian Suburbia

PostPosted: Sun May 06, 2018 1:06 pm    Post subject: Reply with quote

https://msdn.microsoft.com/en-us/library/windows/desktop/dd144909%28v=vs.85%29.aspx
Code:
local color = getPixel(getMousePos())
assert(color ~= 0xffffffff,'CLR_INVALID')
local r,g,b = color & 0xff, color >> 8 & 0xff, color >> 16 & 0xff

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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