Posted 15 March 2015 - 10:14 PM
I started developing this program which is meant to be used in conjunction with Tinker's Construct. It is to get how many blocks the user wants, and run the code inside the "for" loop as many times as the amount of block specified. This works flawlessly in a simple "while" loop, but when used in a "for" loop it only runs the cycle once and then exits the program after a short wait. There are no errors displayed when the program terminates. Why is this? Is it structured wrong? Please give me some help/advice :)/> I'm new to lua and having some issues. Thank You – Heller
-- Used to cast specified amount of blocks , using The mod Tinker's Construct
local times = 0
term.write("How many cycles to run: ")
time = read()
function clean() -- Clears screen and sets cursor to default position
term.clear()
term.setCursorPos(1,1)
end
function pour() -- Main code to turn redstone signal on and off
print("Pouring")
rs.setOutput("bottom", true)
sleep(13)
print("Cooling")
rs.setOutput("bottom", false)
sleep(5)
print("Casted")
sleep(1)
end
for i = 0, times do -- Meant to be official code to carry out process
pour()
clean()
end