Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

repeat my mouse click action


  • Please log in to reply
4 replies to this topic
ng
  • Members
  • 1 posts
  • Last active: Apr 27 2009 01:52 AM
  • Joined: 27 Apr 2009
how can i create a script to make my mouse auto click repeat ?


MouseClick , Left , 1022, 322, 2 , 10


I dont know how can make it repeat this action again and again , anyone can help me please ? thank you very much !

regards , ng

lilalurl.T32
  • Members
  • 391 posts
  • Last active: Jul 05 2011 03:39 PM
  • Joined: 17 May 2007
Using a Loop (from the help file: Perform a series of commands repeatedly: either the specified number of times or until break is encountered.)
________
Buy silver surfer vaporizer

Seatbelt99
  • Members
  • 136 posts
  • Last active: Jan 10 2012 02:55 PM
  • Joined: 08 Aug 2007

how can i create a script to make my mouse auto click repeat ?


MouseClick , Left , 1022, 322, 2 , 10


I dont know how can make it repeat this action again and again , anyone can help me please ? thank you very much !

regards , ng


loop
{
MouseClick , Left , 1022, 322, 2 , 10
}

that should do it. It will click forever. I would suggest putting a sleep, 2000 or whatever (so it only does the click every 2 seconds, or as often as you need) but it is up to you.

[/code]

aWhiteRabbit
  • Members
  • 3 posts
  • Last active: Jun 20 2012 02:18 AM
  • Joined: 20 Jun 2012
Does anyone know how to get the mouse coordinates dynamically? I'd like to create a script that will, when the user clicks something on screen, repeat the mouse clicks 9x.

Added bonus if you can click multiple places and have those clicks repeat without interrupting each other! =)

girlgamer
  • Moderators
  • 3058 posts
  • Last active: Yesterday, 03:02 PM
  • Joined: 04 Jun 2010
first you define what a click means to you. If it's the lbutton then try this
$LButton::
   MouseGetPos, mouseX, mouseY
   loop, 9
   {   click, L, %mouseX%, %mouseY%
       Sleep 100
   }
Return
Although you may not get "simultaneous" mouse clicks on different areas of the screen it should be possible to get "interleaved" clicks where the clicks at one location are alternated with clicks on another location. That will involve some adaptations to the code snippet above. There are several possible ways this could be handled. [*:2fbhm3r9]if you grab all the locs first that you want to click on then you can dramatically simplify the code since you only have to iterate through the number of click locations for the 9 clicks you want on each. It's doable but i'm not going to push that particular modification up on line at the moment since it will take the ability to keep track of multiple variables at different states with multiple loops and conditions at each stage of the process. Ultimately you will have to set a limit on the number of click locations you can have going at any one time. note the following pseudocde for the process has not been verified for accuracy or completeness
[*:2fbhm3r9]if you want to begin clicking as soon as the location is selected you will need to keep track of the number of clicks used for each position and the location along with the number click locations and you'll have to stop clicking when that location's count = 0 but still keep clicking on any other location with a count > 0.
PseudoCode for the process
   1 for each click location in the list
        2 get the number clicks remaining
        3 if the number of clicks remaining = 0
             move to the next click location
             If the clicks location pointer is off the end of the list
                 reset the location pointer back to 1
             if all location counts have been zeroed
                clear the click location counter (no more clicks for any location)
                exit the routine
        4 otherwise the number of clicks is > 0
             click on the current click location
             reduce the click count for that location by 1
             move to the next click location
             If the clicks location pointer is off the end of the list
                 reset the location pointer back to 1
             go back to 2