brett Posted April 29, 2004 Share Posted April 29, 2004 how would i make my program pause until a certain key - or key combination - that is randomly generated, is pressed? -Brett Link to comment Share on other sites More sharing options...
trids Posted April 29, 2004 Share Posted April 29, 2004 1. Click here2. Under Search by Keywords, type pause3. Press the button marked "Perform the search".This will search the Support forum for similar requests, and might give you quite a few ideas.Hope this helps Link to comment Share on other sites More sharing options...
ezzetabi Posted April 29, 2004 Share Posted April 29, 2004 Or simply Func RandomSleep($PauseMin,$PauseMax) Local $Pause If $PauseMin <= $PauseMax Then $Pause = Int(Random($PauseMin,$PauseMax + 1)) * 1000 Sleep($pause) EndIf EndFunc;<== RandomSleep End Append this at the end of your source and call the random pause as function. Link to comment Share on other sites More sharing options...
brett Posted April 29, 2004 Author Share Posted April 29, 2004 i dont mean that it is paused for a random amount of time, i mean that it is paused until a certain key is pressed...for example the random key it generates is "W", so this would pause until "W" is pressed. -Brett Link to comment Share on other sites More sharing options...
Goutetsu Posted April 30, 2004 Share Posted April 30, 2004 I'm new to AutoIt, so you'll have to make due with partial code: You fill an array with strings of the keys you want to be randomly chosen. Where n is number of keys you wish to choose from: Dim $array[n] $array[0] = "B" $array[1] = "{DOWN}" ... ... $array[n] = "{ESC}" Then generate a random number between 0 and n: Dim $rn = Int(Random() * n) then set a hot key HotKeySet($array[$rn], "hotkeyfunc") 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