milo: single wired modem only
This commit is contained in:
@@ -85,7 +85,16 @@ Turtle must be connected to:
|
|||||||
error(msg)
|
error(msg)
|
||||||
end
|
end
|
||||||
|
|
||||||
local modem = Peripheral.get('wired_modem')
|
local modem
|
||||||
|
for _,v in pairs(device) do
|
||||||
|
if v.type == 'wired_modem' then
|
||||||
|
if modem then
|
||||||
|
Syntax('Only 1 wired modem can be connected')
|
||||||
|
end
|
||||||
|
modem = v
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if not modem or not modem.getNameLocal then
|
if not modem or not modem.getNameLocal then
|
||||||
Syntax('Wired modem missing')
|
Syntax('Wired modem missing')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ local function client(socket)
|
|||||||
if node then
|
if node then
|
||||||
local slot = node.adapter.getItemMeta(slotNo)
|
local slot = node.adapter.getItemMeta(slotNo)
|
||||||
if slot then
|
if slot then
|
||||||
if context.storage:import(node, slotNo, slot.count, slot) then
|
if context.storage:import(node, slotNo, slot.count, slot) > 0 then
|
||||||
local item = Milo:getItem(Milo:listItems(), slot)
|
local item = Milo:getItem(Milo:listItems(), slot)
|
||||||
if item then
|
if item then
|
||||||
socket:write({
|
socket:write({
|
||||||
|
|||||||
Reference in New Issue
Block a user