Regency Posted October 15, 2007 Share Posted October 15, 2007 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 More sharing options...
cew27 Posted October 15, 2007 Share Posted October 15, 2007 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 More sharing options...
Regency Posted October 15, 2007 Author Share Posted October 15, 2007 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 Link to comment Share on other sites More sharing options...
Regency Posted October 15, 2007 Author Share Posted October 15, 2007 (edited) 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 October 15, 2007 by Regency Link to comment Share on other sites More sharing options...
cew27 Posted October 15, 2007 Share Posted October 15, 2007 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 ( Link to comment Share on other sites More sharing options...
Regency Posted October 15, 2007 Author Share Posted October 15, 2007 No they are supposed to be there... MouseClick ( "button" [, x, y [, clicks [, speed ]]] ) Link to comment Share on other sites More sharing options...
cew27 Posted October 15, 2007 Share Posted October 15, 2007 i just tried it and im also confused ?? i think there needs to be extra script ? im not sure Link to comment Share on other sites More sharing options...
Regency Posted October 15, 2007 Author Share Posted October 15, 2007 I got it to where it is error free with MouseMove(-4,-4) But cant get MouseClick to work... hummm Link to comment Share on other sites More sharing options...
Nahuel Posted October 15, 2007 Share Posted October 15, 2007 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 More sharing options...
cew27 Posted October 15, 2007 Share Posted October 15, 2007 i got mouse move to work aswell but not mouse click?? Link to comment Share on other sites More sharing options...
Regency Posted October 15, 2007 Author Share Posted October 15, 2007 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 More sharing options...
Nahuel Posted October 15, 2007 Share Posted October 15, 2007 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 More sharing options...
cew27 Posted October 15, 2007 Share Posted October 15, 2007 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 More sharing options...
Regency Posted October 15, 2007 Author Share Posted October 15, 2007 (edited) 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 October 15, 2007 by Regency Link to comment Share on other sites More sharing options...
cew27 Posted October 15, 2007 Share Posted October 15, 2007 thanks for that it worked also you might want to take that off if it is your user name and pass for that website Link to comment Share on other sites More sharing options...
Regency Posted October 15, 2007 Author Share Posted October 15, 2007 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 Link to comment Share on other sites More sharing options...
cew27 Posted October 15, 2007 Share Posted October 15, 2007 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! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now