Posted 12 March 2013 - 06:12 AM
There are some turtle programs I'd like to use that are written assuming that fuel is in use. (http://pastebin.com/zkb4FY4L is the first one, but there are a few others I'd like to use.) Right now it seems like using the function that checks if a turtle has fuel with fuel disabled will cause the program to crash with an error message. (I'm not sure if this is a bug in Computercraft or Working As Intended.)
The server I'm on has the turtles configured to not use fuel, and one of the admins is dead set against "wasting" rare and valuable resources like charcoal on fueling turtles. His reply to my inquiry on this breaking compatibility was was "just comment out the fuel subroutine in the program, then."
Easier said than done, as the program I'm looking to adapt first checks the fuel at pretty much every step, and I don't know LUA– it's transparent enough that I can see how the program works, but I don't know how to actually write LUA. To do this properly, I think I need to work out how to fix the logic that checks both the fuel level and if there's a block in the way. (I'm not asking for someone to rewrite this program for me if that's the only thing that will work; I'd rather be able to do it myself for any other fuel-using programs I might want to use, and the best way to learn is to do it.I'll be experimenting with it this evening.)
Is there an easier way to make programs that use fuel in general work on this server without having to rewrite them? For example, is there a line I could add at the start that says the turtle has ten million fuel and check that instead of what's in the inventory, and leave the rest of the program as it is?
Thank you for your time. :)/>/>
The server I'm on has the turtles configured to not use fuel, and one of the admins is dead set against "wasting" rare and valuable resources like charcoal on fueling turtles. His reply to my inquiry on this breaking compatibility was was "just comment out the fuel subroutine in the program, then."
Easier said than done, as the program I'm looking to adapt first checks the fuel at pretty much every step, and I don't know LUA– it's transparent enough that I can see how the program works, but I don't know how to actually write LUA. To do this properly, I think I need to work out how to fix the logic that checks both the fuel level and if there's a block in the way. (I'm not asking for someone to rewrite this program for me if that's the only thing that will work; I'd rather be able to do it myself for any other fuel-using programs I might want to use, and the best way to learn is to do it.I'll be experimenting with it this evening.)
Is there an easier way to make programs that use fuel in general work on this server without having to rewrite them? For example, is there a line I could add at the start that says the turtle has ten million fuel and check that instead of what's in the inventory, and leave the rest of the program as it is?
Thank you for your time. :)/>/>