From bc9ffadc2380fc103aec714b7d234bef367db079 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Enrico=20Tr=C3=B6ger?= Date: Mon, 20 Oct 2008 02:24:22 +0200 Subject: [PATCH] Add !moo, it's just too important too miss it. --- src/irc.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/irc.c b/src/irc.c index 02e75a6..ed3ba69 100644 --- a/src/irc.c +++ b/src/irc.c @@ -356,6 +356,36 @@ static gboolean get_argument_two(const gchar *line, guint len, const gchar *cmd, } +static void moo(irc_conn_t *irc_conn) +{ + gint32 rand = g_random_int(); + + if (rand % 2 == 0) + { + gsize i; + const gchar *moo_str[] = { + " ^__^\r\n", + " (oo)\r\n", + " /-----(__)\r\n", + " / | ||\r\n", + " * /\\---/\\\r\n", + " ~~ ~~\n\r\n", + "..\"Have you mooed today?\"..\r\n", + NULL + }; + + for (i = 0; moo_str[i] != NULL; i++) + { + irc_send_message(irc_conn, NULL, moo_str[i]); + } + } + else + { + irc_send_message(irc_conn, NULL, "I have Super Cow Powers. Have you mooed today?"); + } +} + + static gboolean process_line(irc_conn_t *irc_conn, const gchar *line, guint len) { static gchar msg[1024]; @@ -452,6 +482,11 @@ static gboolean process_line(irc_conn_t *irc_conn, const gchar *line, guint len) bullets_left--; } } + // !moo + else if (strncmp(content, "!moo", 4) == 0) + { + moo(irc_conn); + } // !coffee else if (strncmp(content, "!coffee", 7) == 0) { -- 2.11.4.GIT