Jump to content




Ripping my hair out with the last error


  • You cannot reply to this topic
3 replies to this topic

#1 protexxi

  • Members
  • 51 posts

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

#2 Buho

  • Members
  • 110 posts

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.

#3 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

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.

#4 oeed

    Oversimplifier

  • Members
  • 2,095 posts
  • LocationAuckland, New Zealand

Posted 11 December 2013 - 03:14 AM

View Postprotexxi, on 10 December 2013 - 06:07 PM, said:

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 by oeed, 11 December 2013 - 03:15 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users