Sign in to follow this  
Followers 0
proem

Looking for a specific function!

7 posts in this topic

Specifically, I'm looking for a function that returns true or false if a specific key is pressed or not. I'm trying to make a "fast clicker" script that checks whether or not a certain key is held down in real time, and makes the mouse click if it is. Simple, no? But it's actually pretty useful for me :D

Help is appreciated!

Share this post


Link to post
Share on other sites



_IsPressed()

*facepalm*

I have a feeling I could have found that if I looked harder. I tried, though. Thanks anyways! I'm looking that up in the help file and I'm well on my way to 1000 clicks/s :D

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I've encountered a problem...

#include <Misc.au3>
AutoItSetOption( "MouseClickDelay", "0" )
$turbo = 0

Func ToggleTurbo()
    if $turbo then
        $turbo = 0
    else
        $turbo = 1
    EndIf
EndFunc

HotKeySet( "{F2}", "ToggleTurbo" )

While True
    If $turbo AND _IsPressed("01") then
        Sleep("10")
        MouseClick( "left" )
    EndIf
WEnd

The script looks like it should work and successfully toggles, but when I hold leftmouse it only clicks once or twice, then stops. Help?

Edited by proem

Share this post


Link to post
Share on other sites

Maybe nothing, but does need the quotations ?

Apparently not, but it doesn't affect it much. I think I've found the problem though: MouseClick is clicking just fine, but after that it releases leftmouse, and when the script checks to see if it's held down it stops because of this. Because I've still got my finger on leftmouse, my mouse doesn't send an update. As far as I can tell there's no way around this :D

Share this post


Link to post
Share on other sites

You could try using a different key as the turbo button for the mouse click and not the left mouse button. That would work. Assign it to the pause button or something.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0