This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
unstopablekk's profile picture

[psst, help] Rednet not send/receive?

Started by unstopablekk, 11 February 2013 - 10:21 AM
unstopablekk #1
Posted 11 February 2013 - 11:21 AM
I may refer to the top room as the central computer room and the bottom room as the multiple computer storage room.

Okay, so me and my friend are trying to make a factory. I setup multiple computers with programs on each and a wireless redstone behind it so it sends the signal (http://puu.sh/20zg7) and it seems to work fine. I wanted to have this central computer (http://puu.sh/20zgI) to send commands to the computers you saw. My plan was to have the central computer broadcast a command to one of the individual computers at the bottom room (Room with all the computers).

When I tested this out this is what I got.
This is a setup to see how it would work: http://puu.sh/20zeR At first I thought it was the wireless redstone but it cant because these work just fine: http://puu.sh/20zfG

Now this computer is #14 (http://puu.sh/20zc4) and has this code: http://puu.sh/20z9q – this computer is acting as the bottom room

Now this computer is #13 (http://puu.sh/20zdy) and has this code: http://puu.sh/20zd6 – this computer is acting as the central computer

when I start them I notice that computer #14 seems to receive the message but does no actions.
I tried to use the os.reboot() function because computer #14 needs it so after the actions are complete then it will reboot and wait for another message from #13. I added the reboot command to pc #13 as-well to see what happens and still nothing. I then try both without the reboot function and still get the same results.

What am I doing wrong?
Zambonie #2
Posted 11 February 2013 - 11:27 AM
Instead of os.reboot,try shell.run("reboot") and see if that could change a little bit.
unstopablekk #3
Posted 11 February 2013 - 11:47 AM
Thanks, it kinda sorta works. I get the messages but the redstone doesn't seem to be going through, I also tried changing redstone.setOutput to rs.setOutput and I still get no result. I do however receive the message saying Hormones: Restocking Hormones but I only receive the message once and then when I reboot and it does it again it skips the Hormones: Restocking Hormones message and goes to Hormones: Hormones Done and it just keeps cycling through the messages and also doesn't give me the redstone action I was expecting.
pc sending messages on progress: http://puu.sh/20z9q
pc receiving messages on progress: http://puu.sh/20zd6
Doyle3694 #4
Posted 11 February 2013 - 12:13 PM
Here is the full code of the program reboot:

if term.isColour() then
term.setTextColour( colours.yellow )
end
print( "Goodbye" )
term.setTextColour( colours.white )
sleep( 1 )
os.reboot()

using shell.run("reboot") is just a really unefficient way around it.

I recommend you enclose everything in a while true do loop:

while true do
runcode()
runmorecode() -- Explain code
sleep(3)
end