Skip to content

Commit

Permalink
updated release notes for mqtt
Browse files Browse the repository at this point in the history
  • Loading branch information
walterhiggins committed Jan 17, 2014
1 parent a13f3ba commit 9a2b39b
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
# 2014 01 17

Added support for communication with Arduino and other devices which
use the [MQTT protocol][mqtt] via a new `sc-mqtt` module. This module
requires a separate sc-mqtt.jar file downloadable from
<http://scriptcraftjs.org/download/extras/mqtt> which must be included
in the CraftBukkit classpath. If using MQTT in ScriptCraft, then
Craftbukkit should be launched like this...

java -classpath craftbukkit.jar;sc-mqtt.jar org.bukkit.craftbukkit.Main

You can use the new `sc-mqtt` module like this to send and receive
messages between minecraft and an Arduino. For example to send a
message to the MQTT broker whenever a player breaks a block...

var mqtt = require('sc-mqtt');
var client = mqtt.client('tcp://localhost:1883','scripcraft');
client.connect();

events.on('block.BlockBreakEvent', function(listener, event){
client.publish('minecraft','block-broken');
});

To have minecraft react to inputs from an MQTT broker...

var mqtt = require('sc-mqtt');
var client = mqtt.client('tcp://localhost:1883','scripcraft');
client.connect();
client.onMessageArrived(function(topic, message){
var payload = message.payload;
if (topic == 'arduino'){
// do something with payload.
}
});

[mqtt]: http://mqtt.org/
# 2014 01 14

Added config.yml file for configuration options. This file allows
Expand Down

0 comments on commit 9a2b39b

Please sign in to comment.