Jump to content

Recommended Posts

Posted

hi guys i have a problem with this  web page https://www.casa.it/vendita-residenziale/in-lucca/mappa-1  in practical  the  web page is divide in 2 part ,one is a frame with google map and  over i have a red point of interest , and  in left of  the page have  the "link" with pics  (i don understund so much in web programming i think is link but if i did do inspect element dont find a classical link href ......),i want create an application.

This app must create a circle over the map  and  take some point of interest , after  with mouse  scroll  over left link and if  point change colour (red to gray) i want ,  grab , price  , name  and m2 

now i am here

#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

HotKeySet("{ESC}", "_Bye")
HotKeySet("{SPACE}", "_FERMA")
;HotKeySet("{+}", "_ZoomPiu")
;HotKeySet("{-}", "_ZoomMeno")
HotKeySet("!q", "_Quadrato")
HotKeySet("!c", "_Cerchio")

Global $iGFerma = 0, $iGCtrlFerma = 0, $iGQuadrato = 0, $iGCerchio = 0, $lokasi

Global $iCircleR = 150 ; <=== Edit this for different circle radius (in pixels)
Global $iCircleD = $iCircleR * 2

Global $pt = MouseGetPos()
Global $GUI = GUICreate("test", $iCircleD, $iCircleD, $pt[0] - $iCircleR, $pt[1] - $iCircleR, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0xFF0000)

;Global $a = _CreateRoundRectRgn(0, 0, $iCircleD, $iCircleD, $iCircleD, $iCircleD)
Global $a = _CreateRoundRectRgn(0, 0, $iCircleD, $iCircleD, $iCircleD, $iCircleD)
Global $b = _CreateRoundRectRgn(4, 4, ($iCircleD - 8), ($iCircleD - 8), ($iCircleD - 4), ($iCircleD - 4))

_CombineRgn($a, $b)
_SetWindowRgn($GUI, $a)

GUISetState()
GUISetState(@SW_DISABLE)

While 1
    Sleep(10)
    If $iGFerma = 0 Then
        $pt = MouseGetPos()
        If Not @error Then WinMove($GUI, "", $pt[0] - $iCircleR, $pt[1] - $iCircleR)
    Else
        _WinAPI_DrawRect(($pt[0] - $iCircleR),  ($pt[1] - $iCircleR), $iCircleD, $iCircleD, 0x0000FF)
        ;MsgBox(0,'coordinate',$iCircleD&" _ "& $iCircleD&" _ "& ($pt[0] - $iCircleR)&" _ "&($pt[1] - $iCircleR))
        ;$lokasi = PixelSearch($iCircleD, $iCircleD, $pt[0] - $iCircleR, $pt[1] - $iCircleR, 0x333F48)
        ;$lokasi = PixelSearch(1150, 500, 740,161, 0x333F48)
        $lokasi = PixelSearch(($pt[0] - ($iCircleD/2)), ($pt[1] - ($iCircleD/2)), ($pt[0] + ($iCircleD/2)), ($pt[1] + ($iCircleD/2)), 0x333F48,4)
        If IsArray($lokasi) Then

            MouseMove($lokasi[0], $lokasi[1], 0)
        ;   MouseClick("left")
            MsgBox(0, '', 'trovato gray')
        EndIf
    EndIf

WEnd


Func _WinAPI_DrawRect($start_x, $start_y, $iWidth, $iHeight, $iColor)
    Local $hDC = _WinAPI_GetWindowDC(0) ; DC of entire screen (desktop)
    $tRect = DllStructCreate($tagRECT)
    DllStructSetData($tRect, 1, $start_x)
    DllStructSetData($tRect, 2, $start_y)
    DllStructSetData($tRect, 3, $iWidth + $start_x) ;  x-coordinate of the lower-right corner of the rectangle
    DllStructSetData($tRect, 4, $iHeight + $start_y) ;  y-coordinate of the lower-right corner of the rectangle
    Local $hBrush = _WinAPI_CreateSolidBrush($iColor)

    _WinAPI_FrameRect($hDC, DllStructGetPtr($tRect), $hBrush)
    ;Local $tRect
    ;_WinAPI_Ellipse ($hDC,$tRect)
    ; clear resources
    _WinAPI_DeleteObject($hBrush)
    _WinAPI_ReleaseDC(0, $hDC)
EndFunc   ;==>_WinAPI_DrawRect




Func _Quadrato()

    $iGQuadrato = 1

    $a = _CreateRoundRectRgn(0, 0, $iCircleD, $iCircleD, 0, 0)
    $b = _CreateRoundRectRgn(4, 4, ($iCircleD - 8), ($iCircleD - 8), 0, 0)

    _CombineRgn($a, $b)
    _SetWindowRgn($GUI, $a)
EndFunc   ;==>_Quadrato

Func _Cerchio()
    $iGQuadrato = 0

    $a = _CreateRoundRectRgn(0, 0, $iCircleD, $iCircleD, $iCircleD, $iCircleD)
    $b = _CreateRoundRectRgn(4, 4, ($iCircleD - 8), ($iCircleD - 8), ($iCircleD - 4), ($iCircleD - 4))

    _CombineRgn($a, $b)
    _SetWindowRgn($GUI, $a)
EndFunc   ;==>_Cerchio

Func _ZoomPiu()
    $iCircleD += 5
    If $iGQuadrato = 1 Then
        $a = _CreateRoundRectRgn(0, 0, $iCircleD, $iCircleD, 0, 0)
        $b = _CreateRoundRectRgn(4, 4, ($iCircleD - 8), ($iCircleD - 8), 0, 0)
        _CombineRgn($a, $b)
        _SetWindowRgn($GUI, $a)
    Else
        $a = _CreateRoundRectRgn(0, 0, $iCircleD, $iCircleD, $iCircleD, $iCircleD)
        $b = _CreateRoundRectRgn(4, 4, ($iCircleD - 8), ($iCircleD - 8), ($iCircleD - 4), ($iCircleD - 4))
        _CombineRgn($a, $b)
        _SetWindowRgn($GUI, $a)
    EndIf

EndFunc   ;==>_ZoomPiu

Func _ZoomMeno()

    $iCircleD -= 5
    If $iGQuadrato = 1 Then
        $a = _CreateRoundRectRgn(0, 0, $iCircleD, $iCircleD, 0, 0)
        $b = _CreateRoundRectRgn(4, 4, ($iCircleD - 8), ($iCircleD - 8), 0, 0)
        _CombineRgn($a, $b)
        _SetWindowRgn($GUI, $a)
    Else

        $a = _CreateRoundRectRgn(0, 0, $iCircleD, $iCircleD, $iCircleD, $iCircleD)
        $b = _CreateRoundRectRgn(4, 4, ($iCircleD - 8), ($iCircleD - 8), ($iCircleD - 4), ($iCircleD - 4))
        _CombineRgn($a, $b)
        _SetWindowRgn($GUI, $a)
    EndIf

EndFunc   ;==>_ZoomMeno

Func _FERMA()
    If $iGCtrlFerma = 0 Then
        $iGCtrlFerma = 1
        $iGFerma = 1
    Else
        $iGCtrlFerma = 0
        $iGFerma = 0
    EndIf
EndFunc   ;==>_FERMA


Func _CreateRoundRectRgn($l, $t, $w, $h, $e1, $e2)
    $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $l, "long", $t, "long", $l + $w, "long", $t + $h, "long", $e1, "long", $e2)
    Return $ret[0]
EndFunc   ;==>_CreateRoundRectRgn

Func _CombineRgn(ByRef $rgn1, ByRef $rgn2)
    DllCall("gdi32.dll", "long", "CombineRgn", "long", $rgn1, "long", $rgn1, "long", $rgn2, "int", 3)
EndFunc   ;==>_CombineRgn

Func _SetWindowRgn($h_win, $rgn)
    DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1)
EndFunc   ;==>_SetWindowRgn

Func _bye()
    Exit
EndFunc   ;==>_bye

the script recognize if a redp point of interest change  to gray , inside of area , but  now , i dont know  how to proceed 

anyone  can help me ??

thankz

 

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
×
×
  • Create New...