I think I messed up , mostly I have no idea whats going on with the programming but back in the day I did some java and well I am able to get the turtle to build my castle walls for me in a way that is though I wish to get the part working where it will check the item in slots 5 - 16 and if 5 is empty then move to slot 6 and so on . Well here is the script thingy I am working on I have messed with it but I get some funky errors can some one please have a look and help me ?
print("how long?")
a = read()
print("how high?")
b = read()
for i=1,a do
for i=1,b do
print( "i is "..tostring(i) ) -- refuel script I coppied
print ("CheckingFuel...")
if turtle.getFuelLevel() < 5 then
for i = 1, 4 do -- loop through the slots
turtle.select(i) -- change to the slot
if turtle.refuel(0) then -- if it's valid fuel
local halfStack = math.ceil(turtle.getItemCount(i)/2) -- work out half of the amount of fuel in the slot
turtle.refuel(halfStack) -- consume half the stack as fuel
end
end
else
print ("Enough fuel")
end -- end refuel script I copied
turtle.select(5) -- select slot 5 after fuel check from slot 1 to 4
z = 5 -- check turtle slot for item it no item move to next slot
turtle.getItemCount(z)
if turtle.getItemCount(z) == 0 then
z = z + 1
turtle.selcect(z)
else
write("slot has blocks in")
end -- end check for item
turtle.placeRight() -- build tower layer
turtle.placeLeft() -- build tower layer
turtle.up() -- build tower layer
turtle.placeDown() -- build tower layer
end
turtle.forward() --move turtle back down to start new collom
for i=1,b do
turtle.down()
end
end
thank you all :)/>