示例#1
0
 void irc_OnMSGRecvd(MSG msg)
 {
     if (msg.message.StartsWith(".addact "))
     {
         action = msg.message.Substring(".addact ".Length);
         if (!action.Contains("$nick"))
         {
             action += " $nick";
         }
         actions.Add((string)action.Clone());
         EncFile.AppendText(server.Data + Path.DirectorySeparatorChar + "actions.db", action + "\n");
     }
     else if (msg.message.StartsWith(".act"))
     {
         if (msg.message.Split(' ').Length > 1)
         {
             action = actions[rand.Next(actions.Count)];
             irc.SendMe(msg.to, action.Replace("$nick", msg.message.Split(' ')[1]));
         }
         else
         {
             action = actions[rand.Next(actions.Count)];
             irc.SendMe(msg.to, action.Replace("$nick", msg.from));
         }
     }
 }
示例#2
0
 public override void AuthedCommand(MSG msg, int operLevel)
 {
     msg.message = msg.message.Substring(msg.message.IndexOf(' ') + 1);
     if (msg.message.StartsWith("add ") && msg.message.Split(' ').Length == 3)
     {
         oplist.Add(msg.message.Split(' ')[1], msg.message.Split(' ')[2]);
         EncFile.AppendText(server.Data + Path.DirectorySeparatorChar + "autoop.db", msg.message.Split(' ')[1] + " " + msg.message.Split(' ')[2] + "\n");
     }
 }
示例#3
0
 public override void Load()
 {
     if (File.Exists(server.Data + Path.DirectorySeparatorChar + "actions.db"))
     {
         foreach (string line in EncFile.ReadAllLines(server.Data + Path.DirectorySeparatorChar + "actions.db"))
         {
             actions.Add(line);
         }
     }
     else
     {
         File.Create(server.Data + Path.DirectorySeparatorChar + "actions.db").Close();
         EncFile.AppendText(server.Data + Path.DirectorySeparatorChar + "actions.db", "shakes hands with $nick\n");
         actions.Add("shakes hands with $nick");
     }
 }