var readline = require('readline');
var mineflayer = require('mineflayer');

var rl = readline.createInterface({
	input: process.stdin,
	output: process.stdout,
	terminal: false
});

var bot = mineflayer.createBot({
  host: "hostname",
  username: "user@email.com",
  password: "password"
});

rl.on('line', function(line) {
	bot.chat(line);
});

bot.on('chat', function(username, message) {
  console.log(username + ": " + message);
});

@@ -180,113 +180,436 @@
 );%0A%0A
-var bot = mineflayer.createBot(%7B%0A  host: %22hostname%22,%0A  username: %22user@email.com%22,%0A  password: %22password%22
+function print_help() %7B%0A%09console.log(%22usage: node minechat.js %3Chostname%3E %3Cuser%3E %3Cpassword%3E%22);%0A%7D%0A%0Aif (process.argv.length %3C 5) %7B%0A%09console.log(%22Too few arguments!%22);%0A%09print_help();%0A%09process.exit(1);%0A%7D%0A%0Aprocess.argv.forEach(function(val, index, array) %7B%0A%09if (val == %22-h%22) %7B%0A%09%09print_help();%0A%09%09process.exit(0);%0A%09%7D%0A%7D);%0A%0Avar bot = mineflayer.createBot(%7B%0A  host: process.argv%5B2%5D,%0A  username: process.argv%5B3%5D,%0A  password: process.argv%5B4%5D
 %0A%7D);

Read host, user and passwd from arglist