Jump to content
Sign in to follow this  
th3ownerer

Problem with script

Recommended Posts

th3ownerer

HI.

I am new to Autoit and just want to make a simple script which switches to a program and then clicks a button every 15 minutes

Please can anyone help me

Share this post


Link to post
Share on other sites
water

Please have a look at Winactivate, WinWaitActive, Sleep and ControlClick.

To get the ControlId of the button please use the AutoIT tool WindowInfo.

Something like:

HotKeySet("+!q", "Quit")    ; HotKey to end the script Ctrl+Alt+Q
WinActivate("Here goes the Window title")
WinWaitActive()
While 1
 Sleep(900000)
 ControlClick("Here goes the Window title","",ControlId)
Wend

Func Quit()
 Exit 0
EndFunc
Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
th3ownerer

does wait win active force the computer to go to that window??

also i need to click a button in the browser not a windows button so I'll need like a OCR or something and then make it read the button

Edited by th3ownerer

Share this post


Link to post
Share on other sites
th3ownerer

and thanks for the help till now

Share this post


Link to post
Share on other sites
th3ownerer

or i could wait for the windows to become active after about 15 mins and then press enter

how could i do this???

Edited by th3ownerer

Share this post


Link to post
Share on other sites
water

does wait win active force the computer to go to that window??

WinActivate activates the Window

WinWaitActive just makes sure the Window is active before doing any actions with the window.

also i need to click a button in the browser not a windows button

There is an UDF available to handle all kind of IE things (please see the help file: User Defined Functions -> IE Management).

What function to use depends on the type of link/button/image you want to click. Please see _IELinkClickByIndex or _IELinkClickByText


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
th3ownerer

i use firefox

Share this post


Link to post
Share on other sites
water

Even worse :)

There is an UDF for FF as well.

As I 've never worked with AutoIT and FF my expertise (if any) ends here.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
th3ownerer

ummm how to loop this

Share this post


Link to post
Share on other sites
jvanegmond

ummm how to loop this

See the first reply by water. Note the while loop and the long sleep.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×