nikooo1608 Posted April 25, 2020 Share Posted April 25, 2020 Hey everybody, this is my HotKeySet Code: HotKeySet("{NUMPAD0}", "_theFunctionToCall") And this is my function: Func _theFunctionToCall() While 1 $rd_time += 1 ConsoleWrite("testing code") If $rd_time > 200 Then ExitLoop EndIf WEnd EndFunc ;==>_theFunctionToCall Obviously my code is different. In my original code: in the while loop a label is changed in a gui (a kind of randomizer) .. The problem is that the script ends after about 200 milliseconds. if I call the function normal, everything is fine, but if I call the function via the hotkey, I can start it again if I just press the hotkey again. Is there any easy method to bypass this? So that you can't call the function again (via hotkey) while the function is already running? Maybe like a HotKeyReset? SouzaRM 1 Link to comment Share on other sites More sharing options...
nikooo1608 Posted April 25, 2020 Author Share Posted April 25, 2020 Fixed it by myself. HotKeySet("{NUMPAD0}", "_theFunctionToCall") Func _theFunctionToCall() HotKeySet("{NUMPAD0}") ;reset hotkey While 1 $rd_time += 1 ConsoleWrite("testing code") If $rd_time > 200 Then HotKeySet("{NUMPAD0}", "_theFunctionToCall") ;set hotkey again before exit ExitLoop EndIf WEnd EndFunc ;==>_theFunctionToCall SouzaRM 1 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