Jump to content

Mouseclick events


beans
 Share

Recommended Posts

Hello All,

My first message on the board!

Found Autoit and was amaised at its capabilities and simplicity but as a starter struggling at even simplest thing I am trying to create.

I made a small window with a button which is when clicked suppose to trigger two successive mouse clicks in different parts of the screen.

Just moving cursor was easy enough and it went precisely where I wanted it to go relative my Autoit button window.

When it came to adding clicks to the script a different story:after moving cursor to the needed location it would click, but after that cursor would move to a different location relative the screen (not my button window).

Anyone has any idea on how to do successive clicks on the screen relative the autoit window?

here is bit of sript:

---------------------------------------

#include <GUIConstants.au3>

GUICreate ("button clicks",220,50)

Opt("GUICoordMode",2)

$Button_1 = GUICtrlCreateButton ("activeate 1", 10, 10, 80)

GUISetState () ; will display an dialog box with button

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg = $Button_1

Opt("MouseCoordMode", 0)

MouseMove ( 50, 100 , 5 );move relative to window

Opt("MouseCoordMode", 0)

MouseClick ( "left" );click

MouseMove ( 100, 100 , 3 );move to to second location

EndSelect

Wend

-----------------------------------------

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