Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- bridge
- os.loadAPI("t")
- local args = {...}
- term.clear()
- term.setCursorPos(1,1)
- print("Attempting to bridge.")
- turtle.select(1)
- diagonalRight = false
- diagonalLeft = false
- messageSent = false
- if #args > 0 then
- if args[1] == "right" then
- diagonalRight = true
- elseif args[1] == "left" then
- diagonalLeft = true
- else
- print("Please specify left or right")
- end
- end
- while true do
- if turtle.getItemCount() > 0 then
- messageSent = false
- t.forward(1)
- t.digDown(1)
- t.placeDown(1)
- if diagonalRight then
- if turned then
- turtle.turnLeft()
- turned = false
- else
- turtle.turnRight()
- turned = true
- end
- end
- if diagonalLeft then
- if turned then
- turtle.turnRight()
- turned = false
- else
- turtle.turnLeft()
- turned = true
- end
- end
- else
- if messageSent == false then
- print("Insert more blocks in slot 1 to continue.")
- messageSent = true
- end
- sleep(5)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement