Jump to content

Script doesn't locate 'other' tab


Recommended Posts

Posted Image

How can I get the script to find the 'other' tab? --> located in the top right <--

; start somesort of search to find the 'other' tab - NEED HELP
            $coord2 = 
            
            If IsArray($coord2) = 1 Then
    ; save coords as 'otherCoords'
                $otherCoords[0] = $coord2[0]
                $otherCoords[1] = $coord2[1]
                MouseClick("left", $otherCoords[0], $otherCoords[1])
; Error msg
            Else
                MsgBox(0,"ERROR","Unable to find '$otherCoords'")
            EndIf

Can't use a pixel search, because multiple things have the same color. I The location never changes in relation to the screen, is there perhaps a way to have it define the top/right/bottom/left coords and 'estimate' the area?

Appreciate the help =-)

Almost have it running.. (i hope).

Edited by meowbits
Link to comment
Share on other sites

Const $c24RGBFullMatch=1        ;Load as 24 bits and full match
Const $c24RGBPartialMatch=2        ;Load as 24 bits and partial match
Const $c16RGBFullMatch=3        ;Load as 16 bits and full match
Const $c16RGBPartialMatch=4        ;Load as 16 bits and partial match

#include <ScreenCapture.au3>
#include <FindBMP.au3>
#include <WindowsConstants.au3>

_GDIPlus_Startup()

Const $sFileSource = @ScriptDir & '\2zh1pco.bmp'
Const $sFileButton = @ScriptDir & '\Button.bmp'

findTester($sFileSource, $sFileButton, $c24RGBPartialMatch)
findTester($sFileSource, $sFileButton, $c16RGBPartialMatch)

$aRet = StringSplit(findBMP($sFileSource,$sFileButton, $c16RGBPartialMatch), ';', 2)

Dim $hGUI = GUICreate('Test', @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOOLWINDOW)
Dim $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
Dim $hImage = _GDIPlus_ImageLoadFromFile($sFileSource)

GUISetState()

_GDIPlus_GraphicsDrawImage($hGraphics, $hImage, 0, 0)
MouseMove($aRet[2], $aRet[3], 5)

Do
Until GUIGetMsg() = -3

_GDIPlus_ImageDispose($hImage)
_GDIPlus_GraphicsDispose($hGraphics)
GUIDelete()

_GDIPlus_Shutdown()



;Do the actual find
Func FindTester($BMP1, $BMP2, $Bool)
    Local $tResult
    $tResult = findBMP($BMP1,$BMP2, $Bool)
    ConsoleWrite($tResult &  " " & $BMP2 & " in " & $BMP1 & " ** matchtype " & $Bool & @LF)
EndFunc

Look here if you need farther information and ofcourse thanks JunkEW for your wonderful library.

Edit: Sorry, forgot to include the images. ;] Link

Edited by Authenticity
Link to comment
Share on other sites

  • 6 months later...

Const $c24RGBFullMatch=1        ;Load as 24 bits and full match
Const $c24RGBPartialMatch=2        ;Load as 24 bits and partial match
Const $c16RGBFullMatch=3        ;Load as 16 bits and full match
Const $c16RGBPartialMatch=4        ;Load as 16 bits and partial match

#include <ScreenCapture.au3>
#include <FindBMP.au3>
#include <WindowsConstants.au3>

_GDIPlus_Startup()

Const $sFileSource = @ScriptDir & '\2zh1pco.bmp'
Const $sFileButton = @ScriptDir & '\Button.bmp'

findTester($sFileSource, $sFileButton, $c24RGBPartialMatch)
findTester($sFileSource, $sFileButton, $c16RGBPartialMatch)

$aRet = StringSplit(findBMP($sFileSource,$sFileButton, $c16RGBPartialMatch), ';', 2)

Dim $hGUI = GUICreate('Test', @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOOLWINDOW)
Dim $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
Dim $hImage = _GDIPlus_ImageLoadFromFile($sFileSource)

GUISetState()

_GDIPlus_GraphicsDrawImage($hGraphics, $hImage, 0, 0)
MouseMove($aRet[2], $aRet[3], 5)

Do
Until GUIGetMsg() = -3

_GDIPlus_ImageDispose($hImage)
_GDIPlus_GraphicsDispose($hGraphics)
GUIDelete()

_GDIPlus_Shutdown()



;Do the actual find
Func FindTester($BMP1, $BMP2, $Bool)
    Local $tResult
    $tResult = findBMP($BMP1,$BMP2, $Bool)
    ConsoleWrite($tResult &  " " & $BMP2 & " in " & $BMP1 & " ** matchtype " & $Bool & @LF)
EndFunc

Look here if you need farther information and ofcourse thanks JunkEW for your wonderful library.

Edit: Sorry, forgot to include the images. ;] Link

Hi i am new to autoit can you help me for findbmp it is searching all of the screen but i want it to search a given coordinate but it is giving error.

This is the codes i want to use.

1.These codes working but using too much memory and i want to change size of the searching area to these coordinate $aTop[0],$aTop[1],$aTop[0]+760,$aTop[1]+53

$ARET = _FINDBMP("SCREEN", $SDATAPATH & "\bmp1\popup_profile.bmp")
        If $ARET[1] == True Then
            MouseClick("left", $ARET[3], $ARET[4], 1, 10)
        EndIf
Link to comment
Share on other sites

Hi i am new to autoit can you help me for findbmp it is searching all of the screen but i want it to search a given coordinate but it is giving error.

This is the codes i want to use.

1.These codes working but using too much memory and i want to change size of the searching area to these coordinate $aTop[0],$aTop[1],$aTop[0]+760,$aTop[1]+53

$ARET = _FINDBMP("SCREEN", $SDATAPATH & "\bmp1\popup_profile.bmp")
        If $ARET[1] == True Then
            MouseClick("left", $ARET[3], $ARET[4], 1, 10)
        EndIf

I found a nother way for it thanks.

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