Jump to content

Recommended Posts

Posted

I haven't scripted for autoit in years and have forgotten most of what I knew. I'm trying to make a script that will start clicking left mouse when I hit 'space' and will keep clicking left mouse until I click 'space' again. Currently I have a script that will left click 100 times when I hit 'space' and I will post that here. It also has a tooltip that comes up by the mouse to say it is clicking. Any help would be appreciated. Thanks.

Global $Paused



HotKeySet ("{PAUSE}","pause")

HotKeySet ("{space}","one")

HotKeySet ("{ESC}","close")



AutoItSetOption ("MouseCoordMode",1)

while 1

four()

sleep(5000)

wend

Func click()

    $pos = MouseGetPos ()

    MouseClick ("left",$pos[0],$pos[1],100,1)

    two()

EndFunc



Func one()

While 1

    $pos = MouseGetPos ()

    ToolTip("Clicking",$pos[0] + 10,$pos[1] + 10)

    click()

WEnd

EndFunc



Func two()

While 1

    $pos = MouseGetPos ()

    ToolTip("Done",$pos[0] + 10,$pos[1] + 10)

    three()

WEnd

EndFunc



Func three()

While 1

    $pos = MouseGetPos ()

    ToolTip("Done",$pos[0] + 10,$pos[1] + 10)

    Sleep (100)

WEnd

EndFunc



Func four()

While 1

    Sleep (5000)

WEnd

EndFunc





Func pause()

    $Paused = NOT $Paused

    While $Paused

        sleep(100)

        ToolTip('Script is "Paused"',1063,822)

    WEnd

    ToolTip("")

EndFunc



Func close()

    Exit

    EndFunc

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
×
×
  • Create New...