Last active
November 21, 2015 16:33
-
-
Save TheUltDev/60ebe0c5028b0abcf0a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local xenohub = IpcPublisherSocket.New('xenohub', 30100) | |
print('XenoHub listening on port 30100.') | |
-- Send blue flashing alarm to hue lights | |
--xenohub:PublishMessage('alarm', '0, 255,0') | |
Module.New('xenohub', function(mod) | |
-- Update player in XenoHub's player list | |
xenohub:PublishMessage('player', string.format('{"id": %d, "name": "%s", "level": %d, "vocation": "Druid", "script": "%s", "state": "%s", "exp": %d, "gold": %d}', | |
Self.ID(), | |
Self.Name(), | |
Self.Level(), | |
'-', | |
'-', | |
0, | |
0 | |
)); | |
-- Send location to XenoHub's map | |
local pos = Self.Position() | |
xenohub:PublishMessage('position', string.format('{"id": %d, "name": "%s", "x": %d, "y": %d, "z": %d}', | |
Self.ID(), | |
Self.Name(), | |
pos.x, pos.y, pos.z | |
)); | |
end) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment