Implementing r.d dice rolling.

This commit is contained in:
raven 2016-08-05 08:47:25 -05:00
parent cb42aac634
commit 47440a1eac
3 changed files with 17 additions and 7 deletions

View File

@ -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

3
README
View File

@ -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

View File

@ -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);