while true do
local x, y=term.getCursorPos()
term.clearLine()
if n==1 then write(">YES< NO") else write (" YES >NO<") end
term.setCursorPos(x, y)
a, b=os.pullEvent()
while a~="key" do a, b=os.pullEvent() end
if b==203 and n==2 then n=1 end
if b==205 and n==1 then n=2 end
if b==28 then print("") break end
end
In the code, it has:
a, b=os.pullEvent()
while a~="key" do a, b=os.pullEvent() end
if b==203 and n==2 then n=1 end
if b==205 and n==1 then n=2 end
if b==28 then print("") break end
end
That means before it continues, it waits for you to press a button, so it stops the timer and everything else
Please, use code tags.
You can use timers:
local updateTimer = os.startTimer()
...
<inside your loop checking for keys>
if event == "timer" and param1 == updateTimer then
updateYourHourBar()
updateTimer = os.startTimer(1) -- Update it every second.
elseif event == "key" and blah then
...
end
Something like that.
I can't guess how you've done your code though, so you'll have to post it if you want more informative help.
My post + code tags
[color=#000000][font=helvetica, arial, sans-serif]a[/font][/color][color=#666600][font=helvetica, arial, sans-serif],[/font][/color][color=#000000][font=helvetica, arial, sans-serif] b[/font][/color][color=#666600][font=helvetica, arial, sans-serif]=[/font][/color][color=#000000][font=helvetica, arial, sans-serif]os[/font][/color][color=#666600][font=helvetica, arial, sans-serif].[/font][/color][color=#000000][font=helvetica, arial, sans-serif]pullEvent[/font][/color][color=#666600][font=helvetica, arial, sans-serif]()[/font][/color]
[color=#000088][font=helvetica, arial, sans-serif]while[/font][/color][color=#000000][font=helvetica, arial, sans-serif] a[/font][/color][color=#666600][font=helvetica, arial, sans-serif]~=[/font][/color][color=#008800][font=helvetica, arial, sans-serif]"key"[/font][/color][color=#000000][font=helvetica, arial, sans-serif] [/font][/color][color=#000088][font=helvetica, arial, sans-serif]do[/font][/color][color=#000000][font=helvetica, arial, sans-serif] a[/font][/color][color=#666600][font=helvetica, arial, sans-serif],[/font][/color][color=#000000][font=helvetica, arial, sans-serif] b[/font][/color][color=#666600][font=helvetica, arial, sans-serif]=[/font][/color][color=#000000][font=helvetica, arial, sans-serif]os[/font][/color][color=#666600][font=helvetica, arial, sans-serif].[/font][/color][color=#000000][font=helvetica, arial, sans-serif]pullEvent[/font][/color][color=#666600][font=helvetica, arial, sans-serif]()[/font][/color][color=#000000][font=helvetica, arial, sans-serif] [/font][/color][color=#000088][font=helvetica, arial, sans-serif]end[/font][/color]
[color=#000088][font=helvetica, arial, sans-serif]if[/font][/color][color=#000000][font=helvetica, arial, sans-serif] b[/font][/color][color=#666600][font=helvetica, arial, sans-serif]==[/font][/color][color=#006666][font=helvetica, arial, sans-serif]203[/font][/color][color=#000000][font=helvetica, arial, sans-serif] [/font][/color][color=#000088][font=helvetica, arial, sans-serif]and[/font][/color][color=#000000][font=helvetica, arial, sans-serif] n[/font][/color][color=#666600][font=helvetica, arial, sans-serif]==[/font][/color][color=#006666][font=helvetica, arial, sans-serif]2[/font][/color][color=#000000][font=helvetica, arial, sans-serif] [/font][/color][color=#000088][font=helvetica, arial, sans-serif]then[/font][/color][color=#000000][font=helvetica, arial, sans-serif] n[/font][/color][color=#666600][font=helvetica, arial, sans-serif]=[/font][/color][color=#006666][font=helvetica, arial, sans-serif]1[/font][/color][color=#000000][font=helvetica, arial, sans-serif] [/font][/color][color=#000088][font=helvetica, arial, sans-serif]end[/font][/color]
[color=#000088][font=helvetica, arial, sans-serif]if[/font][/color][color=#000000][font=helvetica, arial, sans-serif] b[/font][/color][color=#666600][font=helvetica, arial, sans-serif]==[/font][/color][color=#006666][font=helvetica, arial, sans-serif]205[/font][/color][color=#000000][font=helvetica, arial, sans-serif] [/font][/color][color=#000088][font=helvetica, arial, sans-serif]and[/font][/color][color=#000000][font=helvetica, arial, sans-serif] n[/font][/color][color=#666600][font=helvetica, arial, sans-serif]==[/font][/color][color=#006666][font=helvetica, arial, sans-serif]1[/font][/color][color=#000000][font=helvetica, arial, sans-serif] [/font][/color][color=#000088][font=helvetica, arial, sans-serif]then[/font][/color][color=#000000][font=helvetica, arial, sans-serif] n[/font][/color][color=#666600][font=helvetica, arial, sans-serif]=[/font][/color][color=#006666][font=helvetica, arial, sans-serif]2[/font][/color][color=#000000][font=helvetica, arial, sans-serif] [/font][/color][color=#000088][font=helvetica, arial, sans-serif]end[/font][/color]
[color=#000088][font=helvetica, arial, sans-serif]if[/font][/color][color=#000000][font=helvetica, arial, sans-serif] b[/font][/color][color=#666600][font=helvetica, arial, sans-serif]==[/font][/color][color=#006666][font=helvetica, arial, sans-serif]28[/font][/color][color=#000000][font=helvetica, arial, sans-serif] [/font][/color][color=#000088][font=helvetica, arial, sans-serif]then[/font][/color][color=#000000][font=helvetica, arial, sans-serif] [/font][/color][color=#000088][font=helvetica, arial, sans-serif]print[/font][/color][color=#666600][font=helvetica, arial, sans-serif]([/font][/color][color=#008800][font=helvetica, arial, sans-serif]""[/font][/color][color=#666600][font=helvetica, arial, sans-serif])[/font][/color][color=#000000][font=helvetica, arial, sans-serif] [/font][/color][color=#000088][font=helvetica, arial, sans-serif]break[/font][/color][color=#000000][font=helvetica, arial, sans-serif] [/font][/color][color=#000088][font=helvetica, arial, sans-serif]end[/font][/color]
[color=#000088][font=helvetica, arial, sans-serif]end[/font][/color]
[color=#000088][font=helvetica, arial, sans-serif]