27 posts
Posted 21 January 2013 - 05:30 AM
Hi guys,
I need help for a simple code,
I want to a computer, when he broadcast "ABRIR" the turtle's break a block on front and place it again
8543 posts
Posted 21 January 2013 - 05:32 AM
Like this?
while true do
id, msg = rednet.receive()
if msg == "ABRIR" then
turtle.dig()
turtle.place()
end
end
1619 posts
Posted 21 January 2013 - 05:33 AM
Hi guys,
I need help for a simple code,
I want to a computer, when he broadcast "ABRIR" the turtle's break a block on front and place it again
For the computer:
rednet.open(side) --Change side to the side your modem is on, in quotation marks
rednet.broadcast("ABRIR")
For the turtle:
rednet.open(side) --Same as before
while true do
id, msg = rednet.receive()
if msg == "ABRIR" then
turtle.dig()
turtle.place()
end
end
EDIT: Ninja'd by Lyqyd :angry:/>
8543 posts
Posted 21 January 2013 - 05:36 AM
Though, I was operating on the assumption that he'd know to open rednet on the appropriate side, but it is kind of funny that our code was otherwise identical.
27 posts
Posted 21 January 2013 - 05:40 AM
Tkx guys