public int[] GetValuesFromBound() { if (GeneratedBounds != null) { CaptureArea(); if (HangOnCapturedBound) { ShowCapture(); } return(ParseImageValues(RSCTracker.GetValuesFromImg(RSCTracker.KILLIMAGE))); } else { throw new InvalidOperationException("Use CreateFinder to determine bounds first"); } }
public static int[] ParseImageValues(string a) { RSCTracker.ToFile("Tesseract saw: " + a); Regex p = new Regex(@"(\d{1,6})\s(\d{1,6})\s(\d{1,6})\s(\d{1,6})"); if (!p.IsMatch(a)) { return(null); } Match m = p.Match(a); int[] ret = new int[4]; for (int i = 1; i <= 4; i++) { ret[i - 1] = int.Parse(m.Groups[i].Value); } RSCTracker.ToFile("Values parsed to " + ret[0] + " " + ret[1] + " " + ret[2] + " " + ret[3]); return(ret); }