Check color send key

Ask gaming related questions
Nantu
Posts: 12
Joined: 30 Jun 2017, 11:15

Check color send key

Post by Nantu » 29 Jul 2017, 13:21

Code: Select all

#Persistent

SetTimer, checkcolor, 1, Fast
Return 

checkcolor:
If Pix(215, 1004) = 0x2C2021
Send y
Return

; Simplified version of PixelGetColor =P
Pix(x, y){
PixelGetColor, r, %x%, %y%
Return r
}

F11::EXITAPP
im using this to check color at location x y and send key when color is found. can this be done in any other way ?
Also the color in game seems to vary/differ , how do i correctly detect different shades of same color in my script
Nantu
Posts: 12
Joined: 30 Jun 2017, 11:15

Re: Check color send key

Post by Nantu » 19 Oct 2017, 03:34

necroing my old thread CUZ relevancy

ive now figured how to make ahk search pixel for color AND send key when pixel with color is found
for any1 whos might need this here it goes

Code: Select all

#Persistent



 Loop 
 { 
 PixelSearch, Px, Py, 321, 999, 321, 999, 0x41008a, 50, Fast 
 if !ErrorLevel 
   { 
   Send, y 
   Sleep, 800 
   
   } 
 else
   send k
  

 }


F11::exitapp
but now i have a new requirement.
I need to search the pixel for all variants/shades of color red and add it to my code above.Calling all experts to help out the noob i.e. me
Nantu
Posts: 12
Joined: 30 Jun 2017, 11:15

Re: Check color send key

Post by Nantu » 21 Oct 2017, 15:32

bump
Post Reply

Return to “Gaming”