Jump to content

Recommended Posts

Posted

I'm kinda new to the whole scripting thing and im trying to make a script that holds the X key when i press ctrl+g and then press it again to make it stop. I don't even really know where to start. Also if possible I want to make it into a exe

Posted

So what did you try ?

Did you have a look at the documentation ?

I tried

Send("{x down}") ;Holds the x key down

Send("{x up}") ;Releases the x key"
 
and a few other lines of code i found on the forums but they were for different tasks and didn't work and documentation?
Posted
Global $run = False

HotKeySet("^g", "_start")

While 1
    Sleep(100)
WEnd

Func _start()

    $run = Not $run

    While $run
        If $run Then
            Send("{x down}")
        Else
            Send("{x up}")
        EndIf
    WEnd

EndFunc

Is this helps ? just compile it

Big thanks worked perfectly only thing I changed was the ^g because it was bugging out my keyboard when used that hotkey.

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
  • Recently Browsing   0 members

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