Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- b
- -- Moves the turtle the specified distance backwards
- -- Written by HarvDad, March 2014
- args = {...}
- nArgs = #args
- x = 0
- y = 0
- z = 0
- face = 0
- minimumFuel = 100
- abort = false
- local currentFuelLevel = turtle.getFuelLevel()
- distance = 1;
- if (nArgs == 1 and args[1]== "help") then
- print("Moves the turtle the specified distance backwards")
- print("Usage: f [distance]")
- return
- end
- if nArgs == 1 then
- distance = tonumber(args[1])
- if distance == nil then
- print(args[1], " is not a valid distance")
- return
- end
- end
- -- MAIN PROGRAM
- turtle.select(1)
- if currentFuelLevel ~= "unlimited" then
- if currentFuelLevel < minimumFuel then
- if not turtle.refuel() then
- print("No fuel")
- return
- end
- end
- end
- for i=1,distance do
- turtle.back()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement