Jump to content

Mousemove With Pixelcheck Until find point


Recommended Posts

My program idea is to get the nearest points of my start mark

image.thumb.png.cbcd4811b09932354d8b77b52e6a1764.png

My Background:
 -there are no controls in this website to check.
- I already tried pixel search, but it has bad accuracy
- I think Imagesearch will be also bad.

- Already Tried Geocoder  sites, but it does not show street number for all coordinates

 

My Code:

HotKeySet('{f5}', 'start')
HotKeySet('{esc}', '_exe')
 Func _exe()
     Exit 
 EndFunc
While 1
    Sleep(3000)
Wend
Func start()
    Global $c[2] = [954, 613];My Middle Screen
     FindYellow(-1,0,-1, 0) ;Search Left
    
EndFunc
Func FindYellow($Val_X,$Val_Y , $ChangeX , $ChangeY ) 
    MouseMove( $c[0] ,  $c[1],0 )
    $Val_X = 0
    
    Do 
        $PinX = $c[0] + $Val_X
        $PinY = $c[1] + $Val_Y
    ;   print('Val_X',$Val_X )
    ;   print('Val_Y',$Val_Y )
        print('$PinY', $PinX)
        print('$PinY', $PinY)
        ToolTip('Checking....', 0, 0)
        Global  $Chkcolor = PixelGetColor($PinX,$PinY );0x8F8E65
        If $Chkcolor =  '12237499' Then ;White Street Line
            click($PinX,$PinY )
            print('FindYellow_ UP  Found At: ' , $PinX & ',' & $PinY )
            ExitLoop
            Return True  
            Else 
            ;   print('ChkColor', $Hex  )
        EndIf
        ;MouseMove( $PinX , $PinY,0 )
    Print('Current Color',$Chkcolor )
    ;   Sleep(2)
    $Val_X += $ChangeX
    $Val_Y += $ChangeY
        
        ;Sleep(5)
    Until  $PinY <= 0 Or $PinY >=  @DesktopHeight Or $PinX >= @DesktopWidth Or $PinX <= 0
;MouseMove( $PinX , $PinY,0 )
        ToolTip('', 0, 0)
MsgBox(0, 0, 'Done')
EndFunc



Func Pix_GroupYellow()
Global $Yellow_Array[1] = [0xB9B8B9]
    
Global $Hex = '0x'& Hex($Chkcolor, 6)
For $i = 0 To UBound($Yellow_Array) -1
    If  $Hex = $Yellow_Array[$i] Then 
        MsgBox(0, 0,'Group Pix ok') 
        Return True
        ExitLoop 
    EndIf
Next

    
EndFunc

Func Print($Txt,$Func="")
    ConsoleWrite($Txt& '= ' ) 
    ConsoleWrite($Func &@CRLF) 
EndFunc

Website:

https://geoportal.gisqatar.org.qa/qmape/index.html

What I need:

Some way to checking process faster, Or anyway to achieve the main purpose (click on nearest point of start mark)

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