Jump to content

MrMajorThorburn

Members
  • Posts

    12
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

MrMajorThorburn's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Its ok. I was not aware of the restriction of use of autoit. I will establish a business scenario and see if I get the same problem and if so raise a new request for help. I will be able to supply full disclosure that way. Thanks for your interest and guidance. Be back soon in another request.
  2. I blanked out the app I was automating. I afterwards realised that I was running my test where I run my automation, on a second screen. If I move SciTE to the main screen the test works so I need to build a better example. The problem I have is that the pixelsearch which is supplied the handle to the app window always returns the same location for the found (@error=0) pixel. I am using the handle as the window is not on the same screen as SciTE. Is the fact I'm running SciTE on another screen perhaps the cause of my problem?
  3. Using sample code: #include <MsgBoxConstants.au3> ; Find a pure red pixel in the range 0,0-20,300 Local $aCoord = PixelSearch(0, 0, 20, 300, 0xFF0000) If Not @error Then MsgBox($MB_SYSTEMMODAL, "", "X and Y are: " & $aCoord[0] & "," & $aCoord[1]) Else MsgBox($MB_SYSTEMMODAL, "", "Pure Not Found") EndIf ; Find a pure red pixel or a red pixel within 10 shades variations of pure red $aCoord = PixelSearch(0, 0, 20, 300, 0xFF0000, 10) If Not @error Then MsgBox($MB_SYSTEMMODAL, "", "X and Y are: " & $aCoord[0] & "," & $aCoord[1]) Else MsgBox($MB_SYSTEMMODAL, "", "Variant Not Found") EndIf and the attached screenshot which has Pure Red (FF0000) in one icon in the area being searched. Would someone please check this out for me?
  4. I have resolved one issue which was to do with my understanding of which coordinate system a function was using. Simply that I needed to read the documentation fully. Now I have done that and as a side effect of my investigation I now have a mouse locator that I can call and it shows me the mouse location wher I want to see it. Now I can adjust the locations I want things to be clicked and the work on that part is ongoing with no further need for responses to this chat line. I will mention before closing that I did find an anomaly which is a surprise. My debug log showed my window being 1536 by 949 but when I took a screenshot via Alt Printscreen the BMP it produced was, according to my paint.net, 2284 by 1414.
  5. Well, some progress at least. I can now see the saved screen capture in the control client area. I added GUISetBkColor(0xE0FFFF) before the createpic. I am still playing with the difference between GUI, Capture and Search coordinates but at least I can see what is being captured whilst inside the running script..
  6. Ok, changed the script but still a problem with correlation between coordinates of search, capture and control. The function I am using is coded like this: Func MarkSearchArea($X1,$Y1,$X2,$Y2) $sBMP_Path = @ScriptDir & "\Rect.bmp" _DebugOut($sBMP_Path & " " & $X1 & " " & $Y1 & " " & $X2 & " " & $Y2) _ScreenCapture_CaptureWnd($sBMP_Path,$WinHandle, $X1-200, $Y1-100, $X2+200, $Y2+100, False) $hBitmap_GUI = GUICreate("Search Area", $X2-$X1+1,$Y2-$Y1+10,$X1,$Y1-11,$SS_SIMPLE) GUISetState(@SW_SHOW,$hBitmap_GUI) $hPic = GUICtrlCreatePic($sBMP_Path,0,0,$X2-$X1+1,$Y2-$Y1+1,$SS_WHITEFRAME) GUISetState() EndFunc I am passing the same coordinate values to this function as those being used for the PixelSearch The bitmap shows the area I want is towards the right of the area and below it. How do I line these things up?
  7. Additional: I just found out that I can use ScreenCapture_CaptureWnd instead and that PixelSearch can use the same handle for searching so will have a go and see how I get on and feedback here once done.
  8. I setup a function to do the screen capture and the control overlay passing the same coordinates as are being used for the pixel search. The control overlay is showing on the window where I want it in that I can see the title text but there is nothing in the part of the control where I expected the bitmap to appear. Is it possible to set the background of the rectangle that would contain the bitmap to transparent so the actual window would show through? I would not need a bitmap then. The bitmap captured did not contain the area of the window I expected by that I mean not the same as where the control is seen. I have managed to manually find the correct offset from the parameter values past to the function and can see in the captured bitmap the part of the window I want to search and see in the control. It appears to me that the screen capture is using different coordinates (screen?) to the control coordinates (window?) but I am not sure about that and what coordinates the pixel search function is using. Can you help me with that?
  9. I am having to manually adjust the coordinates used for a PixelSearch by experimentation and have been wondering if there is some way I can display a rectangle round the area I am searching so I can speed up my manual process which I have to do if the app window is moved for any reason. My most recent reason for the move was getting a new bigger screen. I have done some searching but not found anything suitable that would only be active when I have set the TestCmd variable to 1 to indicate I am testing the Cmd segment of my script which is an automation of a game to do some resource farming. Hope someone can help me.
  10. Ok. my test has shown that the process of using _ColorGetRGB results in the same Hex values for the RGB as is returned by PixelgetColor. My problem is relating the RGB values as seen in an image editor as apposed to the RGB values shown by the PixelGetColor. I have two files that demonstrate my problem. One is a text file containing the hex values retrieved via PixelGetColor and the other is the extract of the screencapture for the same Window location in a JPG file. I have uploaded these files to share with you so you can see my problem. SampleDmp.txt
  11. does _DebugOut(Hex(PixelgetColor(10,10),6)) log the RGB values of the pixel or do I need to use $a = _ColorGetRGB(PixelgetColor(10,10)) _DebugOut($a[0] & $a[1] & $a[2]) I am asking as I am getting different values for the pixels comparing the information from first option and a screen capture viewed in an image editor.
  12. I am using PixelSearch with color of 0xD89840 and range 15 and get back color AE7134 also color D8A040 range 15 color received BC8F45 also color FFFFFF range 0 color received 876455 I am running W7 64bit and version 3.3.8.1 It looks to me like the range process is not working very well. If search was for FFFFFF and range was 0 ie exact color required why did I get a color found and returned that was not FFFFFF? code snipit is: ------------------------------------------- $coord = PixelSearch($homex-23,$homey,$homex+19,$homey+15,0xFFFFFF,0,1) if not @error Then _DebugOut("CheckDamage6: x=" & $coord[0] & ",y=" & $coord[1] & ",pixel=" & Hex(PixelgetColor($coord[0],$coord[1]),6)) $ReceivingDamage = True EndIf -------------------------------------------
×
×
  • Create New...