Posted 16 April 2013 - 06:27 AM
Hi, i was looking over the forum but unable to find exactly what i was looking for, i was however able to find a good timer that i can use but i have not been able to add a signal to it at timed intervals. what im trying to do is send out a signal every 5 mins that lasts for around a min. My script atm is:
mon = peripheral.wrap("right") –connects to the monitor on top of the computer
sec = 0 –declare variables
min = 0
uur = 0
mon.setTextScale(1.5) –set the text scale of the monitor to a 1.5 magnification
term.redirect(mon) –redirect the output ot the monitors
while true do –main loop
term.clear() –clear the screen
term.setCursorPos(1,1) –set the cursor to the left upper corner
if sec==60 then –if 60 seconds have past add 1 to minutes and set seconds to 0
min = min + 1 –adds 1 to minutes
sec = 0
end –ends if
sec = sec + 1 –counts the seconds
if min==60 then –if 60 minutes have past add 1 to uur(hours) and set minutes to 0
uur = uur + 1 –adds 1 to uur(hours)
min = 0
end
–prints everything
print("time is: ")
print(sec.." seconds")
print(min.." minutes")
print(uur.." hours")
sleep(1) –sleeps for 1 second
end
mon = peripheral.wrap("right") –connects to the monitor on top of the computer
sec = 0 –declare variables
min = 0
uur = 0
mon.setTextScale(1.5) –set the text scale of the monitor to a 1.5 magnification
term.redirect(mon) –redirect the output ot the monitors
while true do –main loop
term.clear() –clear the screen
term.setCursorPos(1,1) –set the cursor to the left upper corner
if sec==60 then –if 60 seconds have past add 1 to minutes and set seconds to 0
min = min + 1 –adds 1 to minutes
sec = 0
end –ends if
sec = sec + 1 –counts the seconds
if min==60 then –if 60 minutes have past add 1 to uur(hours) and set minutes to 0
uur = uur + 1 –adds 1 to uur(hours)
min = 0
end
–prints everything
print("time is: ")
print(sec.." seconds")
print(min.." minutes")
print(uur.." hours")
sleep(1) –sleeps for 1 second
end