Posted 01 November 2012 - 07:15 PM
Hello, just needed to ask what I'm doing wrong here. No matter what configuration I try, I can't run a simple command through rednet. I am trying to set up a "master" computer, which will interface with various other computers in my world. For now, I'm just trying to turn on a redstone wire to learn the basics. This is my code so far:
"Sending Computer"
rednet.open("back") –allow wireless networking
command = read() –user inputs command to select process
if command == copper then –This is where the command is sent, to computer 2, with the message copper
rednet.send(2,"copper")
end
shell.run("factory") –returns the master computer to its default program
"Receiving Computer"
rednet.open("top")
while true do
command = rednet.receive()
if command == "copper" then
redstone.setOutput("front","true")
end
end
There is a wireless modem on both computers. Any suggestions?
"Sending Computer"
rednet.open("back") –allow wireless networking
command = read() –user inputs command to select process
if command == copper then –This is where the command is sent, to computer 2, with the message copper
rednet.send(2,"copper")
end
shell.run("factory") –returns the master computer to its default program
"Receiving Computer"
rednet.open("top")
while true do
command = rednet.receive()
if command == "copper" then
redstone.setOutput("front","true")
end
end
There is a wireless modem on both computers. Any suggestions?