here is the code based on ur image if pixel pattern of "W" and "H" is located it will locate "H" then look for closest "W" to it then save it to variable XW and YW which the "W" we need since they are in same X , we only need math for "Y" one above is + 255 and the lower - 255 then to test it out i put mouse move to Y2 Code: begin if Color.Pixel pattern can be located on screen("0,0,0,11,40,1,0,2,16,-37,0,0,3,12,41,0,0,0,12,-43,5,0,2", "0") and Color.Pixel pattern can be located on screen("0,0,2,-1,41,0,0,0,31,-20,0,0,0,1,-20,0,0,3,1,42,0,0,12,-32,-23,0,0,0", "0") begin Color.Wait for and locate pixel pattern("0,0,2,-1,41,0,0,0,31,-20,0,0,0,1,-20,0,0,3,1,42,0,0,12,-32,-23,0,0,0", "0", "XH", "YH") Color.Find pixel pattern closest to coordinate("0,0,0,11,40,1,0,2,16,-37,0,0,3,12,41,0,0,0,12,-43,5,0,2", "0", "no", "{XH}", "{YH}", "XW", "YW") Variable.Evaluate (Math)("{YW} - 255", "Y1") Variable.Evaluate (Math)("{YW} + 255", "Y2") Mouse.Move to coordinate("{XW}", "{Y2}") end end
here is the code based on ur image if pixel pattern of "W" and "H" is located it will locate "H" then look for closest "W" to it then save it to variable XW and YW which the "W" we need since they are in same X , we only need math for "Y" one above is + 255 and the lower - 255 then to test it out i put mouse move to Y2 [code] begin if Color.Pixel pattern can be located on screen("0,0,0,11,40,1,0,2,16,-37,0,0,3,12,41,0,0,0,12,-43,5,0,2", "0") and Color.Pixel pattern can be located on screen("0,0,2,-1,41,0,0,0,31,-20,0,0,0,1,-20,0,0,3,1,42,0,0,12,-32,-23,0,0,0", "0") begin Color.Wait for and locate pixel pattern("0,0,2,-1,41,0,0,0,31,-20,0,0,0,1,-20,0,0,3,1,42,0,0,12,-32,-23,0,0,0", "0", "XH", "YH") Color.Find pixel pattern closest to coordinate("0,0,0,11,40,1,0,2,16,-37,0,0,3,12,41,0,0,0,12,-43,5,0,2", "0", "no", "{XH}", "{YH}", "XW", "YW") Variable.Evaluate (Math)("{YW} - 255", "Y1") Variable.Evaluate (Math)("{YW} + 255", "Y2") Mouse.Move to coordinate("{XW}", "{Y2}") end end[/code]
|