Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Function to refuel the turtle
- function refuel()
- -- Loop over each slot in the turtle's inventory
- for i = 1, 16 do
- -- Select the slot
- turtle.select(i)
- -- If the selected slot contains an item, try to refuel with it
- if turtle.getItemCount(i) > 0 then
- turtle.refuel(1)
- end
- end
- -- Print out the turtle's current fuel level
- print("Current fuel level: " .. turtle.getFuelLevel())
- end
- -- Call the refuel function
- refuel()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement