Is this possible?
-
- Posts: 1
- Joined: 21 Jan 2018, 04:43
Is this possible?
I need help to see if this is possible or not. Basically I wanna make something that would work like this (Everytime a a certain color appears on a part of my screen it would activate a task) So basically if this part of the screen is this color it would activate then deactivate if its not the color of choice.
Re: Is this possible?
Yes this is possible with PixelSearch
Here's some basic code that may help
Here's some basic code that may help
Code: Select all
coordmode,pixel,screen ;coords for pixelsearch are relative to screen
if CheckColor(0,0,0x000000) { ;example usage
msgbox The color BLACK (0x000000) was found at position 0,0
;perform action
}
if CheckColor(50,50,0xFF0000) {
msgbox The color RED (0xFF0000) was found at position 50,50
;perform action
}
return
CheckColor(x,y,color,variation=10) {
PixelSearch, foundX, foundY, x, y, x, y, color, variation, fast RGB
if (errorlevel = 0)
return true
return false
}
Some of my AHK programs: 3D Voxel Game - Platformer Game
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
GitHub projects : Image/Pixel scanning class - Direct2D overlay class
Who is online
Users browsing this forum: Lamron750 and 85 guests