Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Variables
- turtle.select(1)
- height = 0
- local tArgs = { ... }
- local levelAlt = tonumber(tArgs[1])
- -- Functions
- local function tMove(distance)
- for i=1,distance do
- while turtle.forward() == false do
- turtle.dig()
- turtle.attack()
- sleep(0.5)
- end
- end
- end
- local function tDescend(distance)
- for i=1,distance do
- while turtle.down() == false do
- turtle.digDown()
- turtle.attackDown()
- sleep(0.5)
- end
- end
- end
- local function tAscend(distance)
- for i=1,distance do
- while turtle.up() == false do
- turtle.digUp()
- turtle.attackUp()
- sleep(0.5)
- end
- end
- end
- local function turnaround()
- turtle.turnRight()
- turtle.turnRight()
- end
- local function tPlace()
- if turtle.detectDown() == true then
- turtle.digDown()
- end
- placedItem = 0
- for i=1,2 do
- if turtle.getItemCount(i) > 0 then
- if placedItem == 0 then
- turtle.select(i)
- turtle.placeDown()
- placedItem = 1
- end
- end
- end
- turtle.select(1)
- end
- local function tLineDraw(length)
- for i=1,length do
- tMove(1)
- tPlace()
- end
- end
- local function layDirt()
- turtle.turnLeft()
- tMove(4)
- turnaround()
- for j=1,4 do
- tPlace()
- tLineDraw(8)
- turtle.turnLeft()
- tLineDraw(1)
- turtle.turnLeft()
- tLineDraw(8)
- turtle.turnRight()
- tMove(1)
- turtle.turnRight()
- end
- tPlace()
- tLineDraw(8)
- turnaround()
- tMove(4)
- turtle.turnLeft()
- tMove(4)
- turtle.digDown()
- turtle.select(3)
- turtle.placeDown()
- turtle.select(1)
- tAscend(1)
- turtle.placeDown()
- turtle.turnRight()
- tMove(5)
- turnaround()
- tMove(5)
- turtle.turnRight()
- tMove(1)
- turnaround()
- turtle.select(16)
- turtle.place()
- tDescend(1)
- turtle.select(1)
- turnaround()
- tMove(5)
- end
- -- Startup
- term.clear()
- term.setCursorPos(1,1)
- print("Please place blocks as follows:")
- print("Slot 1 and 2 - Dirt")
- print("Slot 3 - Water Bucket")
- print("Slot 16 - Torches (4)")
- print()
- print("Ground Level = 0")
- print("Press enter a level when ready:")
- level = read(input)
- -- Main Program
- tAscend(4*level)
- tMove(2)
- layDirt()
- tDescend(4*level)
- turnaround()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement