Jump to content

Logging in?


Regency
 Share

Recommended Posts

Well I am just starting to learn autoit and i have some whole codes i can look at and kinda understand. But i cant seem to figure out how to make the mouse click a certain area and type a login or password..

So far this is what i have its not much but its from just messing around trying to understand things. Where would i go from here?

Run("C:\Program Files\Mozilla Firefox\firefox.exe http://www.TheMafiaNetwork.net")
WinWaitActive ("TheMafiaNetwork - Mozilla Firefox")
Link to comment
Share on other sites

you could try sending a number of tabs until it gets to the login info and password then another tab and sending enter?

that may be a bit hard thaugh if the login/home page changes

if not have you tried mouseclick ?

go to the auto it help file/ index and search mouse click it should help you

Link to comment
Share on other sites

I looked into the mouse clicks and i keep getting an error.

C:\Documents and Settings\Compaq\Desktop\simple.au3(3,22) : ERROR: syntax error
MouseClick ( "right" [
~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Compaq\Desktop\simple.au3(3,32) : ERROR: syntax error
MouseClick ( "right" [, -4, -4 [
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Compaq\Desktop\simple.au3(4,13) : ERROR: syntax error
Send "Amped"
~~~~~~~~~~~~^
C:\Documents and Settings\Compaq\Desktop\simple.au3 - 3 error(s), 0 warning(s)
>Exit code: 2   Time: 0.214

Run("C:\Program Files\Mozilla Firefox\firefox.exe [url="http://www.TheMafiaNetwork.net")"]http://www.TheMafiaNetwork.net")[/url]
WinWaitActive ("TheMafiaNetwork - Mozilla Firefox")
MouseClick ( "right" [, -4, -4 [, 1 [, 10 ]]] )
Send "Amped"

Any idea whats wrong?

Edited by Regency
Link to comment
Share on other sites

No they are supposed to be there...

MouseClick ( "button" [, x, y [, clicks [, speed ]]] )

The parameters of a function that are inside [ ] are optional. You don't type the brackets.

Now, about your problem, I recommend you use IE and take a look at the help file for how to work with it.

Link to comment
Share on other sites

The parameters of a function that are inside [ ] are optional. You don't type the brackets.

Now, about your problem, I recommend you use IE and take a look at the help file for how to work with it.

Why IE? what i was gunna use is best in FF... And thank you for telling me that

Link to comment
Share on other sites

Example:

#include <IE.au3>
$oIE=_IECreate("http://www.themafianetwork.net/userlogin.aspx?")
$oUser=_IEGetObjByName($oIE,"txtuid")
_IEFormElementSetValue($oUser,"MyUserName")
$oPass=_IEGetObjByName($oIE,"txtpwd")
_IEFormElementSetValue($oPass,"MyPassWord")
$oLogIn=_IEGetObjByName($oIE,"Button1")
_IEAction($oLogIn,"click")

It won't work on the main site, you need to use this link: http://www.themafianetwork.net/userlogin.aspx?

Link to comment
Share on other sites

this code seems to work

#include <process.au3>

$rc = _RunDOS("start http://www.google.co.uk")

WinActivate ("Google - Mozilla Firefox")

sleep(3000)

MouseMove(518,324)

MouseClick("left")

send("autoit")

mousemove(582,348)

MouseClick("left")

althaugh i did the sleep function because winwaitactive doesnt seem to work it just sits there with the window active and doesnt so the rest of the script?

Link to comment
Share on other sites

this code seems to work

#include <process.au3>

$rc = _RunDOS("start http://www.google.co.uk")

WinActivate ("Google - Mozilla Firefox")

sleep(3000)

MouseMove(518,324)

MouseClick("left")

send("autoit")

mousemove(582,348)

MouseClick("left")

althaugh i did the sleep function because winwaitactive doesnt seem to work it just sits there with the window active and doesnt so the rest of the script?

The winwaitactive works if you add this to it it helped me...

AutoItSetOption("WinWaitDelay",250)

And also put a sleep delay on after the winwaitactive

This is what i got.. It logs me in using FF.. Perfectly. Now i dont know how to loop something after its been exectued.. Like it does it then sleeps for how ever long then repeats the sequence...

Run("C:\Program Files\Mozilla Firefox\firefox.exe http://www.TheMafiaNetwork.net")
AutoItSetOption("WinWaitDelay",250)
WinWaitActive ("TheMafiaNetwork - Mozilla Firefox")
Sleep(2000)
MouseMove(572,334,10)
MouseClick("left") 
Send("Amped")
Sleep(1000)
MouseMove(741,335)
MouseClick("left")
Sleep(1000)
MouseMove(575,359,10)
MouseClick("left")
Send("****")
Sleep(1000)
MouseMove(597,437,10)
MouseClick("left")
Sleep(4000)
MouseClick("left",169,713,33)
Edited by Regency
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...