Facebook Automation. 03-04-2012, 06:22 PM
#1
Here's a little script to automatically log on to facebook. Function is in there too. If the picture won't load, that's because it's saved on my computer.
Code:
#include <IE.au3>
#include <File.au3>
#include <GUIConstants.au3>
#include <Misc.au3>
Global $mail, $pass
LoginGUI()
LoginFB($mail, $pass)
Func LoginGUI()
GUICreate("Facebook Login", 400, 135)
GUICtrlCreatePic("fb.jpg", 0, 0, 400, 100)
GUICtrlCreateLabel("E-mail", 20, 120, 100, 100)
GUICtrlCreateLabel("Password", 190, 120, 100, 100)
$Input1 = GUICtrlCreateInput("", 0, 101, 170, 18)
$Input2 = GUICtrlCreateInput("", 171, 101, 170, 18, 0x0020)
$Submit = GUICtrlCreateButton("Log In", 341, 101, 59, 34)
GUISetState()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $Submit
LoginFB(GUICtrlRead($Input1), GUICtrlRead($Input2))
Case _IsPressed("0D")
LoginFB(GUICtrlRead($Input1), GUICtrlRead($Input2))
EndSelect
WEnd
GUISetState()
EndFunc
Func LoginFB($mail, $pass)
$Int = _IECreate("http://www.facebook.com/login.php", 0, 1, 1)
$Form = _IEFormGetObjByName($Int, "login_form")
$Query = _IEFormElementGetObjByName($Form, "email")
$Query1 = _IEFormElementGetObjByName($Form, "pass")
$oSubmit = _IEFormElementGetObjByName($Form, "login")
_IEFormElementSetValue($Query, $mail)
_IEFormElementSetValue($Query1, $pass)
_IEAction($oSubmit, "click")
EndFunc
![[Image: nNICR.jpg]](http://i.imgur.com/nNICR.jpg)
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)

![[Image: 2drtmya.jpg]](http://oi53.tinypic.com/2drtmya.jpg)