コード例 #1
0
        public override void Tick(MegajewelForm form)
        {
            if (form.Processing.DiamondMineCleared) return;
            var grid = form.Processing.Grid;

            List<Gem> bestGems = new List<Gem>();
            for (int x = 0; x < 8; x++)
                for (int y = 0; y < 8; y++)
                {
                    Gem gem = grid[x, y];
                    if (gem.SuggestedPower >= 3)
                    {
                        bestGems.Add(gem);
                    }
                }
            if (bestGems.Count > 0)
            {
                foreach (Gem randomBestGem in bestGems)
                {
                    Point from = new Point(randomBestGem.X, randomBestGem.Y);
                    Point to = Predictor.MoveInDirection(from, randomBestGem.SuggestedDirection);
                    Point fromReal = form.CurrentMode.GetGemCenter(from.X, from.Y);
                    Point toReal = form.CurrentMode.GetGemCenter(to.X, to.Y);
                    Controller.MoveTo(fromReal.X, fromReal.Y);
                    Controller.HoldLeft();
                    Controller.MoveTo(toReal.X, toReal.Y);
                    Controller.ReleaseLeft();
                }
            }
        }
コード例 #2
0
        public override void Tick(MegajewelForm form)
        {
            int   x  = rgen.Next(7);
            int   y  = rgen.Next(7);
            Point p  = form.CurrentMode.GetGemCenter(x, y);
            Point p2 = form.CurrentMode.GetGemCenter(x + 1, y);

            Controller.MoveTo(p.X, p.Y);
            Controller.HoldLeft();
            Controller.MoveTo(p2.X, p2.Y);
            Controller.ReleaseLeft();
        }
コード例 #3
0
 public HotkeyManager(MegajewelForm form)
 {
     Form = form;
     AddHotkey(Keys.H, () =>
     {
         form.txtDebugLog.Text = "Hello, hotkeys!" + Environment.NewLine + form.txtDebugLog.Text;
     });
     AddHotkey(Keys.Tab, () =>
     {
         Form.IsAutonomous = !Form.IsAutonomous;
     });
 }
コード例 #4
0
 public HotkeyManager(MegajewelForm form)
 {
     Form = form;
     AddHotkey(Keys.H, () =>
     {
         form.txtDebugLog.Text = "Hello, hotkeys!" + Environment.NewLine + form.txtDebugLog.Text;
     });
     AddHotkey(Keys.Tab, () =>
     {
         Form.IsAutonomous = !Form.IsAutonomous;
     });
    
 }
コード例 #5
0
        public override void Tick(MegajewelForm form)
        {
            ticksMissed++;
            if (ticksMissed < 5)
            {
                return;
            }
            ticksMissed = 0;
            var grid = form.Processing.Grid;

            List <Gem> bestGems  = new List <Gem>();
            int        bestPower = 1;

            for (int x = 0; x < 8; x++)
            {
                for (int y = 0; y < 8; y++)
                {
                    Gem gem = grid[x, y];
                    if (gem.SuggestedPower == bestPower)
                    {
                        bestGems.Add(gem);
                    }
                    else if (gem.SuggestedPower > bestPower)
                    {
                        bestPower = gem.SuggestedPower;
                        bestGems.Clear();
                        bestGems.Add(gem);
                    }
                }
            }
            if (bestGems.Count > 0)
            {
                Gem   randomBestGem = bestGems[rgen.Next(bestGems.Count)];
                Point from          = new Point(randomBestGem.X, randomBestGem.Y);
                Point to            = Predictor.MoveInDirection(from, randomBestGem.SuggestedDirection);
                Point fromReal      = form.CurrentMode.GetGemCenter(from.X, from.Y);
                Point toReal        = form.CurrentMode.GetGemCenter(to.X, to.Y);
                Controller.MoveTo(fromReal.X, fromReal.Y);
                Controller.HoldLeft();
                Controller.MoveTo(toReal.X, toReal.Y);
                Controller.ReleaseLeft();
            }
        }
コード例 #6
0
 public override void Tick(MegajewelForm form)
 {
     tick++;
     if (tick % 2 == 0)
     {
         // Down
         for (int x = 0; x < 8; x++)
         {
             for (int y = 0; y < 8; y += 2)
             {
                 Point p  = form.CurrentMode.GetGemCenter(x, y);
                 Point p2 = form.CurrentMode.GetGemCenter(x, y + 1);
                 Controller.MoveTo(p.X, p.Y);
                 Controller.HoldLeft();
                 Controller.MoveTo(p2.X, p2.Y);
                 Controller.ReleaseLeft();
             }
         }
     }
     else
     {
         // Right
         for (int y = 0; y < 8; y++)
         {
             for (int x = 0; x < 8; x += 2)
             {
                 Point p  = form.CurrentMode.GetGemCenter(x, y);
                 Point p2 = form.CurrentMode.GetGemCenter(x + 1, y);
                 Controller.MoveTo(p.X, p.Y);
                 Controller.HoldLeft();
                 Controller.MoveTo(p2.X, p2.Y);
                 Controller.ReleaseLeft();
             }
         }
     }
 }
コード例 #7
0
        public override void Tick(MegajewelForm form)
        {
            if (form.Processing.DiamondMineCleared)
            {
                return;
            }
            var grid = form.Processing.Grid;

            List <Gem> bestGems = new List <Gem>();

            for (int x = 0; x < 8; x++)
            {
                for (int y = 0; y < 8; y++)
                {
                    Gem gem = grid[x, y];
                    if (gem.SuggestedPower >= 3)
                    {
                        bestGems.Add(gem);
                    }
                }
            }
            if (bestGems.Count > 0)
            {
                foreach (Gem randomBestGem in bestGems)
                {
                    Point from     = new Point(randomBestGem.X, randomBestGem.Y);
                    Point to       = Predictor.MoveInDirection(from, randomBestGem.SuggestedDirection);
                    Point fromReal = form.CurrentMode.GetGemCenter(from.X, from.Y);
                    Point toReal   = form.CurrentMode.GetGemCenter(to.X, to.Y);
                    Controller.MoveTo(fromReal.X, fromReal.Y);
                    Controller.HoldLeft();
                    Controller.MoveTo(toReal.X, toReal.Y);
                    Controller.ReleaseLeft();
                }
            }
        }
コード例 #8
0
 public abstract void Tick(MegajewelForm form);
コード例 #9
0
ファイル: Processing.cs プロジェクト: Soothsilver/megajewel
 public Processing(MegajewelForm form)
 {
     Form = form;
 }
コード例 #10
0
ファイル: Overlaying.cs プロジェクト: Soothsilver/megajewel
 public Overlaying(MegajewelForm form)
 {
     Form = form;
 }
コード例 #11
0
 public KnowledgeBase(MegajewelForm form)
 {
     Form = form;
 }
コード例 #12
0
 public KnowledgeBase(MegajewelForm form)
 {
     Form = form;
 }
コード例 #13
0
ファイル: Processing.cs プロジェクト: Soothsilver/megajewel
 public Processing(MegajewelForm form)
 {
     Form = form;
 }
コード例 #14
0
ファイル: Capturing.cs プロジェクト: Soothsilver/megajewel
 public Capturing(MegajewelForm form)
 {
     Form = form;
 }
コード例 #15
0
        public override void Tick(MegajewelForm form)
        {

            ticksMissed++;
            if (ticksMissed < 5) return;
            ticksMissed = 0;
            var grid = form.Processing.Grid;

            List<Gem> bestGems = new List<Gem>();
            int bestPower = 1;
            for (int x= 0;x<8;x++)
                for (int y = 0; y< 8;y++)
                {
                    Gem gem = grid[x, y];
                    if (gem.SuggestedPower == bestPower)
                    {
                        bestGems.Add(gem);
                    }
                    else if (gem.SuggestedPower > bestPower)
                    {
                        bestPower = gem.SuggestedPower;
                        bestGems.Clear();
                        bestGems.Add(gem);
                    }
                }
            if (bestGems.Count > 0)
            {
                Gem randomBestGem = bestGems[rgen.Next(bestGems.Count)];
                Point from = new Point(randomBestGem.X, randomBestGem.Y);
                Point to = Predictor.MoveInDirection(from, randomBestGem.SuggestedDirection);
                Point fromReal = form.CurrentMode.GetGemCenter(from.X, from.Y);
                Point toReal = form.CurrentMode.GetGemCenter(to.X, to.Y);
                Controller.MoveTo(fromReal.X, fromReal.Y);
                Controller.HoldLeft();
                Controller.MoveTo(toReal.X, toReal.Y);
                Controller.ReleaseLeft();
            }
        }
コード例 #16
0
 public override void Tick(MegajewelForm form)
 {
     // Do nothing.
 }
コード例 #17
0
 public abstract void Tick(MegajewelForm form);
コード例 #18
0
 public override void Tick(MegajewelForm form)
 {
    tick++;
     if (tick % 2 == 0)
     {
         // Down
         for (int x = 0; x < 8; x++)
         {
             for (int y = 0; y < 8; y += 2)
             {
                 Point p = form.CurrentMode.GetGemCenter(x, y);
                 Point p2 = form.CurrentMode.GetGemCenter(x, y + 1);
                 Controller.MoveTo(p.X, p.Y);
                 Controller.HoldLeft();
                 Controller.MoveTo(p2.X, p2.Y);
                 Controller.ReleaseLeft();
             }
         }
     }
     else
     {
         // Right
         for (int y = 0; y < 8; y++)
         {
             for (int x = 0; x < 8; x += 2)
             {
                 Point p = form.CurrentMode.GetGemCenter(x, y);
                 Point p2 = form.CurrentMode.GetGemCenter(x + 1, y);
                 Controller.MoveTo(p.X, p.Y);
                 Controller.HoldLeft();
                 Controller.MoveTo(p2.X, p2.Y);
                 Controller.ReleaseLeft();
             }
         }
     }
 }
コード例 #19
0
 public override void Tick(MegajewelForm form)
 {
     for (int i = 0; i < 10; i++)
     {
         int x = rgen.Next(8);
         int y = rgen.Next(7);
         Point p = form.CurrentMode.GetGemCenter(x, y);
         Point p2 = form.CurrentMode.GetGemCenter(x, y + 1);
         Controller.MoveTo(p.X, p.Y);
         Controller.HoldLeft();
         Controller.MoveTo(p2.X, p2.Y);
         Controller.ReleaseLeft();
     }
 }
コード例 #20
0
 public override void Tick(MegajewelForm form)
 {
     Controller.MoveTo(rgen.Next(0, 1680), rgen.Next(0, 1050));
 }
コード例 #21
0
 public override void Tick(MegajewelForm form)
 {
     Controller.MoveTo(rgen.Next(0, 1680), rgen.Next(0, 1050));
 }
コード例 #22
0
 public override void Tick(MegajewelForm form)
 {
     // Do nothing.
 }
コード例 #23
0
ファイル: Capturing.cs プロジェクト: Soothsilver/megajewel
 public Capturing(MegajewelForm form)
 {
     Form = form;
 }