Advertisement
Guest User

startup

a guest
Jul 19th, 2024
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  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.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement