refactor: replace hardcoded status channel ID with dynamic retrieval from platform.channels

This commit is contained in:
MayaTheShy
2026-03-26 15:22:31 -04:00
parent 05cf7e98d9
commit 92ea13a680

View File

@@ -1,7 +1,10 @@
-- Live GPS Tracker for Pocket Computer -- Live GPS Tracker for Pocket Computer
-- Shows your current location in real-time -- Shows your current location in real-time
local STATUS_CHANNEL = 102 local Channels = require('platform.channels')
local WebBridge = require('platform.webbridge')
local STATUS_CHANNEL = Channels.get('remoteturtle.status')
-- Setup modem -- Setup modem
local modem = peripheral.find("modem") local modem = peripheral.find("modem")
@@ -15,7 +18,7 @@ if pocket then
modem = peripheral.find("modem") modem = peripheral.find("modem")
end end
modem.open(STATUS_CHANNEL) WebBridge.openChannels(modem, { 'remoteturtle.status' })
local w, h = term.getSize() local w, h = term.getSize()
local myID = os.getComputerID() local myID = os.getComputerID()