Jump to content

Reece C.

Members
  • Posts

    42
  • Joined

  • Last visited

Everything posted by Reece C.

  1. I could just use this rednet.open("left") while true do shell.run("clear") if rs.getInput ("back") then rednet.broadcast("engines on") shell.run("reboot") else rednet.broadcast("engines off") shell.run("reboot") end os.pullEvent("redstone") end But sometimes there is a large delay before the message is updated. I need something more reliable.
  2. rednet.open("left") while true do shell.run("clear") if rs.getInput ("back") then rednet.broadcast("engines on") else rednet.broadcast("engines off") end os.pullEvent("redstone") end I want it to repeatedly send the correct message, instead of just sending it once when the red-stone is updated.
  3. Well, I just switched out my networking cables for a wireless modem, and the code still works. So yeah.
  4. This looks almost identical to the code I used. I don't see much, if any difference between the two.
  5. I'm talk'n red-stone detection. A conductive pipe that emits a red-stone signal when energy is passing through. Much like the red-stone item or fluid pipes. It shocks me that something like that isn't already installed.
  6. That's what I suspected. So I can easily just use wireless without having to change any code right?
  7. Which ever one has some sort of something to detect weather power is flowing is the better one. I wish I could detect power flow.
  8. How do I give you a like?

  9. Now all I have to figure out is how to make it look nice, you know, with lines ------------------ and stuff. Hope that won't be too difficult.
  10. And presto, it works! Thanks. So now I think I can use this method to add as many computers as I wish. Thank you!
  11. but, it still doesn't work after I fixed it.
  12. oh my bad, the buffer broadcast is in send format. My bad. :/
  13. Here are my current codes main code rednet.open("top") local engine_state = false local buffer_state = false mon = peripheral.wrap("back") while true do event, id, message = os.pullEvent("rednet_message") if message == "engines on" then engine_state = true elseif message == "engines off" then engine_state = false elseif message == "Buffer: Drain" then buffer_state = true elseif message == "Buffer: Retain" then buffer_state = false end mon.clear() mon.setCursorPos(5,5) if engine_state == true then mon.write("Engines: On") else mon.write("Engines: Off") end mon.setCursorPos(60,5) if buffer_state == true then mon.write("Buffer: Drain") else mon.write("Buffer: Retain") end end Engine send code rednet.open("left") while true do shell.run("clear") if rs.getInput ("back") then rednet.broadcast("engines on") else rednet.broadcast("engines off") end os.pullEvent("redstone") end Buffer send code rednet.open("top") while true do shell.run("clear") if rs.getInput ("front") then rednet.broadcast(21,"buffer drain") else rednet.broadcast(21,"buffer retain") end os.pullEvent("redstone") end end
  14. I am using the broadcast method. The engine status seems to be working fine, but the buffer state does not. It is recognizing the signal, but it does not change what is displayed.
  15. here is the wiki page http://computercraft.info/wiki/Rednet.send
  16. My engine computer sends like this rednet.send(21,"engines on") and that computer's id is 17
  17. Because what is happening now is that the main computer is only recognizing the message being sent to it from computer 17. And all the other computers are sending to computer 21 (the main computer). So we need the main computer to recognize messages from multiple ids (computer numbers)
  18. Oh, I thought that "21" was the id of the computer to send it to.
  19. Ah, I see your point. How do I change the rednet id's of my computers? Every computer has a different id, the only way I can think of to make the id's the same is to use one computer, which is not possible in this case.
  20. HURRAH! It works like a charm! So, now if I want to add more computers, and have there stats displayed, all I have to do is copy paste this code again, and change the "cursorPos", id, and the message. Lets say I added the buffer state. the program would look something like this? rednet.open("top") local engine_state = false mon = peripheral.wrap("back") while true do event, id, message = os.pullEvent("rednet_message") if id == 17 then if message == "engines on" then engine_state = true elseif message == "engines off" then engine_state = false end end mon.clear() mon.setCursorPos(5,5) if engine_state == true then mon.write("Engines: On") else mon.write("Engines: Off") end local buffer_state = false while true do event, id, message = os.pullEvent("rednet_message") if id == 10 then if message == "buffer drain" then buffer_state = true elseif message == "buffer retain" then buffer_state = false end end mon.clear() mon.setCursorPos(5,7) if buffer_state == true then mon.write("Buffer: Drain") else mon.write("Buffer: Retain") end end end
  21. the id is: rednet_message
  22. Sorry I don't understand.
  23. also, I ran some experiments. The main computer is detecting and responding to the message sent by the other computer, but it's just not responding correctly. So I think the id's are all in order. The sender code has the id of the main computer, and the main computer listens for the message of the computer with the id of 17.
×
×
  • Create New...