public static List<Color> yellowRange = new List<Color> { Color.FromArgb(191, 209, 154), Color.FromArgb(189, 207, 168), Color.FromArgb(185, 199, 139), Color.FromArgb(189,194,121), Color.FromArgb(189, 203, 144) };
public static List<Point> pointsToCheck = new List<Point> { new Point(959, 540), new Point(960, 540), new Point(960, 538) };
public static void thread1(Point pointToCheck , Color colorToCheck)
{
while (true)
{
Thread.Sleep(1);
var pointColor = GetColorAt(pointToCheck);
foreach(var yellow in yellowRange)
{
if(colorSimilar(pointColor, yellow, yellowTolerence))
{
if (importLibs.isKeyDown(Keys.RButton))
{
shouldfire = true;
}
}
}
}
}
public static void thread2()
{
while (true)
{
if(shouldfire == true)
{
shoot();
importLibs.mouse_event((int)importLibs.MouseEventFlags.MOVE, 0, 13, 0, 0);
new Thread(playbeep1).Start();
Thread.Sleep(18);
shouldfire = false;
}
if (importLibs.isKeyDown(Keys.NumPad9))
{
colorForm cf = new colorForm(GetColorAt(new Point(959, 540)));
cf.ShowDialog();
}
}
}