SHOW:
|
|
- or go back to the newest paste.
1 | mon = peripheral.wrap("back") | |
2 | - | mon.setTextScale(2) |
2 | + | mon.setTextScale(4.5) |
3 | ||
4 | function calc_color(color) | |
5 | return math.pow(2, color - 1) | |
6 | - | mon.clear() |
6 | + | |
7 | - | mon.setCursorPos(2,1) |
7 | + | |
8 | - | mon.write("Mobfarm open ") |
8 | + | function msg(gap, line, color, groundb, text) |
9 | mon.setBackgroundColor(calc_color(groundb)) | |
10 | - | mon.clear() |
10 | + | mon.setCursorPos(gap,line) |
11 | - | mon.setCursorPos(2,1) |
11 | + | mon.setTextColor(calc_color(color)) |
12 | - | mon.write("Mobfarm closed") |
12 | + | text = mon.write(text) |
13 | end | |
14 | - | sleep(1) |
14 | + | |
15 | function clear() | |
16 | for a = 1,10 do | |
17 | msg(01,a,16,16," ") | |
18 | end | |
19 | end | |
20 | ||
21 | while true do | |
22 | if rs.getInput("top", true) then | |
23 | clear() | |
24 | msg(03,02,09,16,"Mobfarm") | |
25 | msg(11,02,06,16,"OPEN") | |
26 | else | |
27 | clear() | |
28 | msg(02,02,09,16,"Mobfarm") | |
29 | msg(10,02,15,16,"CLOSED") | |
30 | end | |
31 | sleep(10) | |
32 | end | |
33 |