Jump to content
pasqui

Help for easy script to click a button every 1 hour and start/stop

Recommended Posts

pasqui

Hi all,

Can you please help me with a simple script? It's for click automatically a button every 1 hour. I have this code:

HotKeySet("+s", "Start")
HotKeySet("{x}", "_Exit")

While 1
sleep(1000)
mouseClick("left",326,346,1)
sleep(60 * 60 * 1000)
WEnd

Func _Exit()
    Exit
EndFunc

 

I would like decide when start and when stop the script (on my Tablet with Windows 10), but Shift+s ("+s" code) doesn't work to me. Exit with "x" key only, instead, works.

When I click on "Run Script", script runs instantly, but I want choose when, pressing Shif+s.

 

Thank you in advance

Share this post


Link to post
Share on other sites
ViciousXUSMC

Rather than the long sleep period where the script will be non responsive.

I think a timer or adlibregister is a better way to go.

HotKeySet("+s", "_Start")
HotKeySet("{x}", "_End")
HotKeySet("{ESC}", "_Exit")

While 1
    Sleep(10)
WEnd

Func _Start()
    AdlibRegister("_Click", 60*60*1000)
EndFunc

Func _End()
    AdlibUnRegister("_Click")
EndFunc

Func _Click()
    MouseClick("Left", 326, 346, 1)
EndFunc

Func _Exit()
    Exit
EndFunc

 

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

×