dkofek Posted June 11, 2013 Share Posted June 11, 2013 I've been playing around with autoit, trying to send a window left mouse clicks. So far I've gotten up to this 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! Link to comment Share on other sites More sharing options...
FireFox Posted June 11, 2013 Share Posted June 11, 2013 Hi, (also, need the delay for ingame purpose) Seems like you've missed the forum rules, particulary about the games automation; there is a link at the bottom right corner of each forum's page. Br, FireFox. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 11, 2013 Moderators Share Posted June 11, 2013 dkofek,FireFox is quite right - please read the Forum rules (the link is also at bottom right of each page) - particularly the bit about not discussing game automation - before you post again. Thread locked. But welcome to the AutoIt forum - and see you soon with a legitimate question I hope. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts