chii Posted March 16, 2008 Share Posted March 16, 2008 Hello. I've read the basics of AutoIt. I'm trying to make a macro that would press a button repeatedly. My code's simple. I let this loop. Func Plank() MouseClick("left", 69 , 62, 1) Sleep("3000") EndFunc My problem is, I want it to run while I can open other windows. With my current code, I have to let the client be activated. I can't use my computer anymore for surfing or other things. What do I add or how do I modify it to make it run in the background? Thank you! Link to comment Share on other sites More sharing options...
mmavipc Posted March 16, 2008 Share Posted March 16, 2008 (edited) Hello. I've read the basics of AutoIt. I'm trying to make a macro that would press a button repeatedly.My code's simple. I let this loop.Func Plank() MouseClick("left", 69 , 62, 1) Sleep("3000")EndFuncMy problem is, I want it to run while I can open other windows. With my current code, I have to let the client be activated. I can't use my computer anymore for surfing or other things.What do I add or how do I modify it to make it run in the background? Thank you! Funk Plank() Controlclick("title of window","","Name of control") sleep("3000")EndFunc Edited March 16, 2008 by mmavipc [size="10"]Pure Au3 crypt funcs(I'm currently also working on making a dll from this)[/size][Y] Be more active in the community[Y] Get 200 posts[N] Get 300 posts[N] Make a Topic in the example scripts forum with at least 50 replies.People who currently hate me:ValikSmOke_N Link to comment Share on other sites More sharing options...
Developers Jos Posted March 16, 2008 Developers Share Posted March 16, 2008 Funk ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
chii Posted March 16, 2008 Author Share Posted March 16, 2008 (edited) Funk ?Thank you! This pushed me into the right direction. I'm reading all about controls right now. Sorry, I'm not very well-versed with programming. ^^I have several additional functionsfunc macroThirst($color) $color = PixelGetColor (56, 383) $color1 = PixelGetColor (50, 375) Thirst($color) life($color1) Plank() macroThirst($color)EndFuncFunc Thirst($color) If $color=15526360 Then Sleep(25000) Send("6") Sleep(2000) Send("e") Sleep(2000) Send("4") Sleep(2000) Send("5") Sleep(2000) Else Sleep(1000) EndIFEndFuncFunc life($color1) If $color1=15526360 Then Terminate() Else Sleep(500) EndIFEndFuncFunc Plank() MouseClick("left", 69 , 62, 1) Sleep("3000")EndFuncBasically, I need to check my life and thirst. Life is just a box of color and thirst is also a box of color as well. At a certain pixel, I order it to pause clicking and drink a shake (e).I've read only a bit about controls so I'm still confused. What do I add to make the color check (if color is not equal to green and color1 is not equal to blue) work, even though the window is not active? A point in the right direction is very much appreciated. I'm thinking that I should use controlsend or controlcommand? Am I right?Thank you! Edited March 16, 2008 by chii 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