Posted 14 August 2013 - 03:12 PM
Title: Stuck with code
Hi I have recently written this code but when i went to use it it said there was an error does anyone know how I can fix it?
note: i have separated the line that the error code said had something wrong "if E key is pressed then"
print("Place saplings in slot 1, bonemeal in slot 2 and fuel in slot 3")
if E key is pressed then
print("Checking Fuel")
if turtle.getFuelLevel() == <100 then
turtle.refuel()
print("Refueling…")
else
print("Enough Fuel")
end
local function sapling()
turtle.select(1)
turtle.place()
sleep(.1)
end
local function bonemeal()
turtle.select(2)
turtle.place()
sleep(.1)
end
function cutTree
turtle.dig()
turtle.forward()
end
while turtle.detectUp() do
turtle.digUp()
turtle.up()
end
while true do
if turtle.detectDown() then
break
else
turtle.down()
end
end
turtle.back()
end
thanks in advance to any replies
Hi I have recently written this code but when i went to use it it said there was an error does anyone know how I can fix it?
note: i have separated the line that the error code said had something wrong "if E key is pressed then"
print("Place saplings in slot 1, bonemeal in slot 2 and fuel in slot 3")
if E key is pressed then
print("Checking Fuel")
if turtle.getFuelLevel() == <100 then
turtle.refuel()
print("Refueling…")
else
print("Enough Fuel")
end
local function sapling()
turtle.select(1)
turtle.place()
sleep(.1)
end
local function bonemeal()
turtle.select(2)
turtle.place()
sleep(.1)
end
function cutTree
turtle.dig()
turtle.forward()
end
while turtle.detectUp() do
turtle.digUp()
turtle.up()
end
while true do
if turtle.detectDown() then
break
else
turtle.down()
end
end
turtle.back()
end
thanks in advance to any replies