From 47440a1eacef8ee27a76c4a7e2fba2d65ff298e9 Mon Sep 17 00:00:00 2001 From: raven Date: Fri, 5 Aug 2016 08:47:25 -0500 Subject: [PATCH] Implementing r.d dice rolling. --- Makefile | 8 ++------ README | 3 ++- ravencommand.csharp | 13 +++++++++++++ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index fc206c2..4ac0c0c 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ raven.mono: /usr/bin/mcs /usr/bin/mono clean ./raven.csharp ./connection.csharp ./ravencommand.csharp /bin/bash /usr/bin/mail /usr/bin/wget mkdir -p /usr/local/etc/TheRaven mcs -out:raven.mono reportmessage.csharp *exception.csharp irc*message.csharp connection.csharp raven*.csharp - id raven || useradd -M -G bzr,ircd,api raven + id raven || useradd -M -G git,ircd,api raven id raven || usermod -d /usr/local/etc/TheRaven raven chown raven:raven /usr/local/etc/TheRaven @@ -15,7 +15,7 @@ edit: emacs -nw raven.csharp test: raven.mono - su raven -c 'script -c "mono ./raven.mono -c /usr/local/etc/TheRaven-Test -v" /tmp/raven-test.log' + script -c "mono ./raven.mono -c /usr/local/etc/TheRaven-Test -v" /tmp/raven-test.log check-for-verbosity: grep Console.WriteLine *.csharp | egrep -v 'verbosity|raven.csharp'; echo @@ -30,7 +30,3 @@ install: raven.mono /usr/bin/bash make-conf-dir.bash /usr/local/etc/TheRaven systemctl daemon-reload systemctl enable raven - -commit: /usr/bin/bzr - bzr commit - chown -R raven:bzr .bzr diff --git a/README b/README index eb4ee32..31e0819 100644 --- a/README +++ b/README @@ -1 +1,2 @@ -This is a readme. +This project is enabled for AniNIX::Bazaar. You can check it out remotely with the bzr package. +Project URL is bzr://bazaar.aninix.net/TheRaven diff --git a/ravencommand.csharp b/ravencommand.csharp index 277ed5f..3eedb15 100644 --- a/ravencommand.csharp +++ b/ravencommand.csharp @@ -50,6 +50,19 @@ namespace AniNIX.TheRaven { } connection.Write(send); return; + case "r.d": + if (bySpace.Length < 2) { + send.PrivMsg(theRaven.helpText,incoming.user); + } else { + try { + int result = theRaven.randomSeed.Next(Int32.Parse(bySpace[1])); + send.PrivMsg(String.Format("{0}",result+1),incoming.target); + } catch (Exception e) { + send.PrivMsg("Bad formatting.",incoming.target); + } + } + connection.Write(send); + return; case "r.tinyurl": if (bySpace.Length < 2) { send.PrivMsg(theRaven.helpText,incoming.user);