IRC & Minecraft

From Unallocated Space
Revision as of 13:58, 6 April 2011 by C-P (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Why build a communication bridge between IRC and Minecraft? Why not.

Running the Minecraft Server

tail -f mcpipe | java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui |& python

import time,sys,os,string

while True:
        if tmp != "" and "!irc" in tmp and "[CONSOLE]" not in tmp:
                os.system("echo 'From MineCraft: "+tmp[27:]+" (!mc to reply)' > /uas/irc/irc")

Talking to people inside the Minecraft server through IRC is done using the !mc command on the IRC Bot. Inside Minecraft chat using !irc will send messages to the IRC channel through the bot.

Strangely, the Minecraft server writes most of its data out through stderr and not stdout, hence having to use |&.

Irc2mc2.png Irc2mc1.png