Hulubulu Posted January 23, 2018 Share Posted January 23, 2018 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 Link to comment Share on other sites More sharing options...
Malkey Posted January 23, 2018 Share Posted January 23, 2018 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. Link to comment Share on other sites More sharing options...
Hulubulu Posted January 23, 2018 Author Share Posted January 23, 2018 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? Link to comment Share on other sites More sharing options...
Hulubulu Posted January 23, 2018 Author Share Posted January 23, 2018 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? Link to comment Share on other sites More sharing options...
careca Posted January 23, 2018 Share Posted January 23, 2018 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 Link to comment Share on other sites More sharing options...
XaelloNegative Posted January 23, 2018 Share Posted January 23, 2018 I think you @Hulubulu can use the WinwaitActive() function. ~XN~ Link to comment Share on other sites More sharing options...
XaelloNegative Posted January 23, 2018 Share Posted January 23, 2018 @Hulubulu what are you trying to accomplish anyway? What kind of program are you trying to create? ~XN~ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now