Franz135 Posted July 22, 2020 Share Posted July 22, 2020 Hello everybody, I created a simple AutoIT bot. The bot should simply click the mouse at two points defined by me. My problem: I want (after the program was started with F5) the commands to be activated with the down arrow key. How do I do this or what am I doing wrong? My previous code: HotKeySet ( "{DOWN}","_start" ) HotKeySet ( "{UP}","_pause" ) HotKeySet ( "{END}","_exit" ) Global $go = 0 Func _start() $go = 1 EndFunc Func _pause() $go = 0 EndFunc Func _exit() Exit EndFunc MouseClick("left",912,271,1,1) Sleep(10) MouseClick("left",912,718,1,1) Sleep(10) Thanks! Link to comment Share on other sites More sharing options...
Sidley Posted July 22, 2020 Share Posted July 22, 2020 You're not doing anything with the $go variable, try this (and please use a code block in future posts): HotKeySet ( "{DOWN}","_start" ) HotKeySet ( "{UP}","_pause" ) HotKeySet ( "{END}","_exit" ) Global $go = 0 While(1) If($go) Then MouseClick("left",912,271,1,1) Sleep(100) MouseClick("left",912,718,1,1) $go=0 Else Sleep(1) EndIf WEnd Func _start() $go = 1 EndFunc Func _pause() $go = 0 EndFunc Func _exit() Exit EndFunc Franz135 1 Link to comment Share on other sites More sharing options...
Nine Posted July 22, 2020 Share Posted July 22, 2020 May I ask you what is the application you are trying to automate ? Because there is better ways to do it without MouseClicks. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Franz135 Posted July 22, 2020 Author Share Posted July 22, 2020 @Sidley Thanks! Link to comment Share on other sites More sharing options...
Franz135 Posted July 22, 2020 Author Share Posted July 22, 2020 @Nine The reason for the program is that I want to quickly reserve places on a website (library) that are taken after two seconds (see picture). I have some ideas how to make the programm better but I dont know how to implement them. I want the program to press the refresh button in my browser at 8:59:59 a.m. After loading the website, it should click on the empty box and the "anmelden" (register) button immediately. Link to comment Share on other sites More sharing options...
Nine Posted July 22, 2020 Share Posted July 22, 2020 You should definitely look in to use Web automation UDF like IE or WebDriver. It will be way easier for you to get robust script than trying to use MouseClicks. IE is part of the installation of AutoIt and it is well documented in help file. Franz135 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
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