Ejemplo n.º 1
0
 public static FindPathRobot GetInstance()
 {
     if (Instance == null)
     {
         Instance = new FindPathRobot();
     }
     return(Instance);
 }
Ejemplo n.º 2
0
 private RobotManager()
 {
     FindPath        = FindPathRobot.GetInstance();
     GotoTianzhufeng = GotoTianzhufengRobot.GetInstance();
     LianDan         = LianDanRobot.GetInstance();
     SongJing        = SongJingRobot.GetInstance();
     Zhenfa          = ZhenfaRobot.GetInstance();
     LuanZhou        = AutoWanderRobot.GetInstance();
     Caiqi           = CaiqiRobot.GetInstance();
     WuDangNew       = WuDangNewRobot.GetInstance();
 }
Ejemplo n.º 3
0
 private void DoStep3()
 {
     if (Regex.IsMatch(_currentMessage, @"^\s+\*+\[1;(?<color>[0-9]+)m\^", RegexOptions.Multiline))
     {
         color      = Regex.Match(_currentMessage, @"^\s+\*+\[1;(?<color>[0-9]+)m\^", RegexOptions.Multiline).Groups["color"].Value;
         _stepTicks = GlobalVariable.Ticks;
     }
     if (Regex.IsMatch(_currentMessage, @"炉火似乎正在慢慢减弱", RegexOptions.Multiline))
     {
         if ("35".Equals(color))
         {
             _comm.SendText("#wa 1500;change M");
         }
         if ("31".Equals(color))
         {
             _comm.SendText("#wa 1500;change L");
         }
         if ("33".Equals(color))
         {
             _comm.SendText("#wa 1500;change H");
         }
         _stepTicks = GlobalVariable.Ticks;
     }
     else if (Regex.IsMatch(_currentMessage, @"丹炉里传出来一阵清香,看来已经成丹了", RegexOptions.Multiline))
     {
         _comm.SendText("#wa 1500;zhan;n;#wa 1000;ask yu about 炼丹");
         _stepTicks = GlobalVariable.Ticks;
     }
     else if (Regex.IsMatch(_currentMessage, @"俞岱岩.*说道:「不错不错", RegexOptions.Multiline))
     {
         _comm.SendText("#goto 武当广场;wc");
         _stepNumber = 3;
         _stepTicks  = GlobalVariable.Ticks;
         Finish();
     }
     else if (Regex.IsMatch(_currentMessage, @"你没有看好丹炉,发现里面的丹药已经结块了", RegexOptions.Multiline))
     {
         _comm.SendText("zhan;#wa 2000;n;ld;#wa 2000;#goto 武当广场;qx");
         Stop();
         _stepTicks = GlobalVariable.Ticks;
         return;
     }
     else if (!FindPathRobot.GetInstance().IsRuning)
     {
         if (GlobalVariable.Ticks - _stepTicks > 200)
         {
             _comm.SendText("zhan;#wa 2000;n;ld;#wa 2000;#goto 武当广场;wc");
             _stepTicks = GlobalVariable.Ticks;
             Finish();
         }
     }
 }
Ejemplo n.º 4
0
 private void DoStep2()
 {
     if (Regex.IsMatch(_currentMessage, @"^>?\s?你向俞岱岩打听有关『炼丹』"))
     {
         _comm.SendText("south;#wa 500;zuo;#wa 500;kan");
         _stepNumber = 2;
         _stepTicks  = GlobalVariable.Ticks;
     }
     else if (!FindPathRobot.GetInstance().IsRuning)
     {
         if (GlobalVariable.Ticks - _stepTicks > 200)
         {
             _comm.SendText("ask yu about 炼丹");
             _stepTicks = GlobalVariable.Ticks;
         }
     }
 }
Ejemplo n.º 5
0
 private void DoStep4()
 {
     if (Regex.IsMatch(_currentMessage, @"云自遥到达诵经地点", RegexOptions.Multiline))
     {
         if (!GlobalVariable.CurrentLocation.Equals(_location))
         {
             _comm.SendText("#goto " + _location + ";l;emote 到达诵经地点!");
             return;
         }
         _stepNumber = 4;
         _comm.SendText("emote 查找书页");
         _stepTicks = GlobalVariable.Ticks;
     }
     else if (!FindPathRobot.GetInstance().IsRuning)
     {
         if (GlobalVariable.Ticks - _stepTicks > 2000)
         {
             _comm.SendText("l;emote 到达诵经地点");
             _stepTicks = GlobalVariable.Ticks;
         }
     }
 }
Ejemplo n.º 6
0
 private void DoStep3()
 {
     if (Regex.IsMatch(_currentMessage, "云自遥找知客借书"))
     {
         _comm.SendText("emote 借书完成");
         _stepTicks = GlobalVariable.Ticks;
     }
     else if (Regex.IsMatch(_currentMessage, "云自遥借书完成"))
     {
         _stepTicks = GlobalVariable.Ticks;
         _comm.SendText("#goto " + _location + ";l;#wa 2000;emote 到达诵经地点");
         _stepNumber = 3;
     }
     else if (!FindPathRobot.GetInstance().IsRuning)
     {
         if (GlobalVariable.Ticks - _stepTicks > 200)
         {
             _comm.SendText("emote 找知客借书");
             _stepTicks = GlobalVariable.Ticks;
         }
     }
 }
Ejemplo n.º 7
0
        private void DoStep2()
        {
            if (Regex.IsMatch(_currentMessage, "你向冲虚道长打听有关『quest』的消息.*冲虚道长.+说道:「今天全派弟子要在.*熟读典籍", RegexOptions.Singleline))
            {
                SongJingRobot.GetInstance().Run();
                _currentJob = "SongJing";
                _stepTicks  = GlobalVariable.Ticks;
            }
            else if (Regex.IsMatch(_currentMessage, "你向冲虚道长打听有关『success』的消息.*冲虚道长.*奖励", RegexOptions.Singleline))
            {
                _comm.SendText("n;w;w;get baicai;get zhou;#3 eat baicai;#3 eat zhou;drop zhou;drop baicai;#wa 3000;e;e;n;n;e;e;drink;#wa 3000;#goto 武当广场;#wa 1000;ask chongxu about quest");
                _stepTicks = GlobalVariable.Ticks;
            }
            else if (Regex.IsMatch(_currentMessage, "你向冲虚道长打听有关『quest』的消息.*冲虚道长.+说道:「道家炼气最讲究", RegexOptions.Singleline))
            {
                CaiqiRobot.GetInstance().Run();
                _currentJob = "CaiQi";
                _stepTicks  = GlobalVariable.Ticks;
            }
            else if (Regex.IsMatch(_currentMessage, "你向冲虚道长打听有关『quest』的消息.*冲虚道长.+说道:「武当派以真武七截阵闻名天下", RegexOptions.Singleline))
            {
                ZhenfaRobot.GetInstance().Run();
                _currentJob = "ZhenFa";
                _stepTicks  = GlobalVariable.Ticks;
            }
            else if (Regex.IsMatch(_currentMessage, "你向冲虚道长打听有关『quest』的消息.*冲虚道长.+说道:「武当三侠最近迷上了炼丹", RegexOptions.Singleline))
            {
                LianDanRobot.GetInstance().Run();
                _currentJob = "LianDan";
                _stepTicks  = GlobalVariable.Ticks;
            }
            else if (Regex.IsMatch(_currentMessage, "你向冲虚道长打听有关『quest』的消息.*冲虚道长.*现在还没有新的工作", RegexOptions.Singleline))
            {
                Robot rbt = WaitRobot.GetInstance();
                rbt.AfterCmd = "ask chongxu about quest";
                rbt.Run();
                _stepTicks = GlobalVariable.Ticks;
            }
            else if (Regex.IsMatch(_currentMessage, @"你向冲虚道长打听有关『quest』的消息.*冲虚道长.+说道:「.*还有任务在身", RegexOptions.Singleline))
            {
                _comm.SendText("ask chongxu about success;#wa 2000;ask chongxu about cancel;#wa 2000;ask chongxu about quest");
                _stepTicks = GlobalVariable.Ticks;
            }

            else
            {
                if (LianDanRobot.GetInstance().IsRuning)
                {
                    _stepTicks = GlobalVariable.Ticks;
                }
                if (CaiqiRobot.GetInstance().IsRuning)
                {
                    _stepTicks = GlobalVariable.Ticks;
                }
                if (SongJingRobot.GetInstance().IsRuning)
                {
                    _stepTicks = GlobalVariable.Ticks;
                }
                if (ZhenfaRobot.GetInstance().IsRuning)
                {
                    _stepTicks = GlobalVariable.Ticks;
                }
                if (FindPathRobot.GetInstance().IsRuning)
                {
                    _stepTicks = GlobalVariable.Ticks;
                }

                if (GlobalVariable.Ticks - _stepTicks > 500)
                {
                    if (GlobalVariable.CurrentLocation.Equals("武当广场"))
                    {
                        _comm.SendText("n;#wa 5000;s;ask chongxu about quest");
                        _stepTicks = GlobalVariable.Ticks;
                    }
                }
            }
        }