AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Pauses

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
edbighead



Joined: 10 Feb 2009
Posts: 4

PostPosted: Tue Feb 10, 2009 9:32 pm    Post subject: Pauses Reply with quote

I have this form online where I have to highlight and select from a list. This is the macro that I use to get to the right part of the page, select all, and then go to the next page. After I go to the next page I need to run the process over again. For some reason I cannot figure out how to put a pause into the macro so that it gives the page time to load before it runs the macro again. Also how can I make it so it repeats X number of times.
Thanks!

heres the code that doesnt work. doesnt seem to pause and just goes into tabbing again while its still loading

#space::Send {TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE} sleep, 5000 {TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{SPACE}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{SPACE}

Should it be on a seperate line or what?
Back to top
View user's profile Send private message
Heavenguard
Guest





PostPosted: Tue Feb 10, 2009 9:37 pm    Post subject: Reply with quote

You can use Sleep, ####, with the #### being milliseconds (so 1000 = 1s)

As for the repetition, you can loop it
Quote:
To perform something more than once consecutively, a loop is the answer. The following loop shows a MsgBox three times:

Loop 3
{
MsgBox This window will be displayed three times.
}
Back to top
edbighead



Joined: 10 Feb 2009
Posts: 4

PostPosted: Tue Feb 10, 2009 9:40 pm    Post subject: Reply with quote

for some reason it doesnt pause with what i have now, which is what you just showed me i believe
Back to top
View user's profile Send private message
edbighead



Joined: 10 Feb 2009
Posts: 4

PostPosted: Tue Feb 10, 2009 9:47 pm    Post subject: Reply with quote

i've tried every combination of spaces, commas, and line changes. Sleep function doesnt seem to be working
Back to top
View user's profile Send private message
edbighead



Joined: 10 Feb 2009
Posts: 4

PostPosted: Tue Feb 10, 2009 9:49 pm    Post subject: Reply with quote

could someone show me an example of sleep being used in a script with keyboard commands. would be a great help, thanks
Back to top
View user's profile Send private message
evan
Guest





PostPosted: Tue Feb 10, 2009 9:54 pm    Post subject: Reply with quote

Code:
#space::
send {tab}
sleep 1000
send {space}
return
Back to top
Sivvy



Joined: 21 Jul 2008
Posts: 726
Location: Calgary, AB, Canada

PostPosted: Wed Feb 11, 2009 3:57 pm    Post subject: Reply with quote

Sleep must be on a separate line, because otherwise your actually issuing a Windows command for sleep, rather than the AHK one.
Code:
#Space::
    Loop 2
    {
        Send, {Tab 8}{Space}
        Loop 9
            Send, {Tab 2}{Space}
        Send, {Tab 9}{Space}
        If %A_Index% = 1
            Sleep, 5000
    }
Return

Untested.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group