Jump to content

Auto login


Recommended Posts

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

Link to comment
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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 9 months later...

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...