Jump to content

Three questions


Recommended Posts

Okay, so I'm relatively new to AutoIt, but I know a decent amount. So here's my questions:

1) Is there a line I could use to alert the x pos and y pos of my mouse position when I click somewhere?

2) How exactly do I simulate a button click? Like if I wanted to replicate the user hitting the letter "A" (as a capital) what would I put?

3) Referring back to #1, if I clicked in a textbox, how would I input a string into that textbox?

I used the help feature, but I have no idea what I need.

Link to comment
Share on other sites

  • Moderators

Okay, so I'm relatively new to AutoIt, but I know a decent amount. So here's my questions:

1) Is there a line I could use to alert the x pos and y pos of my mouse position when I click somewhere?

2) How exactly do I simulate a button click? Like if I wanted to replicate the user hitting the letter "A" (as a capital) what would I put?

3) Referring back to #1, if I clicked in a textbox, how would I input a string into that textbox?

I used the help feature, but I have no idea what I need.

Yes, very basic... It's in the RTFM group of basics :) (I want to do something with my mouse) ;) Mouse* function in the help file

Edit:

Also, you are not making any sense in 2).

"Button Click" which would be ControlClick() in AutoIt, but then go on to explain it as hitting the letter "A" as a captial... That would be Send() or ControlSend()...

So what is it, Click or Send?

Edit2:

Oh... P.S. Welcome to the forum. :P

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I have no idea what I need.

Neither do I man... :)

1) MouseGetPos() maybe combined with _IsPressed():

#include <Misc.au3>
While 1
    If _IsPressed(01) Then
        $Pos=MouseGetPos()
        MsgBox(0,"","Mouse postition: "&$Pos[0]& " " & $Pos[1])
    EndIf
WEnd

2) I don't understand... you want to click on a buttong? How bout MouseClick() and MouseMove() and also ControlClick()

3)Send(); ControlSetText()

Link to comment
Share on other sites

1)

#include <misc.au3>
While 1
If _IsPressed( 01 ) Then
    $MousePos = MouseGetPos()
    $MouseClickPOSX = $MousePos[0]
    $MouseClickPOSY = $MousePos[1]
    While _IsPressed( 01 )
        Sleep(10)
    WEnd
    $MousePos = MouseGetPos()
    $MouseReleasePOSX = $MousePos[0]
    $MouseReleasePOSY = $MousePos[1]
    MsgBox(0, "Mouse Test", "Mouse Click At:" & @CRLF & "X POS: " & $MouseClickPOSX & " ---- " & "Y POS: " & $MouseClickPOSY & @CRLF & @CRLF & "Mouse Released At:" & @CRLF & "X POS: " & $MouseReleasePOSX & " ---- " & "Y POS: " & $MouseReleasePOSY)
EndIf
    Sleep(10)
WEndoÝ÷ Ûf®¶­se6VæBgV÷C´gV÷C²

EDIT: posted 2 and 3 in the same code box

Edited by danwilli
Link to comment
Share on other sites

  • Moderators

You two (nahuel/danwilli) just reminded me of 2 chinese proverbs:

A book holds a house of gold.

Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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