Posted 17 December 2012 - 04:31 PM
I am new to Lua, and as having a background in C++ and Java, some things are a little confusing. That being said, I do make stupid mistakes sometimes and just don't see them… ;)/>
Ok, I am making a mining program and I am getting this error:
Now, I'm not sure what on line 18 should be set equal to anything.
So, what is wrong here? I've tried making dist equal to something, but that doesn't change it either… And I'm not calling anything before it's defined, so I'm really at a loss.
Ok, I am making a mining program and I am getting this error:
> mine 5
bios:338: [string "mine"]:18: '=' expected
Now, I'm not sure what on line 18 should be set equal to anything.
local args = {...}
local length = tonumber(args[1])
function digAbove()
while turtle.detectUp() == true do
turtle.digUp()
sleep(0.5)
end
end
function digForward()
while turtle.detect() == true do
turtle.dig()
sleep(0.5)
end
end
funtion mine(dist) <-------- Line 18
digAbove()
for i = 1, dist do
digForward()
turtle.forward()
digAbove()
end
end
mine(length)
So, what is wrong here? I've tried making dist equal to something, but that doesn't change it either… And I'm not calling anything before it's defined, so I'm really at a loss.