Sign in to follow this  
Followers 0
chii

need my script to run in the background

4 posts in this topic

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! :)

Share this post


Link to post
Share on other sites



#2 ·  Posted (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")

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! :)

Funk Plank()

Controlclick("title of window","","Name of control")

sleep("3000")

EndFunc

Edited 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

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 functions

func macroThirst($color)

$color = PixelGetColor (56, 383)

$color1 = PixelGetColor (50, 375)

Thirst($color)

life($color1)

Plank()

macroThirst($color)

EndFunc

Func 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)

EndIF

EndFunc

Func life($color1)

If $color1=15526360 Then

Terminate()

Else

Sleep(500)

EndIF

EndFunc

Func Plank()

MouseClick("left", 69 , 62, 1)

Sleep("3000")

EndFunc

Basically, 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 by chii

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0