Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dig()
- steps = userside-1
- while steps > 0 do
- turtle.dig()
- turtle.forward()
- steps = steps-1
- storage = turtle.getItemCount(2)
- if storage > 60 then
- turtle.select(2)
- turtle.drop(storage-15)
- end
- storage = turtle.getItemCount(3)
- if storage > 60 then
- turtle.select(3)
- turtle.drop(storage-2)
- end
- if fourth == true then
- storage = turtle.getItemCount(4)
- if storage > 60 then
- turtle.select(4)
- turtle.drop(storage-2)
- end
- end
- turtle.select(1)
- end
- steps = userside-1
- end
- function turn(turn)
- if turn == "left" then
- turn = "right"
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- return turn
- elseif turn == "right" then
- turn = "left"
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- return turn
- end
- end
- function lastaction()
- dig()
- turtle.digDown()
- turtle.down()
- turtle.turnRight()
- turtle.turnRight()
- end
- function ladderfinished()
- height = userheight
- turtle.select(1)
- while height > 0 do
- turtle.down()
- turtle.place()
- height = height-1
- end
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- turtle.turnRight()
- os.shutdown()
- end
- function ladders()
- dig()
- height = userheight
- turtle.select(2)
- while height > 0 do
- if turtle.detect() then
- turtle.up()
- if turtle.detectUp() then
- turtle.back()
- turtle.select(1)
- turtle.place()
- ladderfinished()
- end
- else
- turtle.place()
- turtle.up()
- end
- height = height-1
- end
- turtle.back()
- ladderfinished()
- end
- print "Excavating..."
- turtle.select(1)
- userside = 6
- userheight = 10
- fourth = false
- if (userheight % 2) ~= 0 then
- userheight = userheight+1
- end
- steps = userside-1
- lastturn = "left"
- height = userheight
- firsttime = true
- while height > 0 do
- if firsttime == false then lastaction() end
- firsttime = false
- col = userside-1
- while col > 0 do
- dig()
- lastturn = turn(lastturn)
- col = col-1
- end
- height = height-1
- end
- ladders()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement