i get " bios:338: [string "mining"]:82: 'then' expected
although at line 82 there clearly is a 'then'
although at line 82 there clearly is a 'then'
Code:
function dropping()
turtle.select(1)
turtle.dropUp()
turtle.select(2)
turtle.dropUp()
turtle.select(3)
turtle.dropUp()
turtle.select(4)
turtle.dropUp()
turtle.select(5)
turtle.dropUp()
turtle.select(6)
turtle.dropUp()
turtle.select(7)
turtle.dropUp()
turtle.select(8)
turtle.dropUp()
turtle.select(9)
turtle.dropUp()
turtle.select(10)
turtle.dropUp()
turtle.select(11)
turtle.dropUp()
turtle.select(12)
turtle.dropUp()
turtle.select(13)
turtle.dropUp()
turtle.select(14)
turtle.dropUp()
turtle.select(15)
turtle.dropUp()
end
function movingdown()
turtle.down()
end
function movedown()
for i = 1, k do
movingdown()
end
end
function kakka()
if emptying = 4 then
clearinventory()
end
if emptying = 8 then
clearinventory()
end
if emptying = 12 then
clearinventory()
end
if emptying = 16 then
clearinventory()
end
if emptying = 20 then
clearinventory()
end
if emptying = 24 then
clearinventory()
end
end
function fuel()
if turtle.getFuelLevel() < 500 then
return true
else
return false
end
end
function refuel()
if fuel() then
print "Refuelling the turtle!"
if turtle.getItemCount(16) ~= 0 then
turtle.select(16)
turtle.refuel(4)
turtle.select(1)
print "Turtle refuelled!"
else
print "The turtle does not have fuel in inventory, Turtle will re-boot!"
sleep(3) os.reboot()
end
end
end
emptying = 0
function moveup()
turtle.up()
end
function clearinventory()
for i = 1, b do
moveup()
end
dropping()
movedown()
end
print "How big of an x and an z you want your area to be?"
local a = read()
term.clear()
print("You entered x and z successfully! You entered: ")
print(a)
sleep(2)
term.clear()
print "how big of an y (depth) you want your area to be?"
local b = read()
term.clear()
print("You entered y successfully! You entered: ")
print(b)
sleep(2)
term.clear()
--a = 5
-- adds 1 to size (a) value
--b = 3
c = a - 1
k = b + 1
function digforward()
turtle.dig()
turtle.forward()
end
function turn1()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnRight()
turncount = true
end
function turn2()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turncount = false
end
function row()
for i = 1, a do
digforward()
end
if turncount then
turn2()
else
turn1()
end
end
function endingrow()
for i = 1 , a do
digforward()
end
end
function level()
for i = 1, a do
row()
end
refuel()
endingrow()
end
function down()
turtle.digDown()
turtle.down()
turtle.turnLeft()
turtle.turnLeft()
end
function mining()
level()
down()
emptying = emptying + 1
kakka()
end
function new()
for i = 1, b do
mining()
end
end
refuel()
new()
print "All mining assined has been done!"