Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("left")
- function findItem()
- for i = 1, 16 do
- if turtle.getItemCount(i) > 0 then
- turtle.select(i)
- break
- end
- end
- end
- function receiveRednetMessage()
- turtle.select(9)
- if message == "top" then
- repeat turtle.digUp() turtle.attackUp() until turtle.up()
- elseif message == "bottom" then
- repeat turtle.digDown() turtle.attackDown() until turtle.down()
- elseif message == "left" then
- turtle.turnLeft()
- elseif message == "right" then
- turtle.turnRight()
- elseif message == "front" then
- turtle.back()
- elseif message == "back" then
- repeat turtle.dig() turtle.attack() until turtle.forward()
- if protocol == "build" then
- findItem()
- if turtle.compareDown() == false then
- repeat turtle.digDown() until turtle.placeDown()
- end
- end
- end
- rednet.broadcast("yo", "moveConfirm")
- end
- while true do
- senderId, message, protocol = rednet.receive()
- receiveRednetMessage()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement