Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- if #args < 2 then
- print("Need some parameters!")
- print()
- print("Usage:")
- print("elevator <direction> <floors>")
- print()
- print("direction is down or up")
- print("floors is a number")
- print("ie")
- print("elevator up 4")
- return
- end
- direction = args[1]
- levels = tonumber(args[2])
- if levels <= 0 or levels == nil then
- print("What the heck? I need a number to go up or down!")
- return
- end
- if turtle.getFuelLevel() < levels then
- print("I need some fuel, please give me fuel!")
- return
- end
- direction = string.lower(direction)
- direction = string.sub(direction,1,1)
- if direction == "d" or direction == "u" then
- for i=1,levels do
- if direction == "d" then
- print("Going Down!")
- turtle.down()
- else
- print("Going Up!")
- print("Waiting for you to jump!")
- while not turtle.up() do
- print("Jump Now!")
- end
- end
- end
- else
- print("You can't follow instructions can you?")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement