Sign in to follow this  
Followers 0
RaoulKent

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

3 posts in this topic

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

Share this post


Link to post
Share on other sites



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.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
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!

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