Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local torchDistance = 0 -- Distanz für Fackel
- local fuelLevel = turtle.getFuelLevel() --FuelLevel
- local chests = turtle.getItemCount(4) --Anzahl Chests
- function ivFull()
- local full = true
- for i = 5,16 do
- if turtle.getItemCount(i) == 0 then
- full = false
- end
- end
- return full
- end
- function mine()
- if turtle.getFuelLevel() < 100 then
- turtle.refuel(1)
- end
- end
- while ivFull() == false do
- if torchDistance == 8 then
- turtle.select(2)
- turtle.turnRight()
- turtle.turnRight()
- turtle.place()
- turtle.turnLeft()
- turtle.turnLeft()
- torchDistance = torchDistance - 8
- end
- if turtle.detectDown() == false then
- turtle.select(3)
- turtle.placeDown()
- end
- if turtle.detect() then
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.turnLeft()
- turtle.dig()
- turtle.up()
- turtle.dig()
- turtle.turnRight()
- turtle.turnRight()
- turtle.dig()
- turtle.down()
- turtle.dig()
- turtle.turnLeft()
- torchDistance = torchDistance + 1
- else
- turtle.forward()
- torchDistance = torchDistance + 1
- end
- if ivFull() == true then
- if chests > 0 then
- turtle.select(4)
- turtle.digDown()
- turtle.placeDown()
- chest = chest - 1
- for slot = 5,16 do
- turtle.select(slot)
- turtle.dropDown()
- sleep(1.5)
- end
- turtle.select(5)
- else
- print("Keine Kisten vorhanden")
- os.shutdown()
- end
- print(torchDistance)
- end
- end
- function check()
- local fuel = turtle.getItemCount(1)
- local torch = turtle.getItemCount(2)
- local chest = turtle.getItemCount(4)
- local error = 0
- if torch == 0 then
- print("Im Slot 2 fehlen Fackeln")
- error = error + 1
- else
- print("Fackeln sind vorhanden")
- end
- if fuel == 0 then
- print("Es fehlt brennbares Material")
- error = error + 1
- else
- print("Brennbares Material vorhanden")
- end
- if chest == 0 then
- print("Es fehlen Kisten")
- error = error + 1
- else
- print("Kisten vorhanden")
- end
- if error == 0 then
- return true
- else
- return false
- end
- end
- function Start()
- if check() == true then
- mine()
- else
- print("Slots ueberpruefen")
- end
- end
- Start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement