Posted 01 June 2014 - 02:18 AM
I want to make a CC program that can make a specified size rectangle. The code doesn't come up with any errors, but when i run the program the turtle doesn't do what it's supposed too. Thanks for any help
local s = 1
turtle.select(1)
local function placeFence()
turtle.digDown()
turtle.placeDown()
while not turtle.forward() do
turtle.dig()
end
turtle.forward()
end
if turtle.getItemCount(s) == 0 then
s = s+1
turtle.select(s)
end
local function layingFence()
term.clear()
term.setCursorPos(1,1)
print("How long do you want the quarry?")
x = tonumber(read())
print("How wide do you want the quarry?")
y = tonumber(read())
print("Laying fence " .. x .. " by ".. y)
end
layingFence()
for i=1, x do
placeFence()
end
turtle.turnLeft()
for i=1, y do
placeFence()
end
turtle.turnLeft()
for i = 1, x do
placeFence()
end
turtle.turnLeft()
for i=1, y do
placeFence()
end
turtle.up()
local s = 1
turtle.select(1)
local function placeFence()
turtle.digDown()
turtle.placeDown()
while not turtle.forward() do
turtle.dig()
end
turtle.forward()
end
if turtle.getItemCount(s) == 0 then
s = s+1
turtle.select(s)
end
local function layingFence()
term.clear()
term.setCursorPos(1,1)
print("How long do you want the quarry?")
x = tonumber(read())
print("How wide do you want the quarry?")
y = tonumber(read())
print("Laying fence " .. x .. " by ".. y)
end
layingFence()
for i=1, x do
placeFence()
end
turtle.turnLeft()
for i=1, y do
placeFence()
end
turtle.turnLeft()
for i = 1, x do
placeFence()
end
turtle.turnLeft()
for i=1, y do
placeFence()
end
turtle.up()