John404 Posted May 7, 2012 Posted May 7, 2012 (edited) How would I make AutoIt3 input a random send command? For example Send("{RANDOM}") (just an idea) Send("{RANDOM}") Send("{RANDOM}") Send("{RANDOM}") The outcome would be ojq (random keys) Are there any methods for doing something like this? Basically I want it to come up with a randomly generated letter and send it Help? Thanks. I got it to work with numbers, but not letters... which is what I need. Edited May 7, 2012 by John404
Andreik Posted May 7, 2012 Posted May 7, 2012 Something like this? Send(RandomKeys(8)) ;Send 8 random chars Func RandomKeys($iLen=1) Local $Result Local $aChars = StringSplit("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789","") For $Index = 1 To $iLen $Result &= $aChars[Random(1,$aChars[0],1)] Next Return $Result EndFunc
JohnOne Posted May 7, 2012 Posted May 7, 2012 use your number code, and work in Chr() function. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
John404 Posted May 7, 2012 Author Posted May 7, 2012 Something like this? Send(RandomKeys(8)) ;Send 8 random chars Func RandomKeys($iLen=1) Local $Result Local $aChars = StringSplit("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789","") For $Index = 1 To $iLen $Result &= $aChars[Random(1,$aChars[0],1)] Next Return $Result EndFunc Thank you. @JohnOne Yeah that helped! /sarcasm
JohnOne Posted May 7, 2012 Posted May 7, 2012 Thank you. @JohnOne Yeah that helped! /sarcasm I'm afraid your sarcasm is rather poor, it's unneeded anyway. If you can send random numbers, then you can send a random character ( Chr() ) Send(Chr(Random(65,90,1))) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
czardas Posted May 8, 2012 Posted May 8, 2012 @JohnOne Yeah that helped! /sarcasmHave you thought of using an infinite number of monkeys? operator64 ArrayWorkshop
kylomas Posted May 8, 2012 Posted May 8, 2012 @czardas, Get it right... A random number of monkeys hitting an infinite number of keys will produce "Scripting for Dummies" within a millenium. Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill
Moderators JLogan3o13 Posted May 8, 2012 Moderators Posted May 8, 2012 Thank you.@JohnOne Yeah that helped! /sarcasmNo better way to ensure you will receive no further assistance "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
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