Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ##################################
- -- rotational boring
- -- this is test code.
- -- http://hevohevo.hatenablog.com/
- -- main
- local MIN_FUEL_LEVEL = 300
- local FUEL_SLOT = 16
- i=0
- function myRefuel()
- print("Fuel slot is ",FUEL_SLOT)
- turtle.select(FUEL_SLOT)
- while true do
- turtle.refuel()
- print("Current fuel level is ", turtle.getFuelLevel())
- if turtle.getFuelLevel() > MIN_FUEL_LEVEL then break end
- os.pullEvent("turtle_inventory")
- end
- end
- function digAndDown()
- for i=1,4 do
- turtle.dig()
- turtle.turnRight()
- end
- turtle.digDown()
- return turtle.down()
- end
- function recursive_trip()
- if digAndDown() then
- recursive_trip()
- turtle.up()
- end
- return
- end
- function trip()
- local depth = 0
- while digAndDown() do
- depth = depth + 1
- end
- for i=1, dpeth do
- turtle.up()
- end
- end
- myRefuel()
- turtle.select(1)
- trip()
- --recursive_trip()
Advertisement
Add Comment
Please, Sign In to add comment