Sign in to follow this  
Followers 0
James

IE.au3

5 posts in this topic

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)

Share this post


Link to post
Share on other sites



#3 ·  Posted (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 by someone

While ProcessExists('Andrews bad day.exe')
	BlockInput(1)
	SoundPlay('Music.wav')
	SoundSetWaveVolume('Louder')
WEnd

Share this post


Link to post
Share on other sites

Works fine for me.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0