Jump to content

Recommended Posts

Posted

Tell me if you need some more help.

A.Receiver(controls the lights):

rednet.open("right")

a, b = rednet.receive()

 

if b == "lights-on" then

redstone.setOutput("back",true)

sleep("3")

shell.run("startup")

end

 

if b == "lights-off" then

redstone.setOutput("back",false)

sleep("3")

shell.run("startup")

end


Save it as receiver

 

2.startup file


shell.run("receiver")


 

B.Sender(used to control):

1.To turn on lights


rednet.open("right")

rednet.send(14, "lights-on")


Save as lights-on

 

2.To turn of lights


rednet.open("right")

rednet.send(14, "lights-off")

Save as lights-off

Posted

Wouldn't it be more efficient to use a loop rather than running startup which runs receiver which starts the process all over again?

I may be wrong but I'm pretty sure calling a program within a program doesn't end the first one, just halts it until the called program is finished.

Also, you may want to add a way for the computers to exchange ID's..

rednet.send(14, "lights-off")

The receiving computer may not always be #14, possibly you could have the receivers broadcast their ID's and purpose as a lights on/off receiver and the sending computer looks for that and remembers the IDs.

Or maybe I'm just overachieving =/

Posted

Wouldn't it be more efficient to use a loop rather than running startup which runs receiver which starts the process all over again?

I may be wrong but I'm pretty sure calling a program within a program doesn't end the first one, just halts it until the called program is finished.

Also, you may want to add a way for the computers to exchange ID's..

The receiving computer may not always be #14, possibly you could have the receivers broadcast their ID's and purpose as a lights on/off receiver and the sending computer looks for that and remembers the IDs.

Or maybe I'm just overachieving =/

insert this if you dont want to enter the ID.

To turn on.

rednet.open("right")

rednet.broadcast("lights-on")

write("light are now on.")


 

 

And to turn off.


rednet.open("right")

rednet.broadcast("lights-off")

write("light are now off.")

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...