function resetBeforeTable()
iniT = {}
for row = 0, 4, 12 do
for x = 1, 4, 1 do
table.insert(iniT, turtle.getItemCount(x + row))
if x ==4 then
table.insert(iniT, (x + row + row / 4), (turtle.getItemCount(x + row) + turtle.getItemCount(x + row - 1) + turtle.getItemCount(x + row - 2) + turtle.getItemCount(x + row - 3)))
end
end
for col = 21, 1, 24 do
table.insert(intT, col, (iniT[col - 5] + iniT[col - 10] + iniT[col - 15]))
end
end
table.insert(iniT, 25, iniT[5] + iniT[10] + iniT[15] + iniT[20] + iniT[21] + iniT[22] + iniT[23]) -- calculate the total of the table
end
resetBeforeTable()
EDIT: Corrected typo.











