Jump to content

Variable & ControlSend


Recommended Posts

Hello out there!

I'm having some troubles here making a script

What this is supposed to do is that it has to find a random number between 1 and 4 and if the number is 3 it'll hold down the key what's inside the variable '$Text' but i can't make it work with a variable

$button = random(1,4,1)
$Text = "W"
If $button = 3 Then
    ControlSend("WindowTitle", '', '', "{$Text Down}")
    Endif

it works without the variable as shown below but in order to make this script work properly i need ControlSend to work with a variable

ControlSend("WindowTitle", '', '', "{W Down}")

Any help would be appreciated

Edited by Tyranlol
[u]Only by Attempting the Impossible You Can Earn the Remarkable[/u]
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...