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

Creative Only Fuel Editor.

Started by CCJJSax, 31 October 2013 - 12:33 PM
CCJJSax #1
Posted 31 October 2013 - 01:33 PM
In some programs you need to test what said program would do if it has under a specific amount of fuel, and some that do something differently if it has more than a specific amount of fuel. I think a method to dump out all fuel would be really handy for testing in a creative mode world. at least one that can be spawned in with commands/ NEI.

The fuel adding part is probably less useful, but I have a program that has a UI that displays fuel level. If it gets above a ridiculous amount I have it say "enough" instead of the number amount. but after it gets to that point the only way to test the not-enough-fuel code would be to either make the turtle move in a minecraft circle for a long time.

Final note: I realize that you could put that code on a new turtle, but the problem I have with that is that it could easily get confusing what turtle the latest code is on.
electrodude512 #2
Posted 31 October 2013 - 03:10 PM
Final note: I realize that you could put that code on a new turtle, but the problem I have with that is that it could easily get confusing what turtle the latest code is on.
Put in in .minecraft/mods/ComputerCraft/lua/rom/programs/turtle/<program name>
Then the latest code will be on every turtle. This only works in survival.
Bubba #3
Posted 01 November 2013 - 12:42 AM
Put in in .minecraft/mods/ComputerCraft/lua/rom/programs/turtle/(program name)
Then the latest code will be on every turtle. This only works in survival.

This is wrong. Resource packs are used now. Also, resource packs work in all game modes and on both SMP/SSP as long as the specified resource pack is in the resource folder of the server. See this link for more information on creating resource packs.
Cloudy #4
Posted 01 November 2013 - 10:25 AM
turtle.getFuelLevel = function() return 1234 end
Cranium #5
Posted 01 November 2013 - 10:43 AM
Always glad to elaborate for our resident grumpy cat.

Cloudy has the better solution. You can overwrite the turtle.getFuelLevel() function to return the fuel level you wish to test with, using the example above.
CCJJSax #6
Posted 01 November 2013 - 02:40 PM
turtle.getFuelLevel = function() return 1234 end
Always glad to elaborate for our resident grumpy cat.

Cloudy has the better solution. You can overwrite the turtle.getFuelLevel() function to return the fuel level you wish to test with, using the example above.

This is true. Good idea!