$versionnumber = "1.2"
;$versionyear = 2008
;$REG_versionnumber = "15.0"
Opt("WinTitleMatchMode", 2)
Opt("WinTextMatchMode", 2)
Opt("MouseClickDelay", 250)
Opt("SendKeyDelay", 250)
Global Const $GUI_EVENT_CLOSE = -3
Global Const $GUI_EVENT_RESTORE = -5
Global Const $GUI_CHECKED = 1
Global Const $GUI_UNCHECKED = 4
Global Const $GUI_SHOW = 16
Global Const $GUI_HIDE = 32
Global Const $GUI_ENABLE = 64
Global Const $GUI_DISABLE = 128
Global Const $GUI_FOCUS = 256
Global Const $ES_READONLY = 0x0800
Global Const $BS_DEFPUSHBUTTON = 0x0001
Global Const $WS_SYSMENU = 0x00080000
Global Const $WS_CAPTION = 0x00C00000
Global Const $WS_POPUP = 0x80000000
Global Const $WS_EX_TOPMOST = 0x00000008
Global Const $LVS_SORTASCENDING = 0X0010
Global Const $LVS_SINGLESEL = 0x0004
Global Const $LVS_NOCOLUMNHEADER = 0x4000
Global Const $LVS_SHOWSELALWAYS = 0x0008
Global Const $LVS_EX_GRIDLINES = 0x00000001
Global Const $LVS_EX_FULLROWSELECT = 0x00000020
Global Const $TCS_MULTILINE = 0x0200
Global Const $TCS_FOCUSNEVER = 0x8000
Global Const $LVM_SETCOLUMNWIDTH = 0x101E
Global Const $LVM_SETEXTENDEDLISTVIEWSTYLE = 0x1036
#Include <GuiSlider.au3>
TraySetToolTip("POI Scanner " & $versionnumber & " for MS S&&&T and Autoroute 2008")
$productname = "- Microsoft Streets & Trips"
$titlebarhight = 30 ;$windowframehight = 4 ;$windowframewidth = 4
Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)
$exititem = TrayCreateItem("Exit - Quitter")
TrayItemSetOnEvent($exititem, "HandleTray")
TraySetState()
ProcessSetPriority(@ScriptName, 1)
$STpath = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Automap\" & "\15.0" & "\USA", "InstallTo")
$ARpath = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Automap\" & "\15.0" & "\EUR", "InstallTo")
$scan = 0
While 1
If WinExists($productname, "Task Panel") Then
$Zoom_pixel_1 = 310
$Zoom_pixel_2 = 109
$Zoom_pixel_3 = 37
$Zoom_pixel_4 = 15
EndIf
If Not WinExists($productname, "Task Panel") Then
$Zoom_pixel_1 = 350
$Zoom_pixel_2 = 126
$Zoom_pixel_3 = 42
$Zoom_pixel_4 = 17
EndIf
$counter_zoom = 0
Do
if WinActive($productname, "Map Control") Then
Opt("WinTitleMatchMode", 2)
WinActivate("- Microsoft Streets & Trips")
;ControlFocus($productname, "", "msctls_trackbar321")
$h_slider = ControlGetHandle("- Microsoft Streets & Trips", "", "msctls_trackbar321")
$x_coord_zoom = _GUICtrlSliderGetPos($h_slider)
$counter_zoom = $counter_zoom + 1
EndIf
Sleep(1000)
Until $counter_zoom > 0
$counter_GPS = 0
Do
If WinActive($productname, "Map Control") Then
$pos_AfxWnd802 = ControlGetPos($productname, "", "AfxWnd802")
$left_GPSsearch = $pos_AfxWnd802[0]
$top_GPSsearch = $pos_AfxWnd802[1]
$right_GPSsearch = $pos_AfxWnd802[0] + $pos_AfxWnd802[2]
$bottom_GPSsearch = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
$coord_GPS = PixelSearch($left_GPSsearch, $top_GPSsearch, $right_GPSsearch, $bottom_GPSsearch, 0x800000, 0, 1 )
If Not @error Then
$coord_xGPS = $coord_GPS[0] - $left_GPSsearch - 8
$coord_yGPS = $coord_GPS[1] - $top_GPSsearch - $titlebarhight + 12
$counter_GPS = $counter_GPS + 1
EndIf
EndIf
Sleep(1000)
Until $counter_GPS > 0
If WinActive($productname, "Map Control") Then
If $x_coord_zoom <= 100 and $x_coord_zoom > 90 Then ; 100 = 1 km
$left_MaroonTackScan = $pos_AfxWnd802[0]
$top_MaroonTackScan = $pos_AfxWnd802[1]
$right_MaroonTackScan = $pos_AfxWnd802[0] + $pos_AfxWnd802[2]
$bottom_MaroonTackScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
$coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0x008080, 0, 1 ) ;0x1DA21B FF00FF
If @error Then
$scan = 0
EndIf
If Not @error Then
; Beep(500, 200)
SoundPlay(@WindowsDir & "\media\tada.wav",1)
Sleep(500)
$scan = $scan + 1
EndIf
If $scan > 4 Then
Sleep(19500)
EndIf
EndIf
If $x_coord_zoom <= 90 and $x_coord_zoom > 80 Then ; 100 = 1 km ; 90 = 3 km
$left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_1
$top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_1
$right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_1
$bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_1
$coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0x008080, 0, 1 )
If @error Then
$scan = 0
EndIf
If Not @error Then
; Beep(500, 200)
SoundPlay(@WindowsDir & "\media\tada.wav",1)
Sleep(500)
$scan = $scan + 1
EndIf
If $scan > 4 Then
Sleep(19500)
EndIf
EndIf
If $x_coord_zoom <= 80 and $x_coord_zoom > 70 Then ; 90 = 3 km ; 80 = 8 km
$left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_2
$top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_2
$right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_2
$bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_2
$coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0x008080, 0, 1 )
If @error Then
$scan = 0
EndIf
If Not @error Then
; Beep(500, 200)
SoundPlay(@WindowsDir & "\media\tada.wav",1)
Sleep(500)
$scan = $scan + 1
EndIf
If $scan > 4 Then
Sleep(19500)
EndIf
EndIf
If $x_coord_zoom <= 70 and $x_coord_zoom > 60 Then ; 80 = 8 km ; 70 = 24 km
$left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_3
$top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_3
$right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_3
$bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_3
$coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0x008080, 0, 1 )
If @error Then
$scan = 0
EndIf
If Not @error Then
; Beep(500, 200)
SoundPlay(@WindowsDir & "\media\tada.wav",1)
Sleep(500)
$scan = $scan + 1
EndIf
If $scan > 4 Then
Sleep(19500)
EndIf
EndIf
If $x_coord_zoom <= 60 and $x_coord_zoom > 50 Then ; 70 = 24 km ; 60 = 70km 50 = 175 km
$left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_4
$top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_4
$right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_4
$bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_4
$coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0x008080, 0, 1 )
If @error Then
$scan = 0
EndIf
If Not @error Then
;Beep(500, 200)
SoundPlay(@WindowsDir & "\media\tada.wav",1)
Sleep(500)
$scan = $scan + 1
EndIf
If $scan > 4 Then
Sleep(19500)
EndIf
EndIf
If $x_coord_zoom <= 50 Then ; 50 = 200 km ; 40 = 600 km ; 30 = 1750 km ; 20 = 4750 km
Sleep(100)
EndIf
EndIf
Sleep(1000)
WEnd
Func HandleTray()
Local $TrayMsg = @TRAY_ID
Switch $TrayMsg
Case $exititem
Exit
EndSwitch
EndFunc $versionnumber = "1.2.1"
;$versionyear = 2008
;$REG_versionnumber = "15.0"
Opt("WinTitleMatchMode", 2)
Opt("WinTextMatchMode", 2)
Opt("MouseClickDelay", 250)
Opt("SendKeyDelay", 250)
Global Const $GUI_EVENT_CLOSE = -3
Global Const $GUI_EVENT_RESTORE = -5
Global Const $GUI_CHECKED = 1
Global Const $GUI_UNCHECKED = 4
Global Const $GUI_SHOW = 16
Global Const $GUI_HIDE = 32
Global Const $GUI_ENABLE = 64
Global Const $GUI_DISABLE = 128
Global Const $GUI_FOCUS = 256
Global Const $ES_READONLY = 0x0800
Global Const $BS_DEFPUSHBUTTON = 0x0001
Global Const $WS_SYSMENU = 0x00080000
Global Const $WS_CAPTION = 0x00C00000
Global Const $WS_POPUP = 0x80000000
Global Const $WS_EX_TOPMOST = 0x00000008
Global Const $LVS_SORTASCENDING = 0X0010
Global Const $LVS_SINGLESEL = 0x0004
Global Const $LVS_NOCOLUMNHEADER = 0x4000
Global Const $LVS_SHOWSELALWAYS = 0x0008
Global Const $LVS_EX_GRIDLINES = 0x00000001
Global Const $LVS_EX_FULLROWSELECT = 0x00000020
Global Const $TCS_MULTILINE = 0x0200
Global Const $TCS_FOCUSNEVER = 0x8000
Global Const $LVM_SETCOLUMNWIDTH = 0x101E
Global Const $LVM_SETEXTENDEDLISTVIEWSTYLE = 0x1036
#Include <GuiSlider.au3>
TraySetToolTip("POI Scanner " & $versionnumber & " for MS S&&&T and Autoroute 2008")
$productname = "- Microsoft Streets & Trips"
$titlebarhight = 30 ;$windowframehight = 4 ;$windowframewidth = 4
Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)
$exititem = TrayCreateItem("Exit - Quitter")
TrayItemSetOnEvent($exititem, "HandleTray")
TraySetState()
ProcessSetPriority(@ScriptName, 1)
$STpath = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Automap\" & "\15.0" & "\USA", "InstallTo")
$ARpath = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Automap\" & "\15.0" & "\EUR", "InstallTo")
$scan = 0
While 1
If WinExists($productname, "Task Panel") Then
$Zoom_pixel_1 = 310
$Zoom_pixel_2 = 109
$Zoom_pixel_3 = 37
$Zoom_pixel_4 = 15
EndIf
If Not WinExists($productname, "Task Panel") Then
$Zoom_pixel_1 = 350
$Zoom_pixel_2 = 126
$Zoom_pixel_3 = 42
$Zoom_pixel_4 = 17
EndIf
$counter_zoom = 0
Do
if WinActive($productname, "Map Control") Then
Opt("WinTitleMatchMode", 2)
WinActivate("- Microsoft Streets & Trips")
;ControlFocus($productname, "", "msctls_trackbar321")
$h_slider = ControlGetHandle("- Microsoft Streets & Trips", "", "msctls_trackbar321")
$x_coord_zoom = _GUICtrlSliderGetPos($h_slider)
$counter_zoom = $counter_zoom + 1
EndIf
Sleep(200)
Until $counter_zoom > 0
$counter_GPS = 0
Do
If WinActive($productname, "Map Control") Then
$pos_AfxWnd802 = ControlGetPos($productname, "", "AfxWnd802")
$left_GPSsearch = $pos_AfxWnd802[0]
$top_GPSsearch = $pos_AfxWnd802[1]
$right_GPSsearch = $pos_AfxWnd802[0] + $pos_AfxWnd802[2]
$bottom_GPSsearch = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
$coord_GPS = PixelSearch($left_GPSsearch, $top_GPSsearch, $right_GPSsearch, $bottom_GPSsearch, 0x800000, 0, 1 )
If Not @error Then
$coord_xGPS = $coord_GPS[0] - $left_GPSsearch - 8
$coord_yGPS = $coord_GPS[1] - $top_GPSsearch - $titlebarhight + 12
$counter_GPS = $counter_GPS + 1
EndIf
EndIf
Sleep(200)
Until $counter_GPS > 0
If WinActive($productname, "Map Control") Then
If $x_coord_zoom <= 100 and $x_coord_zoom > 90 Then ; 100 = 1 km
$left_MaroonTackScan = $pos_AfxWnd802[0]
$top_MaroonTackScan = $pos_AfxWnd802[1]
$right_MaroonTackScan = $pos_AfxWnd802[0] + $pos_AfxWnd802[2]
$bottom_MaroonTackScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
$coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 1 ) ;0x1DA21B FF00FF
If @error Then
$scan = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\ding.wav", 1)
;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
;Beep(500, 200)
;Sleep(500)
$scan = $scan + 1
EndIf
If $scan > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 90 and $x_coord_zoom > 80 Then ; 100 = 1 km ; 90 = 3 km
$left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_1
$top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_1
$right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_1
$bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_1
$coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 1 )
If @error Then
$scan = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\ding.wav", 1)
;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
;Beep(500, 200)
;Sleep(500)
$scan = $scan + 1
EndIf
If $scan > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 80 and $x_coord_zoom > 70 Then ; 90 = 3 km ; 80 = 8 km
$left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_2
$top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_2
$right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_2
$bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_2
$coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 1 )
If @error Then
$scan = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\ding.wav", 1)
;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
;Beep(500, 200)
;Sleep(500)
$scan = $scan + 1
EndIf
If $scan > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 70 and $x_coord_zoom > 60 Then ; 80 = 8 km ; 70 = 24 km
$left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_3
$top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_3
$right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_3
$bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_3
$coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 1 )
If @error Then
$scan = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\ding.wav", 1)
;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
;Beep(500, 200)
;Sleep(500)
$scan = $scan + 1
EndIf
If $scan > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 60 and $x_coord_zoom > 50 Then ; 70 = 24 km ; 60 = 70km 50 = 175 km
$left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_4
$top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_4
$right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_4
$bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_4
$coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 1 )
If @error Then
$scan = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\ding.wav", 1)
;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
;Beep(500, 200)
;Sleep(500)
$scan = $scan + 1
EndIf
If $scan > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 50 Then ; 50 = 200 km ; 40 = 600 km ; 30 = 1750 km ; 20 = 4750 km
Sleep(100)
EndIf
;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Begin Green Tack scan
If $x_coord_zoom <= 100 and $x_coord_zoom > 90 Then ; 100 = 1 km
$left_GreenTackScan = $pos_AfxWnd802[0]
$top_GreenTackScan = $pos_AfxWnd802[1]
$right_GreenTackScan = $pos_AfxWnd802[0] + $pos_AfxWnd802[2]
$bottom_GreenTackScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
$coord_GreenTackScan = PixelSearch($left_GreenTackScan, $top_GreenTackScan, $right_GreenTackScan, $bottom_GreenTackScan, 0x7172B6, 0, 1 ) ;green tack
If @error Then
$scan_greentack = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\chimes.wav", 1)
;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
;Beep(500, 200)
;Sleep(500)
$scan_greentack = $scan_greentack + 1
EndIf
If $scan_greentack > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 90 and $x_coord_zoom > 80 Then ; 100 = 1 km ; 90 = 3 km
$left_GreenTackScan = $coord_GPS[0] - $Zoom_pixel_1
$top_GreenTackScan = $coord_GPS[1] - $Zoom_pixel_1
$right_GreenTackScan = $coord_GPS[0] + $Zoom_pixel_1
$bottom_GreenTackScan = $coord_GPS[1] + $Zoom_pixel_1
$coord_GreenTackScan = PixelSearch($left_GreenTackScan, $top_GreenTackScan, $right_GreenTackScan, $bottom_GreenTackScan, 0x7172B6, 0, 1 )
If @error Then
$scan_greentack = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\chimes.wav", 1)
;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
;Beep(500, 200)
;Sleep(500)
$scan_greentack = $scan_greentack + 1
EndIf
If $scan_greentack > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 80 and $x_coord_zoom > 70 Then ; 90 = 3 km ; 80 = 8 km
$left_GreenTackScan = $coord_GPS[0] - $Zoom_pixel_2
$top_GreenTackScan = $coord_GPS[1] - $Zoom_pixel_2
$right_GreenTackScan = $coord_GPS[0] + $Zoom_pixel_2
$bottom_GreenTackScan = $coord_GPS[1] + $Zoom_pixel_2
$coord_GreenTackScan = PixelSearch($left_GreenTackScan, $top_GreenTackScan, $right_GreenTackScan, $bottom_GreenTackScan, 0x7172B6, 0, 1 )
If @error Then
$scan_greentack = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\chimes.wav", 1)
;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
;Beep(500, 200)
;Sleep(500)
$scan_greentack = $scan_greentack + 1
EndIf
If $scan_greentack > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 70 and $x_coord_zoom > 60 Then ; 80 = 8 km ; 70 = 24 km
$left_GreenTackScan = $coord_GPS[0] - $Zoom_pixel_3
$top_GreenTackScan = $coord_GPS[1] - $Zoom_pixel_3
$right_GreenTackScan = $coord_GPS[0] + $Zoom_pixel_3
$bottom_GreenTackScan = $coord_GPS[1] + $Zoom_pixel_3
$coord_GreenTackScan = PixelSearch($left_GreenTackScan, $top_GreenTackScan, $right_GreenTackScan, $bottom_GreenTackScan, 0x7172B6, 0, 1 )
If @error Then
$scan_greentack = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\chimes.wav", 1)
;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
;Beep(500, 200)
;Sleep(500)
$scan_greentack = $scan_greentack + 1
EndIf
If $scan_greentack > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 60 and $x_coord_zoom > 50 Then ; 70 = 24 km ; 60 = 70km 50 = 175 km
$left_GreenTackScan = $coord_GPS[0] - $Zoom_pixel_4
$top_GreenTackScan = $coord_GPS[1] - $Zoom_pixel_4
$right_GreenTackScan = $coord_GPS[0] + $Zoom_pixel_4
$bottom_GreenTackScan = $coord_GPS[1] + $Zoom_pixel_4
$coord_GreenTackScan = PixelSearch($left_GreenTackScan, $top_GreenTackScan, $right_GreenTackScan, $bottom_GreenTackScan, 0x7172B6, 0, 1 )
If @error Then
$scan_greentack = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\chimes.wav", 1)
;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
;Beep(500, 200)
;Sleep(500)
$scan_greentack = $scan_greentack + 1
EndIf
If $scan_greentack > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 50 Then ; 50 = 200 km ; 40 = 600 km ; 30 = 1750 km ; 20 = 4750 km
Sleep(100)
EndIf
;;;;;;;;;;;;;;;;Begin grenn flag scan
If $x_coord_zoom <= 100 and $x_coord_zoom > 90 Then ; 100 = 1 km
$left_GreenFlagScan = $pos_AfxWnd802[0]
$top_GreenFlagScan = $pos_AfxWnd802[1]
$right_GreenFlagScan = $pos_AfxWnd802[0] + $pos_AfxWnd802[2]
$bottom_GreenFlagScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
$coord_GreenFlagScan = PixelSearch($left_GreenFlagScan, $top_GreenFlagScan, $right_GreenFlagScan, $bottom_GreenFlagScan, 0x003399, 0, 1 ) ;0x1DA21B FF00FF
If @error Then
$scan_green_flag = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\notify.wav", 1)
;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
;Beep(500, 200)
;Sleep(500)
$scan_green_flag = $scan_green_flag + 1
EndIf
If $scan_green_flag > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 90 and $x_coord_zoom > 80 Then ; 100 = 1 km ; 90 = 3 km
$left_GreenFlagScan = $coord_GPS[0] - $Zoom_pixel_1
$top_GreenFlagScan = $coord_GPS[1] - $Zoom_pixel_1
$right_GreenFlagScan = $coord_GPS[0] + $Zoom_pixel_1
$bottom_GreenFlagScan = $coord_GPS[1] + $Zoom_pixel_1
$coord_GreenFlagScan = PixelSearch($left_GreenFlagScan, $top_GreenFlagScan, $right_GreenFlagScan, $bottom_GreenFlagScan, 0x003399, 0, 1 )
If @error Then
$scan_green_flag = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\notify.wav", 1)
;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
;Beep(500, 200)
;Sleep(500)
$scan_green_flag = $scan_green_flag + 1
EndIf
If $scan_green_flag > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 80 and $x_coord_zoom > 70 Then ; 90 = 3 km ; 80 = 8 km
$left_GreenFlagScan = $coord_GPS[0] - $Zoom_pixel_2
$top_GreenFlagScan = $coord_GPS[1] - $Zoom_pixel_2
$right_GreenFlagScan = $coord_GPS[0] + $Zoom_pixel_2
$bottom_GreenFlagScan = $coord_GPS[1] + $Zoom_pixel_2
$coord_GreenFlagScan = PixelSearch($left_GreenFlagScan, $top_GreenFlagScan, $right_GreenFlagScan, $bottom_GreenFlagScan, 0x003399, 0, 1 )
If @error Then
$scan_green_flag = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\notify.wav", 1)
;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
;Beep(500, 200)
;Sleep(500)
$scan_green_flag = $scan_green_flag + 1
EndIf
If $scan_green_flag > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 70 and $x_coord_zoom > 60 Then ; 80 = 8 km ; 70 = 24 km
$left_GreenFlagScan = $coord_GPS[0] - $Zoom_pixel_3
$top_GreenFlagScan = $coord_GPS[1] - $Zoom_pixel_3
$right_GreenFlagScan = $coord_GPS[0] + $Zoom_pixel_3
$bottom_GreenFlagScan = $coord_GPS[1] + $Zoom_pixel_3
$coord_GreenFlagScan = PixelSearch($left_GreenFlagScan, $top_GreenFlagScan, $right_GreenFlagScan, $bottom_GreenFlagScan, 0x003399, 0, 1 )
If @error Then
$scan_green_flag = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\notify.wav", 1)
;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
;Beep(500, 200)
;Sleep(500)
$scan_green_flag = $scan_green_flag + 1
EndIf
If $scan_green_flag > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 60 and $x_coord_zoom > 50 Then ; 70 = 24 km ; 60 = 70km 50 = 175 km
$left_GreenFlagScan = $coord_GPS[0] - $Zoom_pixel_4
$top_GreenFlagScan = $coord_GPS[1] - $Zoom_pixel_4
$right_GreenFlagScan = $coord_GPS[0] + $Zoom_pixel_4
$bottom_GreenFlagScan = $coord_GPS[1] + $Zoom_pixel_4
$coord_GreenFlagScan = PixelSearch($left_GreenFlagScan, $top_GreenFlagScan, $right_GreenFlagScan, $bottom_GreenFlagScan, 0x003399, 0, 1 )
If @error Then
$scan_green_flag = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\notify.wav", 1)
;DllCall("user32.dll", "int", "MessageBeep", "int", 0x00000030)
;Beep(500, 200)
;Sleep(500)
$scan_green_flag = $scan_green_flag + 1
EndIf
If $scan_green_flag > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 50 Then ; 50 = 200 km ; 40 = 600 km ; 30 = 1750 km ; 20 = 4750 km
Sleep(100)
EndIf
EndIf
Sleep(200)
WEnd
Func HandleTray()
Local $TrayMsg = @TRAY_ID
Switch $TrayMsg
Case $exititem
Exit
EndSwitch
EndFunc 
$versionnumber = "1.2.3"
;$versionyear = 2008
;$REG_versionnumber = "15.0"
Opt("WinTitleMatchMode", 2)
Opt("WinTextMatchMode", 2)
Opt("MouseClickDelay", 250)
Opt("SendKeyDelay", 250)
Global Const $GUI_EVENT_CLOSE = -3
Global Const $GUI_EVENT_RESTORE = -5
Global Const $GUI_CHECKED = 1
Global Const $GUI_UNCHECKED = 4
Global Const $GUI_SHOW = 16
Global Const $GUI_HIDE = 32
Global Const $GUI_ENABLE = 64
Global Const $GUI_DISABLE = 128
Global Const $GUI_FOCUS = 256
Global Const $ES_READONLY = 0x0800
Global Const $BS_DEFPUSHBUTTON = 0x0001
Global Const $WS_SYSMENU = 0x00080000
Global Const $WS_CAPTION = 0x00C00000
Global Const $WS_POPUP = 0x80000000
Global Const $WS_EX_TOPMOST = 0x00000008
Global Const $LVS_SORTASCENDING = 0X0010
Global Const $LVS_SINGLESEL = 0x0004
Global Const $LVS_NOCOLUMNHEADER = 0x4000
Global Const $LVS_SHOWSELALWAYS = 0x0008
Global Const $LVS_EX_GRIDLINES = 0x00000001
Global Const $LVS_EX_FULLROWSELECT = 0x00000020
Global Const $TCS_MULTILINE = 0x0200
Global Const $TCS_FOCUSNEVER = 0x8000
Global Const $LVM_SETCOLUMNWIDTH = 0x101E
Global Const $LVM_SETEXTENDEDLISTVIEWSTYLE = 0x1036
#Include <GuiSlider.au3>
TraySetToolTip("POI Scanner " & $versionnumber & " for MS S&&&T and Autoroute 2008")
$productname = "- Microsoft Streets & Trips"
$titlebarhight = 30 ;$windowframehight = 4 ;$windowframewidth = 4
Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)
$exititem = TrayCreateItem("Exit - Quitter")
TrayItemSetOnEvent($exititem, "HandleTray")
TraySetState()
ProcessSetPriority(@ScriptName, 1)
$STpath = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Automap\" & "\15.0" & "\USA", "InstallTo")
$ARpath = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Automap\" & "\15.0" & "\EUR", "InstallTo")
$scan = 0
While 1
If WinExists($productname, "Task Panel") Then
$Zoom_pixel_1 = 310
$Zoom_pixel_2 = 109
$Zoom_pixel_3 = 37
$Zoom_pixel_4 = 15
EndIf
If Not WinExists($productname, "Task Panel") Then
$Zoom_pixel_1 = 350
$Zoom_pixel_2 = 126
$Zoom_pixel_3 = 42
$Zoom_pixel_4 = 17
EndIf
$counter_zoom = 0
Do
if WinActive($productname, "Map Control") Then
Opt("WinTitleMatchMode", 2)
WinActivate("- Microsoft Streets & Trips")
$h_slider = ControlGetHandle("- Microsoft Streets & Trips", "", "msctls_trackbar321")
$x_coord_zoom = _GUICtrlSliderGetPos($h_slider)
$counter_zoom = $counter_zoom + 1
EndIf
Sleep(300)
Until $counter_zoom > 0
$counter_GPS = 0
Do
If WinActive($productname, "Map Control") Then
$pos_AfxWnd802 = ControlGetPos($productname, "", "AfxWnd802")
$left_GPSsearch = $pos_AfxWnd802[0]
$top_GPSsearch = $pos_AfxWnd802[1]
$right_GPSsearch = $pos_AfxWnd802[0] + $pos_AfxWnd802[2]
$bottom_GPSsearch = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
$coord_GPS = PixelSearch($left_GPSsearch, $top_GPSsearch, $right_GPSsearch, $bottom_GPSsearch, 0x800000, 0, 1 )
If Not @error Then
$coord_xGPS = $coord_GPS[0] - $left_GPSsearch - 8
$coord_yGPS = $coord_GPS[1] - $top_GPSsearch - $titlebarhight + 12
$counter_GPS = $counter_GPS + 1
EndIf
EndIf
Sleep(300)
Until $counter_GPS > 0
If WinActive($productname, "Map Control") Then
If $x_coord_zoom <= 100 and $x_coord_zoom > 90 Then ; 100 = 1 km
$left_MaroonTackScan = $pos_AfxWnd802[0]
$top_MaroonTackScan = $pos_AfxWnd802[1]
$right_MaroonTackScan = $pos_AfxWnd802[0] + $pos_AfxWnd802[2]
$bottom_MaroonTackScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
$coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 1 ) ;0x1DA21B FF00FF
If @error Then
$scan = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\ding.wav", 1)
$scan = $scan + 1
EndIf
If $scan > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 90 and $x_coord_zoom > 80 Then ; 100 = 1 km ; 90 = 3 km
$left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_1
$top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_1
if $top_MaroonTackScan < $top_GPSsearch Then
$top_MaroonTackScan = $pos_AfxWnd802[1]
endif
$right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_1
$bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_1
if $bottom_MaroonTackScan > $bottom_GPSsearch Then
$bottom_MaroonTackScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
endif
$coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 1 )
If @error Then
$scan = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\ding.wav", 1)
$scan = $scan + 1
EndIf
If $scan > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 80 and $x_coord_zoom > 70 Then ; 90 = 3 km ; 80 = 8 km
$left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_2
$top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_2
if $top_MaroonTackScan < $top_GPSsearch Then
$top_MaroonTackScan = $pos_AfxWnd802[1]
endif
$right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_2
$bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_2
if $bottom_MaroonTackScan > $bottom_GPSsearch Then
$bottom_MaroonTackScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
endif
$coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 1 )
If @error Then
$scan = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\ding.wav", 1)
$scan = $scan + 1
EndIf
If $scan > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 70 and $x_coord_zoom > 60 Then ; 80 = 8 km ; 70 = 24 km
$left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_3
$top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_3
if $top_MaroonTackScan < $top_GPSsearch Then
$top_MaroonTackScan = $pos_AfxWnd802[1]
endif
$right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_3
$bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_3
if $bottom_MaroonTackScan > $bottom_GPSsearch Then
$bottom_MaroonTackScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
endif
$coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 1 )
If @error Then
$scan = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\ding.wav", 1)
$scan = $scan + 1
EndIf
If $scan > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 60 and $x_coord_zoom > 50 Then ; 70 = 24 km ; 60 = 70km 50 = 175 km
$left_MaroonTackScan = $coord_GPS[0] - $Zoom_pixel_4
$top_MaroonTackScan = $coord_GPS[1] - $Zoom_pixel_4
if $top_MaroonTackScan < $top_GPSsearch Then
$top_MaroonTackScan = $pos_AfxWnd802[1]
endif
$right_MaroonTackScan = $coord_GPS[0] + $Zoom_pixel_4
$bottom_MaroonTackScan = $coord_GPS[1] + $Zoom_pixel_4
if $bottom_MaroonTackScan > $bottom_GPSsearch Then
$bottom_MaroonTackScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
endif
$coord_MaroonTackScan = PixelSearch($left_MaroonTackScan, $top_MaroonTackScan, $right_MaroonTackScan, $bottom_MaroonTackScan, 0xFF00FF, 0, 1 )
If @error Then
$scan = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\ding.wav", 1)
$scan = $scan + 1
EndIf
If $scan > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 50 Then ; 50 = 200 km ; 40 = 600 km ; 30 = 1750 km ; 20 = 4750 km
Sleep(100)
EndIf
;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Begin DarkBlue scan
If $x_coord_zoom <= 100 and $x_coord_zoom > 90 Then ; 100 = 1 km
$left_DarkBlueScan = $pos_AfxWnd802[0]
$top_DarkBlueScan = $pos_AfxWnd802[1]
$right_DarkBlueScan = $pos_AfxWnd802[0] + $pos_AfxWnd802[2]
$bottom_DarkBlueScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
$coord_DarkBlueScan = PixelSearch($left_DarkBlueScan, $top_DarkBlueScan, $right_DarkBlueScan, $bottom_DarkBlueScan, 0x000080, 0, 1 ) ;dark blue colour of the pushpin, flag, tack
If @error Then
$scan_DarkBlue = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\chimes.wav", 1)
$scan_DarkBlue = $scan_DarkBlue + 1
EndIf
If $scan_DarkBlue > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 90 and $x_coord_zoom > 80 Then ; 100 = 1 km ; 90 = 3 km
$left_DarkBlueScan = $coord_GPS[0] - $Zoom_pixel_1
$top_DarkBlueScan = $coord_GPS[1] - $Zoom_pixel_1
if $top_DarkBlueScan < $top_GPSsearch Then
$top_DarkBlueScan = $pos_AfxWnd802[1]
endif
$right_DarkBlueScan = $coord_GPS[0] + $Zoom_pixel_1
$bottom_DarkBlueScan = $coord_GPS[1] + $Zoom_pixel_1
if $bottom_DarkBlueScan > $bottom_GPSsearch Then
$bottom_DarkBlueScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
endif
$coord_DarkBlueScan = PixelSearch($left_DarkBlueScan, $top_DarkBlueScan, $right_DarkBlueScan, $bottom_DarkBlueScan, 0x000080, 0, 1 )
If @error Then
$scan_DarkBlue = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\chimes.wav", 1)
$scan_DarkBlue = $scan_DarkBlue + 1
EndIf
If $scan_DarkBlue > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 80 and $x_coord_zoom > 70 Then ; 90 = 3 km ; 80 = 8 km
$left_DarkBlueScan = $coord_GPS[0] - $Zoom_pixel_2
$top_DarkBlueScan = $coord_GPS[1] - $Zoom_pixel_2
if $top_DarkBlueScan < $top_GPSsearch Then
$top_DarkBlueScan = $pos_AfxWnd802[1]
endif
$right_DarkBlueScan = $coord_GPS[0] + $Zoom_pixel_2
$bottom_DarkBlueScan = $coord_GPS[1] + $Zoom_pixel_2
if $bottom_DarkBlueScan > $bottom_GPSsearch Then
$bottom_DarkBlueScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
endif
$coord_DarkBlueScan = PixelSearch($left_DarkBlueScan, $top_DarkBlueScan, $right_DarkBlueScan, $bottom_DarkBlueScan, 0x000080, 0, 1 )
If @error Then
$scan_DarkBlue = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\chimes.wav", 1)
$scan_DarkBlue = $scan_DarkBlue + 1
EndIf
If $scan_DarkBlue > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 70 and $x_coord_zoom > 60 Then ; 80 = 8 km ; 70 = 24 km
$left_DarkBlueScan = $coord_GPS[0] - $Zoom_pixel_3
$top_DarkBlueScan = $coord_GPS[1] - $Zoom_pixel_3
if $top_DarkBlueScan < $top_GPSsearch Then
$top_DarkBlueScan = $pos_AfxWnd802[1]
endif
$right_DarkBlueScan = $coord_GPS[0] + $Zoom_pixel_3
$bottom_DarkBlueScan = $coord_GPS[1] + $Zoom_pixel_3
if $bottom_DarkBlueScan > $bottom_GPSsearch Then
$bottom_DarkBlueScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
endif
$coord_DarkBlueScan = PixelSearch($left_DarkBlueScan, $top_DarkBlueScan, $right_DarkBlueScan, $bottom_DarkBlueScan, 0x000080, 0, 1 )
If @error Then
$scan_DarkBlue = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\chimes.wav", 1)
$scan_DarkBlue = $scan_DarkBlue + 1
EndIf
If $scan_DarkBlue > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 60 and $x_coord_zoom > 50 Then ; 70 = 24 km ; 60 = 70km 50 = 175 km
$left_DarkBlueScan = $coord_GPS[0] - $Zoom_pixel_4
$top_DarkBlueScan = $coord_GPS[1] - $Zoom_pixel_4
if $top_DarkBlueScan < $top_GPSsearch Then
$top_DarkBlueScan = $pos_AfxWnd802[1]
endif
$right_DarkBlueScan = $coord_GPS[0] + $Zoom_pixel_4
$bottom_DarkBlueScan = $coord_GPS[1] + $Zoom_pixel_4
if $bottom_DarkBlueScan > $bottom_GPSsearch Then
$bottom_DarkBlueScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
endif
$coord_DarkBlueScan = PixelSearch($left_DarkBlueScan, $top_DarkBlueScan, $right_DarkBlueScan, $bottom_DarkBlueScan, 0x000080, 0, 1 )
If @error Then
$scan_DarkBlue = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\chimes.wav", 1)
$scan_DarkBlue = $scan_DarkBlue + 1
EndIf
If $scan_DarkBlue > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 50 Then ; 50 = 200 km ; 40 = 600 km ; 30 = 1750 km ; 20 = 4750 km
Sleep(100)
EndIf
;;;;;;;;;;;;;;;;Begin Yellow pushpin scan
If $x_coord_zoom <= 100 and $x_coord_zoom > 90 Then ; 100 = 1 km
$left_YellowPushpinScan = $pos_AfxWnd802[0]
$top_YellowPushpinScan = $pos_AfxWnd802[1]
$right_YellowPushpinScan = $pos_AfxWnd802[0] + $pos_AfxWnd802[2]
$bottom_YellowPushpinScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
$coord_YellowPushpinScan = PixelSearch($left_YellowPushpinScan, $top_YellowPushpinScan, $right_YellowPushpinScan, $bottom_YellowPushpinScan, 0x808000, 0, 1 ) ;0x1DA21B FF00FF
If @error Then
$scan_YellowPushpin = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\notify.wav", 1)
$scan_YellowPushpin = $scan_YellowPushpin + 1
EndIf
If $scan_YellowPushpin > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 90 and $x_coord_zoom > 80 Then ; 100 = 1 km ; 90 = 3 km
$left_YellowPushpinScan = $coord_GPS[0] - $Zoom_pixel_1
$top_YellowPushpinScan = $coord_GPS[1] - $Zoom_pixel_1
if $top_YellowPushpinScan < $top_GPSsearch Then
$top_YellowPushpinScan = $pos_AfxWnd802[1]
endif
$right_YellowPushpinScan = $coord_GPS[0] + $Zoom_pixel_1
$bottom_YellowPushpinScan = $coord_GPS[1] + $Zoom_pixel_1
if $bottom_YellowPushpinScan > $bottom_GPSsearch Then
$bottom_YellowPushpinScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
endif
$coord_YellowPushpinScan = PixelSearch($left_YellowPushpinScan, $top_YellowPushpinScan, $right_YellowPushpinScan, $bottom_YellowPushpinScan, 0x808000, 0, 1 )
If @error Then
$scan_YellowPushpin = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\notify.wav", 1)
$scan_YellowPushpin = $scan_YellowPushpin + 1
EndIf
If $scan_YellowPushpin > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 80 and $x_coord_zoom > 70 Then ; 90 = 3 km ; 80 = 8 km
$left_YellowPushpinScan = $coord_GPS[0] - $Zoom_pixel_2
$top_YellowPushpinScan = $coord_GPS[1] - $Zoom_pixel_2
if $top_YellowPushpinScan < $top_GPSsearch Then
$top_YellowPushpinScan = $pos_AfxWnd802[1]
endif
$right_YellowPushpinScan = $coord_GPS[0] + $Zoom_pixel_2
$bottom_YellowPushpinScan = $coord_GPS[1] + $Zoom_pixel_2
if $bottom_YellowPushpinScan > $bottom_GPSsearch Then
$bottom_YellowPushpinScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
endif
$coord_YellowPushpinScan = PixelSearch($left_YellowPushpinScan, $top_YellowPushpinScan, $right_YellowPushpinScan, $bottom_YellowPushpinScan, 0x808000, 0, 1 )
If @error Then
$scan_YellowPushpin = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\notify.wav", 1)
$scan_YellowPushpin = $scan_YellowPushpin + 1
EndIf
If $scan_YellowPushpin > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 70 and $x_coord_zoom > 60 Then ; 80 = 8 km ; 70 = 24 km
$left_YellowPushpinScan = $coord_GPS[0] - $Zoom_pixel_3
$top_YellowPushpinScan = $coord_GPS[1] - $Zoom_pixel_3
if $top_YellowPushpinScan < $top_GPSsearch Then
$top_YellowPushpinScan = $pos_AfxWnd802[1]
endif
$right_YellowPushpinScan = $coord_GPS[0] + $Zoom_pixel_3
$bottom_YellowPushpinScan = $coord_GPS[1] + $Zoom_pixel_3
if $bottom_YellowPushpinScan > $bottom_GPSsearch Then
$bottom_YellowPushpinScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
endif
$coord_YellowPushpinScan = PixelSearch($left_YellowPushpinScan, $top_YellowPushpinScan, $right_YellowPushpinScan, $bottom_YellowPushpinScan, 0x808000, 0, 1 )
If @error Then
$scan_YellowPushpin = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\notify.wav", 1)
$scan_YellowPushpin = $scan_YellowPushpin + 1
EndIf
If $scan_YellowPushpin > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 60 and $x_coord_zoom > 50 Then ; 70 = 24 km ; 60 = 70km 50 = 175 km
$left_YellowPushpinScan = $coord_GPS[0] - $Zoom_pixel_4
$top_YellowPushpinScan = $coord_GPS[1] - $Zoom_pixel_4
if $top_YellowPushpinScan < $top_GPSsearch Then
$top_YellowPushpinScan = $pos_AfxWnd802[1]
endif
$right_YellowPushpinScan = $coord_GPS[0] + $Zoom_pixel_4
$bottom_YellowPushpinScan = $coord_GPS[1] + $Zoom_pixel_4
if $bottom_YellowPushpinScan > $bottom_GPSsearch Then
$bottom_YellowPushpinScan = $pos_AfxWnd802[1] + $pos_AfxWnd802[3] + $titlebarhight
endif
$coord_YellowPushpinScan = PixelSearch($left_YellowPushpinScan, $top_YellowPushpinScan, $right_YellowPushpinScan, $bottom_YellowPushpinScan, 0x808000, 0, 1 )
If @error Then
$scan_YellowPushpin = 0
EndIf
If Not @error Then
SoundPlay(@WindowsDir & "\media\notify.wav", 1)
$scan_YellowPushpin = $scan_YellowPushpin + 1
EndIf
If $scan_YellowPushpin > 4 Then
Sleep(4500)
EndIf
EndIf
If $x_coord_zoom <= 50 Then ; 50 = 200 km ; 40 = 600 km ; 30 = 1750 km ; 20 = 4750 km
Sleep(100)
EndIf
EndIf
Sleep(200)
WEnd
Func HandleTray()
Local $TrayMsg = @TRAY_ID
Switch $TrayMsg
Case $exititem
Exit
EndSwitch
EndFunc If WinExists("AfxWnd802") Then
$pos_AfxWnd802 = ControlGetPos($productname, "", "AfxWnd802")
EndIf
If WinExists("AfxWnd702") Then
$pos_AfxWnd802 = ControlGetPos($productname, "", "AfxWnd702")
EndIf 