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