zamzam27 Posted May 15, 2010 Posted May 15, 2010 sorry stupid question and really simple answer but whats wrong with this code? Func start HotKeySet("c", click) $x=-1 Func click() $x=$x*-1 endfunc while $x=1 MouseClick("left",740, 400, 1,1000) Wend EndFunc trying to make it click rapidly when i press c and stop clicking when i press c again
dantay9 Posted May 15, 2010 Posted May 15, 2010 (edited) Make sure you use code \code tags when posting code. You have a few problems. Firstly, you can't have a function within a function. Take a look at this code. ;set the hotkey so when you press c, click() is called HotKeySet("c", "click") ;make a variable and set it to false $x = False ;wait until x is true which means c was pressed Do Until $x = True ;while x is true, click in a spot on the screen While $x = True MouseClick("left", 740, 400, 1, 1000) WEnd Func click() ;make x equal to the opposite of what it was $x = Not $x EndFunc ;==>click Edited May 15, 2010 by dantay9
zamzam27 Posted May 15, 2010 Author Posted May 15, 2010 Make sure you use code \code tags when posting code. You have a few problems. Firstly, you can't have a function within a function. Take a look at this code. ;set the hotkey so when you press c, click() is called HotKeySet("c", "click") ;make a variable and set it to false $x = False ;wait until x is true which means c was pressed Do Until $x = True ;while x is true, click in a spot on the screen While $x = True MouseClick("left", 740, 400, 1, 1000) WEnd Func click() ;make x equal to the opposite of what it was $x = Not $x EndFunc ;==>click thanks
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