James Posted November 27, 2006 Share Posted November 27, 2006 Can you help me with this please? I'm trying to make my AutoIT login box, do it automatically without the mouse movements, but for some reason my script won't work. ;; AutoIT login V2 ;; Thanks to everyone for mocking me, ;; I decided to show you I can make it AUTO(IT) #include <IE.au3> ; Create a browser window and navigate to AutoIT Forums $url = "www.autoitscript.com/forum/index.php" $username = "xxxx" $password = "xxxx" $oIE = _IECreate ($url, 1) $title = "AutoIT Forums" WinSetState($title, "", @SW_MAXIMIZE) $o_form = _IEFormGetObjByName ($oIE, "login_form") $o_login = _IEFormElementGetObjByName ($o_form, "UserName") $o_password = _IEFormElementGetObjByName ($o_form, "PassWord") _IEFormElementSetValue ($o_login, $username) _IEFormElementSetValue ($o_password, $password) _IEFormSubmit ($o_form, 0) _IELoadWait ($oIE) Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
mikehunt114 Posted November 27, 2006 Share Posted November 27, 2006 What is your console output? IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
someone Posted November 27, 2006 Share Posted November 27, 2006 (edited) Your problem is the form for the username/password doesn't have a name associated with it so you have to use IEFormGetCollection instead... ;; AutoIT login V2 ;; Thanks to everyone for mocking me, ;; I decided to show you I can make it AUTO(IT) #include <IE.au3> ; Create a browser window and navigate to AutoIT Forums $url = "www.autoitscript.com/forum/index.php" $username = "xxxx" $password = "xxxx" ;$oIE = _IECreate ($url, 1) $oIE = _IECreate ($url) $title = "AutoIT Forums" WinSetState($title, "", @SW_MAXIMIZE) $o_form = _IEFormGetCollection ($oIE, 0) ;$o_form = _IEFormGetObjByName ($oIE, "login_form") $o_login = _IEFormElementGetObjByName ($o_form, "UserName") $o_password = _IEFormElementGetObjByName ($o_form, "PassWord") _IEFormElementSetValue ($o_login, $username) _IEFormElementSetValue ($o_password, $password) _IEFormSubmit ($o_form, 0) ;_IELoadWait ($oIE) Also I wasn't sure why you had the last _IELoadWait command, but the script works fine without it. Are you trying to reuse an exsisting IE window or create a new one? I didn't have any luck with the _IECreate ($url,1) but I have had a lot of luck using _IEAttach... I would recommend trying that. Edited November 27, 2006 by someone While ProcessExists('Andrews bad day.exe') BlockInput(1) SoundPlay('Music.wav') SoundSetWaveVolume('Louder') WEnd Link to comment Share on other sites More sharing options...
AzKay Posted November 27, 2006 Share Posted November 27, 2006 Works fine for me. # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
James Posted November 28, 2006 Author Share Posted November 28, 2006 Well, I want to open a new window. I'll try that code once I get back from college today. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ 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