Jump to content

Recommended Posts

So I have tested a bit of code that allows me to store login and password information and use it later on to login.

See Code below

Func LoginInfo()
    Local $User, $Password
Local $btn, $msg
Global $Usr, $Pwd
   GUICreate(" User Name and Password for ESQ", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1)
   $User = GUICtrlCreateInput("", 10, 5, 300, 20)
   $Password = GUICtrlCreateInput("", 10, 35, 300, 20,0x0020)
   $btn = GUICtrlCreateButton("Ok", 40, 75, 60, 20)
   GUISetState()
   $msg = 0
  While $msg <> $GUI_EVENT_CLOSE
        $msg = GUIGetMsg()
        Select
            Case $msg = $btn
                ExitLoop
        EndSelect
    WEnd
  
   $Usr = GUICtrlRead($User)
   $Pwd = GUICtrlRead($Password)
    ;MsgBox(4096, "User and Password", GUICtrlRead($User))
;MsgBox(0,"Password",GUICtrlRead($Password))
EndFunc

LoginInfo()
#include <IE.au3>
MsgBox(4096, "User and Password", $Usr)
MsgBox(0,"Password",$Pwd)
$URL = "https://google.com"
$IE = _IECreate($URL, 0, 0, 0)
$HWND = _IEPropertyGet($IE, "hwnd")
WinSetState($HWND,"",@SW_MAXIMIZE)
_IEAction($IE, "visible")
_IELoadWait($IE)
Sleep(1000)
Sleep(1000)
MouseClick("Left",-685,274)
Send($Usr)
Sleep(1000)
MouseClick("Left",-685,296)
Send($Pwd)
Sleep(500)
Send(@CR)

Once I use this working code in my larger program it fails. It won't store the login and password information, nor will it wait for rest of the program until the login information is entered.

What am I doing wrong?

Link to comment
Share on other sites

i am soory but pls reread our Forum Rules

SPAM tools including instant messenger or forum auto-posters. This includes forum or site auto-login methods.

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

Please ignore the first responder. There are plenty of reasons to use automated logins. Let me find some of the methods posted by MVPs here that I have used.

;~ #1: this one works well
#include <IE.au3>
$URL = "yoururlhere.com"
$ObjIE = ObjCreate("InternetExplorer.Application")
With $ObjIE;Wait until Forwarding Website loads
.Visible = True
.Navigate ($URL)
Do
  Sleep(50)
Until .ReadyState = 4
EndWith
With $ObjIE.document.forms (0);Set Form Objects on Website
.username.value = "Usernamehere"
.password.value = "Passwordhere"
.submit
EndWith
;~ End #1: this one works well

;~ #2: this one works better
_IENavigate ($oIE, "YourURLHere.com") ; Fill out a page and submit
_IELoadWait ($oIE)
$oForms1 = _IEFormGetObjByName($oIE, "NameOfFormHere")          
$oNum1 = _IEFormElementGetObjByName($oForms1, "NameOfemailField")  
$oNum2 = _IEFormElementGetObjByName($oForms1, "NameOfPasswordField")  
$Email = ""
$Password = ""                
_IEFormElementSetValue($oNum1, $Email)  
_IEFormElementSetValue($oNum2, $Password)   
_IEFormSubmit($oForms1)       ; Sumbit
;~ #2: this one works better
Edited by John117
Link to comment
Share on other sites

Please ignore the first responder.

Oh no you didn't. Advocating ignoring somebody who is parroting the rules I helped create and posted means you are advocating ignoring me. In general that is not a good idea. You have a couple days to think about that.

There are plenty of reasons to use automated logins.

Indeed there are. There are plenty of legitimate reasons to do a lot of things that break rules and laws. That does not mean we discard the rules on a whim, however. The rules are what they are. Right/wrong, agree/disagree they are clearly posted and known to be enforced so people need to either deal with them and work within their constraints or find another forum.

Thread locked and as mentioned, John117 banned for a couple days to think about rules and why ignoring them (and me) is a bad idea.

Link to comment
Share on other sites

I just noticed John117 has been reprimanded no less than 3 times by me within a 3 week period at the end of 2007 through early 2008. Making a note here: Huge Success. No wait, making a note that the next time will be permanent removal.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...