Jump to content

While mouse is down?


joncom
 Share

Recommended Posts

I'm trying to make a script that clicks the left mouse repetatively while the mouse is held down. I imagine it would look something like:

While Mouse-Is-Down

MouseDown("left")

Sleep(100)

MouseUp("left")

WEnd

Now, of course, "Mouse-Is-Down" is not a function, but I cannot find any function suitable to perform this task.... I would appreciate any help here.

Link to comment
Share on other sites

While _IsPressed('01')= 1
MouseDown("left")
Sleep(100)
MouseUp("left")
WEnd

Func _IsPressed($hexKey); by Ezzetabi! :-)

  
  Local $aR, $bRv
  $hexKey = '0x' & $hexKey
  $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey)
 
  If $aR[0] <> 0 Then
     $bRv = 1
  Else
     $bRv = 0
  EndIf
  
  Return $bRv
EndFunc

im not even sure if that will work, but give it a try, i have company right now! and if you just run the script, it will exit right away, so im not sure if making it idle around with

While 1
Sleep (100)
Wend

and then also haveing the first code that i gave would work, idk i really g2g bye

FootbaG
Link to comment
Share on other sites

While _IsPressed('1b');While Left Button is pressed
MouseDown("left")
Sleep(100)
MouseUp("left")
WEnd

Note:I have'nt tested it but i think this might loop indefiniteinly once you press the left mouse button once.

If it does just change 1b to the hex code of a diffrent key like 70 for the F1 Key

Note 2:Thanks to Ezzetabi for the _IsPressed Func

Edit: Edit:Looks like layer beat me to the post! look at the post times!!!!!! :lmao:

Edited by SolidSnake
HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
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...