Barfly Posted May 20, 2005 Share Posted May 20, 2005 (edited) I am not sure why this is not working. I am trying to select one of three options, each one has a shortcut that I am trying to send. The shortcuts are 'alt & a', 'alt & w' and 'alt & m'. I need to send this randomly. My script won't run with this piece of code, if I comment it out it is fine. I have even tried specifying different variable names, with no luck. Any ideas? $y = Random(1, 3, 1) If $y = 1 Then $x = "a" ElseIf $y = 2 Then $x = "w" ElseIf $y = 3 Then $radio = "m" EndIf Send("!" & $x & ") Edited May 20, 2005 by Katy Link to comment Share on other sites More sharing options...
MHz Posted May 20, 2005 Share Posted May 20, 2005 With a couple of minor changes, make work fine Working example $y = Random(1, 3, 1) MsgBox(0, '', $y) If $y = 1 Then $x = "f" ElseIf $y = 2 Then $x = "e" ElseIf $y = 3 Then $x = "o" EndIf Run('notepad') WinWaitActive('Untitled') Send("!" & $x); <-- Notice this Link to comment Share on other sites More sharing options...
Barfly Posted May 23, 2005 Author Share Posted May 23, 2005 With a couple of minor changes, make work fineWorking exampleSend("!" & $x); <-- Notice this<{POST_SNAPBACK}>Thanks alot. I finally found my error very late that night...I had changed one of my variable names when I 'Sent' it. :"> Thanks for the tips though I have been using this shorter method alot now . 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