SHOW:
|
|
- or go back to the newest paste.
1 | os.loadAPI("touch") | |
2 | mon = peripheral.wrap("right") | |
3 | rednet.open("top") | |
4 | mon.setTextScale(0.5) | |
5 | local t1 = touch.new("right") | |
6 | local t = t1 | |
7 | ||
8 | function writeButtons() | |
9 | t1:add ("N-1", nil, 2, 2, 16, 8, colors.gray, colors.cyan) | |
10 | t1:add ("RDC", nil, 18, 2, 32, 8, colors.gray, colors.cyan) | |
11 | t = t1 | |
12 | t:draw() | |
13 | end | |
14 | ||
15 | writeButtons() | |
16 | function Checkclick(p1) | |
17 | if p1 == "N-1" then | |
18 | rednet.broadcast("N1") | |
19 | end | |
20 | if p1 == "RDC" then | |
21 | rednet.broadcast("RDC") | |
22 | ||
23 | end | |
24 | end | |
25 | ||
26 | ||
27 | ||
28 | while true do | |
29 | local event, p1 = t:handleEvents(os.pullEvent()) | |
30 | if event == "button_click" then | |
31 | t:flash(p1) | |
32 | Checkclick(p1) | |
33 | end | |
34 | end | |
35 |