コード例 #1
0
ファイル: Act.cs プロジェクト: DivinityArcane/lulzBot
        public static void cmd_act(Bot bot, String ns, String[] args, String msg, String from, dAmnPacket packet)
        {
            if (args.Length < 2)
            {
                bot.Say(ns, String.Format("<b>&raquo; Usage:</b> {0}act <i>[#channel]</i> msg", bot.Config.Trigger));
            }
            else
            {
                String chan, mesg;

                if (!args[1].StartsWith("#"))
                {
                    chan = ns;
                    mesg = msg.Substring(4);
                }
                else
                {
                    chan = args[1];
                    mesg = msg.Substring(5 + args[1].Length);
                }

                lock (CommandChannels["send"])
                {
                    CommandChannels["send"].Add(ns);
                }

                bot.Act(chan, mesg);
            }
        }
コード例 #2
0
ファイル: Channels.cs プロジェクト: DivinityArcane/lulzBot
        public static void cmd_channels(Bot bot, String ns, String[] args, String msg, String from, dAmnPacket packet)
        {
            String output = String.Empty;

            List<String> chans = new List<String>();

            try
            {
                foreach (var cd in Core.ChannelData.Values)
                    if (cd.Name != "chat:DataShare" && !cd.Name.StartsWith("pchat") && !cd.Name.StartsWith("login"))
                        chans.Add(Tools.FormatNamespace(cd.Name, Types.NamespaceFormat.Channel));

                chans.Sort();

                output += String.Format("<b>&raquo; I am currently residing in {0} channel{1}:</b><br/>", chans.Count, chans.Count == 1 ? "" : "s");

                output += String.Format("<b> &middot; [</b>{0}<b>]</b>", String.Join("<b>]</b>, <b>[</b>", chans));

                bot.Act(ns, output);
            }
            catch (Exception Ex)
            {
                if (Program.Debug)
                    bot.Say(ns, "Error: " + Ex.Message);
            }
        }
コード例 #3
0
ファイル: About.cs プロジェクト: DivinityArcane/lulzBot
        public static void cmd_about(Bot bot, String ns, String[] args, String msg, String from, dAmnPacket packet)
        {
            String output = String.Empty;

            output += String.Format("<b>&raquo; I am a <a href=\"http://fav.me/d5uviwb\">{0}</a> v{1} <b><sup>{2}</sup></b>, written by :devDivinityArcane:<br/>&raquo;</b> I am owned by :dev{3}:<br/>", Program.BotName, Program.Version, Program.ReleaseName, bot.Config.Owner);
            output += String.Format("<b>&raquo;</b> I've disconnected {0} time{1}, while I've been running for {2}<br/>", Program.Disconnects, Program.Disconnects == 1 ? "" : "s", Tools.FormatTime(bot.uptime));

            bot.Act(ns, output);
        }
コード例 #4
0
ファイル: Credits.cs プロジェクト: DivinityArcane/lulzBot
        public static void cmd_credits(Bot bot, String ns, String[] args, String msg, String from, dAmnPacket packet)
        {
            String output = String.Empty;

            output += "&raquo; lulzBot is a bot written by :devDivinityArcane: <sup><i>Formerly Kyogo</i></sup> and it couldn't have been done without the following people:";
            output += "<br/><br/><b>Absolutely f*****g no one!</b> <sub><sub>No, not really.</sub></sub><br/><br/>";
            output += ":devOrrinFox:, who thought of the name and inspired me to write the bot.<br/>";
            output += ":devDeathShadow--666:, for letting me look at n00ds of his sister when I did well.<br/>";
            output += ":devSubjectX52873M:, for teaching me quite a few fun things that bots could do, as well as proving that PHP sucks for bots. :cough: <sub><sub>Dante</sub></sub><br/>";
            output += ":devdoofsmack: and :devtwexler:, who wrote dAmnBot, which inspired me to write bots for dAmn.<br/>";
            output += ":devNoodleMan:, for writing NoodleBot and Gyn, which inspired me to do better, way back when.<br/>";
            output += ":develectricnet:, for writing Futurism, which gave me quite a few ideas on what to do for user<->bot interaction.<br/>";
            output += ":devphotofroggy:, for writing dAmnPHP and Contra, which gave me ideas on how to do certain things I was conflicted about.<br/>";
            output += "And the whole #Botdom team, who put up with my bullshit for many, many years!<br/>";
            output += "<br/>But, most of all, <b>you</b>, for continuing to use lulzBot and letting me know how I can improve it.";

            bot.Act(ns, output);
        }
コード例 #5
0
        private void PlayMove(GameResponse rawData)
        {
            _knowledge.Update(rawData);
            Move action = _bot.Act();

            _con.SendMove(action);
            pictureBoard.Image = KnowledgeRenderer.Render(_knowledge.Map, 4);

            var visRequests = _bot.Visualizaton.ToList();
            int max         = Math.Min(visRequests.Count, _visCtrls.Count);

            for (int i = 0; i < max; i++)
            {
                _visCtrls[i].Description.Text = visRequests[i].Description;
                _visCtrls[i].Image.Image      = KnowledgeRenderer.Render(_knowledge[visRequests[i].ChartName], KnowledgeRenderer.GradientRedToGreen, 4);
            }
            for (int i = max; i < _visCtrls.Count; i++)
            {
                _visCtrls[i].Description.Text = "...";
                _visCtrls[i].Image.Image      = null;
            }
        }