Posted 21 March 2015 - 04:46 PM
I'm writing a program for a Command Computer, that will let me fill an arbitrary volume of blocks with one block.
The problem I have is that the code that actually does the filling, three nested for loops, is not being run.
Here's the code:
The problem I have is that the code that actually does the filling, three nested for loops, is not being run.
Here's the code:
tArgs = {...}
textutils.tabulate(tArgs)
X1 = tArgs[1]
X2 = tArgs[4]
Y1 = tArgs[2]
Y2 = tArgs[5]
Z1 = tArgs[3]
Z2 = tArgs[6]
block = tArgs[7]
if X1 <= X2 then
lowerX = X1
upperX = X2
print(lowerX)
print(upperX)
else
lowerX = X2
upperX = X1
print(lowerX)
print(upperX)
end
if Y1 <= Y2 then
lowerY = Y1
upperY = Y2
print(lowerY)
print(upperY)
else
lowerY = Y2
upperY = Y1
print(lowerY)
print(upperY)
end
if Z1 <= Z2 then
lowerZ = Z1
upperZ = Z2
print(lowerZ)
print(upperZ)
else
lowerZ = Z2
upperZ = Z1
print(lowerZ)
print(upperZ)
end
print("Begin block replacement")
for X = lowerX,upperX,1 do
print("X+1")
for Y = lowerY,upperY,1 do
print("Y+1")
for Z = lowerZ,upperZ,1 do
commands.setBlock(X,Y,Z,block)
print("Is a block set?")
end
end
end
print("Filling complete")