Chaz Posted January 8, 2006 Share Posted January 8, 2006 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 More sharing options...
greenmachine Posted January 8, 2006 Share Posted January 8, 2006 $timer = TimerInit() Do Send ("{UP}") $Diff = TimerDiff ($timer) Until $Diff > 8000 Sure, that doesn't hold it, but it sure presses it fast. Link to comment Share on other sites More sharing options...
Chaz Posted January 8, 2006 Author Share Posted January 8, 2006 (edited) That does the same thing as the While statement, I'll give it a shot though Edit: nvm stupid mistake, thanks everyone i fixed it Edited January 8, 2006 by Chaz Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now