Jump to content
Sign in to follow this  
Sybir

Lbutton holds = clicks

Recommended Posts

Sybir

Hey, I don't know how to make a script that would click mouse button when I hold it down. I tried something like that

GetKeyState, state , LButton, [p]
if state = D
Loop
{
    Sleep, 750
    MouseClick, left
    if state = U
        break

}

But it won't break the loop when I stop pushing the button.

Share this post


Link to post
Share on other sites
Jos

Hey, I don't know how to make a script that would click mouse button when I hold it down. I tried something like that

GetKeyState, state , LButton, [p]
if state = D
Loop
{
    Sleep, 750
    MouseClick, left
    if state = U
        break

}

But it won't break the loop when I stop pushing the button.

I can imagine that this syntax gives a few errors with AutoIt3.exe

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
monoscout999

I dont understand vwry well what you want.. You want a script that do mouseclicks... when you holding down what?

Share this post


Link to post
Share on other sites
Sybir

I want a script that emulate mouseclicks while I hold down a mouse button, Left mouse button or Xbutton 1 preferable

Share this post


Link to post
Share on other sites
Sybir

Just noticed, I mistook AutoIt with AutoHotkey >.>

Share this post


Link to post
Share on other sites
Zedna

Just call GetKeyState in Loop too, something like this:

Loop
{
  Sleep, 750
  GetKeyState, state , LButton, [p]
  if state = D
  {   
    MouseClick, left
  }
}
Edited by Zedna

Share this post


Link to post
Share on other sites
Maffe811

Would something along the lines of the script below work?

#Include <Misc.au3>
While 1
    If _IsPressed("01" ,$vDLL = 'user32.dll') Then
        MouseClick("left")
    EndIf
WEnd

[font="helvetica, arial, sans-serif"]Hobby graphics artist, using gimp.Automating pc stuff, using AutoIt.Listening to music, using Grooveshark.[/font]Scripts:[spoiler]Simple ScreenshotSaves you alot of trouble when taking a screenshot!Don't remember what happened with this, but aperantly the exe is all i got.If you don't want to run it, simply don't._IsRun UDFIt figures out if the script has ben ran before based on the info in a ini file.If you don't want to use exactly what i wrote, you can use it as inspiration.[/spoiler]

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  

×