andi2176

Help to make an auto login bot for gmail

13 posts in this topic

Hello I am fairly new to AutoIT, but i have begun experimenting with IE functions and FF functions.

I have made an IE gmail login bot for gmail successfully, but i am stuck on which functions to use for Firefox.

I have added MozRepl and FF.au3 to my include folder and have downloaded and tried to use the FF_AutoLogin.au3 function but with no luck.

Could somebody please help me?

Regards

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

This is my fail attempt with facebook :( :( :(

#include <FF.au3>


Call("signIn")

Func signIn()
    $oFF = _FFStart("http://wwww.facebook.com/")
    if $oFF = 1 Then
        $site_email = _FFFormOptionSelect(0,"email")
        $site_pass = _FFFormOptionSelect(0,"pass")
        $site_button = _FFFormOptionSelect(0,"u_0_n")

        $user_email = _FFSetValue($site_email,"MY EMAIL")
        $user_pass = _FFSetValue($site_pass,"MY PASSWORD")

        _FFClick($site_button)
        EndIf
EndFunc
Edited by andi2176

Share this post


Link to post
Share on other sites

Hello and welcome to the forums!

I have a little experience with _IEFunctions and nothing with the FireFox UDF you use (hopefully, otherwise I just presented myself as an idiot :) ), so my help may not count for much, but I try.

First when posting any code, pls use code tags (there is a way to type them in your post, but I suggest to use the little blue icon with a white A, its faster I think) that way others can read your code much easier thanks to the highlights.

I would add and else branch to my if, just in case. Otherwise I'm not sure _FFFormOptionSelect is doing what you need to do, just from its name, shouldn't it be something like_ FFFormGetId or handle or Obj or something?

Also it would be helpfull if you would tell us whats the script is actually doing, where is the problem?

Share this post


Link to post
Share on other sites

You definitely don't want _FFFormOptionSelect in this case. Try this:

_FFSetValue ("email@address.com", "email", "id")
_FFSetValue ("yourpass", "pass", "id")
_FFFormSubmit()
1 person likes this

Share this post


Link to post
Share on other sites

Hello and welcome to the forums!

I have a little experience with _IEFunctions and nothing with the FireFox UDF you use (hopefully, otherwise I just presented myself as an idiot :) ), so my help may not count for much, but I try.

First when posting any code, pls use code tags (there is a way to type them in your post, but I suggest to use the little blue icon with a white A, its faster I think) that way others can read your code much easier thanks to the highlights.

I would add and else branch to my if, just in case. Otherwise I'm not sure _FFFormOptionSelect is doing what you need to do, just from its name, shouldn't it be something like_ FFFormGetId or handle or Obj or something?

Also it would be helpfull if you would tell us whats the script is actually doing, where is the problem?

I have chosen _FFFormOptionSelect because i think it's the only function that does something with an element. No other function i can see really involves dealing with elements.

Here is the list of functions for firefox: english.documentation.ff-au3.thorsten-willert.de

The problem i am seeing on my screen is that when i start my script is loads facebook but does nothing from there.

Share this post


Link to post
Share on other sites

Thanks for the documentation, _FFFormOptionSelect is definetley not doing what you want it to do

@Danp's suggestions worth a try, browser automatization works a bit differently then windows/controls etc.

Share this post


Link to post
Share on other sites

 

You definitely don't want _FFFormOptionSelect in this case. Try this:

_FFSetValue ("email@address.com", "email", "id")
_FFSetValue ("yourpass", "pass", "id")
_FFFormSubmit()

Sorry it's doing the same thing i even tried this.

#include <FF.au3>



_FFStart("http://wwww.facebook.com/")
_FFSetValue("MY EMAIL", "email", "id")
_FFSetValue("MY PASS", "pass", "id")
_FFFormSubmit()

Share this post


Link to post
Share on other sites

Have you tried them in your original script? (no reason to change the launch of FireFox,if it was working)

Are you sure, you have the right id's? Maybe you can try with their names.

As an alternate you can try _FFClick and then simply using Send (this is quite a layman solution, I'm not sure if facebook allow it or not, maybe its prohibit it)

Maybe you need to add some Sleep(x) to your script, maybe the script would do what you want, but the FireFox/page simply isn't loaded yet,

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

I use Firefox and this works for me. Use window spy to adjust
co-ordinates of mouse click

Try :

run("C:\PROGRA~1\MOZILL~1\firefox.exe http://gmail.google.com")
WinWaitActive("Welcome to Gmail - Mozilla Firefox")
WinSetState("Welcome to Gmail", "", <at> SW_MAXIMIZE )
sleep(500)
;
;use autoit window spy to change co-ords to username text box on gmail page
;
MouseClick("left", 816, 276, 1)
sleep(500)
;replace with your username + password
send("XXXXXXXX{TAB}xxxxxxxxx{ENTER}")


Cheers

Edited by meows

Share this post


Link to post
Share on other sites

Sorry it's doing the same thing i even tried this.

 

Have you tried them in your original script? (no reason to change the launch of FireFox,if it was working)

 

Yeah... the expectation was that you replace the bad calls to _FFFormOptionSelect with the ones I posted above. I just verified that this code works, so there's something wrong on your end.

Frankly, you haven't given enough details for anyone to assist you any further. I suspect that you don't have MozRepl installed / running properly. Run your script in Scite and post the results from the Output window.

Share this post


Link to post
Share on other sites

Yeah... the expectation was that you replace the bad calls to _FFFormOptionSelect with the ones I posted above. I just verified that this code works, so there's something wrong on your end.

Frankly, you haven't given enough details for anyone to assist you any further. I suspect that you don't have MozRepl installed / running properly. Run your script in Scite and post the results from the Output window.

Could you please point me into the right direction on where i can learn how to install MozRepl again?

Share this post


Link to post
Share on other sites

Go to the url "about:addons" and check to see if it is installed under Extensions. If not, you can install it from here. Once installed, you should have a new sub-menu titled MozRepl under the Tools menu. Check under this menu to be sure MozRepl is started and be sure to enable the Activate on Startup option.

1 person likes this

Share this post


Link to post
Share on other sites

Go to the url "about:addons" and check to see if it is installed under Extensions. If not, you can install it from here. Once installed, you should have a new sub-menu titled MozRepl under the Tools menu. Check under this menu to be sure MozRepl is started and be sure to enable the Activate on Startup option.

Hey thanks for the input dude my problem is solved because my mozrepl wasn't active on startup. The new version of firefox doesnt show the toolbar which consists of the tools dropdown menu until you press f10.

Many thanks.

Share this post


Link to post
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