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

Help using farm-building program

Started by tmdart, 18 January 2015 - 12:07 AM
tmdart #1
Posted 18 January 2015 - 01:07 AM
I know this is an old topic, but I was trying to use your program in Minecraft 1.7.10 using Computercraft 1.65. My world is using fuel off if that matters, but I have tried it with fuel on as well. I have named the program "fb". Every time I run the program I get the following, then nothing happens:

Plenty Building Blocks, Thanks!
fb:32: attempt to compare string with number expected, got string
Lyqyd #2
Posted 18 January 2015 - 01:14 AM
This is split from here.

The issue is that your fuel-disabled setup means that turtle.getFuelLevel returns "unlimited", which isn't a number. You'll either have to re-enable fuel or modify the program to check for "unlimited" as well as a sufficiently large amount of fuel.
tmdart #3
Posted 20 January 2015 - 11:41 AM
This is split from here.

The issue is that your fuel-disabled setup means that turtle.getFuelLevel returns "unlimited", which isn't a number. You'll either have to re-enable fuel or modify the program to check for "unlimited" as well as a sufficiently large amount of fuel.

Thanks for the reply, but as I stated i am getting the same error when I turn the fuel requirements back on.
Bomb Bloke #4
Posted 21 January 2015 - 01:57 AM
Nevertheless, the only way for the specified line to error in that way is to have fuel turned off. Odds are your attempt to re-enable it failed - to do so, you'd need to shut down the game (or server, if you're using one), edit its config, then restart it.

Or you could alter that line to correctly deal with a string response:

if type(turtle.getFuelLevel()) == "string" or turtle.getFuelLevel() >= NeededFuel then