OmenSWE Posted September 21, 2007 Share Posted September 21, 2007 Trying to make so when i hold down LMB it will click fast like hell and when i release it it will stop #Include <Misc.au3> $go=false HotKeySet('{end}', '_Exit') If MouseDown("left") then $go2=true If MouseUp("left") then $go2=false while 1 While $go MouseClick('left') Wend WEnd Func _Exit() Exit EndFunc Link to comment Share on other sites More sharing options...
aslani Posted September 21, 2007 Share Posted September 21, 2007 Try this; While MouseDown("left") $go2=true Wend [font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version Link to comment Share on other sites More sharing options...
JBeef Posted September 21, 2007 Share Posted September 21, 2007 (edited) click mouse while mouse down = crazy talk. click mouse sends mouseup = catch22. :crazy: ~Jap edit- i mean ~Jap Edited September 21, 2007 by JBeef Link to comment Share on other sites More sharing options...
OmenSWE Posted September 21, 2007 Author Share Posted September 21, 2007 (edited) Try this;While MouseDown("left") $go2=true Wenddid not work..I want it for a game when you fire with a pistol you need to press the button agen and agen.Now i want so it auto repress it when i just hold it down. Edited September 21, 2007 by OmenSWE Link to comment Share on other sites More sharing options...
Kip Posted September 21, 2007 Share Posted September 21, 2007 #Include <Misc.au3> While 1 While _IsPressed("01") MouseDown("left") MouseUp("left") WEnd WEnd MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
OmenSWE Posted September 21, 2007 Author Share Posted September 21, 2007 #Include <Misc.au3>While 1 While _IsPressed("01") MouseDown("left") MouseUp("left") WEnd WEndNope did not work Link to comment Share on other sites More sharing options...
JBeef Posted September 21, 2007 Share Posted September 21, 2007 children think more. mousehook and variable to count mousedown. mousedown add 1. click while mousedown is 1 mouseup delete 1. please dont make me show. someone has smarts here? ~Jap Link to comment Share on other sites More sharing options...
Kip Posted September 21, 2007 Share Posted September 21, 2007 well, maybe is the game protected for bots MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
Kip Posted September 21, 2007 Share Posted September 21, 2007 #Include <Misc.au3> While 1 While _IsPressed("01") MouseUp("left") MouseDown("left") WEnd WEnd MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
Nahuel Posted September 21, 2007 Share Posted September 21, 2007 (edited) This works but sometimes you need to click again to stop it :S #Include <Misc.au3> HotKeySet('{end}', '_Exit') while 1 Sleep(10);I don't want it to eat my processor. If _IsPressed(01) Then Do MouseUp("left") Sleep(10);If you don't add this it might not work right. MouseDown("left") until NOT _IsPressed(01) EndIf WEnd Func _Exit() Exit EndFunc Oh, and the previous example does work. Edited September 21, 2007 by Nahuel Link to comment Share on other sites More sharing options...
JBeef Posted September 21, 2007 Share Posted September 21, 2007 get hook.dll expandcollapse popupConst $WH_MOUSE = 7 Const $WM_AUTOITLBUTTONDOWN = 0x1400 + 0x0A30 Const $WM_AUTOITLBUTTONUP = 0x1400 + 0x0B30 $gui = GUICreate("test") Global $DLLinst = DLLCall("kernel32.dll","hwnd","LoadLibrary","str",".\hook.dll") Global $mouseHOOKproc = DLLCall("kernel32.dll","hwnd","GetProcAddress","hwnd",$DLLInst[0],"str","MouseProc") Global $hhMouse = DLLCall("user32.dll","hwnd","SetWindowsHookEx","int",$WH_MOUSE, _ "hwnd",$mouseHOOKproc[0],"hwnd",$DLLinst[0],"int",0) DLLCall(".\hook.dll","int","SetValuesMouse","hwnd",$gui,"hwnd",$hhMouse[0]) GUIRegisterMsg($WM_AUTOITLBUTTONDOWN,"AddMouse") GUIRegisterMsg($WM_AUTOITLBUTTONUP,"SubMouse") Global $mousecount = 0 While 1 $msg = GUIGetMsg() If $msg = -3 Then ExitLoop If $mousecount Then MouseClick("left") Sleep(50) EndIf WEnd Func AddMouse($hWndGUI, $MsgID, $WParam, $LParam) $mousecount += 1 EndFunc Func SubMouse($hWndGUI, $MsgID, $WParam, $LParam) $mousecount -= 1 EndFunc Func OnAutoItExit() DLLCall("user32.dll","int","UnhookWindowsHookEx","hwnd",$hhMouse[0]) DLLCall("kernel32.dll","int","FreeLibrary","hwnd",$DLLinst[0]) EndFunc Link to comment Share on other sites More sharing options...
aslani Posted September 21, 2007 Share Posted September 21, 2007 (edited) Kip had it right, but I would do this instead #Include <Misc.au3> While 1 While _IsPressed("01") AutoItSetOption(MouseClickDelay, 10) MouseClick("left", default, default, 9999) WEnd WEnd Edited September 21, 2007 by aslani [font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version Link to comment Share on other sites More sharing options...
OmenSWE Posted September 21, 2007 Author Share Posted September 21, 2007 (edited) This works but sometimes you need to click again to stop it :S#Include <Misc.au3> HotKeySet('{end}', '_Exit') while 1 Sleep(10);I don't want it to eat my processor. If _IsPressed(01) Then Do MouseUp("left") Sleep(10);If you don't add this it might not work right. MouseDown("left") until NOT _IsPressed(01) EndIf WEnd Func _Exit() Exit EndFuncOh, and the previous example does work.Ok this start and newer stopsget hook.dllexpandcollapse popupConst $WH_MOUSE = 7 Const $WM_AUTOITLBUTTONDOWN = 0x1400 + 0x0A30 Const $WM_AUTOITLBUTTONUP = 0x1400 + 0x0B30 $gui = GUICreate("test") Global $DLLinst = DLLCall("kernel32.dll","hwnd","LoadLibrary","str",".\hook.dll") Global $mouseHOOKproc = DLLCall("kernel32.dll","hwnd","GetProcAddress","hwnd",$DLLInst[0],"str","MouseProc") Global $hhMouse = DLLCall("user32.dll","hwnd","SetWindowsHookEx","int",$WH_MOUSE, _ "hwnd",$mouseHOOKproc[0],"hwnd",$DLLinst[0],"int",0) DLLCall(".\hook.dll","int","SetValuesMouse","hwnd",$gui,"hwnd",$hhMouse[0]) GUIRegisterMsg($WM_AUTOITLBUTTONDOWN,"AddMouse") GUIRegisterMsg($WM_AUTOITLBUTTONUP,"SubMouse") Global $mousecount = 0 While 1 $msg = GUIGetMsg() If $msg = -3 Then ExitLoop If $mousecount Then MouseClick("left") Sleep(50) EndIf WEnd Func AddMouse($hWndGUI, $MsgID, $WParam, $LParam) $mousecount += 1 EndFunc Func SubMouse($hWndGUI, $MsgID, $WParam, $LParam) $mousecount -= 1 EndFunc Func OnAutoItExit() DLLCall("user32.dll","int","UnhookWindowsHookEx","hwnd",$hhMouse[0]) DLLCall("kernel32.dll","int","FreeLibrary","hwnd",$DLLinst[0]) EndFuncThis start on the second i start the file and it dont stop. Edited September 21, 2007 by OmenSWE Link to comment Share on other sites More sharing options...
JBeef Posted September 21, 2007 Share Posted September 21, 2007 oh well. should work. logically perfect. ~Jap Link to comment Share on other sites More sharing options...
Nahuel Posted September 21, 2007 Share Posted September 21, 2007 Ok this start and newer stopsIt works here. But sometimes it doesn't stop and you need to click again.The thing is that everyone gave you ideas. Try to put them all together and come up with a working script. Link to comment Share on other sites More sharing options...
OmenSWE Posted September 22, 2007 Author Share Posted September 22, 2007 I want it for Half-Life 2 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