I've been playing around with autoit, trying to send a window left mouse clicks.
So far I've gotten up to this code:
Code:
Opt ("WinTitleMatchMode",'2') ; Helps With Getting The Window Information...
$Title = "Saga" ; The Name Of The Game...
$Full = WinGetTitle ($Title) ; Get The Full Title..
$HWnD = WinGetHandle ($Full) ; Get The Handle
$iButton = 'left' ; Button The Mouse Will Click I.E. "Left Or Right"
$iClicks = '1000' ; The Number Of Times To Click
$iX = '200' ; The "X" Pos For The Mouse To Click
$iY = '400' ; The "Y" Pos For The Mouse To Click
msgbox(0,"hwnd",$hwnd);This line I had to enter..
If IsHWnD ($HWnD) And WinExists ($Full) <> '0' Then ; Win Check
ControlClick ($HWnD, '','', $iButton, $iClicks, $iX, $iY) ; Clicking The Window While Its Minmized
EndIf
source: autoit help
I ran the script, and it seemed like it did nothing... so I entered a msgbox to see if the handle is actually right, and it is.
After I clicked "ok" in the msgbox, there only one single click (better than nothing, right?)
So, I've a couple of questions about this script..
1. How can I make the script work without having to open a msgbox and click ok before it starts
2. How can I add a delay between the clicks in ControlClick, so it won't use all $iClicks right away and close? (also, need the delay for ingame purpose)
Thanks in advance for all your comments!