Exemple #1
0
 // ------------------------------------------REGISTERED FUNCTIONS----------------------------------------------
 public void SendMessage(string Message)
 {
     ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(object state)
     {
         IRC_Functions.SendMessage(ParentChannel, Message);
     }), null);
 }
Exemple #2
0
 public void RefreshLUA()
 {
     ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(object state)
     {
         InitLUA(ParentChannel);
         IRC_Functions.SendMessage(ParentChannel, "Script refreshed.");
     }), null);
 }
Exemple #3
0
        public void ChatMessageReceived(User user, bool IsMod, string Message)
        {
            // Should probably add an event handler, but RegisterLuaDelegateType is poorly documented.

            ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(object state)
            {
                try
                {
                    NLua.LuaFunction MessageReceived = Environment["event_MessageReceived"] as NLua.LuaFunction;
                    MessageReceived.Call(user.Username, IsMod, Message); // Safer way to call than using DoString
                } catch (NLua.Exceptions.LuaScriptException e)
                {
                    IRC_Functions.SendMessage(ParentChannel, "Script failed");
                    Log.Logger.OutputToConsole(e.ToString());
                } catch {
                    // Do nothing
                }
            }), null);
        }
Exemple #4
0
 ///<summary>
 ///Clear messages by user in Channel
 ///</summary>
 public void ClearMessages()
 {
     IRC_Functions.ClearUserMessages(ChannelName, Username);
 }