Jump to content
Sign in to follow this  

Using sleep with a condtion

Recommended Posts


Hey all,

I've tried this and when it gets to a sleep statement with the lag in there is just hangs. Is it not possible to do this?

NVM - got it to work like this.

Global $Lag

$Lag = 200

$hSlider = GUICtrlCreateSlider(25, 110, 250, 20, BitOR($TBS_TOOLTIPS, $TBS_AUTOTICKS, $TBS_ENABLESELRANGE))
GUICtrlSetLimit(-1, 300, 100)
GUICtrlSetData($hSlider, $lag)
GUICtrlCreateLabel("Lag adj", 280, 110)

$lag = Int(GUICtrlRead($hSlider))
If $lag > 300 Or $lag < 100 Then
    $lag = 200

Sleep(5000) ; this and the line below work

Sleep(5000 & $Lag) ; this did not work and where I was hanging
Edited by Cuervo


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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.