Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/18/2019 in all areas

  1. this is a UDF to make image search on inactive window, but not minimized. using it, you can seach for coords of an image so that you can use ControlClick to click on it in Background while you are watching a movie or doing something else on the screen. i am not who made this UDF . i only fixed some bugs on it : it wasn't able to run on 64 bit : so i added #AutoIt3Wrapper_UseX64=NO it looked for the top left of the image : so i made it find the height \ 2 and the width \ 2 of the image and add them to the Coords so the Coords will be at the middle of the image ... here is the UDF : imageSearchEX.au3 BmpSearch.au3 here is an example : #AutoIt3Wrapper_UseX64=NO ;because ImageSearchEX doesn't run on 64 bit #include <imageSearchEX.au3> $imageSearchEX = imageSearchEX ; this is to make it easy to write the name of the func ^_^ $Win = "..." ;the name or class of requested window $Image = "..." ;the path to the image you want to look for > it must be 24-bit Bitmap....and remember the more the image is small the faster you find it $_$.... ;you can use snipping tool .exe to capture it and use paint .exe to save it as 24-bit Bitmap $p= $imageSearchEX($Win,$Image) if $p=0 Then ; what to do if image was not exists MsgBox(0,"","Image Doesn't exist") EndIf _ArrayDisplay($p) ; you can delete this line >> as it only shows you the Coords of the image on the window ControlClick($Win,"leave it blank","the control you want to click","primary ...or the button you want to click","Number of clicks",$p[0],$p[1]) #cs ;If you want to test it on the screen using MouseClick or Mouse move ...etc $WinSize= WinGetPos("(Frozen) AutoIt v3 Window Info") MouseMove($p[0] + $WinSize[0],$p[1] + $WinSize[1],1) #ce and here are some functions to make it easy to use this UDF : #AutoIt3Wrapper_UseX64=NO #include <imageSearchEX.au3> Global $imageSearchEX = imageSearchEX Global $FAC = FindAndClick Global $WUA = WaitUntilAppear Global $WUATC = WaitUntilAppearThenClick Func FindAndClick($Window,$Image,$Control) ;~ This function is to find an image that is surely on the window when this function is called $coords = $imageSearchEX($Window,$Image) ControlClick($Window,"",$Control,"primary",1,$coords[0],$coords[1]) EndFunc Func WaitUntilAppear($Window,$Image,$Control) ;~ This function is to pause the script until an image is found on the window While 1 $coords = $imageSearchEX($Window,$Image) If Not $coords = 0 Then ExitLoop Sleep(50) WEnd EndFunc Func WaitUntilAppearThenClick($Window,$Image,$Control) ;~ This function is to pause the script until an image is found on the window then click on that image While 1 $coords = $imageSearchEX($Window,$Image) If Not $coords = 0 Then ControlClick($Window,"",$Control,"primary",1,$coords[0],$coords[1]) ExitLoop EndIf Sleep(50) WEnd EndFunc GAMERS - Asking for help with ANY kind of game automation is against the forum rules. DON'T DO IT. Sorry for bad English
    1 point
  2. RTFC

    Access Local Scope

    example of multiple GUI handling
    1 point
  3. Deye

    Access Local Scope

    Oops, didn't notice that line Then in that case : Or use MessageLoop mode for more of other available options Deye
    1 point
  4. BrewManNH

    Access Local Scope

    He's using OnEvent mode to call those functions, he'd have to rewrite the script to use MessageLoop mode, but it can be done.
    1 point
  5. jdelaney

    Access Local Scope

    Byref parameters or return from functions to variables and pass those to other functions. or don't use local for variables needed globally
    1 point
  6. Melba23

    Variable Access

    AndroidZero, Look at AdlibRegister in the Help file. M23
    1 point
  7. Use functions like ControlSetText rather than Send, and ControlClick rather that MouseClick. Another option, run it on session 0 (where services run) so that it won't interact with your current user session. Also, if you are only doing file manipulation, just use FileRead and FileWrite. Using Send and MouseClick will make concurrent running scripts easily conflict with each-other.
    1 point
  8. Just for the records: In the next Update (1.09) for the ISN AutoIt Studio, there will be an Undo/Redo Function in the Form Studio 😎
    1 point
  9. roselpi, Having now read back a bit more in the thread, I feel I must comment on this phrase from your last post: I am afraid that I do not agree with you here. You cannot expect AutoIt to provide functions that do exactly as you expect/wish in every case - it gives you a good set of basic commands which allow you to do practically anything with a bit of imagination and hard work. The UDFs we include with the standard AutoIt install are a good example of that - as the main author of the current _ArrayDisplay code I can assure you that its present behaviour is the result of many requests for an auto-expanding dialog, rather then the old fixed size one that used to be offered. My personal ExtMsgBox UDF that I suggested to you above is another case where basic AutoIt commands are combined to give you something much more polished than the basic Windows dialog. So what you are actually asking is for someone else to do all the hard work so that you can write a simple one-line command in your script which produces exactly what you require. Well, if that is not lazy - then I do not know what is! However, you finish with this line: And this is exactly what I would recommend. Take the existing _ArrayDisplay code (you actually need to look at ArrayDisplayInternals.au3) and try to understand what is going on within it - the code is actually pretty well commented for a standard UDF which will help enormously. You should then be able to write your version, omitting or changing various sections to get precisely what you want. I am certain people here will offer help on any questions you might have - as long as you have done due diligence with the Help file and forum search facility beforehand. That is the best way to learn AutoIt - getting down and dirty with the code. M23
    1 point
  10. your two functions waituntilappear... don't seem to work for me. the "while 1" function will end automatically as the statement for the array is false. I think this works better Do $Cords = imagesearchex($a,$b) $c = isarray($coords) sleep(50) until $c = 1 controlclick(.....)
    1 point
×
×
  • Create New...