This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
matejdro's profile picture

Increased fuel consumption

Started by matejdro, 22 May 2013 - 01:10 PM
matejdro #1
Posted 22 May 2013 - 03:10 PM
Is there a way to increase fuel consumption of turtles? I was looking into configs and bios, but I can't find such option.
Cranium #2
Posted 22 May 2013 - 03:36 PM
There is not any ability to consume more fuel than 1 fuel ber block.
matejdro #3
Posted 22 May 2013 - 03:43 PM
How about reducing how much power certain items "produce"?
nutcase84 #4
Posted 22 May 2013 - 04:23 PM
Why would you want to?
matejdro #5
Posted 22 May 2013 - 04:26 PM
To make turtles a bit more challenging to use.
Kingdaro #6
Posted 22 May 2013 - 04:53 PM
It's not really possible to increase fuel usage, as a turtle has to move in order to use a fuel. Causing the turtle to move more on fuel usage can easily screw up someone's program.

You could, however, overwrite the turtle's refuel function and set a refuel limit.


local maxFuel = 1000
local refuel = turtle.refuel
function turtle.refuel(num)
  local refueled = false
  if num == 0 then
    return refuel(0)
  end
  for i=1, num do
    if turtle.getFuelLevel() < maxFuel then
      if refuel(1) and refueled == false then
        refueled = true
      end
    end
  end
  return refueled
end

Of course, you can't really prevent anyone from going to 999 fuel, then using a bucket to exceed the limit greatly. This function only prevents users from refueling if the turtle's fuel is greater than the maxfuel variable, and doesn't actually limit how much the turtle can store. It's difficult to detect how much fuel an item will give without actually using it as fuel.