Jump to content

Hotkeyset a simple function - script not running for than a few ms


Go to solution Solved by FireFox,

Recommended Posts

HotKeySet("s", "reqjoin")
Func reqjoin()
        MouseClick("Secondary")
    Sleep(10)
    MouseMove(280, 834, 1)
    Sleep(10)
    MouseClick("Primary")
EndFunc   ;==>reqjoin 

This should be a relatively simple problem in basic logic, but I didn't know what to look for to solve my issue, so I thought I might ask people with more expertise!

Simply, when I run this script, it is very unhappy and just dies out the instant (only a few milliseconds of uptime) after I start it!

How do I prevent it from doing so, and stay online, able to receive hotkeypresses more than once, until the script is paused or shut down?

Thank you in advance,

Raoul

Link to comment
Share on other sites

  • Solution

Hi,

Welcome to the autoit forum :)

How do you expect something to run indefinitly if it has nothing to do?

You need to add an endless loop :

...

While 1
    Sleep(10)
WEnd

...

Please read the helpfile, if you did you would have seen that.

Br, FireFox.

Link to comment
Share on other sites

Hi,

Welcome to the autoit forum :)

How do you expect something to run indefinitly if it has nothing to do?

...

Please read the helpfile, if you did you would have seen that.

Br, FireFox.

Argh, of course.

Thank you very much for a speedy response.

I will make sure to make use of the helpfile!

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...