improved opening of modem
This commit is contained in:
parent
61303835f7
commit
af6ff4e7dd
12
client
12
client
@ -1,3 +1,13 @@
|
||||
local sides = peripheral.getNames()
|
||||
for i = 1, #sides do
|
||||
if peripheral.getType(sides[i]) == "modem" then
|
||||
modemSide = sides[i]
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
rednet.open(modemSide)
|
||||
|
||||
function dump(o)
|
||||
if o == nil then
|
||||
return ""
|
||||
@ -15,7 +25,6 @@ function dump(o)
|
||||
return tostring(o)
|
||||
end
|
||||
|
||||
rednet.open("left")
|
||||
rednet.host("rmm", "t0-turtle01")
|
||||
local master = rednet.lookup("rmm", "master")
|
||||
while true do
|
||||
@ -45,3 +54,4 @@ while true do
|
||||
end
|
||||
end
|
||||
|
||||
rednet.close(modemSide)
|
||||
|
12
control
12
control
@ -1,3 +1,13 @@
|
||||
local sides = peripheral.getNames()
|
||||
for i = 1, #sides do
|
||||
if peripheral.getType(sides[i]) == "modem" then
|
||||
modemSide = sides[i]
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
rednet.open(modemSide)
|
||||
|
||||
function dump(o)
|
||||
if o == nil then
|
||||
return ""
|
||||
@ -73,10 +83,10 @@ function control()
|
||||
end
|
||||
end
|
||||
|
||||
rednet.open("back")
|
||||
rednet.host("rmm", "master")
|
||||
|
||||
while true do
|
||||
parallel.waitForAny(recv, control)
|
||||
end
|
||||
|
||||
rednet.close(modemSide)
|
||||
|
Loading…
x
Reference in New Issue
Block a user