Jump to content

right click mouse for 3 seconds


Recommended Posts

Im having hard time how to do it -.- how do u do a autoscript...

Hold right mouse button for 3 seconds and then release it...then do it over and over and over again.(just call it unlimited) home key=activate and end key= deactivate..

thanks :)

Link to comment
Share on other sites

Hold right mouse button for 3 seconds and then release it...then do it over and over and over again.(just call it unlimited)  home key=activate and end key= deactivate..

The MouseClick() and MouseClickDownDelay functions/options are what you are looking for to achieve your desired mouse behaviour. You can find them in the help file index.

Once you have that working, all you need to do is place it in a loop. The HotKeySet() function will allow you to program the End key to terminate the script.

Link to comment
Share on other sites

HotKeySet("{HOME}", "_StartMouse")
HotKeySet("{END}", "_StopMouse")
HotKeySet("{ESC}", "_Exit")
Opt("MouseClickDownDelay",3000)

$Click = 0

While 1
    if $Click Then
        $start = TimerInit()
        MouseClick("left",1,1)
        ConsoleWrite("Clicked: " & TimerDiff($start) & @LF)
    EndIf
WEnd

Func _StartMouse()
    $Click = 1
EndFunc

Func _StopMouse()
    $Click = 0
EndFunc

Func _Exit()
    Exit
EndFunc

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

You may wish to introduce some sort of delay for when the clicking is deactivated, so that CPU usage doesn't fly through the roof:

; ...

While 1
    if $Click Then
        $start = TimerInit()
        MouseClick("left",1,1)
        ConsoleWrite("Clicked: " & TimerDiff($start) & @LF)
    else
        sleep(250)
    EndIf
WEnd

; ...
Link to comment
Share on other sites

HotKeySet("{HOME}", "_StartMouse")
HotKeySet("{END}", "_StopMouse")
HotKeySet("{ESC}", "_Exit")
Opt("MouseClickDownDelay",3000)

$Click = 0

While 1
    if $Click Then
        $start = TimerInit()
        MouseClick("left",1,1)
        ConsoleWrite("Clicked: " & TimerDiff($start) & @LF)
    EndIf
WEnd

Func _StartMouse()
    $Click = 1
EndFunc

Func _StopMouse()
    $Click = 0
EndFunc

Func _Exit()
    Exit
EndFunc

<{POST_SNAPBACK}>

hmm that wierd...i try this script...and my mouse went over on the top left corner..

EDIT: I GOT IT FIXED

HotKeySet("{HOME}", "_StartMouse")

HotKeySet("{END}", "_StopMouse")

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

Opt("MouseClickDownDelay",3000)

$Click = 0

While 1

if $Click Then

$start = TimerInit()

MouseClick("right")

ConsoleWrite("Clicked: " & TimerDiff($start) & @LF)

EndIf

WEnd

Func _StartMouse()

$Click = 1

EndFunc

Func _StopMouse()

$Click = 0

EndFunc

Func _Exit()

Exit

EndFunc

Edited by Lemonadez
Link to comment
Share on other sites

or use MouseClickDelay

MouseClickDelay is good for a delay inbetween clicks but when $Click = 0, the While..WEnd loop is effectively empty and can be troublesome without a Sleep() (just like me!).
Link to comment
Share on other sites

hmm that wierd...i try this script...and my mouse went over on the top left corner..

If you'd like the mouse to be clicked where it currently sits then you can change the MouseClick() call to:

mouseClick("right", mouseGetPos(0), mouseGetPos(1))
Link to comment
Share on other sites

EDITED: THANKS NOW I GOT IT RIGHT :)

HotKeySet("{HOME}", "_StartMouse")

HotKeySet("{END}", "_StopMouse")

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

$Click = 0

While 1

    if $Click Then

        $start = TimerInit()

  MouseClick("right")

  MouseUp("right")

  Sleep(1020)

  MouseDown("right")

  Sleep(3070)

        ConsoleWrite("Clicked: " & TimerDiff($start) & @LF)

    EndIf

WEnd

Func _StartMouse()

    $Click = 1

EndFunc

Func _StopMouse()

    $Click = 0

EndFunc

Func _Exit()

    Exit

EndFunc

can i ask something? is it possible to put a music into autoit? i mean if the music was .swf format and it was uploaded into a site...then make autoit have a button play stop? is that possible..

Edited by Lemonadez
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...