Posted 22 September 2013 - 02:01 PM
I am relatively new to computercraft and I have set up 8 airport boards connected to 1 Computer(the server) with bundled cable. I know that this is not the best thing to use but due to the long distance and low altitude I have to use it. I would like to be able to output separate messages on separate boards, and I thought I had it working, however, when I send a message via rednet to one computer controlling one board, the same message appears on all 8 boards? Why is this?
Server code:
(The server ID is 44)
Board client code:
It is probably something stupid, but please take a look. thanks!
Server code:
function main()
term.clear()
term.setCursorPos(1,1)
rednet.open("top")
print("Airport Gate Screen Server booting...")
os.sleep(3)
print("Please enter the screen ID to change")
id = tonumber(read())
print("Please enter flight # & location")
message = read()
rednet.send(id,message)
main()
end
main()
(The server ID is 44)
Board client code:
function rednetreceive()
rednet.open("front")
id,message = rednet.receive()
if id == 44 then
screen()
end
end
function screen()
size = 1
side = "back"
mon = peripheral.wrap(side)
mon.setTextScale(size)
mon.setCursorPos(9,3)
mon.clear()
mon.write(message)
local cX,cY = mon.getCursorPos()
mon.setCursorPos(1,cY+2)
mon.write("Departure expected: **:**")
rednetreceive()
end
rednetreceive()
screen()
rednetreceive()
It is probably something stupid, but please take a look. thanks!