Blog

Blog

Frotz on IRC

Posted at 22:49 on 08 Apr 2010

image

For some reason I got the idea that it would be fun to play some text adventure games collaboratively over IRC. I also wanted to learn a bit about the IRC protocol so I ended up writing a little program that can proxy the input and output from a process into an IRC channel. It can be used with Frotz to connect up a Z-Machine file to IRC.

The program is meant to be general purpose so there are probably lots of other uses for it. For example you might want to relay the output of a log file to a channel. You could do this simply by setting the command to something like 'tail -f /var/log/messages'. The code is a glib-based C program and I've tried to make it reusable so that it has the beginnings of an IRC client library using the GMainLoop.

Frotz has a dumb terminal mode called dfrotz which is designed for this sort of thing. However I had to make some small changes to it to stop it from printing the prompt unless it is longer than two characters. Otherwise it would litter the output with '>' symbols at the beginning of messages. I've put the patch for my changes here.

The code for the program is available here:

git clone git://git.busydoingnothing.co.uk/irc-relay.git