sd333221 Posted May 16, 2005 Share Posted May 16, 2005 Hello, i downloaded the newest version of Autoit and i set up a code. I want a script which i can activate and stop with the pause key. I want it to press left mouse key, press arrow down, enter, enter. Wait 1 secound and then repeat. this is what i got ;Script ;Activation $answer = MsgBox(4, "Script", "Do you want to activate the script?. Run?") If $answer = 7 Then MsgBox(0, "AutoIt", "OK. Bye!") Exit EndIf ;Activate Windows WinActivate("Firefox") ;hotkey .... ;Main function MouseClick("left") Send("{ENTER}") Send("{DOWN}") Send("{ENTER}") Send("{ENTER}") but its not complete. I NEED YOUR HELP. It would be very kind if you could complete the code!!!!! thanks Link to comment Share on other sites More sharing options...
buzz44 Posted May 16, 2005 Share Posted May 16, 2005 Help File...HotKeySet()Loop Statements qq Link to comment Share on other sites More sharing options...
sd333221 Posted May 16, 2005 Author Share Posted May 16, 2005 (edited) ; Press Esc to terminate script, Pause/Break to "pause" Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d ;;;; Body of program would go here;;;; Sleep(100) MouseClick("left", 1041, 423, 2) Sleep(100) Send("aeroclient.exe{DOWN}") Sleep(100) Send("aeroclient.exe{Enter}") Sleep(100) Send("aeroclient.exe{Enter}") Sleep(100) ;;;;;;;; Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc Func ShowMessage() MsgBox(4096,"","Thank you for using the ]script!") EndFunc it still doesnt work plz help! Edited May 16, 2005 by sd333221 Link to comment Share on other sites More sharing options...
buzz44 Posted May 16, 2005 Share Posted May 16, 2005 Obviously you didn't bother to thouroughly look at "Loop Statements". As I provided sufficient information I will not bother repeating myself. qq Link to comment Share on other sites More sharing options...
sd333221 Posted May 16, 2005 Author Share Posted May 16, 2005 Obviously you didn't bother to thouroughly look at "Loop Statements". As I provided sufficient information I will not bother repeating myself.<{POST_SNAPBACK}>Sorry but i couldnt find the file,where is it located? Link to comment Share on other sites More sharing options...
buzz44 Posted May 16, 2005 Share Posted May 16, 2005 ????... The Help File. I know you were in it because of your new script with the HotKeySet's. Open the help file, and click the "Index" tab... then type "Loop Statements" . qq Link to comment Share on other sites More sharing options...
sd333221 Posted May 16, 2005 Author Share Posted May 16, 2005 Ok my final script is: expandcollapse popup; Press Esc to terminate script, Pause/Break to "pause" Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d ; Initial shit WinActivate("Firefox") ;;;; Body of program;;;; $i = 0 Do MouseClick("left") Send("{Enter}") sleep(300) Send("{Enter}") sleep(300) Send("{DOWN}") Send("{Enter}") sleep(300) Send("{Enter}") sleep(300) Send("{Enter}") Sleep(100) $i = $i + 1 Until $i = 10000 ;;;;;;;; Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc Func ShowMessage() MsgBox(4096,"","Thank you for using, the script.") EndFunc I added "sleep(300)" commands but he doesnt sleep, he klicks too fast. How can i make him wait? Thanks for ur great help ) Link to comment Share on other sites More sharing options...
steveR Posted May 16, 2005 Share Posted May 16, 2005 well you could use SendKeyDelay (look it up under the keyboard functions) or you could increase the sleep() time. remember time is in milliseconds, so 3000 would be 3 seconds AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass. 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