Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print ("||||||||||||||||||||||||")
- print ("Checking Fuel...")
- beforeFuel = turtle.getFuelLevel()
- if beforeFuel<50 then
- print ("Fuel is very low! Console will refuel using 3 coal in the top left slot.")
- turtle.select(1)
- if turtle.refuel(3) then
- print ("Current fuel level: " .. turtle.getFuelLevel())
- print ("Please restart the program to contine sorting.")
- else
- print ("No coal to refuel with./n Please put 3 coal in the top left slot of the turtle and restart the program.")
- end
- else
- print ("Plenty of fuel.")
- print ("Sorting started...")
- turtle.forward()
- turtle.select(13)
- if turtle.compare() then
- turtle.select(9)
- turtle.up()
- turtle.drop()
- else
- turtle.select(14)
- if turtle.compare() then
- turtle.select(10)
- turtle.up()
- turtle.drop()
- else
- turtle.select(15)
- if turtle.compare() then
- turtle.select(11)
- turtle.up()
- turtle.drop()
- else
- turtle.select(16)
- if turtle.compare() then
- turtle.elect(12)
- turtle.up()
- turtle.drop()
- else
- print ("There is an error. The block identifyer for the FIRST chest is not included in the system. Console will ignore this batch and continue sorting.")
- turtle.up()
- end
- end
- end
- end
- turtle.up()
- turtle.up()
- turtle.select(13)
- if turtle.compare() then
- turtle.select(9)
- turtle.up()
- turtle.drop()
- else
- turtle.select(14)
- if turtle.compare() then
- turtle.select(10)
- turtle.up()
- turtle.drop()
- else
- turtle.select(15)
- if turtle.compare() then
- turtle.select(11)
- turtle.up()
- turtle.drop()
- else
- turtle.select(16)
- if turtle.compare() then
- turtle.elect(12)
- turtle.up()
- turtle.drop()
- else
- print ("There is an error. The block identifyer for the SECOND chest is not included in the system. Console will ignore this batch and continue sorting.")
- turtle.up()
- end
- end
- end
- end
- turtle.up()
- turtle.up()
- turtle.select(13)
- if turtle.compare() then
- turtle.select(9)
- turtle.up()
- turtle.drop()
- else
- turtle.select(14)
- if turtle.compare() then
- turtle.select(10)
- turtle.up()
- turtle.drop()
- else
- turtle.select(15)
- if turtle.compare() then
- turtle.select(11)
- turtle.up()
- turtle.drop()
- else
- turtle.select(16)
- if turtle.compare() then
- turtle.elect(12)
- turtle.up()
- turtle.drop()
- else
- print ("There is an error. The block identifyer for the THIRD chest is not included in the system. Console will ignore this batch and continue sorting.")
- turtle.up()
- end
- end
- end
- end
- turtle.up()
- turtle.up()
- turtle.select(13)
- if turtle.compare() then
- turtle.select(9)
- turtle.up()
- turtle.drop()
- else
- turtle.select(14)
- if turtle.compare() then
- turtle.select(10)
- turtle.up()
- turtle.drop()
- else
- turtle.select(15)
- if turtle.compare() then
- turtle.select(11)
- turtle.up()
- turtle.drop()
- else
- turtle.select(16)
- if turtle.compare() then
- turtle.select(12)
- turtle.up()
- turtle.drop()
- else
- print ("There is an error. The block identifyer for the FOURTH chest is not included in the system. Console will ignore this batch and continue sorting.")
- turtle.up()
- end
- end
- end
- end
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.down()
- turtle.down()
- turtle.down()
- turtle.down()
- turtle.down()
- turtle.down()
- turtle.down()
- turtle.down()
- turtle.down()
- turtle.down()
- afterFuel = turtle.getFuelLevel()
- totalUsedFuel = beforeFuel-afterFuel
- print ("Sorting sucsessful!")
- print ("========================")
- print ("Fuel started with: | " .. beforeFuel)
- print ("Fuel ended with: | " .. afterFuel)
- print ("--------------------+---")
- print ("Total used fuel: | " .. totalUsedFuel)
- print ("========================")
- print ("||||||||||||||||||||||||")
- end
Advertisement
Add Comment
Please, Sign In to add comment