scorp2k19 Posted September 27, 2019 Share Posted September 27, 2019 Hi There, I have a very basic question, iv been watching most of Autoit Youtube videos and I understand how the While Loop works but I wanted to know if its possible to add a PixelSearch inside the While Loop? For example: HotKeySet("^!x", "MyExit") While 1 ; do stuff here WEnd Func MyExit() Exit EndFunc This is what I normally use for loops but I wanted to understand how to add a pixel search inside a loop, for example doing something extra if a pixel search is found while doing the loop? Maybe I am not explaining myself correctly because I don't have a purpose right now but I really wanna understand if this would be possible and how would it work? Also a quick question, when doing the PixelSearch, I normally use the Magnifier to search for Pixels with the AutoIt Windows Info and I dont know if the pixel is the entire square I see within the Magnifier? or just the center of the magnifier? Thanks in advance!! Link to comment Share on other sites More sharing options...
seadoggie01 Posted September 27, 2019 Share Posted September 27, 2019 (edited) Yes, you absolutely can. Lots of things can be put inside of other things... While True While True While True If PixelSearch() Then While True ConsoleWrite("Hi!") WEnd EndIf WEnd WEnd WEnd (That's an example, don't try it) Loops, functions, and conditionals can all have things inside of them Edit: Also, Welcome! Edited September 27, 2019 by seadoggie01 scorp2k19 1 All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types Link to comment Share on other sites More sharing options...
scorp2k19 Posted September 30, 2019 Author Share Posted September 30, 2019 On 9/27/2019 at 4:52 PM, seadoggie01 said: Yes, you absolutely can. Lots of things can be put inside of other things... While True While True While True If PixelSearch() Then While True ConsoleWrite("Hi!") WEnd EndIf WEnd WEnd WEnd (That's an example, don't try it) Loops, functions, and conditionals can all have things inside of them Edit: Also, Welcome! Thanks!!! I will try it. So basically I could do something like this right? HotKeySet("^!x", "MyExit") While 1 ; do stuff here If PixelSearch() Then While True ; do this WEnd Endif WEnd Func MyExit() Exit EndFunc Link to comment Share on other sites More sharing options...
seadoggie01 Posted September 30, 2019 Share Posted September 30, 2019 Yes. (I meant don't try it because there was no exit condition and no parameters for the PixelSearch... aka, it won't do anything) scorp2k19 1 All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types Link to comment Share on other sites More sharing options...
scorp2k19 Posted September 30, 2019 Author Share Posted September 30, 2019 Thanks for the help seadoggie01 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