Jump to content

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


Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

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

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

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

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...