View difference between Paste ID: q2fseGJN and fZAmd77M
SHOW: | | - or go back to the newest paste.
1
--Timer
2
min = min + 1;
3
if min == 60 then
4
    min = 0;
5
    hr = hr + 1;
6
    if hr == 24 then
7
        hr = 0;
8
    end
9
end
10
11
--Script
12
function write_time()
13-
    local s
13+
    local s;
14-
    local shr
14+
    local shr;
15-
    local smin
15+
    local smin;
16-
    local sdot
16+
    local sdot;
17
18-
    if <= 12 then
18+
    if hr <= 12 then
19
        sdot = "am";
20
        shr = hr;
21
    else
22
        sdot = "pm";
23
        shr = hr - 12;
24
    end
25
26
    if min < 10 then
27-
        smin = "0" .. min
27+
        smin = "0" .. min;
28
    else
29-
        smin = min
29+
        smin = min;
30
    end
31
	
32-
    s =  = "Time is " .. shr .. ":" .. smin .. " " .. dot
32+
    s = "Time is " .. shr .. ":" .. smin .. " " .. dot;
33-
    return s
33+
    return s;
34
end