Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- goLeft = false
- coalSlots = {1,5,9,13}
- iFuel = 1
- brickSlots = {2,3,4,6,7,8,10,11,12,14,15,16}
- iBrick = 1
- print("Enter L or R")
- direction = read()
- if direction == "l" then
- goLeft = true
- end
- print("Enter x:")
- x = tonumber(read())
- print("Enter y:")
- y = tonumber(read()) - 1
- yT = y
- function refuelT ()
- turtle.select(coalSlots[iFuel])
- turtle.refuel()
- iFuel = iFuel + 1
- end
- function selectBrick ()
- turtle.select(brickSlots[iBrick])
- if iBrick < 12 then
- iBrick = iBrick + 1
- else
- iBrick = 1
- end
- end
- refuelT()
- selectBrick()
- while x >= 1 do
- y = yT
- while y >= 1 do
- print("x: " .. x .. ", y: ".. y)
- turtle.digDown()
- if turtle.getItemCount() == 1 then
- selectBrick()
- end
- turtle.placeDown()
- turtle.digUp()
- turtle.dig()
- while turtle.detect() == true do
- turtle.dig()
- sleep(0.5)
- end
- turtle.forward()
- y = y - 1
- end
- print(x)
- if goLeft == true then
- turtle.digUp()
- turtle.digDown()
- if turtle.getItemCount() == 1 then
- selectBrick()
- end
- turtle.placeDown()
- turtle.turnLeft()
- turtle.dig()
- while turtle.detect() == true do
- turtle.dig()
- sleep(0.5)
- end
- turtle.forward()
- turtle.digUp()
- turtle.turnLeft()
- goLeft = false
- else
- turtle.digUp()
- turtle.digDown()
- if turtle.getItemCount() == 1 then
- selectBrick()
- end
- turtle.placeDown()
- turtle.turnRight()
- turtle.dig()
- while turtle.detect() == true do
- turtle.dig()
- sleep(0.5)
- end
- turtle.forward()
- turtle.digUp()
- turtle.turnRight()
- goLeft = true
- end
- x = x - 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement