; ; AutoIt Version: 3.0 ; Language: English ; Platform: Win9x/NT/XP ; Author: Neil Robertson GM8EUG ; ; Script Function: Monitor WSPR status TX/RX (by looking at colour of status box) and ; switch HRD to match status by clicking the appropriate button to control the rig. ; ;This is a technique demo that runs on a 1400x1050 screen and assumes that WSPR and HRD are already running ;with HRD connected to a Demo-matic FT2000 and that HRD is set to default colours. ;The 'Moni' button of the FT2000 rig on the HRD screen is toggled to match the TX/RX status of WSPR. ;To use it with a different/real rig and the actual TX button required will need the use of the AU3INFO program(supplied with AUTOIT) to determine the changes required to ;window titles, pixel coordinates and colours, and the button ID to be used ;This script can be run inside the SCITE.EXE editor/devpt environment also supplied with AUTOIT. Once debugged it can ;be converted to an EXE. To stop the script rt-click in the status bar on the icon for the Autoit script. ; Check if user really wants to run the script - use a Yes/No prompt $answer = MsgBox(4, "WSPR9", "Run?") ; If "No" was clicked (7) then exit the script If $answer = 7 Then MsgBox(0, "WSPR9", "OK. Bye!") Exit EndIf ; Bring WSPR to top WinActivate(" WSPR 1.12 by K1JT") ; Check that WSPR is running WinWaitActive(" WSPR 1.12 by K1JT") ; Move WSPR to top LHS of screen and to a known size so position of receiving/waiting/transmitting box on bottom RHS corner of WSPR window is known ; as we will be reading its colour later WinMove(" WSPR 1.12 by K1JT","",0,0,690,543) ; Bring HRD to top WinActivate("HamRadioDeluxe - [FT-2000: Demo]") ; Check that HRD is running WinWaitActive("HamRadioDeluxe - [FT-2000: Demo]") ; Move HRD to bottom half of screen and to a known size so we know where selected button is ; as we will be reading its colour later WinMove("HamRadioDeluxe - [FT-2000: Demo]","",0,544,1398,500) While 1=1 ;loop forever (sloppy!) ;set wspr_tx_flag to 0 i.e.RX or waiting $wspr_tx_flag=0 ; Bring WSPR to top WinActivate(" WSPR 1.12 by K1JT") ; Check that WSPR is running WinWaitActive(" WSPR 1.12 by K1JT") ;check if WSPR is transmitting by looking at colour of box at bottom RHS of window - if it is yellow i.e. TX then set flag to 1 if PixelGetColor( 675 , 526 ) = 16776960 then $wspr_tx_flag=1 ; Bring HRD to top WinActivate("HamRadioDeluxe - [FT-2000: Demo]") ; Check that HRD is running WinWaitActive("HamRadioDeluxe - [FT-2000: Demo]") ;if WSPR is set to TX i.e. yellow and HRD is set to RX i.e chosen button is green then click button to put rig into TX if $wspr_tx_flag=1 and PixelGetColor( 1092 , 823 ) = 39936 then ControlClick ("HamRadioDeluxe - [FT-2000: Demo]","",1053) ;if WSPR is set to RX i.e. not yellow and HRD is set to TX i.e chosen button is red then click button to put rig back into RX if $wspr_tx_flag=0 and PixelGetColor( 1092 , 823 ) = 12582912 then ControlClick ("HamRadioDeluxe - [FT-2000: Demo]","",1053) ;loop back and check WSPR again WEnd exit ; Finished!