Vicate Posted June 16, 2011 Share Posted June 16, 2011 (edited) Hello! I am wondering what is wrong with the following function.Func _Find() ;Searches for the occurance of colors and clicks when found $Coord1 = PixelSearch(515, 500, 515, 500, 0x52C550, 30); $Coord2 = PixelSearch(515, 500, 515, 500, 0x7DD56B, 30); $Coord3 = PixelSearch(515, 500, 515, 500, 0x3CBB0F, 30); $Coord4 = PixelSearch(515, 500, 515, 500, 0x6CDB96, 30); If $TriggerA = 'false' and $TriggerB = 'false' and $TriggerC = 'false' and $Status = 'ON' and $AIM = 'false' and IsArray($Coord1) or IsArray($Coord2) or IsArray($Coord3), or IsArray($Coord4) Then Sleep(100) MouseClick("Left") Else EndIf EndFuncThe function worked perfectly when it was just one PixelSearch command like so:If $TriggerA = 'false' and $TriggerB = 'false' and $TriggerC = 'false' and $Status = 'ON' and $AIM = 'false' and IsArray($Coord1) ThenHowever when I added the other three PixelSearches things stopped working.It seems to become completely non-responsive to the colors(including the original one).My guess is it has to do with the "or" expressions throwing the conditions off.I would still like all of the AND entries to apply:If $TriggerA = 'false' and $TriggerB = 'false' and $TriggerC = 'false' and $Status = 'ON' and $AIM = 'false'But instead of just looking for one color, to monitor the presence of three additional colors(with shade variation) at the same coordinate.Thank you for your time! Edited June 16, 2011 by Vicate Link to comment Share on other sites More sharing options...
JohnOne Posted June 16, 2011 Share Posted June 16, 2011 Try If ($TriggerA = 'false' and $TriggerB = 'false' and $TriggerC = 'false' and $Status = 'ON' and $AIM = 'false') and (IsArray($Coord1) or IsArray($Coord2) or IsArray($Coord3), or IsArray($Coord4)) Then AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Vicate Posted June 17, 2011 Author Share Posted June 17, 2011 Yes! That works Thanks John. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now