X-sploiT Posted August 14, 2006 Share Posted August 14, 2006 (edited) This code does not work as planned,when you clikc mouse one it sends the mouse click on release..how can i make it so it send mouse clicks all the time hile mouse1 is down #include <misc.au3> HotKeySet("{INSERT}","On") HotKeySet("{F12}","WORK") While 1 sleep(5) wend Func WORK() send("{F12}") EndFunc Func On() while 1 if _ispressed("01") then MouseClick("left") send("{F12}") while _ispressed("01") MouseDown("left") send("{F12}") wend EndIf Wend EndFunc Edited August 14, 2006 by X-sploiT Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 14, 2006 Moderators Share Posted August 14, 2006 Cool, let us know how that turns out. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
X-sploiT Posted August 14, 2006 Author Share Posted August 14, 2006 lol i edited it Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 14, 2006 Moderators Share Posted August 14, 2006 lol i edited it I am really too lazy tonight to work out what you're really trying to do. Here's how I understand it, While your holding down F12 and MouseClick you want to MouseClick... You could do this with HotKeySet() but I'm too lazy as I said:Opt('MouseClickDelay', 1) While 1 While _IsPressed('7b') While _IsPressed('01') MouseClick('left') Sleep(10) WEnd Sleep(10) WEnd Sleep(10) WEnd Func _IsPressed($v_R, $v_dll = 'user32.dll') $v_R = DllCall($v_dll, 'int', 'GetAsyncKeyState', 'int', '0x' & $v_R) Return (Not @error And BitAND($v_R[0], 0x8000) = 0x8000) * 1 EndFunc ;==>_IsPressed Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
X-sploiT Posted August 14, 2006 Author Share Posted August 14, 2006 Opt('MouseClickDelay', 1) prolly just need that Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 14, 2006 Moderators Share Posted August 14, 2006 Opt('MouseClickDelay', 1) prolly just need thatactually if that's your script, you'll never leave the work() function when you press F12, it will just keep going back there over and over. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
X-sploiT Posted August 14, 2006 Author Share Posted August 14, 2006 well it still clicks on release HotKeySet("{INSERT}","On") HotKeySet("{F12}","Ex") Opt('MouseClickDelay', 1) while 1 sleep(1) WEnd Func On() While 1 if _IsPressed('01') Then While _IsPressed('01') MouseClick('left') Sleep(10) WEnd EndIf Sleep(10) WEnd EndFunc Func Ex() Exit EndFunc Func _IsPressed($v_R, $v_dll = 'user32.dll') $v_R = DllCall($v_dll, 'int', 'GetAsyncKeyState', 'int', '0x' & $v_R) Return (Not @error And BitAND($v_R[0], 0x8000) = 0x8000) * 1 EndFunc ;==>_IsPressed Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 14, 2006 Moderators Share Posted August 14, 2006 This clicks only while I have the left mouse button down, I added an exitloop when I let up on itHotKeySet("{INSERT}","On") HotKeySet("{F12}","Ex") Opt('MouseClickDelay', 1) While 1 Sleep(1000) WEnd Func On() While 1 If _IsPressed('01') Then While _IsPressed('01') MouseClick('right');Switch back to left, switched to right for testing Sleep(10) WEnd ExitLoop EndIf Sleep(10) WEnd EndFunc Func Ex() Exit EndFunc Func _IsPressed($v_R, $v_dll = 'user32.dll') $v_R = DllCall($v_dll, 'int', 'GetAsyncKeyState', 'int', '0x' & $v_R) Return (Not @error And BitAND($v_R[0], 0x8000) = 0x8000) * 1 EndFunc ;==>_IsPressed Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
X-sploiT Posted August 14, 2006 Author Share Posted August 14, 2006 Nope doesnt work clikc mouse1 shot fired release mouse1 shot fired i need click and hold down mouse1 shots fired Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 14, 2006 Moderators Share Posted August 14, 2006 Nope doesnt workclikc mouse1 shot fired release mouse1 shot firedi need click and hold down mouse1 shots firedUgh, slow down your MouseClickDelay (the 1 setting, raise that) until you get the right tempo, it's probably sending more clicks than what you think. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
X-sploiT Posted August 14, 2006 Author Share Posted August 14, 2006 i dont think thats it Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 14, 2006 Moderators Share Posted August 14, 2006 (edited) i dont think thats it*** edit rude comment ***Edit:Why don't you put step by step what it is you are trying to accomplish.Like:Step 1: When F12 is pressed ... DoStep 2: When done doing etc...etc... Edited August 14, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
X-sploiT Posted August 14, 2006 Author Share Posted August 14, 2006 (edited) Sorry..im trying to make an auto pisTol program for cs so while you press mouse1 it press mouse1 again i've seen it been done by BoB Perhaps its my mouse andf i test it with enter and it worked Edited August 14, 2006 by X-sploiT Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 14, 2006 Moderators Share Posted August 14, 2006 Sorry..im trying to make an auto pisyol program for cs so while you press mouse1 it press mouse1 againPut it like this:HotKeySet("{INSERT}","On") HotKeySet("{F12}","Ex") Opt('MouseClickDelay', 1) While 1 Sleep(1000) WEnd Func On() While 1 If _IsPressed('01') Then While _IsPressed('01') Sleep(200) MouseClick('right');Switch back to left, switched to right for testing WEnd ExitLoop EndIf Sleep(10) WEnd EndFunc Func Ex() Exit EndFunc Func _IsPressed($v_R, $v_dll = 'user32.dll') $v_R = DllCall($v_dll, 'int', 'GetAsyncKeyState', 'int', '0x' & $v_R) Return (Not @error And BitAND($v_R[0], 0x8000) = 0x8000) * 1 EndFunc ;==>_IsPressedNotice where I put the Sleep(200) (before the next mouseclick()) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
X-sploiT Posted August 14, 2006 Author Share Posted August 14, 2006 Perhaps its my mouse andf i test it with enter and it worked Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 14, 2006 Moderators Share Posted August 14, 2006 Perhaps its my mouse andf i test it with enter and it workedCan I ask a really silly question... what is your primary mouse button, the left one or the right one? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
X-sploiT Posted August 14, 2006 Author Share Posted August 14, 2006 (edited) left one is my primary for shooting for sum reason enter works you have to bind a key like enter to +attack HotKeySet("{INSERT}","On") HotKeySet("{F12}","Ex") Opt('MouseClickDelay', 1) While 1 Sleep(1000) WEnd Func On() While 1 If _IsPressed('0D') Then While _IsPressed('0D') Send("{enter}") WEnd EndIf Sleep(10) WEnd EndFunc Func Ex() Exit EndFunc Func _IsPressed($v_R, $v_dll = 'user32.dll') $v_R = DllCall($v_dll, 'int', 'GetAsyncKeyState', 'int', '0x' & $v_R) Return (Not @error And BitAND($v_R[0], 0x8000) = 0x8000) * 1 EndFunc ;==>_IsPressed Edited August 14, 2006 by X-sploiT 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