Kodaah

Mouse click script

7 posts in this topic

Hello,

 

I would like to make a mouseclick script.

When i run the .au3 file i want the script to wait for 5 seconds, then click once, wait 1 second, click again.

Then wait 13 seconds and repeat it.

Can someone help me making this script? So far i only got MouseClick ("Left") hehehe....

Thanks, !

 

Kodaah

Share this post


Link to post
Share on other sites



So,  

- Run the file.

- Wait 5 seconds, then click once.

- Wait 1 second, then click again.

- Then wait 13 seconds and click.

after that 13 seconds click it can repeating the clicks without the 5 seconds in the beginnen.

Share this post


Link to post
Share on other sites
Global $X = @DesktopWidth / 2 ;The X pixel to click. In this example it will click in the middle of your screen if only have one monitor connected.
Global $Y = @DesktopHeight / 2 ;The Y pixel to click.
Global $RandomMin = "1000" ;Should always be an integar in milliseconds.
Global $RandomMax = "13000" ;Should always be an integar in milliseconds.
opt("MouseClickDelay",10);Time in ms between each the Click Up from one click and the Click Down for the next one.
opt("MouseClickDownDelay",10);Time in ms between the Click Down and Click Up for the same click.
opt("MouseClickDragDelay",250);Time in ms between Click Down and the next command in the script.
For $i=1 to 5 ;loops 5 times. Can be a max of 2^32-1 on 32 bit systems or 2^64-1 on 64 bit systems. If you perfer infinite looping, use while 1 wend instead of for next.
    MouseClick("primary",$X,$Y,1,0);Clicks the primary button (usually left) at $x and $y 1 time at 0 speed (instant)
    sleep(Random($RandomMin,$RandomMax)) ;sleeps in ms for a random duration between $RandomMin and $RandomMax.
Next ;Increments $i by one ($i+=1) and repeats the loop. If the loop goes over 5, the loop stops. 

;For additional help, open SciTE and in the menu click Help>Help (Press F1). Note you can click on a function, such as the MouseClick above and then press F1 to get its help file.

 

1 person likes this

False Positive Reporter - Mass email all anti virus vendors with an attachment of your program for fast and easy whitelisting.

PortableApps.com App Creation Wizard  - A simple GUI-based Wizard for creating PortableApps.

SoundBoard - Play any song or sound you want at the press of a hotkey.

My GitHub Page: https://github.com/BetaLeaf

Share this post


Link to post
Share on other sites

Thank you so much BetaLeaf!

I've placed the X and Y pixel to click, only problem is.. i can't figure out how i get this to an infinit loop.

It works fine for me now, i only want the infinite loop.

 

Global $X = 3200 / 2 ;The X pixel to click. In this example it will click in the middle of your screen if only have one monitor connected.
Global $Y = 1610 / 2 ;The Y pixel to click.
Global $RandomMin = "1500" ;Should always be an integar in milliseconds.
Global $RandomMax = "16000" ;Should always be an integar in milliseconds.
opt("MouseClickDelay",10);Time in ms between each the Click Up from one click and the Click Down for t08he next one.
opt("MouseClickDownDelay",10);Time in ms between the Click Down and Click Up for the same click.
opt("MouseClickDragDelay",250);Time in ms between Click Down and the next command in the script.
Local $i = 0
While $i <= 1 ;loops 5 times. Can be a max of 2^32-1 on 32 bit systems or 2^64-1 on 64 bit systems. If you perfer infinite looping, use while 1 wend instead of for next.
    sleep(Random($RandomMax))
    MouseClick("primary",$X,$Y,1,0);Clicks the primary button (usually left) at $x and $y 1 time at 0 speed (instant)
    sleep(Random($RandomMin)) ;sleeps in ms for a random duration between $RandomMin and $RandomMax.
    MouseClick("primary",$X,$Y,1,0)
    $i = $i + 1
WEnd ;Increments $i by one ($i+=1) and repeats the loop. If the loop goes over 5, the loop stops.

;For additional help, open SciTE and in the menu click Help>Help (Press F1). Note you can click on a function, such as the MouseClick above and then press F1 to get its help file.

 

Here is the script i got right now at the moment,

 

Help me out please <3

Share this post


Link to post
Share on other sites

When posting a script please use the code tags in the editor (the button marked "<>"). That enhances readability :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

The answer to your question is in the code posted by BetaLeaf.
Out of curiosity: Can you please tell us what you ned the script for?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
Global $X = @DesktopWidth / 2 ;The X pixel to click. In this example it will click in the middle of your screen if only have one monitor connected.
Global $Y = @DesktopHeight / 2 ;The Y pixel to click.
Global $RandomMin = "1000" ;Should always be an integar in milliseconds.
Global $RandomMax = "13000" ;Should always be an integar in milliseconds.
opt("MouseClickDelay",10);Time in ms between each the Click Up from one click and the Click Down for the next one.
opt("MouseClickDownDelay",10);Time in ms between the Click Down and Click Up for the same click.
opt("MouseClickDragDelay",250);Time in ms between Click Down and the next command in the script.
While 1;loops infinitely
    MouseClick("primary",$X,$Y,1,0);Clicks the primary button (usually left) at $x and $y 1 time at 0 speed (instant)
    sleep(Random($RandomMin,$RandomMax)) ;sleeps in ms for a random duration between $RandomMin and $RandomMax.
Wend

;For additional help, open SciTE and in the menu click Help>Help (Press F1). Note you can click on a function, such as the MouseClick above and then press F1 to get its help file.

 


False Positive Reporter - Mass email all anti virus vendors with an attachment of your program for fast and easy whitelisting.

PortableApps.com App Creation Wizard  - A simple GUI-based Wizard for creating PortableApps.

SoundBoard - Play any song or sound you want at the press of a hotkey.

My GitHub Page: https://github.com/BetaLeaf

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