Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --LatvianRemote
- function init()
- clearTerm()
- rednet.open("back")
- parallel.waitForAll(loopRead, loopRednet)
- end
- function loopRednet()
- while true do
- event, p1, p2 = os.pullEvent("rednet_message")
- if stringStarts(p2, "latprint ") then
- print("> " .. string.sub(p2, 10))
- end
- end
- end
- function stringStarts(s, st)
- return string.sub(s, 1, string.len(st)) == st
- end
- function loopRead()
- while true do
- txt = read()
- if txt == "clear" then
- return clearTerm()
- end
- --print("> " .. txt)
- rednet.broadcast("latpath " .. txt)
- end
- end
- function clearTerm()
- term.clear()
- term.setCursorPos(1, 1)
- end
- init()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement