Guest 2n193r Posted July 1, 2005 Posted July 1, 2005 (edited) I want it so that when ever the use was to hold a key down it woudl constantly do a left mouse click. I wanted this to work in any program. ex. A computer game. My idea $k = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "SwapMouseButtons") While;missing code If $k = 1 Then MouseClick("left") Else MouseClick("right") Sleep(33) EndIf Wendhaha, this looks like a programming test. Errr, i want Java, but i cant do it. any help would be very much appreciate. Edited July 1, 2005 by 2n193r
nobby Posted July 1, 2005 Posted July 1, 2005 $k = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "SwapMouseButtons") While 1 If $k = 1 Then MouseClick("left") Else MouseClick("right") Sleep(33) EndIf Wend CheersNobby
Guest 2n193r Posted July 1, 2005 Posted July 1, 2005 i dont want it to click all the time, just when.. lets see mouse3(middle mouse button is pushed)
therks Posted July 1, 2005 Posted July 1, 2005 Have a look at the IsPressed UDF (link in my sig), it might give you some ideas. My AutoIt Stuff | My Github
Valuater Posted July 1, 2005 Posted July 1, 2005 This will do what you want #include <GuiConstants.au3> Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") call("TogglePause") While 1 MouseClick("left") sleep(20) WEnd Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc just press "Pause" (you do not need to hold it down) the script will send continuous mouse clicks press"Pause" again and it will stop press "Esc" and the script will terminate Hope that helps... 8)
Guest 2n193r Posted July 1, 2005 Posted July 1, 2005 (edited) ok, i got it working last night. Here is what i got. I will prob make a GUI so some one can change the delay and key.$k = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "SwapMouseButtons") While 1 If _IsPressed('04') Then If $k = 1 Then MouseClick("right") Else MouseClick("left") EndIf EndIf Sleep(1) Wend Exit ;Credit for _IsPressed() at: ;http://www.autoitscript.com/forum/index.php?showtopic=5760 Func _IsPressed($hexKey) Local $aR, $bO $hexKey = '0x' & $hexKey $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) If Not @error And BitAND($aR[0], 0x8000) = 0x8000 Then $bO = 1 Else $bO = 0 EndIf Return $bO EndFuncOops, i think i jusy made hack for a computer game, delete time. Owell Edited July 1, 2005 by 2n193r
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