This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
tysciman7's profile picture

Two things working

Started by tysciman7, 21 January 2013 - 04:54 PM
tysciman7 #1
Posted 21 January 2013 - 05:54 PM
How can i run a password door program and a rednet program that has to receive a message for the door to stay open on the same startup program
Kingdaro #2
Posted 21 January 2013 - 06:12 PM
I assume you want to be able to open a door by password and by rednet message. A neat system, I'd say. Should probably just run a parallel with the two programs:

parallel.waitForAny(
  function() shell.run('program1') end,
  function() shell.run('program2') end
)

Substituting "program1" and "program2" for the names of your password and rednet programs.
tysciman7 #3
Posted 22 January 2013 - 03:36 AM
ok if i put it in a loop will it stay running
SuicidalSTDz #4
Posted 22 January 2013 - 04:49 AM
ok if i put it in a loop will it stay running

A loop generally stays in a loop until an outside variable effects it. Being a player, server crash, etc.