예제 #1
0
 private void run()
 {
     if (ContentsFinderConfirm.IsOpen)
     {
         if (!isUp)
         {
             isUp = true;
             SndPlayer.Play();
             Log.print("Dungeon is ready");
             if (Settings.Current.pBullet.active)
             {
                 new PushBullet.Note("DfAlert", "Dungeon is ready").Push();
             }
             _dutyJoiner.Reset();
         }
         if (Settings.Current.autoCommence.active)
         {
             _dutyJoiner.Commence();
         }
     }
     else
     {
         isUp = false;
     }
 }
예제 #2
0
        private async void EmoteMessageReceived(object sender, ff14bot.Managers.ChatEventArgs e)
        {
            if (Settings.current.Emote.Enabled)
            {
                var  msg    = e.ChatLogEntry.Contents;
                var  author = e.ChatLogEntry.SenderDisplayName;
                bool match  = false;
                if (authorCheck(author))
                {
                    match = msgMatchesCrit(Settings.current.Emote, msg);
                    if (match)
                    {
                        SndPlayer.play("emote.wav");
                        Log.Bot.print("收到来自[情感动作]的消息");

                        if (Settings.current.Emote.Reply && !Replied)
                        {
                            await Task.Delay(5000);

                            ChatManager.SendChat("/p " + Settings.current.Emote.ReplyText);
                            Replied = true;
                            await Task.Delay(300000);

                            Replied = false;
                        }
                    }
                }
                if (match || Settings.current.chatLog.LogAll)
                {
                    Log.Chat.printMsg(Log.Chat.Channels.Emote, msg, author);
                }
            }
        }
예제 #3
0
        private async void GameMasterMessageReceived(object sender, ChatEventArgs e)
        {
            if (Settings.current.GM.Enabled)
            {
                double timeDifference = (DateTime.Now - GMLastReplyTime).TotalSeconds;

                SndPlayer.play("gm.wav");
                Log.Bot.print("警告!110查房了!");
                Log.Chat.printMsg(Log.Chat.Channels.GM, e.ChatLogEntry.Contents, e.ChatLogEntry.SenderDisplayName);

                if (timeDifference < 300)
                {
                    Log.Bot.print("距离上次消息回复不足5分钟");
                    ChatManager.SendChat("/echo 距离上次消息回复不足5分钟");
                }

                if (Settings.current.GM.Reply && (timeDifference > 300))
                {
                    ChatManager.SendChat("/echo 5秒后自动回复消息");
                    await Task.Delay(5000);

                    ChatManager.SendChat("/r " + Settings.current.GM.ReplyText);
                    GMLastReplyTime = DateTime.Now;
                }
            }
        }
예제 #4
0
        private async void TellReceived(object sender, ChatEventArgs e)
        {
            if (Settings.current.Tell.Enabled)
            {
                var    msg            = e.ChatLogEntry.Contents;
                var    author         = e.ChatLogEntry.SenderDisplayName;
                double timeDifference = (DateTime.Now - LastReplyTime).TotalSeconds;

                SndPlayer.play("pm.wav");
                Log.Bot.print("收到了新的私聊消息");
                Log.Chat.printMsg(Log.Chat.Channels.Tell, msg, author);

                if (timeDifference < 300)
                {
                    Log.Bot.print("距离上次消息回复不足5分钟");
                    ChatManager.SendChat("/echo 距离上次消息回复不足5分钟");
                }

                if (Settings.current.Tell.Reply && (timeDifference > 300))
                {
                    ChatManager.SendChat("/echo 5秒后自动回复消息");
                    await Task.Delay(5000);

                    ChatManager.SendChat("/r " + Settings.current.Tell.ReplyText);
                    LastReplyTime = DateTime.Now;
                }
            }
        }
예제 #5
0
 private async void ShoutReceived(object sender, ff14bot.Managers.ChatEventArgs e)
 {
     if (Settings.Current.Shout.Enabled)
     {
         var  msg    = e.ChatLogEntry.Contents;
         var  author = e.ChatLogEntry.SenderDisplayName;
         bool match  = false;
         if (authorCheck(author))
         {
             match = msgMatchesCrit(Settings.Current.Shout, msg);
             if (match)
             {
                 SndPlayer.play("chat.wav");
                 Log.Bot.Print("[Shout] Message received");
                 if (Settings.Current.Shout.PushBulletEnabled && Settings.Current.pushBullet.Enabled)
                 {
                     await new PushBullet.Note("AlertMe", String.Format("From: {0}\r\n{1} {2}", author, '[' + Log.Chat.Channels.Shout.ToString() + ']', msg)).Push();
                 }
             }
         }
         if (match || Settings.Current.chatLog.LogAll)
         {
             Log.Chat.PrintMsg(Log.Chat.Channels.Shout, msg, author);
         }
     }
 }
예제 #6
0
        private async void GameMaster(object sender, ChatEventArgs e)
        {
            if (Settings.Current.GM.Enabled)
            {
                SndPlayer.play("gm.wav");
                Log.Bot.Print("ATTENTION! A Game Master is contacting you.");
                Log.Chat.PrintMsg(Log.Chat.Channels.Gm, e.ChatLogEntry.Contents, e.ChatLogEntry.SenderDisplayName);

                if (Settings.Current.GM.PushBulletEnabled && Settings.Current.pushBullet.Enabled)
                {
                    await new PushBullet.Note("AlertMe", String.Format("From: {0}\r\n{1} {2}", e.ChatLogEntry.SenderDisplayName, '[' + Log.Chat.Channels.Gm.ToString() + ']', e.ChatLogEntry.Contents)).Push();
                }
            }
        }
예제 #7
0
        private async void TellReceived(object sender, ff14bot.Managers.ChatEventArgs e)
        {
            if (Settings.Current.PM.Enabled)
            {
                var msg    = e.ChatLogEntry.Contents;
                var author = e.ChatLogEntry.SenderDisplayName;

                SndPlayer.play("pm.wav");
                Log.Bot.Print("[PM] message received");
                Log.Chat.PrintMsg(Log.Chat.Channels.Pm, msg, author);
                if (Settings.Current.PM.PushBulletEnabled && Settings.Current.pushBullet.Enabled)
                {
                    await new PushBullet.Note("AlertMe", String.Format("From: {0}\r\n{1} {2}", author, '[' + Log.Chat.Channels.Pm.ToString() + ']', msg)).Push();
                }
            }
        }
예제 #8
0
        protected void ReceiveMessage(object sender, ChatEventArgs e)
        {
            // e.ChatLogEntry.MessageType == (MessageType)2115 &&
            if (e.ChatLogEntry.Contents.Contains("有鱼上钩了") || e.ChatLogEntry.Contents.Contains("收竿停止了钓鱼"))
            {
                Logging.Write(Colors.OrangeRed, "Message - 正常钓鱼中");
                _count = 0;
                Logging.Write("计数清零");
            }
            else if (e.ChatLogEntry.Contents.Contains("甩出了鱼线开始钓鱼"))
            {
                Logging.Write(Colors.OrangeRed, "Message Received");
                var timeDifference = (DateTime.Now - _lastMessage).TotalSeconds;
                Logging.Write(timeDifference);
                _lastMessage = DateTime.Now;

                if (_count == 0)
                {
                    _count = 1;
                    Logging.Write("计数开始");
                }
                else if (_count != 0 && timeDifference < Settings.current.fishCheck)
                {
                    Logging.Write("上一次甩出鱼线后经过 " + timeDifference + ",小于设定的 " + Settings.current.fishCheck + " 秒");
                    Logging.Write("计数 " + _count);
                    _count++;
                }
                else if (_count == 2)
                {
                    // await Task.Delay(5000);
                    // ChatManager.SendChat("/ac 收竿");
                    _count = 0;
                    Logging.Write("计数清零");
                    SndPlayer.play("pm.wav");
                    TreeRoot.Stop("你可能有暴露的风险,停止RB");
                }
            }
        }