Hidden Posted May 4, 2012 Share Posted May 4, 2012 (edited) I have read the help file for it but it didn't really help me out too much... I'm very new to Autoit... A long time ago I used to make more complex things on it but that was years ago and have forgotten everything, so for now I'm basically a 1 day old user... What I'm trying to do: While minimized... I'd like my script to click in the last spot I left the mouse every .2 of a sec... Pretty much the middle of the screen. Every 3 minutes, I'd like the script to stop clicking, press "9", hold right click for 3 seconds, release press "5" and continue on clicking where the mouse was left off (middle of screen). Now, Controlclick seemed quite complicated in the sense that it asked for an ID and such, but I don't need it to click a button, just the 1 spot. What made sense to me and I tried, but didn't work... Global $nine = 1 Winactivate("Entered title here") If $nine = 1 then Controlclick("Entered title here", "", "", "left", "1") Sleep(200) Elseif $nine = 2 then ControlSend("Entered title here", "", "", "9") Sleep(300) MouseDown("right") Sleep(3000) MouseUp("right") Sleep(200) ControlSend("Entered title here", "", "", "5") Sleep(300) $nine = 1 Endif While 1 = 1 Sleep(180000) $nine = 2 EndW Since that didn't work, i tried the top part again under: Winactivate("Entered title here") While 1 = 1 Controlclick("Entered title here", "", "", "left", "1") Sleep(200) EndW And then set the second part as... While 2 = 2 Sleep(180000) ControlSend("Entered title here", "", "", "9") Mousedown("right") Sleep(3000) MouseUp("right) ControlSend("Entered title here", "", "", "5") EndW Now on the second part, I wasn't sure if the sleep wouldn't clash but I tried and well it didn't work regardless. As I said... Massive noob, I'm probably nowhere near down the right path but I thought I'd ask. Edited May 4, 2012 by Hidden Link to comment Share on other sites More sharing options...
stormbreaker Posted May 4, 2012 Share Posted May 4, 2012 Just a spot. See MouseClick() in the help file. ---------------------------------------- :bye: Hey there, was I helpful? ---------------------------------------- My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1 Link to comment Share on other sites More sharing options...
Hidden Posted May 4, 2012 Author Share Posted May 4, 2012 Just a spot. See MouseClick() in the help file. I think I kinda know the function... Because I can't use it while minimized, I've dumbed it down hardcore to this: While 1 = 1 Mouseclick("left") Sleep(183) Mouseclick("left") Sleep(190) Mouseclick("left") Sleep(187) Mouseclick("left") Sleep(197) WEnd Which works while not minimized... Could you kindly point me towards which part of MouseClick I should be concentrating on? Link to comment Share on other sites More sharing options...
stormbreaker Posted May 4, 2012 Share Posted May 4, 2012 (edited) Use this: $controlID = "[TEXT:btntext]" ControlClick( "Window Title", "Window text", $controlID) Using ControlSend won't make sense, as it changes the control text. Edited May 4, 2012 by MKISH ---------------------------------------- :bye: Hey there, was I helpful? ---------------------------------------- My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1 Link to comment Share on other sites More sharing options...
Hidden Posted May 4, 2012 Author Share Posted May 4, 2012 As I said... Please treat me like a 1 day noob. I have no idea if I have to change anything bar the window title in there. Window text? It doesn't have any text. btntext... No buttons. ControlSend I used as part of pressing the number 9, then 5. Is that not how you send keys to minimized programs? Link to comment Share on other sites More sharing options...
stormbreaker Posted May 5, 2012 Share Posted May 5, 2012 Check this: $TIMER = TimerInit() While 1 If IsInt(TimerDiff($TIMER)/180000) then ControlSend("Entered title here", "", "", "9") MouseDown("right") Sleep(3000) MouseUp("right") ControlSend("Entered title here", "", "", "5") else MouseClick("left") Sleep(200) EndIf WEnd ---------------------------------------- :bye: Hey there, was I helpful? ---------------------------------------- My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1 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