Exemple #1
0
        //将时间格式化输出
        public void KeyTimeToGame(GameTime g, SummonerFlashTime s)
        {
            string msg = "";

            for (int i = 0; i < 5; i++)
            {
                //判断是否需要输出的信息
                if (s.Time[i] == 0)
                {
                    continue;
                }
                msg += summonerName[i] + TimeFix(g.Minutes, g.Seconds, s.Time[i]) + " ";
            }
            Console.WriteLine(msg);

            /*
             * try
             * {
             *  SendKeys.Send("{ENTER}" + "{CAPSLOCK}" + msg + "{CAPSLOCK}" + "{ENTER}");
             * }
             * catch (InvalidOperationException e)
             * {
             *  Console.WriteLine(e.Message);
             *  Console.WriteLine("Find a error!");
             *  throw;
             * }
             */
            dm.KeyPressChar("enter");
            dm.KeyPressChar("cap");
            IOHandle(msg.ToCharArray());
            dm.KeyPressChar("cap");
            dm.KeyPressChar("enter");
        }
Exemple #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            pattern   = @"^\d{1,2}[::][0-5]?[0-9]$";
            gameName  = "League of Legends (TM) Client";
            numOfSMOT = 0;

            outputTime        = new OutputTime();
            summonerFlashTime = new SummonerFlashTime();
            gameTime          = new GameTime();
            hook = new KeyboardHook();

            hook.KeyDownEvent += new KeyEventHandler(hook_KeyDown);
            hook.Start();
        }
 public void ShowMsg(GameTime gt, SummonerFlashTime sft)
 {
     lblMsgTemp.Text  = "游戏时间\r\n";
     lblMsgTemp.Text += gt.Minutes.ToString() + ":" + ((gt.Seconds < 10) ? ("0" + gt.Seconds.ToString()) : gt.Seconds.ToString()) + "\r\n";
     for (int i = 0; i < 5; i++)
     {
         uint t = sft.Time[i];
         if (t != 0)
         {
             lblMsgTemp.Text += (i == 2) ? " " : "" + OutputTime.summonerName[i] + t;
             if (t < 10)
             {
                 lblMsgTemp.Text += " ";
             }
             else if (t < 100)
             {
                 lblMsgTemp.Text += "  ";
             }
             lblMsgTemp.Text += "\r\n";
         }
     }
 }