Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = { ... }
- --[[
- dig f 1 d 2
- args = [ "f", 1, "d", 2]
- #args = 4
- args[1] = "f"
- dig f 2 u
- args = [ "f", 2, "u"]
- #args = 3
- ]]
- for j = 1, #args do
- -- print ( args[j] )
- if args[j] == "f" then
- for i = 1, args[j+1] do
- turtle.dig()
- turtle.forward()
- end
- j = j+1
- end
- if args[j] == "b" then
- for e = 1, args[j+1] do
- turtle.back()
- end
- end
- if args[j] == "r" then
- turtle.turnRight()
- end
- if args[j] == "l" then
- turtle.turnLeft()
- end
- if args[j] == "d" then
- turtle.digDown()
- turtle.down()
- end
- if args[j] == "u" then
- for x = 1, args[j+1] do
- turtle.up()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement