ItsR Posted September 1, 2010 Share Posted September 1, 2010 Hi everyone great forum you have here, I'm having a bit a trouble though what I want autoit to do is send a random keypress out of like 4 selected keys so for example: space, w, s, d, a and it would randomly pick one Would the code be someting like this: Send((Random({"w" "s" "d" "a"}))) or am I completely off here? sorry if its completely wrong still learning any help would be appreciated Link to comment Share on other sites More sharing options...
kaotkbliss Posted September 1, 2010 Share Posted September 1, 2010 Wow, those look a lot like movement keys (wasd) but assuming they are not and it was just a poor example... $key=Random(1,5,1) if $key=1 then send("w") elseif $key=2 then send("a") elseif $key=3 then send("s") elseif $key=4 then send("d") elseif $key=5 then send("{SPACE}") endif that will only run once, to make it run more than that it needs to go into a function being called from the main script when needed, or put in a loop Also you could use switch...case instead of if...esleif 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
ItsR Posted September 1, 2010 Author Share Posted September 1, 2010 Thanks that's exactly what I need. Thankyou very much for your help 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