ItsR 0 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 Share this post Link to post Share on other sites
kaotkbliss 146 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 010101000110100001101001011100110010000001101001011100110010000001101101011110010010000001110011011010010110011100100001My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueekWe're gonna need another Timmy! Share this post Link to post Share on other sites
ItsR 0 Posted September 1, 2010 Thanks that's exactly what I need. Thankyou very much for your help Share this post Link to post Share on other sites