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

Noob here, what is wrong with my program?

Started by Jokerfour, 20 February 2015 - 06:00 AM
Jokerfour #1
Posted 20 February 2015 - 07:00 AM
My program is as follows:

turtle.getFuelLevel()
print("FuelLevel")
exit
end

I just started computer craft today so there may be some basic thing that I am not understanding.
KingofGamesYami #2
Posted 20 February 2015 - 02:20 PM
Couple points:

1) Anything enclosed in quotes ("", '') is a string. Strings can be printed
2) exit is not needed
3) end is only needed if you have something to close (if statement, loop, etc.) (don't worry, I made the same mistake :P/>)

Assuming you want to print the current fuel level, or the value returned by turtle.getFuelLevel(), your program could look like this:

print( turtle.getFuelLevel() )

PS: When posting code on the forums, it's nice to use code tags.