Register for your free account! | Forgot your password?

You last visited: Today at 02:40

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Bug

Discussion on Bug within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2010
Posts: 20
Received Thanks: 2
Bug

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!
muofek is offline  
Old 06/11/2013, 13:38   #2
 
YatoDev's Avatar
 
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
use MouseClick
YatoDev is offline  
Old 06/11/2013, 14:10   #3
 
elite*gold: 0
Join Date: May 2010
Posts: 20
Received Thanks: 2
Quote:
Originally Posted by »FlutterShy™ View Post
use MouseClick
Thanks for the reply, but I want to keep clicking even if it's minimized (or hidden) cause I wanna do something else in the meantime. Mouse Click won't click on a hidden window..
muofek is offline  
Old 06/14/2013, 21:16   #4

 
.yorliK's Avatar
 
elite*gold: 0
Join Date: Nov 2011
Posts: 1,448
Received Thanks: 1,257
hmm, i tested your Script with the Window "Firefox" and its clicking. I dont know how many times but it clicks more than one. I changed it to "right" click and I think I saw 1000 clicks but very very fast.
I think you want, that it click 1000 times until you stopp it.

I add a WhileLoop and a HotKey to Exit that Script. It just click "left" much times until you stopp it, with the Hotkey [ESC] or in the taskbar.
Code:
HotKeySet("{ESC}", "_exit")

Opt("WinTitleMatchMode", 2)
$Title = Saga"
$Full = WinGetTitle($Title)
$HWnD = WinGetHandle($Full) 
$iButton = "left"
$iClicks = 1
$iX = 200 ; X Pos
$iY = 400 ; Y Pos

Global $click = True

While $click 
   If IsHWnD($HWnD) And WinExists($Full) <> 0 Then
	  ControlClick($HWnD, "", "", $iButton, $iClicks, $iX, $iY)
   EndIf
Wend

Func _exit()
  $click = False
EndFunc
.yorliK is offline  
Reply




All times are GMT +1. The time now is 02:41.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.