Replace process.api with Event

This commit is contained in:
kepler155c@gmail.com
2017-07-28 19:01:59 -04:00
parent f8bcf90a6b
commit be51935662
21 changed files with 326 additions and 343 deletions

View File

@@ -18,7 +18,7 @@ if device and device.wireless_modem then
Message.enable()
end
Event.addHandler('device_attach', function(event, deviceName)
Event.on('device_attach', function(event, deviceName)
if deviceName == 'wireless_modem' then
Message.enable()
end
@@ -41,7 +41,7 @@ function Message.removeHandler(h)
end
end
Event.addHandler('modem_message',
Event.on('modem_message',
function(event, side, sendChannel, replyChannel, msg, distance)
if msg and msg.type then -- filter out messages from other systems
local id = replyChannel