Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

Commit

Permalink
加大颜色判定范围以解决两个光圈太近时颜色互相影响导致不在判定范围内的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex1911-Jiang committed Mar 22, 2021
1 parent fb9379e commit 9048fe8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions GenshinBalladsOfBreezeAider/frmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,12 @@ private void btnStart_Click(object sender, EventArgs e)

Dictionary<Keys, DateTime> dicKeysNextPressTime = new Dictionary<Keys, DateTime>();

int width = (int)Math.Round(Screen.PrimaryScreen.Bounds.Width * dpiX);
int height = (int)Math.Round(Screen.PrimaryScreen.Bounds.Height * dpiY);
Size s = new Size(width, height);

while (working)
{
int width = (int)Math.Round(Screen.PrimaryScreen.Bounds.Width * dpiX);
int height = (int)Math.Round(Screen.PrimaryScreen.Bounds.Height * dpiY);
Size s = new Size(width, height);
Bitmap memoryImage = new Bitmap(width, height);
Graphics memoryGraphics = Graphics.FromImage(memoryImage);
memoryGraphics.CopyFromScreen(0, 0, 0, 0, s);
Expand Down Expand Up @@ -366,7 +367,7 @@ private DateTime PressKey(ref bool getReady, Bitmap bmp, int x, int y, Keys key)
}
if (getReady)
{
if (color.R == 255 && color.G > 170 && color.G < 230 && color.B > 60 && color.B < 70)
if (color.R > 240 && color.G > 210 && color.G < 240 && color.B > 50 && color.B < 80)
{
byte byteKey = (byte)key;
//getReady = false; //连击不会显示黑色圈导致判定有问题, 现只用作判断是否开始音游
Expand All @@ -380,7 +381,7 @@ private DateTime PressKey(ref bool getReady, Bitmap bmp, int x, int y, Keys key)
{
keybd_event(byteKey, code, 2, 0);
});
return DateTime.Now.AddMilliseconds(50);
return DateTime.Now.AddMilliseconds(100);
}
}
return DateTime.Now;
Expand Down

0 comments on commit 9048fe8

Please sign in to comment.