Jump to content
Sign in to follow this  
Hulubulu

Simple mouse dobleclick at two spots in loop

Recommended Posts

Hi everyone

I'm pretty new to this so bear with it :)

 

At this moment I need a script that double clicks at one spot, waits for 500ms then doubleclicks at another spot, and then it should continue in a loop.
I tried so far this but it comes with an error.

HotKeySet("{esc}","LoopFlagToggle")

$loopflag = 0

Do
MouseClick($MOUSE_CLICK_PRIMARY, 211, 173, 2)
Sleep (500)
MouseClick($MOUSE_CLICK_PRIMARY, 257, 168, 2)
Sleep (500)
Until $loopflag <> 0

Func LoopFlagToggle()

$loopflag = 1

EndFunc

 

Share this post


Link to post
Share on other sites

If the error is
"warning: $MOUSE_CLICK_PRIMARY: possibly used before declaration.",
then add

#include <AutoItConstants.au3>


to the top of your script - as per MouseClick() example in AutoIt help file.  

This will add the missing variable declaration to your script.

When in SciTE, place the cursor on the "#include <...." line.  Then press SciTE menu>Tools>Open include.  The .au3 include file will open and you will be able to inspect that file for the previously missing variable declaration, if needs be.

Share this post


Link to post
Share on other sites
1 hour ago, Malkey said:

If the error is
"warning: $MOUSE_CLICK_PRIMARY: possibly used before declaration.",
then add

#include <AutoItConstants.au3>


to the top of your script - as per MouseClick() example in AutoIt help file.  

This will add the missing variable declaration to your script.

When in SciTE, place the cursor on the "#include <...." line.  Then press SciTE menu>Tools>Open include.  The .au3 include file will open and you will be able to inspect that file for the previously missing variable declaration, if needs be.

Thanks, that did the trick.

Well just another problem now. What if I want to use it in an inactive window, how do I do that? :)

Share this post


Link to post
Share on other sites

What was the need for double post? and quoting what someone just said? ;)

Well tipically when you click an inactive window it becomes active, not sure there's a way around that, maybe i didn't understand the question right, you can always activate it.


Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...