Cees-Jan Kiewiet has posted a tutorial to his site showing how to connect Phergie to Slack through a custom gateway. Phergie is a popular PHP open source IRC bot project in use in several channels on the Freenode.net IRC network.
Ever since the rise of Slack and the Phergie v3 connecting them has been on my to do list. And while Slack API is the better alternative this was fun nontheless.
He walks you through some of the prerequisites for the setup including a working installation of the Phergie bot (installations instructions not included). From there he helps you make the custom Gateway and make a user for the bot to operate under. He then includes the settings and configuration you'll need to configure on the bot to allow it to join the Slack instance.