Jump to content
Sign in to follow this  
Regency

Logging in?

Recommended Posts

Regency

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")

Share this post


Link to post
Share on other sites
cew27

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

Share this post


Link to post
Share on other sites
Regency

No i didnt think of sending a tabs sequence for it... The page never changes so it should work.

But i will look in the index.. Thank you

Share this post


Link to post
Share on other sites
Regency

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

Share this post


Link to post
Share on other sites
cew27

im not 100% sure on this but im not suer those ] are supposed to be there try deleteing the line up to mouseclick and it should give u a hint as to how to write the code when u type the first (

Share this post


Link to post
Share on other sites
Regency

No they are supposed to be there...

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

Share this post


Link to post
Share on other sites
cew27

i just tried it and im also confused ?? i think there needs to be extra script ? im not sure

Share this post


Link to post
Share on other sites
Regency

I got it to where it is error free with

MouseMove(-4,-4)

But cant get MouseClick to work...

hummm

Share this post


Link to post
Share on other sites
Nahuel

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.

Share this post


Link to post
Share on other sites
cew27

i got mouse move to work aswell but not mouse click??

Share this post


Link to post
Share on other sites
Regency

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

Share this post


Link to post
Share on other sites
Nahuel

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?

Share this post


Link to post
Share on other sites
cew27

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?

Share this post


Link to post
Share on other sites
Regency

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

Share this post


Link to post
Share on other sites
cew27

thanks for that it worked :)

also you might want to take that off if it is your user name and pass for that website

Share this post


Link to post
Share on other sites
Regency

Yea it is... But its a dupe.. so i dont care plus i quit.. just was gunna post a auto scripter for the people on the site to spoil to fun.. lol

Share this post


Link to post
Share on other sites
cew27

lol kool ....

but does wnyone know whay i am having bother with win wait active? as it is quite annoying if a page / window take a little longer than notmal to load the clicks are just wasted on my desktop!

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.