Posted 13 August 2012 - 07:39 PM
Here's my code so far, I want to be able to use (at the moment print to test but also other things) either the message typed in, or the message received as a variable basically. (assigned to a)
Currently it returns either 1 (Received message) or 2 (Input message). The send or receive bit work fine!!
Please guide me!
Currently it returns either 1 (Received message) or 2 (Input message). The send or receive bit work fine!!
Please guide me!
function initialise (vRednetSide, vElevatorSide)
rednet.open (vRednetSide)
redstone.setOutput(vElevatorSide, false)
end
function Listen ()
senderId, message, distance = rednet.receive()
print (message)
return message
end
function selectFloor ()
write ("Enter floor: ")
vFloor = read()
rednet.broadcast(vFloor)
return vFloor
end
initialise ("back", "bottom")
a = parallel.waitForAny (Listen, selectFloor)
print (a)