Jump to content

Double pixel search help


jabbaws
 Share

Recommended Posts

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

  • Moderators

@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

  • Moderators

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 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

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...