So, I was poking about the internet for something fun and interesting to do when I came upon something that I was planning to write myself, but before I ever do that I always look to see if someone else has already done it. Why duplicate effort if you’re just goofing around. If I was into learning, of course I’d take a crack at it on my own, but I just wanted to find something and get it running. What I found was this: https://github.com/seishun/irc-steam-relay
It’s pretty simple really, using node.js establish a connection to an IRC channel, and a connection to Steam Chat, and then relay the messages. The implementation and documentation of this particular project left a bit to be desired however and initially I couldn’t figure out how the heck to get it working.
First things obviously, you need to have Node.js – setting that up is outside the scope of this post so I’m going to skip that bit.
With NPM installed it was very easy to setup irc-steam-relay with:
npm install git://github.com/seishun/irc-steam-relay.git
I set it up in a folder by itself, and the NPM install installed the node-modules directory and nothing more. People who aren’t familiar with node might not know the next step and the documentation isn’t very helpful so here is step by step from this point.
Create a new file, I usually name it “app.js” and paste in the details for setup found on the GitHub page.. here is my example.
var relay = require(‘irc-steam-relay’);
chatroom: ‘chatroom GID’,
msgFormat: ‘<%s> %s’,
msgFormatGame: ‘<%s> %s’,
emoteFormat: ‘<%s> %s’,
emoteFormatGame: ‘<%s> %s’
Notice the PORT field.. this isn’t in the README I sort of just felt that one out after having problems connecting to IRC initially.
Connecting to Steam was an even bigger issue, I created a new steam account since I didn’t want to tie up my personal one.. turns out, you can’t initialize a chat without having purchased something. Not even free game, gifted game or even family account. That account must OWN a game, otherwise you would get this.
This must be Steam’s cute way to get you to buy games… actually, it’s to prevent spammers and nuisances, and I get it and I didn’t mind searching for an hour for the right game I wanted to buy which, was Amnesia: Dark Descent for $4.99. That was last night, now today they release it in their Halloween Humble Bundle FTW seriously? What are the chances of that. Anyway…
The AUTH code never really came into play for me, not sure why not but I never had to put one in. But if you do, you get it in your email.. put it in, connect once and then comment it out as it won’t be needed again. You can run the app on the command line with: “node app.js” but this isn’t really sufficient for running something for any length of time and leaving it, so I set this up on my Virtual Host with a simple bash script using screen.
screen -dmS steam node app.js &
This way it runs in a screen process and I can access it with “screen -r steam” whenever I need to and close it gracefully. That’s really all there is to it, a few tweaks and you’ve connected your steam chat channel to your IRC channel. Feel free to come check out mine if it’s up and running the steam group is Pwn9, and the IRC channel is #pwn on esper.net
Just one more thing to take away from this, Node.js is totally awesome ain’t it?