Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Which file would you like to load?")
- print("Tip: Include .lua")
- fileName = io.read()
- file = fs.open(fileName , "r")
- directionList = {}
- count = 1
- for line in file.readLine do
- directionList[count] = line
- count = count + 1
- end
- file.close()
- for i=1,#directionList do
- local dir = directionList[i]
- dir = string.lower(dir)
- if dir == "up" then
- turtle.digUp()
- turtle.up()
- elseif dir == "down" then
- turtle.digDown()
- turtle.down()
- elseif dir == "forward" then
- turtle.dig()
- turtle.forward()
- elseif dir == "back" then
- turtle.back()
- elseif dir == "right" then
- turtle.turnRight()
- elseif dir == "left" then
- turtle.turnLeft()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement