term.clear()
term.setCursorPos( 1,1 )
write("What side is your monitor?")
term.setCursorPos( 1,2 )
monSide = read()
term.setCursorPos( 1,4 )
write("What side is your modem?")
term.setCursorPos( 1,5 )
modemSide = read()
while peripheral.isPresent(string.lower(monSide)) == false do
print("There is nothing on that side!! Please try again!")
monSide = read()
end
while peripheral.isPresent(string.lower(modemSide)) == false do
print("There is nothing on that side!! Please try again!")
modemSide = read()
end
term.clear()
term.setCursorPos( 1,1 )
rednet.open(modemSide)
monitorMsg = peripheral.wrap(monSide)
print("Great! Now listening for messages from the loggers.")
lineNum = 1
scrollNum = 1
while true do
event, p1, p2, p3 = os.pullEvent()
if event == "rednet_message" and string.sub(p2,1,9) == "X90Logger" then
monitorMsg.setCursorPos(1, lineNum)
monitorMsg.write("."..p2)
term.setCursorPos(1, lineNum)
term.write("."..p2)
lineNum = lineNum + 1
if lineNum > 10 and string.len(p2) > 1 then
monitorMsg.scroll(scrollNum)
end
end
end