Jump to content

Mouse Click Repeater?


Recommended Posts

I'm trying to make a "Mouse Click Repeater" what I've seen from the help file is that I could do a

Mouse click down

(SOMETHING) have it do something until the click up was done

Mouse click up

loop

Is it possible to send mouse up and down within a mouse up and down? Or should I try Mouse click down-->mouse click-->Mouse click up and put it on a loop?

I've seen posts about people mad about "botting," yes one of the main purposes for this would be playing an on-line game. But its annoying having to click repeatedly at the exact same spot when I could just hold it down and repeat until I released. I'm spamming clicks as fast as possible anyway, might as well make it less annoying lol

chad

Link to comment
Share on other sites

I'm trying to make a "Mouse Click Repeater" what I've seen from the help file is that I could do a

Mouse click down

(SOMETHING) have it do something until the click up was done

Mouse click up

loop

Is it possible to send mouse up and down within a mouse up and down? Or should I try Mouse click down-->mouse click-->Mouse click up and put it on a loop?

I've seen posts about people mad about "botting," yes one of the main purposes for this would be playing an on-line game. But its annoying having to click repeatedly at the exact same spot when I could just hold it down and repeat until I released. I'm spamming clicks as fast as possible anyway, might as well make it less annoying lol

chad

I don't quite understand. Whats the point in MouseClick up - MouseClick -> MouseClick down

if you can just send a series of MouseClick or ControlClicks ?

Link to comment
Share on other sites

Im very new to Autoit as a language. I can understand parts of scripts but writing it myself is a different story.

I thought that since Mouseclick had an up and down stage that I could put clicks between the up and down. Maybe I'm wrong. Ill use whatever is best, but I want to be able to hold down the left click button, and have the script repeat left clicks until I release. Would just repeating clicks work?

@ mdiesel thats the idea yes

Edited by RAMMRODD
Link to comment
Share on other sites

ok will do thanks

EDIT:

So I downloaded the UDF and it seems like what I need.

;Disable Primary mouse button *down*, and call our function when mouse button *down* event is recieved

_MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "MousePrimaryDown_Event")

Sleep(5000)

_MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT) ;Enable mouse button back.

MsgBox(64, "Attention!", "Now we disable Secondary mouse button up, and call our function when mouse button up event is recieved.", 5)

would I replace the "Sleep(5000)" with what I want it to do?

If I get this script it disables the mouse buttons and instead calls a function until a certain time/event and then enables the mouse? This is what the comments say just double checking, I wouldnt want my assumptions to cause me problems later.

Edited by RAMMRODD
Link to comment
Share on other sites

Global $Click = 0

_MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "Event")
_MouseSetOnEvent($MOUSE_PRIMARYUP_EVENT, "Event2")
HotkeySet ("^{ESC}", "_Exit")

While 1
$Pos = MouseGetpos ()
If $Click = 1 Then Mouseclick ("Left", $Pos[0], $Pos[1], 1, 0)
Wend

Func Event ()
$Click = 1
EndFunc

func Event2 ()
$Click = 0
EndFunc

untested code, but its the idea that counts.

look at the hotkeyset functions in the helpfile, its a similar sort of thing

Edited by mdiesel
Link to comment
Share on other sites

I got the hotkey working, that part was easy lol. Now the code you posted stops the left click from clicking, which I think is what I need right? Now I need to figure out how to use MrCreator's UDF to assign a function to initiate?

#include <MouseSetOnEvent_UDF.au3>
Global $Click = 0

_MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "Event")
_MouseSetOnEvent($MOUSE_PRIMARYUP_EVENT, "Event2")
HotKeySet("{ESC}", "Terminate")

While 1
$Pos = MouseGetpos ()
If $Click = 1 then MouseClick("primary", $Pos[0], $Pos[0], 2)
    
Wend

Func Event ()
$Click = 1
EndFunc

func Event2 ()
$Click = 0 
EndFunc

Func Terminate()
    Exit 0
EndFunc

Is what I put together with yours. I managed to get the mouse to move, but its way down to the bottom of the screen. It stays the same from left to right but it's up and down direction goes down....a lot. Anything I did that screams out "move to bottom of screen?"

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