Rivertam
Christoffer Öjeling
1 About
Rivertam is an IRC Bot written in Haskell.
LICENSE: AGPLv3 - GNU Affero General Public License v3
1.1 Features
-
Primitive Access System with different priviligies
-
Tremded Parser - Send a message to an IRC channel from tremded and vice versa
-
Flame/Love - What can be more humiliating than having an irc bot insult you?
-
Tremulous Master Polling - Find tremulous players, list online clan-players, get current scores from a server, get statistics based on cvars. All within 1.5s!
-
Clanwars Tracker - Saves clangames to a database, Generates a variety of statistics. Clangames are easily added with a brief command in irc.
-
Clanlist - Keep track of clans. Integrates with clanwars and tremulous commands.
-
Memos - A message that will be delivered whenever the person appears online or talks.
2 Getting rivertam
The preferred way to acquire rivertam is with git
git clone git://git.mercenariesguild.net/rivertam.git
You can also get a source tarball with the latest version at
http://git.mercenariesguild.net/?p=rivertam.git;a=snapshot;sf=tgz
The git repository can also be browsed at http://git.mercenariesguild.net/?p=rivertam.git
You will also need PostgreSQL, if you use linux I’m sure it’s in your repository, otherwise: http://www.postgresql.org
3 Building
3.1 Requirements
-
POSIX compatible system.
-
ghc >= 6.10 - http://haskell.org/ghc
-
Cabal - http://haskell.org/cabal
-
PostgreSQL headers - http://www.postgresql.org
3.2 Compiling & Installing
Compiling and installing is really easy! Cabal will download and install all dependencies.
cabal update
cd rivertam
cabal install
If you wish to install it globally run it with root privileges.
4 Basic configuration
First you’ll need PostgreSQL with a database rivertam got full permissions to. Since there’s so many different ways to do this, this guide wont even try to explain it. However, it’s very straightforward and it took me about 3min of googling to get it running.
4.1 river.conf
You can either
-
create .rivertam/ in your home directory and copy the example river.conf to it.
or
-
start rivertam in the directory with the config file in it. (NOTE: for this to work .rivertam/ can’t exist)
The example river.conf is well documented.
4.2 Tremded Parser
Syntax: !trem <message>
Example: !trem Hello! I love River-Tam!!!
Tremulous Output: [IRC] Nickname: Hello! I love River-Tam!!!
Syntax: (In-Game) irc: <message>
Example: irc: Hello! I love River-Tam too, but leave me alone! I’m playing!
IRC Output: <[T] Nickname> Hello! I love River-Tam too, but leave me alone! I’m playing!
NOTE: You must set up a fifo before using trem → irc!
Decide some arbitrary path for the fifo, here I’m going to use /tmp/fifo. You need to enter the path to the fifo in river.conf also.
mkfifo /tmp/fifo
NOTE: You must have both read AND write permission to the pipe.
When you later start your tremded you need to pipe it’s output to the fifo, specifically stderr. In this example we pipe both stdout and stderr:
tremded.x86 &> /tmp/fifo
Keep in mind that if you quit rivertam and the server writes something to the fifo it will crash. There’s an easy workaround, keep the fifo open in an external program without writing anything to it. Here’s a program like that written in C:
//Usage: ./program /path/to/fifo
#include <stdio.h>
int main(int argc, char ** argv)
{
}
5 Credits
-
Christoffer Öjeling “Cadynum” - <cadynum@gmail.com>
-
Twey - Haskell support
-
Raf - Helping me learn Haskell
-
OddRaw - Bughunting
-
MG & benmachine - git repository
-
Entroacceptor - Bughunting, bot hosting, SQL support