Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- if #tArgs ~= 1 then
- print( "Usage: quarry size <length>" )
- print( "Place blocks in slots 1 - 14, place landmarks in 16" )
- return
- end
- -- Set length with user input
- local length = tonumber( tArgs[1] )
- if length < 1 then
- print( "Side length must be positive" )
- return
- end
- local curSlot = 1
- function putblockdown()
- if not (turtle.detectDown()) then
- while turtle.getItemCount(curSlot) == 0 and curSlot < 15 do
- curSlot = curSlot + 1
- end
- turtle.select(curSlot)
- turtle.placeDown()
- end
- end
- -- Place Landmark in front
- function placelmf()
- if not (turtle.detect()) then
- putblockdown()
- turtle.back()
- turtle.select(16)
- turtle.place()
- end
- end
- -- Place Landmark left and right
- function placelmb()
- if not (turtle.detect()) then
- turtle.turnRight()
- turtle.forward()
- putblockdown()
- turtle.back()
- turtle.select(16)
- turtle.place()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- putblockdown()
- turtle.back()
- turtle.select(16)
- turtle.place()
- turtle.turnRight()
- end
- end
- function backhome()
- x = length
- while x > 0 do
- -- putblockdown()
- turtle.back()
- x = x - 1
- end
- end
- -- Move length to place first Landmark and return home
- local i = 0
- while i < length do
- turtle.forward()
- i = i + 1
- end
- placelmf()
- backhome()
- turtle.back()
- turtle.turnLeft()
- -- Build platform for quarries and power
- local i = 0
- while i < 11 do
- putblockdown()
- turtle.forward()
- i = i + 1
- end
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- local i = 0
- while i < 11 do
- putblockdown()
- turtle.forward()
- i = i + 1
- end
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- -- Move length and place Landmarks on both sides then return home
- local i = 0
- while i < length do
- putblockdown()
- turtle.forward()
- i = i + 1
- end
- placelmb()
- backhome()
- turtle.turnLeft()
- turtle.forward()
- -- Move length and place landmark for 2nd quarry then return home
- local i = 0
- while i < length do
- turtle.forward()
- i = i + 1
- end
- placelmf()
- backhome()
- -- Fin
- print("Quarry setup")
- return
Add Comment
Please, Sign In to add comment