Jump to content

jiut

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by jiut

  1. It's working great Gotemp, thank you very much! The problem was indeed in ImageSearch.au3. I copied the one you posted on another thread.
  2. Thank you, Gotemp. I suspect there's something wrong with my ImageSearch.au3 file. The first image verification always work, but if the first image (for verification) isn't present the script always crashes with: ImageSearch.au3 (49) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: Also, is it possible to search a specific area in a window, by inputting the upper left and bottom right relative coordinates? Thank you
  3. ElseIf should also work.. I've tried your solution and if image1 shows up, it works. However, if image2 appears it shows the same error as before :/
  4. I've tried using 'window info', but the values I'm looking for don't show up. That'd be the best option, making it a lot simpler.. That's why I'm trying to use image recognition, which works for the purpose, but I don't know how to look for several images.
  5. Hi, I am trying to do the following: Search for an image inside a window (right now I can only search the entire desktop), and if it's found, do action 1. Else If, search image 2, and if it's found, do action 2. Else, do nothing. Run the code every 60 minutes. So far I have the following code: #include <ImageSearch.au3> $x1=0 $y1=0 $weaknessBar = _ImageSearch("C:\AutoIt\image1.bmp",1,$x1,$y1,0) $strengthBar = _ImageSearch("C:\AutoIt\image2.bmp",1,$x1,$y1,0) If $weaknessBar = 1 Then MsgBox(0,"1","found image1") ElseIf $strengthBar = 1 Then MsgBox(0,"2","found image2") Else Sleep(3600000) EndIf The problem with this is that it searches the whole desktop and not inside a specific window. I'm not sure if it's possible to search inside a window, but I couldn't implement _ImageSearchArea, either =/ Plus, how can I search multiple images? If I remove one of those variables the script runs fine, but I keep them both I get the following error: C:\Program Files (x86)\AutoIt3\Include\ImageSearch.au3 (49) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: Any help is much appreciated! Thank you very much
  6. Oh, of course! You're right! Since the area is delimited by the top left corner and then bottom right corner, it scans as I needed. But what if I need the opposite, the pixel coming from below? I've made pseudo-code and an image to explain the situation better: If (pixel 1 is moving up && is above Y1 && pixel 2 is below Y2) MoveMouse to Pixel 2 position else (MoveMouse to Pixel 1 position) Hopefully I could explain the situation in fully detail with the previous information. My problem is how to detect if the pixel is moving up. Is it possible to define two adjacent areas, and see if the pixel has moved from one to another (moving on the Y axis)? Thanks for all the help so far!
  7. There is not a specific amount of white pixels on the area. It can range from one to probably 10 or more at the same time. However, I'm only interested in the ones that enter the area from the top, and not from below. They may or may not come exactly straightly. They can move diagonally. The mouse should move to the ones that have the lowest Y position, or basically, move to the ones that enter the delimited are first. Preferably, the mouse should only move to the next pixel once the last pixel disappears from the designated area. How should I write it, so it compares the initial Y position of the pixel to the next (which should be lower)? Thanks once again
  8. Hi there! I've just started using AutoIt and it's an incredible automation tool! I don't know why I haven't started using it earlier! Thank you developers! I've created a macro that detects if a white pixel is on the screen, and if it is, the mouse moves to that position. The function that I have so far is: func start () While 1 $variable = PixelSearch(277, 488, 786, 513, "0xFFFFFF", 0) If not @error Then MouseMove($variable[0], $variable[1], 0) EndIf WEnd EndFunc My question is, how can I detect if the pixel comes from above or below the specified area of the pixel search? I've thought of creating another search area and determining if the pixel moves from one to another, but how could I translate it into code? Any thoughts on this are very appreciated! Thank you! : D
×
×
  • Create New...