SirCountPotat Posted October 16, 2007 Posted October 16, 2007 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.
Moderators SmOke_N Posted October 16, 2007 Moderators Posted October 16, 2007 (edited) 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 fileEdit: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. Edited October 16, 2007 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.
Nahuel Posted October 16, 2007 Posted October 16, 2007 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()
DW1 Posted October 16, 2007 Posted October 16, 2007 (edited) 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 October 16, 2007 by danwilli AutoIt3 Online Help
Moderators SmOke_N Posted October 16, 2007 Moderators Posted October 16, 2007 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.
SirCountPotat Posted October 16, 2007 Author Posted October 16, 2007 Haha, Sorry I was unclear on #2. I meant a keystroke (kinda tired >_>). Thanks for the welcome Smoke, thanks for the help nahuel and danwilli.
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