shrapnel2038 Posted September 6, 2011 Share Posted September 6, 2011 Hey, everyone. I have been trying to find an answer to this question for a while now and decided to make an account. Sorry if this is an easy one, I'm new to programming in general. The script I am writing involves pressing the down arrow a random number of times. I have tried a few different ways I could think of, but none of them have worked. Right now I have: $var3=Random(1,12,1) Send("{DOWN}") I have tried fitting $var3 somewhere in the send command, but it hasn't seemed to work for me. Thanks in advance for the help! Link to comment Share on other sites More sharing options...
JohnOne Posted September 6, 2011 Share Posted September 6, 2011 There are at least a couple of ways to do it. The first in these examples can be seen in the helpfile under the Send() function, so I suggest you pay a little more attention to that wonderful resource for future problems. $var = Random(1,12,1) Send("{DOWN " & $var & "}"); use the variable in the function call Sleep(2000) For $i = 1 To $var ; use it in a loop Send("{DOWN}") Next AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
shrapnel2038 Posted September 6, 2011 Author Share Posted September 6, 2011 Thanks JohnOne. I feel really stupid right now because I saw the first way in the help file, I just didn't realize what the whole break in quotes did... Yay for late night programming Link to comment Share on other sites More sharing options...
JohnOne Posted September 6, 2011 Share Posted September 6, 2011 lol Glad you got sorted. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Blue_Drache Posted September 6, 2011 Share Posted September 6, 2011 Concatenate is your friend and is very helpful in combining variables into commands, strings, and whatnot. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache 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