Posted 13 July 2013 - 02:06 PM
I'm using steve's carts to farm trees, but leaves are aparently opaque enough to block the solar panels on the cart.
Therefore I'm trying to use a turtle to clear the areas above the 22x6 rectanlge of track.
I know very little about turtle programming, but this is what I've cobbled together from a few bit of code I've found while searching the net.
I'd appreciate any advice on how I could optimize this. I've never used for loops before so I'm not even sure if this will work as is.
EDIT: tried running the program, it returns: "bios:338: [string "test"]:40: 'in' expected"
removing the final for loop (which is what's on line 40) makes it run properly, but of course removes the part where the turtle resets to it's initial position.
Therefore I'm trying to use a turtle to clear the areas above the 22x6 rectanlge of track.
I know very little about turtle programming, but this is what I've cobbled together from a few bit of code I've found while searching the net.
I'd appreciate any advice on how I could optimize this. I've never used for loops before so I'm not even sure if this will work as is.
EDIT: tried running the program, it returns: "bios:338: [string "test"]:40: 'in' expected"
removing the final for loop (which is what's on line 40) makes it run properly, but of course removes the part where the turtle resets to it's initial position.
while true do
local h = 20
for DoNotChangeThis=1, h do
local q = 22
for DoNotChangeThis=1, q do
turtle.dig()
turtle.forward()
end
turtle.turnRight()
local w = 6
for DoNotChangeThis=1, w do
turtle.dig()
turtle.forward()
end
turtle.turnRight()
local e = 22
for DoNotChangeThis=1, e do
turtle.dig()
turtle.forward()
end
turtle.turnRight()
local r = 6
for DoNotChangeThis=1, r do
turtle.dig()
turtle.forward()
end
turtle.turnRight()
turtle.up()
end
local t = 20
for DoNotChangeThis, t do
turtle.down()
end
end