Sign in to follow this  
Followers 0
Joshuaaaa

Right mouse click repeatedly with delay?

7 posts in this topic

I'm looking for a script/code that will right click wherever my cursur is repeatedly with delay in between each click.

Something like this... but with delay:

Do
MouseClick ("SECONDARY") 
Until _IsPressed ("21")

Share this post


Link to post
Share on other sites

I'm looking for a script/code that will right click wherever my cursur is repeatedly with delay in between each click.

Something like this... but with delay:

Do
MouseClick ("SECONDARY") 
Until _IsPressed ("21")
Poke a sleep in there...

Do
     MouseClick ("SECONDARY") 
     Sleep(500) ; 500ms = .5sec
Until _IsPressed ("21")

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Poke a sleep in there...

Do
     MouseClick ("SECONDARY") 
     Sleep(500) ; 500ms = .5sec
Until _IsPressed ("21")

:)

The Sleep is causing the "Until _IsPressed ("21") to be ineffective. Therefore, I cannot use "Page Up" key to stop this script.

Share this post


Link to post
Share on other sites

Use Sleep(1), i bet you cannot make your click in that split second

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Use Sleep(1), i bet you cannot make your click in that split second

It's still cancelling it out.

Here is my code:

#include <GUIConstants.au3>
#include <misc.au3>

#Region ### START Koda GUI section ### Form=
$Tester = GUICreate("Simple Clicker by Joshperson", 201, 151, 337, 222)
GUISetCursor (2)
GUISetBkColor(0xA6CAF0)
$Auto_Scatter = GUICtrlCreateCheckbox("Auto_Scatter", 56, 24, 97, 17)
GUICtrlSetBkColor(-1, 0xC0DCC0)
$Auto_Jumper = GUICtrlCreateCheckbox("Auto_Jumper", 56, 56, 97, 17)
GUICtrlSetBkColor(-1, 0xC0DCC0)
$Run = GUICtrlCreateButton("Run", 59, 115, 75, 25, 0)

GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Run
            If BitAND(GUICtrlRead($Auto_Scatter), $GUI_CHECKED) Then
            Do
     MouseClick ("SECONDARY") 
     Sleep(1); 1= .01sec
Until _IsPressed ("21")
                EndIf
            If BitAND(GUICtrlRead($Auto_Jumper), $GUI_CHECKED) Then
                Send("{LCTRL Down}")
Sleep(0); 0 seconds
Send("{LCTRL Up}")


            
            EndIf
    EndSwitch
WEnd

In this code, I'm trying to make it so that this

If BitAND(GUICtrlRead($Auto_Scatter), $GUI_CHECKED) Then
            Do
     MouseClick ("SECONDARY") 
     Sleep(1); 1= .01sec
Until _IsPressed ("21")
                EndIf

and this

If BitAND(GUICtrlRead($Auto_Jumper), $GUI_CHECKED) Then
                Send("{LCTRL Down}")
Sleep(0); 0 seconds
Send("{LCTRL Up}")

can be played through at the same time, but whenever I attempt to play them together with "Sleep" on the right mouse clicks (Auto_scatter), "Until _IsPressed ("21") becomes ineffective, and also, my second script (Auto_Jumper) remains ineffective.

When I leave out the sleep function, "Until _IsPressed ("21") works just fine, but my second script still won't play while the first one is in motion. Basically, they won't go together. What I'm trying to do it have it so that my right mouse repeats, (scatter), while my Ctrl button is being held down (second script) allowing me to still use my left mouse button in person.

It'd be really awesome if someone could help me through this. It's my first actual script, and I'm kind of learning more as it goes.

Edited by Joshuaaaa

Share this post


Link to post
Share on other sites

Jeez I'm so stupid. I had it all wrong because I put Until _IsPressed ("21") infront of my second script, which didn't allow for it to play until the first script was ENDED by the Until _IsPressed ("21").

Hehe, thanks :)

Share this post


Link to post
Share on other sites

The Sleep is causing the "Until _IsPressed ("21") to be ineffective. Therefore, I cannot use "Page Up" key to stop this script.

Good point.

It looks like you already have a working solution now, but if responsiveness is still an issue change the GUI to GuiOnEventMode vice GuiGetMsg loop, kick the right clicks from AdLibEnable. The AdLibEnable can be dynamically enabled/disabled by your script, or you can turn the action on/off with a flag variable.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  
Followers 0