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

wood.txt:2: attempt to compare __lt on function and number

Started by unzzenedy, 17 May 2013 - 02:21 AM
unzzenedy #1
Posted 17 May 2013 - 04:21 AM
Hi guys, can u guys find any mistakes? when i run the program "Wood.txt" this shows up:
wood.txt:2: attempt to compare __lt on function and number

Here's the code:

function fixaFuel()
if turtle.getFuelLevel < 100 then
turtle.select(16)
turtle.refuel(1)
end

function fixaBoneMeal()
if turtle.getItemCount(2) == 0 then
print "Fixa mer BoneMeal!"
end

function plantera()
turtle.forward()
turtle.forward()
turtle.select(1)
turtle.place()
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
turtle.place()
turtle.turnLeft()
turtle.forward()
turtle.turnRight()
turtle.turnRight()
turtle.place()
turtle.turnRight()
turtle.forward()
for slot=3,10 do
turtle.select(slot)
turtle.drop()
end

turtle.turnLeft()
turtle.turnLeft()
turtle.select(1)
turtle.place()
turtle.select(2)
turtle.place()
end
end
end

fixaFuel()
fixaBoneMeal()
plantera()
KaoS #2
Posted 17 May 2013 - 08:24 AM
if turtle.getFuelLevel < 100 then
should be
if turtle.getFuelLevel() < 100 then

on line 2