Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- local start = tonumber(args[1])
- local steps = tonumber(args[2])
- local depth = tonumber(args[3])
- local width = tonumber(args[4])
- local consume = steps * depth * width
- if turtle.getFuelLevel() <= consume then
- turtle.select(1)
- turtle.refuel(math.floor(consume/80)+1)
- end
- local fuel = turtle.getFuelLevel()
- print("fuel:"..tostring(fuel))
- local function GetBlocks(z)
- for i=1,z do
- turtle.down()
- end
- turtle.turnLeft()
- for i=1,3 do
- turtle.forward()
- end
- turtle.turnRight()
- turtle.suck()
- turtle.turnLeft()
- for i=1,3 do
- turtle.back()
- end
- turtle.turnRight()
- for i=1,z do
- turtle.up()
- end
- end
- local function PutLine(wl)
- for i=1, tonumber(wl) do
- if not turtle.detectDown() then
- print("place")
- turtle.placeDown()
- else
- print("skip")
- end
- turtle.forward()
- end
- end
- local function MakeWall(d, w)
- PutLine(d)
- turtle.turnRight()
- PutLine(w)
- turtle.turnRight()
- PutLine(d)
- turtle.turnRight()
- PutLine(w)
- turtle.turnRight()
- end
- local cz = 0
- turtle.select(2)
- for i=1,start do
- turtle.up()
- cz = cz + 1
- end
- for i=1,steps do
- cz = cz + 1
- turtle.forward()
- MakeWall(depth, width)
- turtle.back()
- GetBlocks(cz)
- end
- for i=1,start do
- turtle.down()
- cz = cz - 1
- end
Advertisement
Add Comment
Please, Sign In to add comment