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

Ripping my hair out with the last error

Started by protexxi, 10 December 2013 - 05:07 PM
protexxi #1
Posted 10 December 2013 - 06:07 PM
error is on line 43


while true do
turtle.getFuelLevel(l)
  if ..l >=200 then
  refuel()
  rednet.send(1, "Refuelling... ")
   else
   rednet.send(1, "mining... ")
   mine()
   Empty()
  end
end

line 43

if ..l >=200 then
iv tried everything i can think of and google drew a blank
Buho #2
Posted 10 December 2013 - 06:21 PM
I've never seen that syntax before. (I'm not a Lua expert, though.) Try this instead:


if turtle.getFuelLevel() >= 200 then

getFuelLevel() takes no parameters.
MKlegoman357 #3
Posted 11 December 2013 - 01:19 AM
Next time post what error you get and give us your full code. It is easier to help when we have the code.
oeed #4
Posted 11 December 2013 - 03:14 AM
error is on line 43


while true do
turtle.getFuelLevel(l)
  if ..l >=200 then
  refuel()
  rednet.send(1, "Refuelling... ")
   else
   rednet.send(1, "mining... ")
   mine()
   Empty()
  end
end

line 43

if ..l >=200 then
iv tried everything i can think of and google drew a blank

Are you trying to refuel it if the fuel level is below 200?

If so, try this:


while true do
local fuelLevel = turtle.getFuelLevel()
if fuelLevel <= 200 then
  refuel()
  rednet.send(1, "Refuelling... ")
else
  rednet.send(1, "mining... ")
  mine()
  Empty()
end
end
Edited on 11 December 2013 - 02:15 AM