Jump to content

Recommended Posts

Posted

Using sample code:

#include <MsgBoxConstants.au3>
; Find a pure red pixel in the range 0,0-20,300
Local $aCoord = PixelSearch(0, 0, 20, 300, 0xFF0000)
If Not @error Then
    MsgBox($MB_SYSTEMMODAL, "", "X and Y are: " & $aCoord[0] & "," & $aCoord[1])
Else
    MsgBox($MB_SYSTEMMODAL, "", "Pure Not Found")
EndIf
; Find a pure red pixel or a red pixel within 10 shades variations of pure red
$aCoord = PixelSearch(0, 0, 20, 300, 0xFF0000, 10)
If Not @error Then
    MsgBox($MB_SYSTEMMODAL, "", "X and Y are: " & $aCoord[0] & "," & $aCoord[1])
Else
    MsgBox($MB_SYSTEMMODAL, "", "Variant Not Found")
EndIf
 
and the attached screenshot which has Pure Red (FF0000) in one icon in the area being searched.
screenshot.jpg
Would someone please check this out for me?
Posted

I blanked out the app I was automating.

I afterwards realised that I was running my test where I run my automation, on a second screen.

If I move SciTE to the main screen the test works so I need to build a better example.

The problem I have is that the pixelsearch which is supplied the handle to the app window always returns the same location for the found (@error=0) pixel.

I am using the handle as the window is not on the same screen as SciTE.

Is the fact I'm running SciTE  on another screen perhaps the cause of my problem?

 

 

  • Moderators
Posted
1 hour ago, MrMajorThorburn said:

I blanked out the app I was automating.

I don't think that was ever in question. I asked what app it is, because 99% of the time pixelsearch is not the way to go. There is almost always a better way to do it.

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

Posted

MrMajorThorburn, we could gladly help you with your request but first you would have to actually provide information about why are you trying to use pixelsearch? For what purpose is it?

If you can give me details about what you want to use it for then I'll gladly help you

Posted

Its ok. I was not aware of the restriction of use of autoit.

I will establish a business scenario and see if I get the same problem and if so raise a new request for help.

I will be able to supply full disclosure that way.

Thanks for your interest and guidance.

Be back soon in another request.

  • Moderators
Posted

Before coming back please ensure you are familiar with the forum rules, as you obviously had not read them yet. Along with the restriction on game automation, please see this section:

Quote

Do not repost the same question if the previous thread has been locked - particularly if you merely reword the question to get around one of the prohibitions listed above.

 

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

Guest
This topic is now closed to further replies.
×
×
  • Create New...