diff --git a/pocketremote.lua b/pocketremote.lua index 74a91cb..bca8fdd 100644 --- a/pocketremote.lua +++ b/pocketremote.lua @@ -1,9 +1,12 @@ -- Touch-Enabled Command Center for Pocket Computer (FIXED) -- Monitor and control autonomous mining turtles -local CHANNEL_SEND = 100 -local CHANNEL_RECEIVE = 101 -local STATUS_CHANNEL = 102 +local Channels = require('platform.channels') +local WebBridge = require('platform.webbridge') + +local CHANNEL_SEND = Channels.get('remoteturtle.command') +local CHANNEL_RECEIVE = Channels.get('remoteturtle.response') +local STATUS_CHANNEL = Channels.get('remoteturtle.status') local modem = peripheral.find("modem") if not modem then @@ -15,8 +18,10 @@ if pocket then modem = peripheral.find("modem") end -modem.open(CHANNEL_RECEIVE) -modem.open(STATUS_CHANNEL) +WebBridge.openChannels(modem, { + 'remoteturtle.response', + 'remoteturtle.status', +}) local w, h = term.getSize()