Mati002 Posted May 1, 2020 Share Posted May 1, 2020 Hello, I'm new not only to autoit but programming in general and I would appreciate your help. I have been having problems with my latest code because the main repetition doesn't work, here is the code: #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> For $i = 1 To InputBox("", "How many pages?", 3) MouseClick($MOUSE_CLICK_RIGHT, 1560, 450) MouseClick($MOUSE_CLICK_RIGHT, 1690, 460) For $i = 1 To 19 ; this works WinActivate("Bills") Send("{TAB}") Send("^{Enter}") Next Send("^{PGDN}") For $i = 1 To 20 ; this works too MouseClick($MOUSE_CLICK_LEFT, 1590, 250) MouseClick($MOUSE_CLICK_LEFT, 1590, 310) Sleep(1000) Send("^v") Send("{TAB}") Send("ACH") Send("{TAB}") Send("ACH") Send("{ENTER}") Sleep(1000) Send("{ENTER}") Sleep(1000) Send("^w") Next Sleep(1000) Send("{F5}") Sleep(1000) Next ; and here it dies regardless of the value of $Number, even if I manually change it to other value it stops here Basically once it refreshes the page and waits a second it doesn't go back to clicking on the unpaid bills, the script icon disappears from the task bar so I assume it thinks it has finished but it doesn't repeat the whole script. Link to comment Share on other sites More sharing options...
Mati002 Posted May 1, 2020 Author Share Posted May 1, 2020 18 minutes ago, Mati002 said: Hello, I'm new not only to autoit but programming in general and I would appreciate your help. I have been having problems with my latest code because the main repetition doesn't work, here is the code: #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> For $i = 1 To InputBox("", "How many pages?", 3) MouseClick($MOUSE_CLICK_RIGHT, 1560, 450) MouseClick($MOUSE_CLICK_RIGHT, 1690, 460) For $i = 1 To 19 ; this works WinActivate("Bills") Send("{TAB}") Send("^{Enter}") Next Send("^{PGDN}") For $i = 1 To 20 ; this works too MouseClick($MOUSE_CLICK_LEFT, 1590, 250) MouseClick($MOUSE_CLICK_LEFT, 1590, 310) Sleep(1000) Send("^v") Send("{TAB}") Send("ACH") Send("{TAB}") Send("ACH") Send("{ENTER}") Sleep(1000) Send("{ENTER}") Sleep(1000) Send("^w") Next Sleep(1000) Send("{F5}") Sleep(1000) Next ; and here it dies regardless of the value of $Number, even if I manually change it to other value it stops here Basically once it refreshes the page and waits a second it doesn't go back to clicking on the unpaid bills, the script icon disappears from the task bar so I assume it thinks it has finished but it doesn't repeat the whole script. I'm sorry I see now that it's a variable problem, such a rookie mistake coming from a rookie, I swear I did look through the forums and I was afraid of breaking the code by changing the repetition variables. this is how I ended up fixing it, hopefully it will be helpful to someone as lost as me. #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> For $i = 1 To InputBox("", "How many pages?", 3) MouseClick($MOUSE_CLICK_RIGHT, 1560, 450) MouseClick($MOUSE_CLICK_RIGHT, 1690, 460) For $i1 = 1 To 19 ; this works WinActivate("Bills") Send("{TAB}") Send("^{Enter}") Next Send("^{PGDN}") For $i2 = 1 To 20 ; this works too MouseClick($MOUSE_CLICK_LEFT, 1590, 250) MouseClick($MOUSE_CLICK_LEFT, 1590, 310) Sleep(1000) Send("^v") Send("{TAB}") Send("ACH") Send("{TAB}") Send("ACH") Send("{ENTER}") Sleep(1000) Send("{ENTER}") Sleep(1000) Send("^w") Next Sleep(1000) Send("{F5}") Sleep(1000) Next ; Insert Anakin Skywalker's "it's working" gif here I'll make sure to spend more time researching and looking through the resources next time, it's just that as someone with a finance career programming is difficult and I'm used to solving financial problems rather than programming issues. Still if you have external resources (I'd prefer videos) to better understand variables and syntax they are very welcome. Link to comment Share on other sites More sharing options...
faustf Posted May 2, 2020 Share Posted May 2, 2020 hi and welcom in autoit comunity , you want automate a broswer , or windows app?? 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