예제 #1
0
 private static void SetClipBoardData()
 {
     if (Clipboard.ContainsText())
     {
         ClipBoard = SetEncodingDefault(Clipboard.GetText());
         if (ClipBoard.Contains("\n"))
         {
             ClipBoardLines = ClipBoard.Split('\n').ToList();
         }
     }
 }
예제 #2
0
        private static void Game_OnUpdate(EventArgs args)
        {
            if (CopyPaste["DisablePaste"].Cast <CheckBox>().CurrentValue)
            {
                return;
            }
            if (Sent)
            {
                return;
            }
            var delay = CopyPaste["Delay"].Cast <Slider>().CurrentValue;

            if (CopyPaste["Paste"].Cast <KeyBind>().CurrentValue)
            {
                SetClipBoardData();
                if (!ClipBoard.Contains("\n"))
                {
                    Chat.Say(ClipBoard);
                    Sent = true;
                    Core.DelayAction(() => Sent = false, delay);
                }
                else
                {
                    foreach (var s in ClipBoardLines)
                    {
                        Chat.Say(s);
                    }
                    Sent = true;
                    Core.DelayAction(() => Sent = false, delay);
                    ClipBoardLines.Clear();
                }
            }
            if (CopyPaste["PasteForAll"].Cast <KeyBind>().CurrentValue)
            {
                SetClipBoardData();
                if (!ClipBoard.Contains("\n"))
                {
                    Chat.Say("/all " + ClipBoard);
                    Sent = true;
                    Core.DelayAction(() => Sent = false, delay);
                }
                else
                {
                    foreach (var s in ClipBoardLines)
                    {
                        Chat.Say("/all " + s);
                    }
                    Sent = true;
                    Core.DelayAction(() => Sent = false, delay);
                    ClipBoardLines.Clear();
                }
            }
        }