Awesome, thanks bro! Just one more question. How do I know what the computers ID is? I can turn the routers and stuff on ill just edit the start up. Also, should I put these under a specific code name? Or just ask the shell to run that at startup. So like I put that into the startup as like
rednet.open(side)
shell.run(program name)
Or should I do something else? For the receiving computer of course.
Edit: does this also leave the door open for a few seconds? Or would I have to alter that?
To check the computer's id, simply type:
id
Or use this within your code if you want to find out the ID that way(Sometimes useful, but not so much in this situation)
id = os.getComputerID
I would name the receiving computer program as "startup" so it runs whenever the computer restarts. The other program may be named whatever.
If you want the door to stay open for an amount of time, we will ditch the close variable and use this instead for the recieving side:
local open = "word that will trigger the door to open"
local delay = --A number for the delay in seconds
local side = "side the door is on, touching the computer"
while true do
local message, senderId = os.pullEvent("rednet_message")
if message == open then
rs.setOutput(side,true)
sleep(delay)
rs.setOutput(side,false)
end
end
You can have an infinate number of computers relaying the message to the recieving end, however, the ID variable MUST be the same for the message to go through. Of course if two computers sent the message at the same time, that could raise errors. I suggest sticking with two-four computers that relay the rednet_message to the reciever for less of a chance to send two messages at once.