Jump to content
Sign in to follow this  
Parrot

Mouse Positioning Problem

Recommended Posts

Parrot

Hello. I'm new to AutoIt and I'm trying to mess around so as to understand the basics and the syntax. I decided to start out by making a program that would open up a firefox window and log into my comics.com account for me. This is what I've got:

Run("C:\Program Files\Mozilla Firefox\firefox.exe")
WinWaitActive("Mozilla Firefox Start Page - Mozilla Firefox")
Opt("MouseCoordMode", 2)   
MouseClick("left", 320, 40, 1)
Send("www.comics.com{ENTER}")
WinWait("Comics.com Home Page - Mozilla Firefox")
MouseClick("left", 180, 180, 1)
WinWait("Comics Extra - Mozilla Firefox")
MouseClick("left", 700, 370, 1)

I'm using the AutoIt v3 Window Info application in order to determine the mouse position for clicking on the buttons and areas. I took the co-ordinates from the Control tab, looking at the "ControlClick Coords" parameter.

I gather that this parameter gives me the coordinates in terms of the user area for the current window, which suits me fine because it means that it won't matter where the window opens up. So I set the MouseCoordMode to 2.

That worked fine for the first mouse click, but for the second mouse click something seems to have gone wrong. Instead of clicking on position 180, 180 - the Windo Info tool tells me that it's actually clicking on position 180, 95

What went wrong here?

Edited by Parrot

Share this post


Link to post
Share on other sites
AdmiralAlkex

The mouse position from the Control-tab should be used when doing ControlClick(), hence the name "ControlClick Coords".

You should use the positions from the Mouse-tab. To change between screen/window/client coordinates press "Options>Coord Mode" and then on the one you want.

But for automating "browsing the web" you should use IE.au, it's faster/safer and you won't need to worry about coordinates and such stuff. See "IE Management" in the helpfile.

Edit: And welcome to the forum! ;)

Edited by AdmiralAlkex

Share this post


Link to post
Share on other sites
Parrot

Okay, I've got the part about the co-ordinates. My question now is what is the basis for the ControlClick coordinates, and why are they different from any mouse coordinate system used?

Also, I'm looking at IE management in the help file... I'm a little lost. Is there somewhere I can get more than just a list of functions? The help file doesn't explain how to use it very well.

Share this post


Link to post
Share on other sites
AdmiralAlkex

ControlClick coordinates is used to choose where on the control you want to click, so if you wanted to click on the "upper left corner" it would be "0,0".

About the IE management, I am not sure what you mean, doesn't the examples work for you?

Share this post


Link to post
Share on other sites
Parrot

ControlClick coordinates is used to choose where on the control you want to click, so if you wanted to click on the "upper left corner" it would be "0,0".

What do you mean by "on the control"

About the IE management, I am not sure what you mean, doesn't the examples work for you?

I'm not sure exactly how these examples could work for anybody. Perhaps I'm missing something. I see a list of functions and some examples how to use them... but no real explanation of how to do what I want done.

I'm looking through the functions for something to help me browse to a website and possibly collect or download information off of it.... I come across _IEBodyReadText, but it seems to be just for inserting HTML code into a blank page. I've looked through a few of the others, but none of them seem to bear any relation to what I want.

Usually when I read a programming manual there's some explanation of how to do different things, instead of just a list of functions that I'm supposed to hunt through.

I guess I'll browse through them a little bit more, see if I can figure it out.

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  

×