Posted 01 December 2013 - 11:26 AM
So, first a little bit of background. Having looked around at the different strip mining programs out there, I found that none was quite what I was looking for and thus decided to attempt to make my own. Alas, I quickly encountered a problem that I cannot seem to solve. The code, as it is, looks like this http://pastebin.com/VhaefF6U
The problem is, no matter what I do, I cannot make the turtle use the turtle.up() function. Actually, none of the movement functions produce any result whatsoever, even if the turtle is put in a huge area with empty space in every direction. I have tested this repeatedly with the small function
Does anyone have any idea of why this isn't working?
Regards,
[indent=1]Legato[/indent]
local args={...}
--Gets the values provided as args at start of program and asignes them to lenght, rows and height
local lenght = tonumber(args[1])
local rows = tonumber(args[2])
local height = tonumber(args[3])
--Sets maximun values for lenght, number of rows and height of tunnel
local lenghtl=128
local rowsl=16
local heightl=15
--Checks that values have been provided
if lenght==nil or rows==nil or height==nil then
print("Lenght, number and height must be provided")
print("Please use as:\nstripmine [lenght] [rows] [height]")
--Checks so that the provided values don't exceed the maximun limit
elseif lenght>lenghtl and rows>rowsl and height>7 then
print("Value exceeding limit was detected. The limits are -\n")
print("Lenght: "..lenghtl.."\nRows: "..rowsl.."\nHeight: "..heightl)
else
--Loop to put turtle at correct initial vertical position
for i=0, height do
if turtle.detectUp() then
turtle.digUp()
end
turtle.up()
end
end
The problem is, no matter what I do, I cannot make the turtle use the turtle.up() function. Actually, none of the movement functions produce any result whatsoever, even if the turtle is put in a huge area with empty space in every direction. I have tested this repeatedly with the small function
for i=1, 16 do
if turtle.forward() then
turtle.forward()
print("forward +1")
else
print("Movement failed")
end
sleep(0.5)
end
for all movement functions, with no success for any of them.Does anyone have any idea of why this isn't working?
Regards,
[indent=1]Legato[/indent]