Advertisement
DarkSiders061

PC Sender 2.1

Jul 20th, 2024 (edited)
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 ("RDC", nil, 2, 2, 18, 8, colors.gray, colors.cyan)
  10.     t1:add ("N-1", nil, 21, 2, 37, 8, colors.gray, colors.cyan)
  11.     t1:add ("N-2", nil, 40, 2, 56, 8, colors.gray, colors.cyan)
  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.     t:draw()
  17.  end
  18.  
  19. writeButtons()
  20. function Checkclick(p1)
  21.     if p1 == "RDC" then
  22.         rednet.broadcast("RDC")
  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.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement