Advertisement
Guest User

startup

a guest
May 29th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.94 KB | None | 0 0
  1. -- A Computer Button Pannel with the button
  2. -- API from Direwolf20 by leachiml
  3. os.loadAPI("button")
  4. m = peripheral.wrap("back")
  5. m.clear()
  6.  
  7. function fillTable()
  8.    button.setTable("Eingang", pro1, 2,12,3,5)
  9.    button.setTable("ME System", pro2, 17,27,3,5)
  10.    button.screen()
  11. end
  12.  
  13. function getClick()
  14.    event,side,x,y = os.pullEvent("monitor_touch")
  15.    button.checkxy(x,y)
  16. end
  17.  
  18. function pro1()
  19.    button.toggleButton("Eingang")
  20.    rs.setBundledOutput("left", colors.orange)
  21.    sleep(1)
  22.    rs.setBundledOutput("left",colors.subtract(rs.getBundledOutput("left"), colors.orange))  
  23. end
  24.  
  25. function pro2()
  26.    button.toggleButton("ME System")
  27.    rs.setBundledOutput("left",colors.blue)
  28.    sleep(0.5)
  29.    rs.setBundledOutput("left",colors.subtract(rs.getBundledOutput("left"), colors.blue))              
  30. end
  31.    
  32. fillTable()
  33. button.heading("Securety System")
  34.  
  35. while true do
  36.    getClick()
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement