Posted 13 March 2013 - 05:18 AM
Hi, made a little mob farm on my server. and i got it up an running, but now. im thinking of adding a count down timer to it, and have written a count down code.
but how would i make the timer run 60 times (count down from 60) within my Text function?
Any help or tips are more then welcome :D/>
(and yes, i could just have used one computer for to turn the mobs on, maybe next time)
but how would i make the timer run 60 times (count down from 60) within my Text function?
Any help or tips are more then welcome :D/>
(and yes, i could just have used one computer for to turn the mobs on, maybe next time)
term.clear()
rednet.open("right")
mon = peripheral.wrap("bottom")
print(" Menu")
print(" --------------")
print(" 1.Creeper")
print(" 2.Zombie")
print(" 3.Skeleton")
print(" 4.Pigman")
print(" 5.Tons of xp!")
print(" --------------")
print(" Enter number")
print(" 1 - 5")
print(" --------------")
print(" Please enter only one command")
print(" The system will auto reset")
print(" after 1 min")
name = io.read()
function text()
print(" ----------------------------")
print(" The system will run for 1min")
print(" Then auto restart")
print(" Please wait till it's done")
print(" ----------------------------")
sleep(60)
os.reboot()
end
function timer()
count = 60
repeat
while true do
term.setCursorPos(1,1)
term.redirect(mon)
mon.setTextScale(3)
term.clear()
count = count -1
print(count)
sleep(1)
end
end
if name == "1" then
rednet.send(17,"creeper")
term.clear()
text()
elseif name == "2" then
rednet.send(18,"creeper")
term.clear()
text()
elseif name == "3" then
rednet.send(19,"Skeleton")
term.clear()
text()
elseif name == "4" then
rednet.send(18,"Pigman")
term.clear()
text()
elseif name == "5" then
term.clear()
print(" ----------------------------")
print(" Will you be needing a book?")
print(" ----------------------------")
print(" yes/no")
print(" ----------------------------")
name = io.read()
if name == "yes" then
rs.setOutput("top",true)
sleep(1)
rs.setOutput("top",false)
rednet.send(17,"Creeper")
rednet.send(18,"zombie")
rednet.send(19,"skeleton")
term.clear()
text()
elseif name == "no" then
rednet.send(17,"Creeper")
rednet.send(18,"zombie")
rednet.send(19,"skeleton")
term.clear()
text()
end
end