Sign in to follow this  
Followers 0
dvlkn

Auto login

5 posts in this topic

Hello

I wanted to use this code to auto login into that web page (starkingdoms.com) but I cannot find the form name nor the button name.

#include <IE.au3>

$sUsername = "username"
$sPassword = "password"

$sURL = "http://starkingdoms.com"
$oIE = _IECreate($sURL)
$oForm = _IEFormGetObjByName($oIE, "no form name!")
$oUsername = _IEFormElementGetObjByName($oForm, "account")
$oPassword = _IEFormElementGetObjByName($oForm, "password")
$oButton = _IEGetObjByName($oForm, "no button name!")
_IEFormElementSetValue($oUsername, $sUsername)
_IEFormElementSetValue($oPassword, $sPassword)
_IEAction($oButton, "click")

So how can I do this ? If there is an alternative way, please tell me: I am trying to learn programming in autoIT

Share this post


Link to post
Share on other sites



I can't check out the website, but for the form try IEFormGetCollection, and for the button try IELinkClickByIndex, or IEFormSubmit (obviously need reference to the form first). Or if the button has an id I believe you can reference it IEGetObjById


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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hello

I wanted to use this code to auto login into that web page (starkingdoms.com) but I cannot find the form name nor the button name.

#include <IE.au3>

$sUsername = "username"
$sPassword = "password"

$sURL = "http://starkingdoms.com"
$oIE = _IECreate($sURL)
$oForm = _IEFormGetObjByName($oIE, "no form name!")
$oUsername = _IEFormElementGetObjByName($oForm, "account")
$oPassword = _IEFormElementGetObjByName($oForm, "password")
$oButton = _IEGetObjByName($oForm, "no button name!")
_IEFormElementSetValue($oUsername, $sUsername)
_IEFormElementSetValue($oPassword, $sPassword)
_IEAction($oButton, "click")

So how can I do this ? If there is an alternative way, please tell me: I am trying to learn programming in autoIT

Here is how you can do:

#include <IE.au3>

$oIE = _IECreate("http://starkingdoms.com/")
$oForm = _IEFormGetCollection ($oIE, 0)
$oAccount = _IEFormElementGetCollection ($oForm, 0)
$oPass = _IEFormElementGetCollection ($oForm, 1)

_IEFormElementSetValue ($oAccount,"Username")
_IEFormElementSetValue ($oPass,"Password")
_IEFormSubmit ($oForm,0)
_IELoadWait($oIE)

MsgBox(0,"Done","The job is done")

Regards

Edited by newbiescripter

Share this post


Link to post
Share on other sites

I was just about to post back in here about some problem but your code solved it muttley thanks!

Share this post


Link to post
Share on other sites

Does this script work for https:// sites as well?

Thanks.

Here is how you can do:

#include <IE.au3>

$oIE = _IECreate("http://starkingdoms.com/")
$oForm = _IEFormGetCollection ($oIE, 0)
$oAccount = _IEFormElementGetCollection ($oForm, 0)
$oPass = _IEFormElementGetCollection ($oForm, 1)

_IEFormElementSetValue ($oAccount,"Username")
_IEFormElementSetValue ($oPass,"Password")
_IEFormSubmit ($oForm,0)
_IELoadWait($oIE)

MsgBox(0,"Done","The job is done")

Regards

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