Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local C1, C2, C3, C4, C5, C6, C7, C8 = 96, 97, 99, 100, 101, 102, 103, 104
- local C1v, C2v, C3v, C4v, C5v, C6v, C7v, C8v
- local compID, value, distance = "nil", "nil", "nil"
- function netClose()
- rednet.close("right")
- end
- function netOpen()
- netClose()
- rednet.open("right")
- end
- function getData()
- compID, value, distance = rednet.receive()
- end
- function assignData()
- netOpen()
- getData()
- if compID == C1 then
- C1v = value
- print("Computer 1 reports: "..C1v)
- elseif compID == C2 then
- C2v = value
- print("Computer 2 reports: "..C2v)
- elseif compID == C3 then
- C3v = value
- print("Computer 3 reports: "..C3v)
- elseif compID == C4 then
- C4v = value
- print("Computer 4 reports: "..C4v)
- elseif compID == C5 then
- C5v = value
- print("Computer 5 reports: "..C5v)
- elseif compID == C6 then
- C6v = value
- print("Computer 6 reports: "..C6v)
- elseif compID == C7 then
- C7v = value
- print("Computer 7 reports: "..C7v)
- elseif compID == C8 then
- C8v = value
- print("Computer 8 reports: "..C8v)
- end
- end
- while true do assignData() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement