Jump to content

Website Form Input


Recommended Posts

Hi Guys..

I am really new to Autoit but i'm hoping it will solve my problem.

Im hoping to put together something which will allow me to log into my E-mail from a custom input box.

So:

Custom Input Box

User name: JoeBlogs

Password: xxxxx

then script opens e-mail website and inputs JoeBlogs"@etc.com" and password and logs me in which also adds "@etc.com"

Any advice would be most appreciated!

Link to comment
Share on other sites

Can you post the website you are trying to do this with.

E.G. How you can achieve what you want.

#include <IE.au3>
; Create a browser window and navigate to hotmail
$oIE = _IECreate("http://mail.yahoo.com")
; get pointers to the login form and username, password and signin fields
Local $o_form = _IEFormGetObjByName($oIE, "login_form")
Local $o_login = _IEFormElementGetObjByName($o_form, "login")
Local $o_password = _IEFormElementGetObjByName($o_form, "passwd")
Local $username = "your username here"
Local $password = "your password here"
; Set field values and submit the form
_IEFormElementSetValue($o_login, $username)
_IEFormElementSetValue($o_password, $password)
_IEAction($o_password, "focus")
Edited by Guest
Link to comment
Share on other sites

Here.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
GUICreate("Login",300,200,-1,-1)
GUICtrlCreateLabel("Account Name:",20,32,200,25)
GUICtrlCreateLabel("Password:",20,102,200,25)
$UserNameCON = GUICtrlCreateInput("",20,50,260,22)
$UserPasswordCON = GUICtrlCreateInput("",20,120,260,22,0x0020)
$loginBtn = GUICtrlCreateButton("Login",105,160,100,25)
GUISetState(@SW_SHOW) ; will display an empty dialog box
    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()
  Switch $msg
   Case $loginBtn
    $UserName = GUICtrlRead($UserNameCON)
    $UserPassword = GUICtrlRead($UserPasswordCON)
    $oIE = _IECreate("http://www.outlook.com")
    Sleep(1000)
    Send($UserName&"@EmailHere.com") ; Email <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    Sleep(500)
    Send("{TAB}")
    Sleep(500)
    Send($UserPassword) ; Password
    Send("{TAB}")
    Send("{TAB}")
    Send("{TAB}")
    Send("{ENTER}")
    ExitLoop
   Case $GUI_EVENT_CLOSE
    ExitLoop
  EndSwitch
    WEnd
    GUIDelete()
Link to comment
Share on other sites

This thread violates the rules. Since you gave such shitty code though I don't have to delete it. Anyway, don't discuss how to automate logins on this forum. I suggest both of you read the rules before further posts.

Link to comment
Share on other sites

Apparently Aipion got all butthurt over me saying his code was shit. Even though it is shit. Why is it shit? Because it uses Send(). Simple user interaction with the keyboard will break the script. There are much better ways of providing input to the elements on a page that the user cannot interrupt.

It's ironic, really. I had just finished reading when I was directed towards the report directed at me. Kind of rings pretty damn true. For those curious, here's the report description:

Wow so we can what ever we like on this forum to other people, like fuck you, you waste-man on the street i don't even know.

Nice,

I am looking forward to go around looking at random posts and saying fuck you which i don't think is very nick thing well thats coz if valik can do that then i can do that right. Nice example he is showing to every1.

Let's pick this apart, shall we?

Wow so we can what ever we like on this forum to other people, like fuck you, you waste-man on the street i don't even know.

When did I say "fuck you" or advocate saying that? When did I mention anything about garbage? I didn't. I said the code was shit. This is not opinion. This is not subjective. It can be very clearly demonstrated scientifically that the code is bad because it is easy to break the script's flow of execution. There are very simple alternatives that are an order of magnitude more reliable. Then, of course, there's the years of empirical data I have that proving that Send() is unreliable on a good day due to unforeseen events. But what do I know.

I am looking forward to go around looking at random posts and saying fuck you which i don't think is very nick thing

You know what I don't find to be very nice? People who fail to read the rules. You did not read the rules and helped somebody do something that violates our rules. Then you got some sand in your vag and abused the report feature to report me. Me. A moderator. You reported a moderator. What are the others going to do? Ban me for telling you and the OP to read the rules because you broke them? Choo choo. Hear that? It's the logic train. You missed it.

well thats coz if valik can do that then i can do that right. Nice example he is showing to every1.

This would be incorrect. I can get away with what I want because of substantial contributions to this language and this community. My eccentricities are tolerated because in general I'm valuable to have around. You? What purpose do you serve? Well right now you are serving as fodder for me to shred which others will find entertaining. So you have that going for you I guess. /golfclap

Anyway. You get a 7 day ban for your little report. My suggestion to you is accept the 7 day ban, don't PM me - or other mods - to bitch about it and don't try to evade it. Basically anything but being quiet will lead to your permanent removal from this forum. No, you won't evade the removal.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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