kq702 Posted May 1, 2015 Share Posted May 1, 2015 (edited) Hi I use autoit to automate a lot of my user logins. I made a program in visual basic 6 and for example when I click a button in the program, it automatically launches IE browser and the script is started. I start it with a 10 second delay which gives the page some time to load. Then after 10 seconds the script is active and the tab button automatically gets shifted however many times needed till the curser is in the user name box, for example maybe the tab button was pressed three times (by auto it) . Then a few seconds later the user name is automatically typed in (by auto it). Then there is a 2 second delay then another tab and then another 2 second delay then the password is automatically typed in by auto it. 2 seconds later the enter button is pressed and usually I am successfully logged into whatever site I have it programmed for.The problem is sometimes a webpage is updated it may for example require an extra tab to be pushed, so since it was programmed to tab 3 times in the example above but now it requires 4 tabs until the curser is in the username box.So I had an idea to prevent that from happening, if I press the button on VB to launch the webpage and launch the script, is there a way to make the script stay dormant until a button is pressed? That way I can click the curser into the user name field manually and when the curser is there I can press a button on keyboard to activate the script to start running. That way I wont have to worry about the tabs at all Edited May 1, 2015 by kq702 Link to comment Share on other sites More sharing options...
DigDeep Posted May 1, 2015 Share Posted May 1, 2015 either use Send ( "keys" [, flag = 0] ) funtion and mention the keys to be pressed to activate the next operation.oruse _IsPressed function.you can check the help file for more details. Link to comment Share on other sites More sharing options...
jguinch Posted May 1, 2015 Share Posted May 1, 2015 Look at the helpfile for _IECreate and _IExxxx functions. It should really help you. Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
kq702 Posted May 1, 2015 Author Share Posted May 1, 2015 Hi I looked at the help file and I see that I am going to have to learn a lot more about this program before I can learn about how the functions work. So can I cheat and post a copy of my script here and maybe someone can tell me how to quickly change it to require the "z" key to be tapped before the script finishes running? It would be much appreciated; Script Start - Add your code below here HotKeySet("x", "MyExit") Sleep(1000) send("user01") Sleep(200) Send("{tab}") Sleep(200) send("passcode01") Sleep(200) Send("{enter}") Func MyExit() Exit EndFunc Link to comment Share on other sites More sharing options...
aleph01 Posted May 2, 2015 Share Posted May 2, 2015 This may not be what you are looking for, but...$z = 0 Do $z = InputBox ("", "Enter the letter z to continue.") Until $z = "z" Meds. They're not just for breakfast anymore. Link to comment Share on other sites More sharing options...
SadBunny Posted May 2, 2015 Share Posted May 2, 2015 Two ways would be to enter a waiting loop and use _IsPressed to check if a certain key, erm, is pressed You can also enter a waiting loop that waits for a boolean variable to be toggled, and use another HotKeySet to toggle that variable. Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
kq702 Posted May 3, 2015 Author Share Posted May 3, 2015 aleph01 - I tried ur example and I think that will work for my needs! Thanks for the help!! Also thanks for the other suggestions everyone 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