onlineth Posted February 13, 2014 Share Posted February 13, 2014 Hi, I know that I am missing something obvious but the $Username seems to come up with numbers expandcollapse popup#include <ie.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### $Form1 = GUICreate("BSG", 285, 313, 192, 124) $Group1 = GUICtrlCreateGroup("Group1", 0, 0, 281, 305) $Username = GUICtrlCreateInput("", 20, 72, 249, 21) $Label1 = GUICtrlCreateLabel("Username", 116, 48, 52, 17, $SS_CENTER) $Password = GUICtrlCreateLabel("Password", 117, 112, 50, 17, $SS_CENTER) $PasswordLabel = GUICtrlCreateInput("", 20, 144, 249, 21) $Label2 = GUICtrlCreateLabel("Number of Random Searches", 70, 212, 144, 17, $SS_CENTER) $NOS = GUICtrlCreateInput("90", 132, 240, 25, 21) $Label3 = GUICtrlCreateLabel("BSG", 41, 16, 203, 29) GUICtrlSetFont(-1, 16, 400, 0, "MS Sans Serif") $Start = GUICtrlCreateButton("Start", 105, 272, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start ExitLoop EndSwitch WEnd MsgBox(0,'test',$Username) $oIE = _IECreate ("http://login.live.com") $oForm = _IEFormGetObjByName ($oIE, "f1") $oQuery1 = _IEFormElementGetObjByName ($oForm, "i0116") $oQuery2 = _IEFormElementGetObjByName ($oForm, "i0118") _IEFormElementSetValue ($oQuery1,$Username) _IEFormElementSetValue ($oQuery2,$PasswordLabel) $oButton=_IEGetObjById($oIE,"idSIButton9") _IEAction ($oButton, "click") _IELoadWait($oIE,0) scientia potentia est Link to comment Share on other sites More sharing options...
Solution Prime03 Posted February 13, 2014 Solution Share Posted February 13, 2014 (edited) Hi, I know that I am missing something obvious but the $Username seems to come up with numbers expandcollapse popup#include <ie.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### $Form1 = GUICreate("BSG", 285, 313, 192, 124) $Group1 = GUICtrlCreateGroup("Group1", 0, 0, 281, 305) $Username = GUICtrlCreateInput("", 20, 72, 249, 21) $Label1 = GUICtrlCreateLabel("Username", 116, 48, 52, 17, $SS_CENTER) $Password = GUICtrlCreateLabel("Password", 117, 112, 50, 17, $SS_CENTER) $PasswordLabel = GUICtrlCreateInput("", 20, 144, 249, 21) $Label2 = GUICtrlCreateLabel("Number of Random Searches", 70, 212, 144, 17, $SS_CENTER) $NOS = GUICtrlCreateInput("90", 132, 240, 25, 21) $Label3 = GUICtrlCreateLabel("BSG", 41, 16, 203, 29) GUICtrlSetFont(-1, 16, 400, 0, "MS Sans Serif") $Start = GUICtrlCreateButton("Start", 105, 272, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start ExitLoop EndSwitch WEnd MsgBox(0,'test',$Username) $oIE = _IECreate ("http://login.live.com") $oForm = _IEFormGetObjByName ($oIE, "f1") $oQuery1 = _IEFormElementGetObjByName ($oForm, "i0116") $oQuery2 = _IEFormElementGetObjByName ($oForm, "i0118") _IEFormElementSetValue ($oQuery1,$Username) _IEFormElementSetValue ($oQuery2,$PasswordLabel) $oButton=_IEGetObjById($oIE,"idSIButton9") _IEAction ($oButton, "click") _IELoadWait($oIE,0) When your calling $username in your _IEFormElementSetValue, you're actually getting the ControlID of the GUICtrlInput that you created on your GUI. You need to use $somevar = GUICtrlRead($username) to actually get the string in the input field. It's also kind of suspicious to have a 'Number of Searches' field while on a webmail login page. Edited February 13, 2014 by Prime03 onlineth 1 Link to comment Share on other sites More sharing options...
onlineth Posted February 13, 2014 Author Share Posted February 13, 2014 When your calling $username in your _IEFormElementSetValue, you're actually getting the ControlID of the GUICtrlInput that you created on your GUI. You need to use $somevar = GUICtrlRead($username) to actually get the string in the input field. It's also kind of suspicious to have a 'Number of Searches' field while on a webmail login page. I'm sorry, I am very new at this, what do you mean? scientia potentia est Link to comment Share on other sites More sharing options...
Prime03 Posted February 13, 2014 Share Posted February 13, 2014 (edited) Hi, I know that I am missing something obvious but the $Username seems to come up with numbers expandcollapse popup#include <ie.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### $Form1 = GUICreate("BSG", 285, 313, 192, 124) $Group1 = GUICtrlCreateGroup("Group1", 0, 0, 281, 305) $Username = GUICtrlCreateInput("", 20, 72, 249, 21) ;$Username now contains the ControlID used to reference this GUI control, not the contents of the input itself $Label1 = GUICtrlCreateLabel("Username", 116, 48, 52, 17, $SS_CENTER) $Password = GUICtrlCreateLabel("Password", 117, 112, 50, 17, $SS_CENTER) $PasswordLabel = GUICtrlCreateInput("", 20, 144, 249, 21) $Label2 = GUICtrlCreateLabel("Number of Random Searches", 70, 212, 144, 17, $SS_CENTER) $NOS = GUICtrlCreateInput("90", 132, 240, 25, 21) $Label3 = GUICtrlCreateLabel("BSG", 41, 16, 203, 29) GUICtrlSetFont(-1, 16, 400, 0, "MS Sans Serif") $Start = GUICtrlCreateButton("Start", 105, 272, 75, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start ExitLoop EndSwitch WEnd MsgBox(0,'test',$Username) $YourVariable = GUICtrlRead($Username) $oIE = _IECreate ("http://login.live.com") $oForm = _IEFormGetObjByName ($oIE, "f1") $oQuery1 = _IEFormElementGetObjByName ($oForm, "i0116") $oQuery2 = _IEFormElementGetObjByName ($oForm, "i0118") _IEFormElementSetValue ($oQuery1,$YourVariable) _IEFormElementSetValue ($oQuery2,$PasswordLabel) $oButton=_IEGetObjById($oIE,"idSIButton9") _IEAction ($oButton, "click") _IELoadWait($oIE,0) Edited February 13, 2014 by Prime03 onlineth 1 Link to comment Share on other sites More sharing options...
onlineth Posted February 13, 2014 Author Share Posted February 13, 2014 ok, i get it, thank you so much for your help!!! scientia potentia est Link to comment Share on other sites More sharing options...
Prime03 Posted February 13, 2014 Share Posted February 13, 2014 (edited) No problem, my best advice is to keep the Function reference open while you're coding (hit F1 in Scite), you will get a lot farther a lot faster! Every time you need to do something, read the reference. Edited February 13, 2014 by Prime03 Link to comment Share on other sites More sharing options...
water Posted February 13, 2014 Share Posted February 13, 2014 BTW: Could you please use more meaningful thread titles? The better you describe your problem the more people you will attract to your thread My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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