SmithWesson Posted August 2, 2017 Share Posted August 2, 2017 Hello AutoIt members, I was messing around with the script learning it and came across an issue that I'm unable to solve. This script doesn't apply to anything besides sending the pagedown key twice then waiting for a few seconds and repeating. I was writing this just to get more familiar with it and was using excel as a foundation. Essentially I am just messing around, but looking to have it hit page down twice back to back then waiting it out 4 or 5 seconds, rinse repeat. All it does is continue to send pagedown every 400ms (at least I assume 400ms) but never sits idle the 4000ms. Can you guys give me a sanity check below to see what I'm doing wrong? Global $multiple Func fastread(); While 1 While $multiple2 > 0 send("{PGDN}"); sleep(400); $multiple2 = $multiple2-1; WEnd Sleep (4000); WEnd EndFunc fastread(); Link to comment Share on other sites More sharing options...
Simpel Posted August 2, 2017 Share Posted August 2, 2017 Hi. What is $multiple2 defined the first time? And where is $multiple2 resetted to this default to start the inner while wend again? The inner while wend seems to run endlessly because the condition could never proved right. Regards, Conrad P.S. It's only one very short line you have to insert. Think about it and when you don't get it I will say it to you. Ok? SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. Link to comment Share on other sites More sharing options...
SmithWesson Posted August 3, 2017 Author Share Posted August 3, 2017 Simpel, Ah I wrote that up at work from memory on how I did at from home. Looks I had it almost right except for 1 line of code (which I think is what you're referring to) but it still doesn't work. Global $multiple $multiple=2 Func fastread(); While 1 $multiple2 = $multiple While $multiple2 > 0 send("{PGDN}"); sleep(400); $multiple2 = $multiple2-1; WEnd Sleep (4000); WEnd EndFunc fastread(); Link to comment Share on other sites More sharing options...
Simpel Posted August 3, 2017 Share Posted August 3, 2017 (edited) Hi. It works for me. The only thing I changed is uncomment Send() and add ConsoleWrite() because then I can see much better if the loop is running correct. Global $multiple $multiple=2 Func fastread(); While 1 $multiple2 = $multiple While $multiple2 > 0 ;~ send("{PGDN}"); ConsoleWrite("PGDN" & @CRLF) sleep(400); $multiple2 = $multiple2-1; WEnd Sleep (4000); WEnd EndFunc fastread(); Some notes beside. You declared $multiple but not $multiple2. Put all of your functions at the end of your code. You can run your loops w/o $multiple. fastread() Func fastread() Local $multiple2 While 1 $multiple2 = 2 While $multiple2 > 0 ;~ send("{PGDN}") ConsoleWrite("PGDN" & @CRLF) sleep(400) $multiple2 = $multiple2 - 1 WEnd Sleep (4000) WEnd EndFunc Regards, Conrad Edited August 3, 2017 by Simpel misspelling SciTE4AutoIt = 3.7.3.0 AutoIt = 3.3.14.2 AutoItX64 = 0 OS = Win_10 Build = 19044 OSArch = X64 Language = 0407/german H:\...\AutoIt3\SciTE H:\...\AutoIt3 H:\...\AutoIt3\Include (H:\ = Network Drive) Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 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