Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- side = "left"
- local monitor = peripheral.wrap("right")
- rednet.open(side)
- term.redirect(monitor)
- monitor.write("Booted!")
- function clear() -- screen-clearing function
- term.clear()
- term.setCursorPos(1,1)
- end
- clear()
- while true do
- event, param1, param2 = os.pullEvent("rednet_message") -- with rednet messages, the second variable is the ID of
- -- the computer from which it was sent (integer) and
- -- the third is the message itself (string)
- -- parameter argument "rednet_message" limits the event
- -- accepted to just "rednet_message"
- if param2 == "e" then -- if the message received is the string "e",
- clear()
- break -- break the loop and exit
- end
- print(param2) -- if the loop isn't broke, it will print from which the ID came from and
- -- the message itself
- end
Advertisement
Add Comment
Please, Sign In to add comment