Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Turtle Programm --
- -- Category: Mining --
- -- [INFORMATION] --
- local appName = "Stairs.lua"
- local appType = "Turtle"
- local category = "Mining"
- local version = "1.0"
- local author = "S3mpx"
- -- print info --
- print("["..appName.."]")
- print("Programm Type: "..appType)
- print("Category: "..category)
- print("Version: "..version)
- print("written by"..author)
- print("")
- -- [LOCALS] --
- local depth = 0
- local width = 0
- -- [FUNKTIONS] --
- -- dig() --
- local function dig()
- turtle.dig()
- turtle.forward()
- end
- -- turn() --
- local function turn()
- turtle.turnLeft()
- end
- -- turnAround() --
- local function turnAround()
- for i=1, 2 do
- turn()
- end
- end
- -- feedback(x) --
- local function feedback(x)
- if x == 1 then
- print("Making the stairs!")
- elseif x == 0 then
- print("Finished the stairs!")
- end
- end
- -- startup() --
- local function startup()
- feedback(1)
- turtle.forward()
- turn()
- end
- -- finishup() --
- local function finishup()
- turn()
- dig()
- turnAround()
- feedback(0)
- end
- -- stairDown() --
- local function stairDown()
- turtle.digDown()
- dig()
- turtle.digDown()
- turtle.down()
- end
- -- stairUp() --
- -- [INPUT FUNKTIONS] --
- -- depth() --
- local function depth()
- print("How deep should the stairs go?")
- depth = io.read()
- end
- -- width() --
- local function width()
- print("How many blocks should be inbetween the stairs?")
- width = io.read()
- end
- -- [MAIN FUNKTION] --
- -- stairs() --
- local function stairs()
- depth()
- width()
- startup()
- for i=1, depth/2 do
- for i=1, width + 1 do
- stairDown()
- end
- turn()
- end
- finishup()
- end
- -- [END] --
- stairs()
Advertisement
Add Comment
Please, Sign In to add comment