Пример #1
0
 private void ManualConfig_Tick(object sender, EventArgs e)
 {
     win32.MoveMouse(Setting.BattleX, Setting.BattleY);
     win32.MoveMouse(Setting.BattleX + 1, Setting.BattleY);
     if (cManualConfig1.Checked)
     {
         //pixelmiddle
         uint  pixel       = Convert.ToUInt32(getpixel.GrabPixel(Setting.TargetX, Setting.TargetY));
         Color colormiddle = Color.FromArgb((int)(pixel & 0x000000FF), (int)(pixel & 0x0000FF00) >> 8, (int)(pixel & 0x00FF0000) >> 16);
         ManualMiddle.BackColor = colormiddle;
         //pixelleft
         uint  pixelleft = Convert.ToUInt32(getpixel.GrabPixel(Setting.TargetX - 1, Setting.TargetY));
         Color colorleft = Color.FromArgb((int)(pixelleft & 0x000000FF), (int)(pixelleft & 0x0000FF00) >> 8, (int)(pixelleft & 0x00FF0000) >> 16);
         ManualLeft.BackColor = colorleft;
         //pixelright
         uint  pixelright = Convert.ToUInt32(getpixel.GrabPixel(Setting.TargetX + 1, Setting.TargetY));
         Color colorright = Color.FromArgb((int)(pixelright & 0x000000FF), (int)(pixelright & 0x0000FF00) >> 8, (int)(pixelright & 0x00FF0000) >> 16);
         ManualRight.BackColor = colorright;
         //pixelup
         uint  pixelup = Convert.ToUInt32(getpixel.GrabPixel(Setting.TargetX, Setting.TargetY - 1));
         Color colorup = Color.FromArgb((int)(pixelup & 0x000000FF), (int)(pixelup & 0x0000FF00) >> 8, (int)(pixelup & 0x00FF0000) >> 16);
         ManualUp.BackColor = colorup;
         //pixeldown
         uint  pixeldown = Convert.ToUInt32(getpixel.GrabPixel(Setting.TargetX, Setting.TargetY + 1));
         Color colordown = Color.FromArgb((int)(pixeldown & 0x000000FF), (int)(pixeldown & 0x0000FF00) >> 8, (int)(pixeldown & 0x00FF0000) >> 16);
         ManualDown.BackColor = colordown;
     }
     if (cManualConfig2.Checked)
     {
         //pixelmiddle
         uint  pixel       = Convert.ToUInt32(getpixel.GrabPixel(Setting.TargetX2, Setting.TargetY2));
         Color colormiddle = Color.FromArgb((int)(pixel & 0x000000FF), (int)(pixel & 0x0000FF00) >> 8, (int)(pixel & 0x00FF0000) >> 16);
         ManualMiddle.BackColor = colormiddle;
         //pixelleft
         uint  pixelleft = Convert.ToUInt32(getpixel.GrabPixel(Setting.TargetX2 - 1, Setting.TargetY2));
         Color colorleft = Color.FromArgb((int)(pixelleft & 0x000000FF), (int)(pixelleft & 0x0000FF00) >> 8, (int)(pixelleft & 0x00FF0000) >> 16);
         ManualLeft.BackColor = colorleft;
         //pixelright
         uint  pixelright = Convert.ToUInt32(getpixel.GrabPixel(Setting.TargetX2 + 1, Setting.TargetY2));
         Color colorright = Color.FromArgb((int)(pixelright & 0x000000FF), (int)(pixelright & 0x0000FF00) >> 8, (int)(pixelright & 0x00FF0000) >> 16);
         ManualRight.BackColor = colorright;
         //pixelup
         uint  pixelup = Convert.ToUInt32(getpixel.GrabPixel(Setting.TargetX2, Setting.TargetY2 - 1));
         Color colorup = Color.FromArgb((int)(pixelup & 0x000000FF), (int)(pixelup & 0x0000FF00) >> 8, (int)(pixelup & 0x00FF0000) >> 16);
         ManualUp.BackColor = colorup;
         //pixeldown
         uint  pixeldown = Convert.ToUInt32(getpixel.GrabPixel(Setting.TargetX2, Setting.TargetY2 + 1));
         Color colordown = Color.FromArgb((int)(pixeldown & 0x000000FF), (int)(pixeldown & 0x0000FF00) >> 8, (int)(pixeldown & 0x00FF0000) >> 16);
         ManualDown.BackColor = colordown;
     }
     if (!cManualConfig1.Checked && !cManualConfig2.Checked)
     {
         ManualMiddle.BackColor = Color.Black;
         ManualRight.BackColor  = Color.Black;
         ManualLeft.BackColor   = Color.Black;
         ManualUp.BackColor     = Color.Black;
         ManualDown.BackColor   = Color.Black;
         ManualConfig.Stop();
     }
 }