josh77 Posted June 29, 2011 Share Posted June 29, 2011 (edited) hey guys im trying to create a script that repeats the key X as long as i hold the MOUSE1 button and stops when i release it... but im having a lot of trouble to create it ... can u guys help me out ??? i've managed to make a similar script but it only works whit space bar , im trying to modify it to repeat X while holding MOUSE1 ... #include <Misc.au3> #include <GUIConstantsEx.au3> $spacerepeat= 3 $spacerepeatdelay= 100 $hgui= GUICreate("send space app", 200, 60) GUISetState();shows the gui window do $guimsg= GUIGetMsg() if _IsPressed("20") Then for $i=0 to $spacerepeat-1 $timer= TimerInit() while TimerDiff($timer)<$spacerepeatdelay wend send("{space}") next endif until $guimsg= $GUI_EVENT_CLOSE what im doing wrong , or what should i do ?? thanks guys . Edited June 29, 2011 by josh77 Link to comment Share on other sites More sharing options...
JohnOne Posted June 29, 2011 Share Posted June 29, 2011 "what im doing wrong" You are sending space, when you want to sen x AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Tvern Posted June 29, 2011 Share Posted June 29, 2011 And _IsPressed("20") checks for space, rather than MOUSE1 Link to comment Share on other sites More sharing options...
josh77 Posted June 29, 2011 Author Share Posted June 29, 2011 im rather new to scripting and i still cant make it work , i changed something but ii still dont work =[ #include <Misc.au3> #include <GUIConstantsEx.au3> $xrepeat= 3 $xrepeatdelay= 10 $hgui= GUICreate("send x app", 200, 60) GUISetState();shows the gui window do $guimsg= GUIGetMsg() if _IsPressed("20") Then for $i=0 to $xrepeat-1 $timer= TimerInit() while TimerDiff($timer)<$xrepeatdelay wend send MouseClick( "Left" ) next endif until $guimsg= $GUI_EVENT_CLOSE i made some changes and i feel like i made it worse ... still can make a proper macro that repeats X while i hold MOUSE1 , can someone help me out ??? btw thanks for answers i got so far =] Link to comment Share on other sites More sharing options...
JohnOne Posted June 29, 2011 Share Posted June 29, 2011 if _IsPressed("01") Then AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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