Jump to content

Holding a button down


Chaz
 Share

Recommended Posts

Hi, i am having trouble making my script hold the button down.

I want the script to hold down the button and hold it for a certain amount of seconds.

It is for a game to make it walk.

$timer = TimerInit()
Send("{UP down}")

While $timer < 8000
Sleep(10)
WEnd

Send("{UP up}")

Unfortunately, this doesn't work as all it does is press up, but it does not constantly press it.

To fix this, i've tried these:

$timer = TimerInit()

While $timer < 8000
Send("{UP}")
sleep(10)
WEnd

$timer = TimerInit()

While $timer < 8000
Send("{UP down}")
sleep(10)
Send("{UP up}")

WEnd

I was wondering if i am doing anything wrong. Thanks for your help in advance =).

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...