;#AutoIt3Wrapper_UseX64=Y ;Should be used for stuff like tagpoint having right struct etc. when running on a 64 bits os ;~ #include ;~ #include ;~ #include ;~ #include ;~ #include ;~ #Include ;~ #include ;~ #include ;From UI Examples, may not need all #include #include #include #include #include #include "UIAWrappers.au3" #include "CUIAutomation2.au3" ;********************************************************************************************** ;Screen position coordinates of desired data parameters: ON CROSSHAIR POPUP ; x y=132 y=132+24 ;Bar Hi 3rd parameter 128 208 232 ;Bar Lo 4th parameter 128 223 247 ;Bar date 5th parameter 85 156 180 ;*********************************************************************************************** $BarHix=128 $BarLox=128 $BarDatex=85 $BarHiY=232 $BarLoY=247 $BarDatey=180 ;_UIA_Init() ;IS THIS REQUIRED, What does it do? Global $tStruct = DllStructCreate($tagPOINT) ; Create a structure that defines the point to be checked. ;SETTUP THE HOTKEY DEFINITIONS HotKeySet("{ESC}","ExitScript") ;Hot keys for Swing Trade Average run length capture (number of points and number of days) ;Need to cycle through up to 5 runs in the script code, OR separate (1,2---5) hot keys for each run which would allow changing any specific errant run entry instead of having to clear and start over HotKeySet("{F1}","RunBeginning") ;Capture data for run start day HotKeySet("{F2}","RunEnd") ;Capture data for run end day While 1 sleep(500);Wait loop counter time WEnd Global $ObjDate Global $ObjBarLo Global $ObjBarHi Global $RunBegDate Global $RunBegLo Global $RunBegHi global $oUIElementbegdate Global $Tempa Func RunBeginning() ;Capture the BarLow and Date for the initial run day ;Get Date DllStructSetData($tStruct, "x", $BarDatex) DllStructSetData($tStruct, "y", $BarDatey) $UIA_oUIAutomation.ElementFromPoint($tStruct,$UIA_pUIElement ) $oUIElementbegdate = objcreateinterface($UIA_pUIElement,$sIID_IUIAutomationElement, $dtagIUIAutomationElement) $ObjDate=_UIA_ACTION($oUIElementbegdate,"attach") $RunBegDate=_UIA_getPropertyValue($ObjDate,$UIA_NamePropertyId) ConsoleWrite("*******RUN BEGINNING DATE******* = " & $RunBegDate & @CRLF) ;NOTE: $RunBegDate is defined/declared here as it displays on console #cs ;Get Bar Lo DllStructSetData($tStruct, "x", $BarLox) DllStructSetData($tStruct, "y", $BarLoy) $UIA_oUIAutomation.ElementFromPoint($tStruct,$UIA_pUIElement ) $oUIElement = objcreateinterface($UIA_pUIElement,$sIID_IUIAutomationElement, $dtagIUIAutomationElement) $ObjBarLo=_UIA_ACTION($oUIElement,"attach") $RunBegLo=_UIA_getPropertyValue($ObjBarLo,$UIA_NamePropertyId) ConsoleWrite("********RUN BEGINNING BAR LOW******* = " & $RunBegLo & @CRLF) ;Get Bar Hi DllStructSetData($tStruct, "x", $BarHix) DllStructSetData($tStruct, "y", $BarHiy) $UIA_oUIAutomation.ElementFromPoint($tStruct,$UIA_pUIElement ) $oUIElement = objcreateinterface($UIA_pUIElement,$sIID_IUIAutomationElement, $dtagIUIAutomationElement) $ObjBarHi=_UIA_ACTION($oUIElement,"attach") $RunBegHi=_UIA_getPropertyValue($ObjBarHi,$UIA_NamePropertyId) ConsoleWrite("********RUN BEGINNING BAR HI******* = " & $RunBegHi & @CRLF) #ce EndFunc Func RunEnd() ;ConsoleWrite("********RUN BEGINNING BAR HI, entering RunEnd code ******* = " & $RunBegHi & @CRLF) ;ConsoleWrite("********RUN BEGINNING BAR LOW, entering RunEnd code******* = " & $RunBegLo & @CRLF) ConsoleWrite("*******RUN BEGINNING DATE, entering RunEnd code******* = " & $RunBegDate & @CRLF) ;THIS STATEMENT FAILS, indicating Variable not declared ;Additional code goes here that needs to use the value of "$RunBegDate" EndFunc #cs ;ALLOWS COM FUNCTION TO WORK WHEN ACCESSING AND TYPING VALUES INTO SPREADSHEET - STOPS ERRORS FROM DISPLAYING/STOPPING SCRIPT EXECUTION Func MyErrFunc() Return EndFunc ;==>MyErrFunc #ce ;EXIT SCRIPT USING "ESC" Func ExitScript() Exit EndFunc