Sign in to follow this  
Followers 0
j-p

have a hotkey script to stay active

3 posts in this topic

Hi,

I've defined some hotkeys for my convenience :whistle: (really simple, they just start some progs)

Well, but how to keep that little script active, probably I could Sleep(100000000000000000) but there should be a better way.

any help would be appreciated

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi,

I've defined some hotkeys for my convenience :whistle: (really simple, they just start some progs)

Well, but how to keep that little script active, probably I could Sleep(100000000000000000) but there should be a better way.

any help would be appreciated

While 1
    Sleep(10000)
WEnd
It's a loop, just put it after your hotkeys. Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Just to clarify smoke_n

;Hotkeys come first
HotKeySet("{Key1}","Function1")
HotKeySet("{Key2}","Function2")

;Loop to make the script stay active
While 1
     Sleep(1000)
WEnd

;Functions to call with Hotkeys
Func Function1()
;Do whatever
EndFunc

Func Function2()
;Do whatever again
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
Sign in to follow this  
Followers 0