Posted 01 October 2012 - 04:41 AM
Hello everyone, currently setting up a minecart station (which will eventually have turtles storing things from chest carts that arrive at the station, which is why I need rednet)
Right now I'm sort of 'beta-testing'. I am simply detecting if a cart has arrived, sending a message to a computer, that computer, then reads the message, if the message is "Cart2", it will wait 5 seconds, then send a message back to the detector computer, which should send the cart away. These are my programs:
Detecting Computer
Receiving Computer:
The receiving computer does print that a minecart arrived.
EDIT: It appears one of the modems was off, although now once I add:
Right now I'm sort of 'beta-testing'. I am simply detecting if a cart has arrived, sending a message to a computer, that computer, then reads the message, if the message is "Cart2", it will wait 5 seconds, then send a message back to the detector computer, which should send the cart away. These are my programs:
Detecting Computer
local delay = 5
term.clear()
term.setCursorPos(1,1)
while true do
if redstone.getInput("bottom") then
rednet.send(7, "Cart2")
print(textutils.formatTime(os.time(),false)..": Minecart arrived at bay.")
senderId, message = rednet.receive()
if message == "SendCart2" then
redstone.setOutput("back", true)
print(textutils.formatTime(os.time(),false)..": Minecart left bay.")
sleep(2)
redstone.setOutput("back", false)
end
end
sleep(0.1)
end
Receiving Computer:
term.clear()
while true do
senderId, message = rednet.receive()
if message == "Cart2" then
sleep(5)
rednet.send(4, "SendCart2")
end
sleep(0.1)
end
The receiving computer does print that a minecart arrived.
EDIT: It appears one of the modems was off, although now once I add:
print(textutils.formatTime(os.time(), false)": Minecart arrived at bay two.")
onto the receiving computer, below line 4, the OSTime never prints, and the message is never sent, although there is no problem with that code because I have the same exact code in my sending computer for local logs. Thanks! :)/>/>