Example #1
0
 public void Start()
 {
     if (_session == null)
     {
         _session = new MSession();
     }
     //TODO:
     //_nextViewer = User32.SetClipboardViewer(this.Handle);
     _robot.Deal(null, null);
 }
Example #2
0
        private void Answer(MSession session, MRequest request)
        {
            if (session.LastInput == request.RawInput)
            {
                session.RIndex += 1;
            }
            else
            {
                session.LastInput = request.RawInput;

                string t = Regex.Replace(request.RawInput, "\\s+", "");
                // 仅数字
                if (Regex.IsMatch(t, "^\\d+$"))
                {
                    return;
                }
                // 数学运算
                t = Regex.Replace(t, "[\\[\\{(【{]", "(");
                t = Regex.Replace(t, "[\\]\\})】}]", ")");
                if (Regex.IsMatch('(' + t + ')', @"^(((?<o>\()[-+]?(\d+[-+*/])*)+\d+((?<-o>\))([-+*/]\d+)*)+($|[-+*/]))*(?(o)(?!))$"))
                {
                    return;
                }

                session.Question.Clear();
                session.QIndex = 0;
                _DataModel.FindQuestion(session.Question, session.LastInput, session.Style, session.Language, session.Category);
                if (session.Question.Count < 1)
                {
                    _Target.SendMessage(session.LastInput);
                    return;
                }

                session.Response.Clear();
                session.RIndex = 0;
                _DataModel.FindResponse(session.Response, session.Question[0].P3100103, session.Style, session.Language, session.Category);
                if (session.Response.Count < 1)
                {
                    _Target.SendMessage(session.LastInput);
                    return;
                }
            }

            _Target.SendMessage(session.Response[session.RIndex].P3100105);
        }
Example #3
0
        public bool Start()
        {
            if (_session == null)
            {
                _session = new MSession();
            }

            SrcWindow = IntPtr.Zero;
            SrcControl = IntPtr.Zero;
            DstWindow = IntPtr.Zero;
            DstControl = IntPtr.Zero;

            return Deal(_UserModel.Solution.PreFunction);
        }
Example #4
0
        public void Start()
        {
            if (_Session == null)
            {
                _Session = new MSession();

                ShowOptions(EOptions.Default, "");
            }

            if (!_MagicPtn.Visible)
            {
                _MagicPtn.Visible = true;
            }
        }