Now opens modem.
Not sure why it wasn't being opened before.
This commit is contained in:
parent
5ec04421b2
commit
441702556a
@ -33,7 +33,9 @@ print("Checking for modem.")
|
|||||||
if (modem == nil) then
|
if (modem == nil) then
|
||||||
error("Modem not found.")
|
error("Modem not found.")
|
||||||
end
|
end
|
||||||
print("Modem found.")
|
|
||||||
|
print("Modem found. Opening on channel: " .. CHANNEL)
|
||||||
|
modem.open(CHANNEL)
|
||||||
|
|
||||||
local function captureString(str, seq)
|
local function captureString(str, seq)
|
||||||
if seq == nil then seq = "([^%s]+)" end
|
if seq == nil then seq = "([^%s]+)" end
|
||||||
@ -112,7 +114,6 @@ local function listenToMiners()
|
|||||||
while running do
|
while running do
|
||||||
local event, side, sendChannel, replyChannel, data, distance = os.pullEvent("modem_message")
|
local event, side, sendChannel, replyChannel, data, distance = os.pullEvent("modem_message")
|
||||||
print("")
|
print("")
|
||||||
print("Received data: " .. data)
|
|
||||||
local token, recipient, sender, type, content = interpretData(data)
|
local token, recipient, sender, type, content = interpretData(data)
|
||||||
if token == TOKEN and recipient == HOST then
|
if token == TOKEN and recipient == HOST then
|
||||||
handleMessage(sender, content, type)
|
handleMessage(sender, content, type)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user