bennyvo Posted October 27, 2005 Share Posted October 27, 2005 hello. can someone tell me if this is possible or impossible. If something is true THEN do it Else Delay 5 seconds The code should work fine, however i would like it to be like this. If something is true THEN do it, else, Delay 5 seconds, but during that 5 second, if something is true, i want it to do it right away. Lets say something is False, now it delay 5 seconds, but then it just delay for 2 seconds then something True, so now i want it to do it right away, it must skip that 3 remaining seconds. i hope i make some sense to you. can somebody tell me if its possible or not. thanks in advance Link to comment Share on other sites More sharing options...
Shibuya Posted October 27, 2005 Share Posted October 27, 2005 (edited) something like this? While 1 If [your condition] THEN [your actions] ExitLoop Else Sleep(500) EndIf WEnd Edit: Missed out your conditions a while loop with a cobination of if-else statement should do the trick added the 0.5sec delay Edited October 27, 2005 by Shibuya The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!" Link to comment Share on other sites More sharing options...
bennyvo Posted October 27, 2005 Author Share Posted October 27, 2005 i know that script and its doesn't what i need. lets say it start to sleep 5000, after 5000 then it will come back to the If [your condition] THEN that's normal. what i need is even sleep 5000 is not complete yet, as long as If [your condition] is TRUE THEN [your actions] if perform. Link to comment Share on other sites More sharing options...
bennyvo Posted October 27, 2005 Author Share Posted October 27, 2005 can you post that while loop too? Link to comment Share on other sites More sharing options...
Shibuya Posted October 27, 2005 Share Posted October 27, 2005 (edited) i know that script and its doesn't what i need.lets say it start to sleep 5000, after 5000 then it will come back to theIf [your condition] THENthat's normal.what i need is even sleep 5000 is not complete yet, as long as If [your condition] is TRUE THEN [your actions] if perform.can you elaborate more?what is your condition?i suppose you want to quit your script when the 5sec is up?$count = 1 While 1 If [your condition] THEN [your actions] ExitLoop Else Sleep(500) If $count = 5 Then Exit Else $count = $count + 1 EndIf EndIf WEnd Edited October 27, 2005 by Shibuya The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!" Link to comment Share on other sites More sharing options...
bennyvo Posted October 27, 2005 Author Share Posted October 27, 2005 i think i make my own problem. While 1 If [start] THEN [Jump] Else Stay Still EndIf WEnd i put in the delay that make me confuse, if i didn't put in the delay then it exactly what i need. so it will jump when [start] is true, else it stay still waiting for [start] to be true then it jump again, and it stay still when [start] is false...and so on... thanks for your help. Link to comment Share on other sites More sharing options...
Shibuya Posted October 27, 2005 Share Posted October 27, 2005 While 1 If [START] Then ExitLoop WEnd [Jump] are you waiting for an window/application to start? what you might be looking for could be WinWaitActive or ProcessWait The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!" Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now