Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tool = {}
- local t = turtle
- function tool.needR(slotMax)
- slot = t.getSelectedSlot()
- if not slotMax then
- slotMax = 16
- end
- t.select(1)
- if turtle.getFuelLevel()<10 then
- while not turtle.refuel(1) do
- turtle.select((turtle.getSelectedSlot()%slotMax)+1)
- end
- end
- t.select(slot)
- end
- function tool.checkGravel()
- _, tuple = t.inspectUp()
- if not tuple then return end
- while string.find(tuple.name, 'gravel') do
- t.dig()
- _, tuple = t.inspectUp()
- if not tuple then break end
- end
- end
- function tool.fd(slotMax)
- tool.needR(slotMax)
- b, tuple = turtle.inspect()
- if b then
- if string.find(tuple['name'], 'lava') then
- return
- end
- end
- while not t.forward() do t.dig() end
- end
- function tool.d()
- tool.needR()
- b, tuple = turtle.inspectDown()
- if b then
- if string.find(tuple['name'], 'lava') then
- return
- end
- end
- while not t.down() do t.digDown() end
- end
- function tool.up()
- tool.needR()
- b, tuple = turtle.inspectUp()
- if b then
- if string.find(tuple['name'], 'lava') then
- return
- end
- end
- while not t.up() do t.digUp() end
- end
- return tool
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement