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.")

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...