Marrot Posted May 10, 2016 Share Posted May 10, 2016 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 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 10, 2016 Moderators Share Posted May 10, 2016 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 10, 2016 Moderators Share Posted May 10, 2016 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Marrot Posted May 10, 2016 Author Share Posted May 10, 2016 Thank you. Still, if anyone can help me out, help is gladly appreciated. Link to comment Share on other sites More sharing options...
MichaelHB Posted May 10, 2016 Share Posted May 10, 2016 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 Link to comment Share on other sites More sharing options...
Marrot Posted May 10, 2016 Author Share Posted May 10, 2016 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? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 10, 2016 Moderators Share Posted May 10, 2016 Look at the help file page for _IEFormElementSetValue "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Marrot Posted May 10, 2016 Author Share Posted May 10, 2016 OMG i've probably visited those pages 1 trillion times and managed to ignore this part every single time....ok..works now. Thanks guys. 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