Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- arg1 = tonumber(args[1])
- local function isempty(s)
- return s == nil or s == ''
- end
- if isempty(arg1) then
- print("")
- print("Benutzung: prepareField [1-6]")
- print("1 = Farmland - Slot 1")
- print("2 = 8 Inferium Layer - Slot 2")
- print("3 = 8 Prudentium Layer - Slot 3")
- print("4 = 8 Tertium Layer - Slot 4")
- print("5 = 8 Imperium Layer - Slot 5")
- print("6 = 8 Supremium Layer - Slot 6")
- print("Bitte die notwendigen Blöcke in die slots legen!")
- else
- if (arg1 >= 1 and arg1 <= 6) then
- steps = arg1
- else
- print("Step-Angabe ausserhalb der Border!")
- end
- end
- function digLayer(dLayer, dBlocks)
- if dLayer == steps then
- turtle.dig()
- turtle.forward()
- else
- for i=dBlocks, 1, -1 do
- turtle.digDown()
- if not (dLayer == 1 and i==1) then
- turtle.down()
- end
- end
- end
- end
- function digHole (digStep)
- for i=digStep, 1, -1 do
- digLayer(i, 8)
- end
- end
- function placeLayer(pLayer, pBlocks)
- turtle.select(pLayer)
- if pLayer == 1 then
- turtle.back()
- turtle.place()
- else
- for i=pBlocks, 1, -1 do
- turtle.placeDown()
- if not (pLayer == 2 and i==1) then
- turtle.up()
- end
- end
- end
- end
- function placeBlocks(placeStep)
- for i=placeStep, 1, -1 do
- placeLayer(i, 8)
- end
- end
- function main()
- digHole(steps)
- placeBlocks(steps)
- print("Finished!")
- end
- if not isempty(steps) then
- main()
- end
Add Comment
Please, Sign In to add comment