10 posts
Posted 06 April 2012 - 09:07 PM
The problem I am having is:
I rednet.send then go into receive(), and then it stops.
It was intended to get a rednet.send from another machine.
help would be appreciated
first pcSpoiler
rednet.open("top")
rednet.send(3, "check")
while true do
a, b = rednet.receive()
if b == "on" then
print("on")
end
end
second pcSpoiler
rednet.open("top")
while true do
e, p1 = rednet.receive()
a = rs.getOutput("left")
if p1 == "check" then
if a == true then
rednet.send(1, "on")
elseif a == false then
rednet.send(1, "off")
end
end
end
718 posts
Location
Hawaii
Posted 06 April 2012 - 09:10 PM
The problem I am having is:
I rednet.send then go into receive(), and then it stops.
It was intended to get a rednet.send from another machine.
help would be appreciated
first pcSpoiler
rednet.open("top")
rednet.send(3, "check")
while true do
a, b = rednet.receive()
if b == "on" then
print("on")
end
end
second pcSpoiler
rednet.open("top")
while true do
e, p1 = rednet.receive()
a = rs.getOutput("left")
if p1 == "check" then
if a == true then
rednet.send(1, "on")
elseif a == false then
rednet.send(1, "off")
end
end
end
Try to run the second program first then run the first one
10 posts
Posted 06 April 2012 - 09:24 PM
have tried that, doesn't work
*edit now my check on the 1. pc spits out either 28 or 32… ?
718 posts
Location
Hawaii
Posted 06 April 2012 - 09:28 PM
do you have a modem on top?
10 posts
Posted 06 April 2012 - 09:30 PM
on both pc's, yes
10 posts
Posted 06 April 2012 - 09:35 PM
I know this my be bothersome for you ComputerCraftFan11, but could you try and write the code as you would've done it ?
718 posts
Location
Hawaii
Posted 06 April 2012 - 09:52 PM
Program 1 would be like this:
rednet.open("top")
rednet.send(3, "check")
while true do
a, b = rednet.receive()
if b == "on" then
print("on")
elseif b == "off" then
print("off")
end
end
Program 2 would be like this:
rednet.open("top")
while true do
id, message = rednet.receive()
if message == "check" then
if rs.getInput("left") == true then
rednet.send(id, "on")
elseif rs.getInput("left") == false then
rednet.send(id, "off")
end
end
end
Found out problem:
you put rs.getOutput, i changed it to getInput, now try
10 posts
Posted 06 April 2012 - 10:01 PM
thxs that worked