Jump to content
Sign in to follow this  
Tyranlol

Variable & ControlSend

Recommended Posts

Tyranlol

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]

Share this post


Link to post
Share on other sites
omikron48

You're doing it wrong...

ControlSend("WindowTitle", '', '', "{" & $Text & " Down}")

Share this post


Link to post
Share on other sites
Tyranlol

You're doing it wrong...

ControlSend("WindowTitle", '', '', "{" & $Text & " Down}")

Thanks buddy, working perfectly

[u]Only by Attempting the Impossible You Can Earn the Remarkable[/u]

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.