Advertisement
DarkSiders061

PC appel

Jul 19th, 2024
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. os.loadAPI("touch")
  2. mon = peripheral.find("monitor")
  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 ("Appel", nil, 2, 2, 16, 8, colors.gray, colors.cyan)
  10.  t = t1
  11.  t:draw()
  12.  end
  13.  
  14. writeButtons()
  15.  function Checkclick(p1)
  16.      if p1 == "Appel" then
  17.         rednet.broadcast("N1")
  18.      end
  19.  end
  20.  
  21.  
  22.  
  23.  while true do
  24.   local event, p1 = t:handleEvents(os.pullEvent())
  25.       if event == "button_click" then
  26.       t:flash(p1)
  27.       Checkclick(p1)
  28.       end
  29.   end
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement