HCEMan Posted 2 hours ago Posted 2 hours ago Hi, I have software that initiates an analysis by clicking a blue button on an open window. I'm trying to automate the initiation using a clicker script that prompts me to enter how many times the script should click. It would be best if the script could find the button automatically since the window may move around and sometimes be in the background. The clicks need to occur approximately 3 minutes apart, as many times as the user enters. It's the blue "stop/play" button in the picture that needs to be clicked. So far I've only found a way to receive input via a GUI: expandcollapse popup#include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Main() Func Main() $Form1 = GUICreate("Name", 251, 161, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI, $WS_MINIMIZEBOX)) $label1 = GUICtrlCreateLabel("Whatever you want to write", 10, 10) $Input1 = GUICtrlCreateInput("", 24, 96, 201, 21, $ES_NUMBER) GUICtrlSetLimit(-1, 4) $Button1 = GUICtrlCreateButton("OK", 24, 128, 75, 25) $Button2 = GUICtrlCreateButton("Cancel", 152, 130, 75, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If StringLen(GUICtrlRead($Input1)) < 4 Then GUICtrlSetData($Input1, "") Else ConsoleWrite("Success" & @CRLF) EndIf EndSwitch WEnd Local $Counter = 0 While $Counter < $Input1 ; Perform mouse click ; Not sure how to do this ; Sleep for 3 minutes Sleep(60000 * 3) $Counter = $Counter + 1 WEnd EndFunc Thankful for any input :)
argumentum Posted 2 hours ago Posted 2 hours ago WinGetPos() of the window and add the distance to that X,Y of the blue button 🤔 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now