Kane49 0 Posted December 26, 2006 Okay, at first i'd like to say that im a total noob when it comes down to AutoIT, so i'd to not get scolded for the first mistake i made , unless of course im starting to get retarded *drop* So, my code looks like this CODESleep(11000); MouseClick("left",728,550,1,0); pretty simple, so now the Problem is that sometimes, even if under the exactly same preferences it won't click, just moves the mouse onto the right button and refuses to click O_o It seems totaly random, maybe i'd have to say that im trying to click a flashy button inside a c++ Application. Desperately hoping for Help Felix Share this post Link to post Share on other sites
herewasplato 2 Posted December 26, 2006 ...Problem is that sometimes, even if under the exactly same preferences it won't click,...Are you sure that the window of interest is active prior to the click? Not just visible, but active? Try adding a WinActivate and WinWaitActive line right before your MouseClick line.SleepWinActivate WinWaitActive MouseClickWelcome to the forum... Hide herewasplato's signature Hide all signatures [size="1"][font="Arial"].[u].[/u][/font][/size] Share this post Link to post Share on other sites
Kane49 0 Posted December 26, 2006 Thanks for the Help ^^ The Window was already active, a normal MouseClick() just wasnt recognized so i made my own MouseClickSecure(); CODEFunc MouseClickSecure() MouseDown("left"); Sleep(150); MouseUp("left"); EndFunc Seems like a normal mouse click was to short Oo, this may work for other apps too. Im not sure about the randomness though, something about process timing maybe ^^ Share this post Link to post Share on other sites
herewasplato 2 Posted December 27, 2006 Good work around. You might also want to look into the Opt setting for MouseClickDelay. According the help file, it:Alters the length of the brief pause in between mouse clicks.Time in milliseconds to pause (default=10).Placing this one Opt setting near the top if your script would make all of your MouseClicks like your function... or you could place it before and after the one MouseClick that did not work using the default 10ms. Hide herewasplato's signature Hide all signatures [size="1"][font="Arial"].[u].[/u][/font][/size] Share this post Link to post Share on other sites
Outshynd 1 Posted December 27, 2006 I think you mean Opt MouseClickDownDelay. MouseClickDelay alters the delay between clicks when clicking multiple times; MouseClickDownDelay sets the time between mouse_down and mouse_up. Opt("MouseClickDownDelay", 150) Makes all MouseClick()s like your MouseClickSecure() function. Share this post Link to post Share on other sites
herewasplato 2 Posted December 27, 2006 I think you mean Opt MouseClickDownDelay...You are correct. One would think that I would read what I copied/pasted/posted from the help file. It only goes to prove that I can be senile - "in the moment" - as it were.Thanks for the correction, hopefully the OP will stop back by. Hide herewasplato's signature Hide all signatures [size="1"][font="Arial"].[u].[/u][/font][/size] Share this post Link to post Share on other sites
Outshynd 1 Posted December 27, 2006 At least you're backed up by your member title! Share this post Link to post Share on other sites