Jump to content

AND operator using pixelgetcolor and pixelsearch wont work


Recommended Posts

hello i'm here again i know im quite annoying because i ask nonsense questions >.<
i just wanted to improve my automated autoclicker yahoomail

I wanted to check if it is match pink and white color using AND operator && but i cant make it to work :(

im really newbie in programming ,i wanted to learn more, i hope you help me again

Func CheckIfMatch()
   $pink = PixelSearch(0, 0, @DesktopHeight, @DesktopWidth, 0x2f0326) && If PixelGetColor ( 1002 , 236 ) = 0xFFFFFF &&
   If isArray($pink) then
   Send("{F5}")
   MouseClick("primary", $pink[0] , $pink[1], 0, 0)
Else
   MouseClick("primary", $pink[0] , $pink[1], 0, 0)
EndIf
EndFunc

 

Edited by christian11
Link to comment
Share on other sites

  • Moderators

Look through the language operators in the help file, do you see a double ampersand? Start there.

Try something like: If x AND y Then ...

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

ok ill try ..is it okay?

its worked but it doesn't Mouseclick to $pink any idea why?

 

Func CheckIfMatch()
   $pink = PixelSearch(0, 0, @DesktopHeight, @DesktopWidth, 0x2f0326)
   $white = PixelGetColor ( 1002 , 236 ) 
   If isArray($pink) And $white = 0xFFFFFF  then
   Send("{F5}")
   MouseClick("primary", $pink[0] , $pink[1], 0, 0)
Else
   MouseClick("primary", $pink[0] , $pink[1], 0, 0)
EndIf
EndFunc
Edited by christian11
Link to comment
Share on other sites

  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...