jabbaws Posted September 17, 2019 Share Posted September 17, 2019 So i'm trying to have 2 pixelsearchs( 1 for red and 1 for orange) and if any of them return true i want to click it, i've managed toi get something working with only 1 pixelsearch, anytime i try to get both running it eithers doesnt work at all or it just does the last one called in the script. the working code i have is the follow #include <Misc.au3> Local $hDLL = DllOpen("user32.dll") While 1 If _IsPressed("20", $hDLL) Then ConsoleWrite("_IsPressed - Pressed Shift." & @crlf) While _IsPressed("20", $hDLL) PixelSearch(960,537,961,538,0xFF4040,50) If Not @error Then MouseClick("left") EndIf WEnd ConsoleWrite("_IsPressed - Pressed Shift." & @crlf) ElseIf _IsPressed("23", $hDLL) Then MsgBox(4096, "jabbaws", "Script has Been Aborted by pressing END.") ExitLoop EndIf Sleep(250) WEnd the second pixelsearch im trying to implement is this one PixelSearch(960,537,961,538,0xFFB233,50). Any help on how to make it work if any of them is detected? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 17, 2019 Moderators Share Posted September 17, 2019 @jabbaws welcome to the forum. How about explaining more about what you're trying to accomplish? A single PixelSearch can be unreliable enough, let alone a double. There is doubtless a better way to accomplish what you're after. "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 More sharing options...
jabbaws Posted September 17, 2019 Author Share Posted September 17, 2019 so what i intend to do is to have autoit loopclicking while having any 1 of 2 colors being displayed, i've managed to make it work for only 1 color, but i needed it to work if any of the both are present and i'm not being able to do that Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 17, 2019 Moderators Share Posted September 17, 2019 (edited) Yes, you stated that. The question is, loopclicking what, exactly? If we're not having to guess at what you're trying to accomplish, we are better suited to assist. A screenshot would help, if it is difficult to describe. Edited September 17, 2019 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 More sharing options...
jabbaws Posted September 17, 2019 Author Share Posted September 17, 2019 well i managed to solve the issue with this #include <Misc.au3> Local $hDLL = DllOpen("user32.dll") While 1 If _IsPressed("20", $hDLL) Then ConsoleWrite("_IsPressed - Pressed Shift." & @crlf) ; Standby cycle until the key is released. While _IsPressed("20", $hDLL) PixelSearch(960,537,961,538,0xFF4040,50) If Not @error Then MouseClick("left") else PixelSearch(960,537,961,538,0xFFB233,50) If Not @error Then MouseClick ("left") EndIf EndIf WEnd ConsoleWrite("_IsPressed - Pressed Shift." & @crlf) ElseIf _IsPressed("23", $hDLL) Then MsgBox(4096, "GamerGuyX", "Script has Been Aborted by pressing END.") ExitLoop EndIf Sleep(250) WEnd Thanks for trying to help me Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 17, 2019 Moderators Share Posted September 17, 2019 Likely still more than you actually need, but glad you got it working. "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 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