Posted 04 March 2013 - 10:15 AM
I am working on making a mob arena which gets harder as time passes. I'm using computercraft and soul shards to do this but need help with a program that lets a spawner spawn mobs every 20 seconds or so, i've written a program but it doesn't work as it seems to ignore the "if round < 30 then" or whatever and do the code even if that if statement is wrong
So here's the program:
sec = 0
round = 1
while true do
if sec==60 then
sec = 0
round = round + 1
end
sec = sec + 20
if redstone.getInput("right", true) then
if round > 30 then
if round < 51 then
redstone.setOutput("back", false)
sleep(2)
redstone.setOutput("back", true)
term.clear()
sleep(18)
end
end
if round > 50 then
if round < 71 then
redstone.setOutput("back", false)
sleep(4)
redstone.setOutput("back", true)
sleep(16)
end
end
if round > 70 then
if round < 101 then
redstone.setOutput("back", false)
sleep(6)
redstone.setOutput("back", true)
sleep(14)
end
end
end
if redstone.getInput("left", true) then
redstone.setOutput("back", true)
term.clear()
term.setCursorPos(1, 1)
print("There's no round in play.")
round = 1
sec = 0
sleep(1)
end
end
Thankyou, please help!!
So here's the program:
sec = 0
round = 1
while true do
if sec==60 then
sec = 0
round = round + 1
end
sec = sec + 20
if redstone.getInput("right", true) then
if round > 30 then
if round < 51 then
redstone.setOutput("back", false)
sleep(2)
redstone.setOutput("back", true)
term.clear()
sleep(18)
end
end
if round > 50 then
if round < 71 then
redstone.setOutput("back", false)
sleep(4)
redstone.setOutput("back", true)
sleep(16)
end
end
if round > 70 then
if round < 101 then
redstone.setOutput("back", false)
sleep(6)
redstone.setOutput("back", true)
sleep(14)
end
end
end
if redstone.getInput("left", true) then
redstone.setOutput("back", true)
term.clear()
term.setCursorPos(1, 1)
print("There's no round in play.")
round = 1
sec = 0
sleep(1)
end
end
Thankyou, please help!!