pasqui

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

4 posts in this topic

#1 ·  Posted

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



#2 ·  Posted

@pasqui what are you trying to accomplish? There are bound to be better ways of doing it than with constant mouseclicks.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#4 ·  Posted

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