Jump to content

Facebook App


Recommended Posts

Wanted to write a script that opens Facebook for me, I did it,but then tried too many features and variables,now I'm really stuck!

The process should be as such:

1.Click set Password

2.Login To Facebook

3.Delay Message then Function Zoom is called

If Set Password is clicked again it should ask if you want to reset password,then ask if you want to login or not.

I've confused myself.

Help me Obi Wan,you're my only hope!

Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)

HotKeySet("^!l","Login")

GuiCreate("Facebook App",150,210,682,0)
$Setpassword=GuiCtrlCreateButton("Set Password",0,0,150,35)
$Login=GuiCtrlCreateButton("Open Facebook",0,35,150,35)
GuiSetState()

While 1
$msg=GuiGetMsg()
if $msg=$Setpassword then SetPWD()
If $msg=$Login Then Login()
Wend

Global $passwd = InputBox("FB Password", "Enter your password.", "", "*")

Func SetPWD()
If $passwdset = False then
$passwd = InputBox("FB Password", "Enter your password.", "", "*")
$passwdset = True
$Loginanswer = MsgBox(4, "?", "Do you want to Login?")
If $Loginanswer = 6 Then EnterPWD()
If $Loginanswer = 7 Then Sleep(10)
Else
$answer = MsgBox(4, "?", "Do you want to reset the password?")
If $answer = 6 Then ResetPWD()
If $answer = 7 Then Sleep(10)
$Loginanswer = MsgBox(4, "?", "Do you want to Login?")
If $Loginanswer = 6 Then EnterPWD()
If $Loginanswer = 7 Then Sleep(10)
EndIf
EndFunc

Func ResetPWD()
    $passwd = InputBox("FB Password", "Enter your password.", "", "*")
    $passwdset = True
EndFunc

Func Login()
Send("{LWINDOWN}r{LWINUP}")
WinWait("Run","")
If Not WinActive("Run","") Then WinActivate("Run","")
WinWaitActive("Run","")
Send("http://apps.facebook.com/onthefarm/index.php?ref=ts{ENTER}")
WinWait("Login | Facebook - Windows Internet Explorer","")
If Not WinActive("Login | Facebook - Windows Internet Explorer","") Then WinActivate("Login | Facebook - Windows Internet Explorer","")
WinWaitActive("Login | Facebook - Windows Internet Explorer","")
Send("{ALTDOWN}{SPACE}{ALTUP}x")
Sleep(20)
Send("{F11}")
Sleep(50)
;Mouseclick("left",439,342,3,0)
;Send("*********@hotmail.co.uk{TAB}
EnterPWD()
EndFunc

Func EnterPWD()
if $passwdset = True then
Sleep(200)
MsgBox(0, "Example", "My variable is " & $passwd)
send($passwd,1)
send("{ENTER}")
MsgBox(0,"Delay","Press OK when FB has loaded.")
Zoom()
else
SetPWD()
endif

Func Zoom()
MouseClick("Left",725,564,1,0) 
WinWait(" - Adobe Flash Player","")
If Not WinActive(" - Adobe Flash Player","") Then WinActivate(" - Adobe Flash Player","")
WinWaitActive(" - Adobe Flash Player","")
Sleep(2000)
MouseClick("Left",797,632,1,0) 
Sleep(2000)
MouseClick("Left",797,632,1,0) 
Sleep(2000)
MouseClick("Left",797,632,1,0)
Sleep(2000)
$ZoomedOut = true
EndFunc

EndFunc
Edited by BitByteBit
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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