public void StartMission(Bitmap image1) { var position = new List <(Point Button, Point Status)> { (new Point(900, 250), new Point(900, 200)), (new Point(900, 444), new Point(900, 388)), (new Point(900, 630), new Point(900, 580)), }; foreach (var p in position) { MouseController.Move(p.Button.X, p.Button.Y); while (true) { var image = Amongus.GetImage(); if (image.GetPixel(p.Status.X, p.Status.Y) != Color.FromArgb(0, 0, 0)) { MouseController.Click(); Thread.Sleep(20); break; } Thread.Sleep(20); } } }
private List <Bitmap> GetButtonImages(int count) { var result = new List <Bitmap>(); for (var i = 0; i < count; i++) { result.Add(Amongus.GetImage()); Thread.Sleep(320); } return(result); }
public void StartMission(Bitmap image) { var goal = new Point(460, 413); while (IsMyMission(image)) { var diff = _mapping.Where(x => image.GetPixel(x.X, x.Y) != x.Color).ToList(); if (diff.Any()) { var first = diff[diff.Count / 2]; MouseController.LeftDown(new Point(first.X, first.Y), 50); MouseController.LeftUp(new Point(goal.X, goal.Y), 50); } Thread.Sleep(100); image = Amongus.GetImage(); } }