Computer 1's code (Sender):
--Computer id is 1
print("Lamp on or off?")
print("1=On 0=Off")
rednet.open("back") --modem is indeed here and within range
ans = io.read() -- ans is what the user requested
if ans == ("1") then
rednet.send(1, "1")
print("Turned it on!")
elseif ans == ("0") then
rednet.send(1, "0")
print("Turned it off!")
else
print("Invalid Input")
end
Computer 2's code (Receiver):
--Computer id is 4
rednet.open("back") --modem is indeed here and within range
ans = rednet.receive()
if ans == ("1") then
redstone.setOutput("left", true) --Lamp is indeed here
elseif ans == ("0") then
redstone.setOutput("left", false) --Lamp is indeed here
else
print("Invalid Input!")
end












