Right,
I\'m trying to write a wee script in PHP that will send an in game chat package to Minecraft.
//Deliberately low timeout
$mc = fsockopen(\"localho
try the plugin HTTPConsole and
and use a function like this to execute the command:
function exec_shell_command($command) {
$command = urlencode($command);
$url = "http://127.0.0.1:25560/console?command=$command";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($ch);
curl_close($ch);
return $out;
}
$retval = exec_shell_command("say this is a server message");
I am not sure if this is doing what you want when you say "send a chat message", This posts a console message to the server.