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

What code would i put in these spots?

Started by Th3RadMan, 29 July 2013 - 07:16 PM
Th3RadMan #1
Posted 29 July 2013 - 09:16 PM
Title: What code would i put in these spots?

I am trying to figure out how to make the amount of fuel 'collected in a turtle.getFuelLevel() a variable that i can use in other spots

thanks and plan to get a lot more questions from me :P/> never have coded before and have only made a password door…
jesusthekiller #2
Posted 30 July 2013 - 10:46 AM

--#Values returned from function are saved to this local variable
local fuel = turtle.getFuelLevel()

So, we can do:


--#Values returned from function are saved to this local variable
local fuel = turtle.getFuelLevel()

--#Print out fuel level
--#tostring() transforms number into string, so it can be concatenated with our text
print("Fuel level: "..tostring(fuel))