Jump to content

Some weird bug..


Recommended Posts

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

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

  • Moderators

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

But welcome to the AutoIt forum - and see you soon with a legitimate question I hope. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...