Jump to content

Recommended Posts

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

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

 

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
  • Recently Browsing   0 members

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