Sign in to follow this  
Followers 0
Marrot

Login script crashing

8 posts in this topic

Hello everyone,

i am trying to create a login script for my battle.net account but i can't get it to work.

I already tried this:

#include <IE.au3>
Local $oIE = _IECreate("https://eu.battle.net/login/de/?ref=http://eu.battle.net/de/&app=com-root") 
Local $oForm = _IEFormGetCollection($oIE, 0)
Local $oMail = _IEFormElementGetCollection ($oForm, 0)
_IEFormElementSetValue($oMail, "mailaddress")

It puts the "mailaddress" text into the mail field but afterwards crashes.

 

I also tried with _IEFormElementGetObjByName but there it is the same, it puts in the text but crashes directly.

 

I already created other login scripts for various sites, using both _IEFormElementGetCollection and _IEFormElementGetObjByName but it seems i can't get it to work with the battle.net website.

 

Can someone make a short test or tell me if there is anything going on with this site that i am not aware of? Is there maybe anything in the website code that makes the script fail or whatever?

 

Appreciate any help or advice. Thanks in advance.

 

Regards

Share this post


Link to post
Share on other sites



Marrot,

You appear not to have read the Forum rules since your arrival. Please do read them - particularly the bit about not discussing game automation - before you post again and then you will understand why you will get no help and this thread will now be locked.

M23

 


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Marrot,

I have been persuaded that merely opening the site does not break the rules, so I am reopening the thread.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Thank you.

 

Still, if anyone can help me out, help is gladly appreciated.

Share this post


Link to post
Share on other sites

Marrot, the "problem" (it's not really a problem, you problaly have not read the help file carefully) is on the "FireEvent", from the help file:

[optional] specifies whether to fire an OnChange event after changing value
0 = Do not fire OnChange or OnClick event after setting value
1 = (
Default) fire OnChange and OnClick event after setting value

You can also work with the ID, like this:

#include <IE.au3>

Local $sUserName = "UserName"
Local $sPassword = "Password"

Local $oIE = _IECreate("https://eu.battle.net/login/de/?ref=http://eu.battle.net/de/&app=com-root")
If Not IsObj($oIE) Then Exit ConsoleWrite("Error in $oIE" & @CRLF)

Sleep(2000)

Local $oUserName = _IEGetObjById($oIE, "accountName")
If Not IsObj($oUserName) Then Exit ConsoleWrite("Error in $oUserName" & @CRLF)

Local $oPassword = _IEGetObjById($oIE, "password")
If Not IsObj($oPassword) Then Exit ConsoleWrite("Error in $oPassword" & @CRLF)

_IEFormElementSetValue($oUserName, $sUserName, 0)
If @error Then Exit ConsoleWrite("Error setting the Username. Error number: " & @error & @CRLF)

_IEFormElementSetValue($oPassword, $sPassword, 0)
If @error Then Exit ConsoleWrite("Error setting the Password. Error number: " & @error & @CRLF)

Exit

 

Share this post


Link to post
Share on other sites
27 minutes ago, MichaelHB said:

Marrot, the "problem" (it's not really a problem, you problaly have not read the help file carefully) is on the "FireEvent", from the help file:

[optional] specifies whether to fire an OnChange event after changing value
0 = Do not fire OnChange or OnClick event after setting value
1 = (
Default) fire OnChange and OnClick event after setting value

You can also work with the ID, like this:

#include <IE.au3>

Local $sUserName = "UserName"
Local $sPassword = "Password"

Local $oIE = _IECreate("https://eu.battle.net/login/de/?ref=http://eu.battle.net/de/&app=com-root")
If Not IsObj($oIE) Then Exit ConsoleWrite("Error in $oIE" & @CRLF)

Sleep(2000)

Local $oUserName = _IEGetObjById($oIE, "accountName")
If Not IsObj($oUserName) Then Exit ConsoleWrite("Error in $oUserName" & @CRLF)

Local $oPassword = _IEGetObjById($oIE, "password")
If Not IsObj($oPassword) Then Exit ConsoleWrite("Error in $oPassword" & @CRLF)

_IEFormElementSetValue($oUserName, $sUserName, 0)
If @error Then Exit ConsoleWrite("Error setting the Username. Error number: " & @error & @CRLF)

_IEFormElementSetValue($oPassword, $sPassword, 0)
If @error Then Exit ConsoleWrite("Error setting the Password. Error number: " & @error & @CRLF)

Exit

 

First, thanks for your help.

 

I read here:

https://www.autoitscript.com/autoit3/docs/libfunctions/_IEFormGetCollection.htm

https://www.autoitscript.com/autoit3/docs/libfunctions/_IEFormElementGetCollection.htm

https://www.autoitscript.com/autoit3/docs/libfunctions/_IEFormElementGetObjByName.htm

 

none of these say something about a "FireEvent". Where is your information from?

Share this post


Link to post
Share on other sites

Look at the help file page for _IEFormElementSetValue


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

OMG i've probably visited those pages 1 trillion times and managed to ignore this part every single time....ok..works now. Thanks guys.

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