Added some verbosity.
Mostly to test if the in-game computer can download on startup.
This commit is contained in:
parent
6a791d2741
commit
3fd7385441
@ -27,11 +27,12 @@ local FAILED = "failed"
|
|||||||
|
|
||||||
running = true
|
running = true
|
||||||
local modem = peripheral.find("modem")
|
local modem = peripheral.find("modem")
|
||||||
|
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.")
|
||||||
|
|
||||||
local function captureString(str, seq)
|
local function captureString(str, seq)
|
||||||
if seq == nil then seq = "([^%s]+)" end
|
if seq == nil then seq = "([^%s]+)" end
|
||||||
res = {}
|
res = {}
|
||||||
@ -60,6 +61,7 @@ local function interpretData(data)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- User command loop
|
-- User command loop
|
||||||
|
print("Now listening for user input.")
|
||||||
local function listenForCommands()
|
local function listenForCommands()
|
||||||
while running do
|
while running do
|
||||||
printPrompt()
|
printPrompt()
|
||||||
@ -108,7 +110,6 @@ local function listenToMiners()
|
|||||||
while running do
|
while running do
|
||||||
local event, side, channel, reply, message, distance = os.pullEvent("modem_message")
|
local event, side, channel, reply, message, distance = os.pullEvent("modem_message")
|
||||||
print("")
|
print("")
|
||||||
print("Recieved data.")
|
|
||||||
local token, recipient, sender, type, content = interpretData(message)
|
local token, recipient, sender, type, content = interpretData(message)
|
||||||
if token == TOKEN and recipient == HOST then
|
if token == TOKEN and recipient == HOST then
|
||||||
handleMessage(sender, content, type)
|
handleMessage(sender, content, type)
|
||||||
|
Loading…
Reference in New Issue
Block a user