I need a program that "Multi-clicks" when you hold down

Status
Not open for further replies.
The below code will send approx 10 left clicks every second while the mouse button is held down.
It will break as soon as you stop pressing the mouse button.
To run it, download autohotkey then create a new script (right click on the desktop, choose new > autohotkey script.) copy the code in, save, then right click on the file on the desktop and choose 'compile'

If you want more than 10 clicks a second, change the 'sleep 95' line to a smaller value. the 95 bit means 95 milliseconds (1000 = 1 second). For fastest click rate, delete the sleep line

Code:
LButton::
While GetKeyState("LButton","P") = 1
{Click
sleep 95
}
 
The below code will send approx 10 left clicks every second while the mouse button is held down.
It will break as soon as you stop pressing the mouse button.
To run it, download autohotkey then create a new script (right click on the desktop, choose new > autohotkey script.) copy the code in, save, then right click on the file on the desktop and choose 'compile'

If you want more than 10 clicks a second, change the 'sleep 95' line to a smaller value. the 95 bit means 95 milliseconds (1000 = 1 second). For fastest click rate, delete the sleep line

Code:
LButton::
While GetKeyState("LButton","P") = 1
{Click
sleep 95
}

K that code doesn't work as-is, "GetKeyState" is not a valid command, neither is "click". I did this:

While MouseDown("left") = 1
MouseClick("left")
Sleep(100)
WEnd

But MouseDown is not the right command here, you have the right idea with "GetKeyState" but I can't find a command like that which works.

Right now this script repeatedly clicks my button, never breaks out of the loop no matter what I do.

So, ye, all I need is a command to check if my mouse button is being pressed.

EDIT: nvm, i found a command called _IsPressed("01") with 01 being LMB. But the piece of crap quits after 1 loop, it will not repeat. I want it to stay there and do it every time I click the button, not just once. wtf. Here's my new code:

$dll = DllOpen("user32.dll")

While 1
Sleep ( 250 )
If _IsPressed("01", $dll) Then
MouseClick("left")
Sleep(500)
MouseClick("left")
Sleep(500)
ExitLoop
EndIf
WEnd
DllClose($dll)
 
Dude, you're not using Autohotkey. You're using autoitscript or some weird thing...
Here's the link to the ACTUAL Autohotkey installer

http://www.autohotkey.com/download/AutoHotkeyInstall.exe

Install it, then follow the instructions of my previous post

lol, how the **** could you miss that you're using the wrong program? :p

edit: btw, if you want to hide the tray icon when the program is running, use this code instead:
Code:
#NoTrayIcon
LButton::
While GetKeyState("LButton","P") = 1
{Click
sleep 95
}
 
Dude, you're not using Autohotkey. You're using autoitscript or some weird thing...
Here's the link to the ACTUAL Autohotkey installer

http://www.autohotkey.com/download/AutoHotkeyInstall.exe

Install it, then follow the instructions of my previous post

lol, how the **** could you miss that you're using the wrong program? :p

edit: btw, if you want to hide the tray icon when the program is running, use this code instead:
Code:
#NoTrayIcon
LButton::
While GetKeyState("LButton","P") = 1
{Click
sleep 95
}


u own.

I was using AutoIt, lol.

Ok is there a hotkey to suspend the script while in fullscreen mode? CTRL-F12 or something?
 
yeah, that's pretty easy
The below code will stop the program running when you press the windows + p keys. if you want to change the keys to different ones, just replace the #p:: line with what you want. In this case '#' is the windows key and 'p' is obviously the p key :) the '::' part is the shortcut part, always add that for key combos.
e.g. LAlt:: will make just pressing the left alt key stop the script. Full list of keys here: http://www.autohotkey.com/docs/KeyList.htm
Code:
#NoTrayIcon
#p::
Suspend,Permit
Suspend
LButton::
While GetKeyState("LButton","P") = 1
{Click
sleep 95
}
 
Code:
*PAUSE::Suspend
return

LButton::
loop
{
GetKeyState, state, LButton, P
If state = U
break;

send,{LButton}
sleep,25
}
use this
also, press pause/break on the keyboard to pause or unpause the script
 
this is cool but the macro doesn't work in Modern Warfare 2. I'm trying to get the FAL (single fire AR) to fire bursts or just plain automatic, but for some reason it won't work.
 
It's most likely because the key is already in use in MW2, e.g. there's something else already mapped to it.

When I get home I'll trial a few things and see if I can get it working for you.
 
or you can just buy a logitech g15 or g19 keyboard or a razor lycosa, all of which have easy macro set up function without the need to write scripts.
 
but writing scripts is more "pr0"

and SOULphIRE, what do you mean there is something else mapped to the key?

It should work just like physically clicking the mouse button quickly. If I physically click it fast then the gun will fire, but not with this macro.

I tried the other program and the script works, but my script is very crappy and I only get 2 shot bursts.
 
Status
Not open for further replies.
Back
Top Bottom