I looked at your code, and it seems to be failing to find CFL.bmp in the correct location. Part of the reason is that I'm not using the default XP desktop, as I prefer the NT look. Could I suggest running a loop to find CFL.bmp (go from say 25 to 35 in X and from 220 to 230 in Y), and then using that to determine how to modify MainTop, MainBottom, etc?
I'm going to try and do it myself right now, but I'm not sure there isn't some other problem. (To say nothing about never programming in AHK before...)
edit..
So I made it work on my machine. I had to make some changes to the script. Here's the result of FC:
Comparing files Original FindMagma.ahk and FINDMAGMA.AHK
***** Original FindMagma.ahk
FindImage(ImageX, ImageY
, 226, 28, 417, 38
, "CFL.bmp")
If ErrorLevel
***** FINDMAGMA.AHK
FindImage(ImageX, ImageY
, 220, 20, 451, 40
, "CFL.bmp")
If ErrorLevel
*****
I added some extra space so that some movement of CFL.bmp can happen (like using a "Windows Classic" Theme...)
***** Original FindMagma.ahk
}
Start := A_Now
***** FINDMAGMA.AHK
}
XOff := ImageX - 226
YOff := ImageY - 28
Start := A_Now
*****
Then I determine how much different this window is from the normal.
***** Original FindMagma.ahk
Found = Found Magma in Region %RegionX%,%RegionY%
FindImage(ImageX, ImageY, 178, 304, 232, 314, "Embark.bmp")
If ErrorLevel
***** FINDMAGMA.AHK
Found = Found Magma in Region %RegionX%,%RegionY%
FindImage(ImageX, ImageY, 178 + XOff, 304 + YOff, 232 + XOff, 314 + YOff, "Embark.bmp")
If ErrorLevel
*****
And then use those offsets to move some of the search boxes a bit:
***** Original FindMagma.ahk
, RegionXLeft, RegionXTop, RegionXRight, RegionXBottom
Loop
***** FINDMAGMA.AHK
, RegionXLeft, RegionXTop, RegionXRight, RegionXBottom
, XOff, YOff
Loop
*****
This is the declarations for GoToCorner
***** Original FindMagma.ahk
FindBlinkingX(ImageX, ImageY
, LocalRight, MainTop, RegionRight, MainBottom)
If ErrorLevel
***** FINDMAGMA.AHK
FindBlinkingX(ImageX, ImageY
, LocalRight + XOff, MainTop + YOff, RegionRight + XOff, MainBottom + YOff)
If ErrorLevel
*****
Also in GoToCorner
***** Original FindMagma.ahk
Else If (Corner = "TopLeft")
AND (ImageX = RegionXLeft)
AND (ImageY = RegionXTop)
Break
***** FINDMAGMA.AHK
Else If (Corner = "TopLeft")
AND (ImageX = RegionXLeft + XOff)
AND (ImageY = RegionXTop + YOff)
Break
*****
Note that if the planned NearestCorner is done, the other Corners will need to get the offsets, too.
I haven't done a full run on this very sloooow computer at work, but it's a good start.
[ December 17, 2007: Message edited by: Quarthinos ]