Jump to content

how to adjust the coordinates of the mouse movement


beiqi
 Share

Recommended Posts

Hi, there!

I am new to AutoIt and try to use them to automate some testing works!

At the learning, I have got a problem with AutoItRecorder:

If you use the AutoInfo, you can adjust the coordinaten as you like by choosing one of them: screen, windows or clients

That is great, but I can not choose them if I use AutoItRecorder.

Thanks in advance for your help or some advices!

Regards

XXL

Link to comment
Share on other sites

Hi beiqi!

I'm not sure if I understand what you're saying, but it seems like the main thing is "...you can adjust the coordinaten...". Could you be more specific? I tried both AutoItRecorder & AutoInfo they seemed to work fine together.

Mike B)

Link to comment
Share on other sites

Hi beiqi!

I'm not sure if I understand what you're saying, but it seems like the main thing is "...you can adjust the coordinaten...". Could you be more specific? I tried both AutoItRecorder & AutoInfo they seemed to work fine together.

Mike :)

Hi Mikey,

thanks for your mail. One can change the mouse coordinates unter the program AutoItInfo. There are three alternatives, but unter AutoItRecorder I can not do / do not know to do that, for example, I'd like to use the client coordinates, not the screen coordinates, I CANNOT!

thanks for your help in advance!

Link to comment
Share on other sites

One can change the mouse coordinates unter the program AutoItInfo

Well, 'one can change the mouse coordinates' by MOVING the mouse with the AutoIt Window Info tool running, yes.

I kind of think that AutoIt Recorder ISN'T the program you want. I'm also a newbie at this, but if you search the help files or forum, I'm pretty sure you will find that the AutoIt3 program (not AutoIt Recorder) has the ability for you to: 1) determine the mouse coordinates using AutoIt Window Info tool, then: 2) enter those coordinates into your AutoIt3 script to make the mouse go wherever you want.

You can download AutoIt3 form here: http://www.autoitscript.com/autoit3/downloads.php

Have fun! B) Mike

Link to comment
Share on other sites

@Mikey,

The AutoItRecorder that beiqi is talking about is part of the SciTE Editor enhancements. It is called AU3Recorder in the distribution that I have... perhaps it has been renamed. SciTE4AutoIt3 is available here:

http://www.autoitscript.com/autoit3/scite/

@beiqi,

My version of the AU3Recorder also records all mouse clicks to be used with Opt("MouseCoordMode",0) and I know of no place to change that setting for what it records. (You could manually adjust each set of coordinates after the fact or not use the recorder at all --- write your scripts from scratch.) You could ask Larry to add this feature/option to AU3Recorder- but you might want to read this first:

http://www.autoitscript.com/forum/index.ph...64entry123564

You could record your script using the AU3Recorder and then manually replace certain lines:

this line:

Opt("MouseCoordMode",0)

becomes:

Opt("MouseCoordMode",2)

;0 = relative coords to the active window

;1 = absolute screen coordinates (default)

;2 = relative coords to the client area of the active window

and lines like this:

MouseMove(210,219)

MouseDown("left")

MouseUp("left")

are replaced with a line like this:

MouseClick("left",210,219,1,1)

All I can offer is a small script like this to ease your pain :-)

AutoItSetOption("MouseCoordMode", 2)
AutoItSetOption("TrayIconDebug", 1)

HotKeySet("{PAUSE}", "Terminate")

While 1
    $pos = MouseGetPos()
    ToolTip("Desktop X: " & $pos[0] & ", " & "Desktop Y: " & $pos[1] & " Pause2exit")
    Sleep(10)
WEnd

Func Terminate()
    ClipPut('MouseClick("left",' & $pos[0] & ',' & $pos[1] & ',1,1); wrt Client')
    Exit
EndFunc  ;==>Terminate
Run that code...

Position your mouse over the area of interest...

Press pause to exit the script...

Paste the contents of the Windows clipboard over lines like:

MouseMove(210,219)

MouseDown("left")

MouseUp("left")

BTW, "wrt" = "with respect to"

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Hi herewarplato,

@beiqi,

My version of the AU3Recorder also records all mouse clicks to be used with Opt("MouseCoordMode",0) and I know of no place to change that setting for what it records. (You could manually adjust each set of coordinates after the fact or not use the recorder at all --- write your scripts from scratch.) You could ask Larry to add this feature/option to AU3Recorder- but you might want to read this first:

http://www.autoitscript.com/forum/index.ph...64entry123564

thanks for your post. I have read that post of Larry, I think he make only a joke because the feature which I search exists already in AutoItInfo, that mean the dev-team have already the solution!

You could record your script using the AU3Recorder and then manually replace certain lines:

this line:

Opt("MouseCoordMode",0)

becomes:

Opt("MouseCoordMode",2)

;0 = relative coords to the active window

;1 = absolute screen coordinates (default)

;2 = relative coords to the client area of the active window

I have used that trick with my first script, but if I have a lot of scripts it will be a dirty and hard job B)

Thanks again for that you have understood my poor english!

Link to comment
Share on other sites

Thanx herewasplato. :o Ya, I've got the new Scite, but didn't know about the AU3Recorder.

@bequi : Sorry! Slight confusion! Obviously I was looking at a completely different program (with a similar name). B)

Hi Mikey!

I think we use the same AutoIt (is there another one?). If you use the adapted Scite version to Autoit (available at the autoIt site, too), you will get AutoItInfo unter the menu Tools, AutoItRecorder too.

Link to comment
Share on other sites

  • 1 year later...

@Mikey,

The AutoItRecorder that beiqi is talking about is part of the SciTE Editor enhancements. It is called AU3Recorder in the distribution that I have... perhaps it has been renamed. SciTE4AutoIt3 is available here:

http://www.autoitscript.com/autoit3/scite/

Don't know about thing during the time this thread was posted/discussed. But there appears to be a different AutoIt Recorder now that is a separate project (not necessarily a spinoff?)

It's at:

http://sourceforge.net/projects/autoit-recorder/

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...