Posted 01 December 2013 - 02:59 PM
Hello! I'm building a home on a server, and I'm trying to heavily incorporate Computercraft into it. My current project is a lock for my front door that has other players type in their username to open the door. That username then is sent to a computer in my control room via rednet, where the username is displayed both on the computer and on a monitor. The last five or so, maybe even ten, usernames to open the front door are always displayed on the machines.
So far, I have successfully programmed the lock for the door and sending the message. However I am having problems with the control room computer receiving the message and the message being displayed. The receiving computer's sole purpose will be receiving the message, checking to see if the message came from the front door computer, and if yes, displaying it. The modem is on the top of the computer, the monitor is on the right, and the front door computer's ID is 79. The receiving computer's startup file looks like this:
What am I missing or doing wrong?
Thanks much,
Dorktoid
So far, I have successfully programmed the lock for the door and sending the message. However I am having problems with the control room computer receiving the message and the message being displayed. The receiving computer's sole purpose will be receiving the message, checking to see if the message came from the front door computer, and if yes, displaying it. The modem is on the top of the computer, the monitor is on the right, and the front door computer's ID is 79. The receiving computer's startup file looks like this:
term.clear()
term.setCursorPos(1,1)
rednet.open("top")
monitor = peripheral.wrap("right")
monitor.write("Front door access log:")
print("Front Door Access Log")
id, msg, dis = rednet.receive()
if id == 79 then
print(msg)
monitor.write(msg)
end
When I start up the computer, it prints on the screen and the monitor "Front door access log", like I want it to. However, the computer's display does not have a cursor. It will do nothing whatsoever unless I hold Ctrl+T. When the front door computer sends a message, the receiving computer's display skips a line and then the > appears with a cursor. The monitor does nothing.What am I missing or doing wrong?
Thanks much,
Dorktoid