Xibalba Posted January 26, 2011 Share Posted January 26, 2011 For (5) Send("{a down}") Sleep(200, 2000, 1) Send("{a up}") Send({ENTER}) Next In notepad, the result is always: a a a a a When I expect something like this (depending on key delay in OS): aaa a aa aa aaa Have I missed something or why isn't some of the a's repeated? Link to comment Share on other sites More sharing options...
somdcomputerguy Posted January 26, 2011 Share Posted January 26, 2011 Sleep has no 'random' abilities built into it. Check the Random() function in the docs. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Xibalba Posted January 26, 2011 Author Share Posted January 26, 2011 Sleep has no 'random' abilities built into it. Check the Random() function in the docs. Yeah ok, I cheated. I didn't post my working code, since I'm fairly sure it isn't any syntax problem. For the sake of it, I'm using a correct For-loop as well as this: $delay = Random(200, 2000, 1) Sleep($delay) Question in OP remains. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted January 26, 2011 Share Posted January 26, 2011 Try then increasing the range, say, 100 to 3500, that may help things. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Xibalba Posted January 26, 2011 Author Share Posted January 26, 2011 Try then increasing the range, say, 100 to 3500, that may help things.If I type with my own keyboard chars gets repeated after like 600ms... anyone? Link to comment Share on other sites More sharing options...
Xibalba Posted January 26, 2011 Author Share Posted January 26, 2011 Not even this works: Opt("SendKeyDownDelay", 3300) Send("b") Only one b is printed (in notepad) Can't find more info about this by searching either. halp Link to comment Share on other sites More sharing options...
somdcomputerguy Posted January 26, 2011 Share Posted January 26, 2011 Maybe do it like this.. For $i = 1 To 5 $keys = Random(1, 10, 1) $delay = Random(200, 2000, 1) For $j = 1 To $keys Send("{a}") Next Send("{ENTER}") Sleep($delay) Next - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. 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