public static string GetColour(Point point) { AutoHotkey.ExecSimple(string.Format("PixelGetColor, color, {0}, {1} ", point.X, point.Y)); string ret = AutoHotkey.GetVar("color"); return(ret); }
public static Point ImageSearch(string image, int intensityVariation, Point p1, Point p2) { AutoHotkey.SetVar("OutputVarX", "0"); AutoHotkey.SetVar("OutputVarY", "0"); AutoHotkey.ExecSimple( string.Format("ImageSearch OutputVarX, OutputVarY, {0}, {1}, {2}, {3}, *{4} {5} ", p1.X, p1.Y, p2.X, p2.Y, intensityVariation, image)); int erroLevel = -1; int.TryParse(AutoHotkey.GetVar("ErrorLevel"), out erroLevel); if (erroLevel == 1) { return(Point.Error); } else { return(new Point(int.Parse(AutoHotkey.GetVar("OutputVarX")), int.Parse(AutoHotkey.GetVar("OutputVarY")))); } }