Change:
parallel.waitForAny(local x = read("*"), local password = rednet.receive()) --Unexpected symbol.
To:
local x,password
parallel.waitForAny(function() x = read("*") end, function() _,password = rednet.receive() end)
The
parallel.waitForAny is expecting
functions as arguments. I replaced your
assignments with two inline
functions. Also, the first return value for
rednet.receive() is the
senderID, the second is the
message. You want the
message. I ignored the first return value of
rednet.receive() so I could get the
message (
_,password = rednet.receive() ). You will have trouble if you don't do that.
Edit: CometWolf was answering this at the same time I was testing my answer. His answer is better developed, although he did not address the problem with your call to
rednet.receive(). I edited mine to emphasize the change I made to your code here.
Edited by surferpup, 28 January 2014 - 10:53 AM.