Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- local dis = tonumber(tArgs[1])
- g = 1
- st = 5
- -- Functions
- function turnaround()
- turtle.turnRight()
- turtle.turnRight()
- end
- function placedown(item)
- if (turtle.detectDown() == true) then
- turtle.digDown()
- end
- turtle.select(item)
- turtle.placeDown()
- end
- function placefront(item)
- if (turtle.detect() == true) then
- turtle.dig()
- end
- turtle.select(item)
- turtle.place()
- end
- function placerow()
- placefront(st)
- checkst(st)
- placedown(gr)
- checkgr(gr)
- turnaround()
- turtle.forward()
- placedown(gr)
- checkgr(gr)
- turtle.forward()
- placedown(gr)
- checkgr(gr)
- placefront(st)
- checkst(st)
- turnaround()
- turtle.forward()
- turtle.turnLeft()
- end
- function checkgr(item)
- if (turtle.getItemCount(item) == 1) then
- if (gr == 4) then
- print "Out of Gravel"
- else
- gr = gr + 1
- end
- end
- end
- function checkst(item)
- if (turtle.getItemCount(item) == 1) then
- if (st == 8) then
- print "Out of Stairs"
- else
- st = st + 1
- end
- end
- end
- -- Main Script
- for i=1, 2 do
- turtle.forward()
- turtle.turnRight()
- turtle.forward()
- placerow()
- end
- print("Code Terminated")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement