Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Turtle Programm --
- -- Category: Movement/Mining --
- -- [INFORMATION] --
- local appName = "Move.lua"
- local appType = "Turtle"
- local category = "Movement/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)
- -- [LOCALS] --
- local x = ""
- local y = ""
- -- [FUNKTIONS] --
- -- go(x) --
- local function go(x)
- for i=1, x do
- turtle.dig()
- turtle.forward()
- end
- end
- -- up(x) --
- local function up(x)
- for i=1, x do
- turtle.digUp()
- turtle.up()
- end
- end
- -- down(x) --
- local function down(x)
- for i=1, x do
- turtle.digDown()
- turtle.down()
- end
- end
- -- left(x) --
- local function left(x)
- turtle.turnLeft()
- go(x)
- end
- -- right(x) --
- local function right(x)
- turtle.turnRight()
- go(x)
- end
- -- [MAIN FUNKTION] --
- print("When you're done, type 'done'!")
- repeat
- y = io.read()
- if y == "go" then
- print("go(x)?")
- x = io.read()
- go(x)
- end
- if y == "up" then
- print("up(x)?")
- x = io.read()
- up(x)
- end
- if y == "down" then
- print("down(x)?")
- x = io.read()
- down(x)
- end
- if y == "left" then
- print("left(x)?")
- x = io.read()
- left(x)
- end
- if y == "right" then
- print("right(x)?")
- x = io.read()
- right(x)
- end
- until y == "done"
- -- [END] --
Advertisement
Add Comment
Please, Sign In to add comment