Wonderbread Posted August 7, 2009 Share Posted August 7, 2009 Global $Paused HotkeySet("{F6}", "TogglePause") HotkeySet("{F5}", "Start") Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Start() While 1 WinActivate("Title Removed") $RandomW = Random(1,700) $RandomH = Random(1,767) Sleep(5) MouseClick("left",$RandomW,$RandomH) Sleep(5) WEnd EndFunc While 1 Sleep (1) WEnd That's my code so far. I'm trying to get it to only click inside of a certain window, the one thats title I've removed. I've read through docs. but the only one I can find is ControlClick - but I don't want to click on a certain piece of text - just a random pixel within the window. Basic info, yes. If you need more just ask. Link to comment Share on other sites More sharing options...
GEOSoft Posted August 7, 2009 Share Posted August 7, 2009 Func Start() While 1 WinActivate("Title Removed") WinWaitActive("Title Removed") $RandomW = Random(1,700) $RandomH = Random(1,767) Sleep(5) MouseClick("left",$RandomW,$RandomH) Sleep(5) WEnd EndFunc Also remember that those sleeps are in miliseconds and 5/1000 of a second is not very long George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Wonderbread Posted August 7, 2009 Author Share Posted August 7, 2009 Func Start() While 1 WinActivate("Title Removed") WinWaitActive("Title Removed") $RandomW = Random(1,700) $RandomH = Random(1,767) Sleep(5) MouseClick("left",$RandomW,$RandomH) Sleep(5) WEnd EndFunc Also remember that those sleeps are in miliseconds and 5/1000 of a second is not very long Cheers. Testing it now. Thanks for the info about sleep, by the way. I've been working in python lately, only came back to Autoit a day or two ago, It's "time.sleep(Seconds)" in python. Link to comment Share on other sites More sharing options...
GEOSoft Posted August 7, 2009 Share Posted August 7, 2009 Cheers. Testing it now. Thanks for the info about sleep, by the way. I've been working in python lately, only came back to Autoit a day or two ago, It's "time.sleep(Seconds)" in python.Common transitional mistake. In AutoIt it's Sleep(5000). George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now