SHOW:
|
|
- or go back to the newest paste.
1 | - | local function piszCyfre(str, licz) |
1 | + | local function piszCyfre(str, licz) |
2 | - | local o = 0 |
2 | + | local o = 0 |
3 | - | if licz == 0 then o = 119 end -- 1110111 |
3 | + | if licz == 0 then o = 119 end -- 1110111 |
4 | - | if licz == 1 then o = 36 end -- 0100100 |
4 | + | if licz == 1 then o = 36 end -- 0100100 |
5 | - | if licz == 2 then o = 93 end -- 1011101 |
5 | + | if licz == 2 then o = 93 end -- 1011101 |
6 | - | if licz == 3 then o = 109 end -- 1101101 |
6 | + | if licz == 3 then o = 109 end -- 1101101 |
7 | - | if licz == 4 then o = 46 end -- 0101110 |
7 | + | if licz == 4 then o = 46 end -- 0101110 |
8 | - | if licz == 5 then o = 107 end -- 1101011 |
8 | + | if licz == 5 then o = 107 end -- 1101011 |
9 | - | if licz == 6 then o = 123 end -- 1111011 |
9 | + | if licz == 6 then o = 123 end -- 1111011 |
10 | - | if licz == 7 then o = 37 end -- 0100101 |
10 | + | if licz == 7 then o = 37 end -- 0100101 |
11 | - | if licz == 8 then o = 127 end -- 1111111 |
11 | + | if licz == 8 then o = 127 end -- 1111111 |
12 | - | if licz == 9 then o = 111 end -- 1101111 |
12 | + | if licz == 9 then o = 111 end -- 1101111 |
13 | - | rs.setBundledOutput(str, o) |
13 | + | rs.setBundledOutput(str, o) |
14 | end | |
15 | - | |
15 | + | |
16 | - | local function piszLiczbe(liczba) |
16 | + | local function piszLiczbe(liczba) |
17 | - | local cyfra1 = (liczba-(liczba%10))/10 --liczba/10 zaokraglone w dol |
17 | + | local cyfra1 = (liczba-(liczba%10))/10 --liczba/10 zaokraglone w dol |
18 | - | local cyfra2 = liczba%10 |
18 | + | local cyfra2 = liczba%10 |
19 | - | piszCyfre("left", cyfra1) |
19 | + | piszCyfre("left", cyfra1) |
20 | - | piszCyfre("right", cyfra2) |
20 | + | piszCyfre("right", cyfra2) |
21 | end | |
22 | - | |
22 | + | |
23 | - | |
23 | + | |
24 | - | while true do |
24 | + | while true do |
25 | - | while not rs.testBundledInput("front", colors.white) do |
25 | + | while not rs.testBundledInput("front", colors.white) do |
26 | - | rs.setBundledOutput("left", colors.lightBlue) |
26 | + | rs.setBundledOutput("left", colors.lightBlue) |
27 | - | rs.setBundledOutput("right", colors.lightBlue) |
27 | + | rs.setBundledOutput("right", colors.lightBlue) |
28 | - | sleep(0.5) |
28 | + | sleep(0.5) |
29 | - | rs.setBundledOutput("left", 0) |
29 | + | rs.setBundledOutput("left", 0) |
30 | - | rs.setBundledOutput("right", 0) |
30 | + | rs.setBundledOutput("right", 0) |
31 | - | sleep(0.5) |
31 | + | sleep(0.5) |
32 | - | end |
32 | + | end |
33 | - | rs.setBundledOutput("left", 0) |
33 | + | rs.setBundledOutput("left", 0) |
34 | - | rs.setBundledOutput("right", 0) |
34 | + | rs.setBundledOutput("right", 0) |
35 | - | rs.setBundledOutput("front", colors.magenta) |
35 | + | rs.setBundledOutput("front", colors.magenta) |
36 | - | local czas = 2 |
36 | + | local czas = 35 |
37 | - | local sek = 60 |
37 | + | local sek = 60 |
38 | - | while czas > 1 do |
38 | + | while czas > 1 do |
39 | - | piszLiczbe(czas) |
39 | + | piszLiczbe(czas) |
40 | - | rs.setBundledOutput("front", colors.combine(colors.magenta, colors.orange)) |
40 | + | rs.setBundledOutput("front", colors.combine(colors.magenta, colors.orange)) |
41 | - | sleep(0.1) |
41 | + | sleep(0.1) |
42 | - | rs.setBundledOutput("front", colors.magenta) |
42 | + | rs.setBundledOutput("front", colors.magenta) |
43 | - | sleep(59.9) |
43 | + | sleep(59.9) |
44 | - | czas = czas - 1 |
44 | + | czas = czas - 1 |
45 | - | end |
45 | + | end |
46 | - | rs.setBundledOutput("front", colors.combine(colors.magenta, colors.orange)) |
46 | + | rs.setBundledOutput("front", colors.combine(colors.magenta, colors.orange)) |
47 | - | sleep(0.1) |
47 | + | sleep(0.1) |
48 | - | rs.setBundledOutput("front", colors.magenta) |
48 | + | rs.setBundledOutput("front", colors.magenta) |
49 | - | while sek > 0 do |
49 | + | while sek > 0 do |
50 | - | piszLiczbe(sek) |
50 | + | piszLiczbe(sek) |
51 | - | rs.setBundledOutput("front", 0) |
51 | + | rs.setBundledOutput("front", 0) |
52 | - | sleep(0.5) |
52 | + | sleep(0.5) |
53 | - | rs.setBundledOutput("front", colors.magenta) |
53 | + | rs.setBundledOutput("front", colors.magenta) |
54 | - | sleep(0.5) |
54 | + | sleep(0.5) |
55 | - | sek = sek - 1 |
55 | + | sek = sek - 1 |
56 | - | end |
56 | + | end |
57 | - | rs.setBundledOutput("front", 0) |
57 | + | rs.setBundledOutput("front", 0) |
58 | - | rs.setBundledOutput("left", 0) |
58 | + | rs.setBundledOutput("left", 0) |
59 | - | rs.setBundledOutput("right", 0) |
59 | + | rs.setBundledOutput("right", 0) |
60 | end |