feat(turtle-utils): better getFuelPercentage for display

This commit is contained in:
Guillaume ARM 2024-05-26 01:21:00 +02:00
parent c030b03a11
commit 69a04a19d5

View File

@ -201,7 +201,9 @@ turtleUtils.countFreeSlots = function()
end
turtleUtils.getFuelPercentage = function()
return (turtle.getFuelLevel() / turtle.getFuelLimit()) * 100
local rawPercentage = (turtle.getFuelLevel() / turtle.getFuelLimit()) * 100
return math.floor(rawPercentage * 100) / 100
end
turtleUtils.getMatureCrop = function(inspectFn)