Takeshi Posted December 20, 2009 Share Posted December 20, 2009 (edited) Hello, I am trying to make my AutoIt script send a random key between 1 to 5. I have tried something along the lines of set $x = Random (1,5,1) Send ("{$x}") but that doesnt work. Please help. Edited December 20, 2009 by Takeshi Link to comment Share on other sites More sharing options...
danielkza Posted December 20, 2009 Share Posted December 20, 2009 'Inline' variable substitution is not enabled by default. The 'proper' way would be using the string concatenation operator: Send("{"&Random(1,5,1)&"}") In fact, from your example, I can infer you have not checked the documentation at all. There is no 'Set' keyword. To declare variables, you use Global, Local or Dim. Link to comment Share on other sites More sharing options...
Takeshi Posted December 20, 2009 Author Share Posted December 20, 2009 Thank you. In my autoit script, i haven't put set. I'm just use to typing set before a variable because of some other language. I havent made that mistake in my autoit scripts tho. Link to comment Share on other sites More sharing options...
TurionAltec Posted December 20, 2009 Share Posted December 20, 2009 Hello, I am trying to make my AutoIt script send a random key between 1 to 5. I have tried something along the lines of set $x = Random (1,5,1) Send ("{$x}") but that doesnt work. Please help. $x = Random (1,5,1) Send ($x) 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