Jump to content

Looking for a specific function!


proem
 Share

Recommended Posts

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!

Link to comment
Share on other sites

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
Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...