Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local start = true
- local counter = 0
- --Inventory:
- --Fuel,#,#,#
- --#,#,#,#
- --#,#,#,#
- --#,#,#,Ender Chest
- --[[
- Type:
- PeripheralLeft - PickAxe
- PeripheralRight - Compass
- --]]
- while true do
- function refuelSelf()
- if turtle.getFuelLevel()<500 then
- while turtle.getFuelLevel()<500 do
- for i=1,15,1 do
- turtle.select(i)
- turtle.refuel(1)
- turtle.select(1)
- end
- end
- end
- end
- function fillChest()
- turtle.select(16)
- while not turtle.placeDown() do
- turtle.digDown()
- end
- for i=2,15,1 do
- turtle.select(i)
- turtle.dropDown()
- end
- if turtle.getItemCount(16) > 0 then
- for i = 2, 15, 1 do
- if turtle.transferTo(i) then
- break
- end
- if i == 15 then
- os.terminate()
- end
- end
- end
- turtle.select(16)
- turtle.digDown()
- turtle.select(1)
- end
- --Startup
- if start == true then
- print("Hi! My name is Liam!")
- print("Job: Mining")
- print("")
- print("Inventory:")
- print("Fuel,#,#,#")
- print("#,#,#,#")
- print("#,#,#,#")
- print("#,# #,Ender Chest")
- print("")
- turtle.select(16)
- if turtle.getItemCount(16) ~= 1 then
- if turtle.getItemCount(16) ~= 0 then
- os.terminate()
- else
- turtle.fillChest()
- end
- end
- turtle.select(1)
- end
- --Main
- counter = counter + 1
- turtle.dig()
- turtle.digUp()
- turtle.digDown()
- while not turtle.forward() do
- turtle.dig()
- end
- refuelSelf()
- if counter >= 15 then
- turtle.select(16)
- if turtle.getItemCount(16) > 1 then
- os.terminate()
- end
- fillChest()
- counter = 0
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement