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)
|
| 9 | + | t1:add ("RDC", nil, 2, 2, 18, 8, colors.gray, colors.cyan)
|
| 10 | - | t1:add ("RDC", nil, 18, 2, 32, 8, colors.gray, colors.cyan)
|
| 10 | + | t1:add ("N-1", nil, 21, 2, 37, 8, colors.gray, colors.cyan)
|
| 11 | - | t = t1 |
| 11 | + | t1:add ("N-2", nil, 40, 2, 56, 8, colors.gray, colors.cyan)
|
| 12 | - | t:draw() |
| 12 | + | t1:add ("N-3", nil, 2, 10, 18, 16, colors.gray, colors.cyan)
|
| 13 | t1:add ("N-4", nil, 21, 10, 37, 16, colors.gray, colors.cyan)
| |
| 14 | ||
| 15 | t = t1 | |
| 16 | - | function Checkclick(p1) |
| 16 | + | t:draw() |
| 17 | - | if p1 == "N-1" then |
| 17 | + | |
| 18 | - | rednet.broadcast("N1")
|
| 18 | + | |
| 19 | - | end |
| 19 | + | |
| 20 | - | if p1 == "RDC" then |
| 20 | + | function Checkclick(p1) |
| 21 | - | rednet.broadcast("RDC")
|
| 21 | + | if p1 == "RDC" then |
| 22 | - | |
| 22 | + | rednet.broadcast("RDC")
|
| 23 | - | end |
| 23 | + | end |
| 24 | if p1 == "N-1" then | |
| 25 | rednet.broadcast("N1")
| |
| 26 | end | |
| 27 | if p1 == "N-2" then | |
| 28 | rednet.broadcast("N2")
| |
| 29 | end | |
| 30 | if p1 == "N-3" then | |
| 31 | rednet.broadcast("N3")
| |
| 32 | end | |
| 33 | if p1 == "N-4" then | |
| 34 | rednet.broadcast("N4")
| |
| 35 | end | |
| 36 | end | |
| 37 | while true do | |
| 38 | local event, p1 = t:handleEvents(os.pullEvent()) | |
| 39 | if event == "button_click" then | |
| 40 | t:flash(p1) | |
| 41 | Checkclick(p1) | |
| 42 | end | |
| 43 | end | |
| 44 |