Sign in to follow this  
Followers 0
Barfly

Random problems

3 posts in this topic

#1 ·  Posted (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 by Katy

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

With a couple of minor changes, make work fine

Working example

Send("!" & $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 :(.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0