Jump to content

Recommended Posts

Posted

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

 

Posted

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.

Posted
  On 1/23/2018 at 12:28 PM, 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.

Expand  

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? :)

Posted

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.

  Reveal hidden contents

IUIAutomation - Topic with framework and examples

Au3Record.exe

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...