Guest User

startup

a guest
Nov 13th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.41 KB | None | 0 0
  1. os.loadAPI("button")
  2. m = peripheral.find("monitor")
  3. m.setTextScale(1)
  4. m.clear()
  5.  
  6. function fillTable()
  7.     button.addButton("C-Off",F1,10,19,3,4)
  8.     button.addButton("I-Off",F2,10,19,6,7)
  9.     button.addButton("E-Off",F3,10,19,9,10)
  10.     button.addButton("All-Off",F7,10,19,12,13)
  11.    
  12.     button.addButton("C-On",F4,20,29,3,4)
  13.     button.addButton("I-On",F5,20,29,6,7)
  14.     button.addButton("E-On",F6,20,29,9,10)
  15.     button.addChart("Battery", 31,37,3,16,20,colors.red,"Battery")
  16.     button.addButton("All-On",F8,20,29,12,13)
  17.    
  18.     button.addButton("SELF-DESTRUCT",F9,5,25,15,17)
  19.    
  20.     button.screenButton()
  21.     button.screenChart()
  22.    
  23.     redstone.setOutput("back", false)
  24.     redstone.setOutput("left", false)
  25.     redstone.setOutput("bottom", false)
  26.     button.toggleButton("C-Off")
  27.     button.toggleButton("I-Off")
  28.     button.toggleButton("E-Off")
  29. end
  30.  
  31. function getClick()
  32.     event,side,x,y = os.pullEvent("monitor_touch")
  33.     button.checkxy(x, y)
  34. end
  35.  
  36. function F1()
  37.     if (redstone.getOutput("back", true)) then
  38.     redstone.setOutput("back", false)
  39.     button.toggleButton("C-On")
  40.     button.toggleButton("C-Off")
  41.     else
  42.     redstone.setOutput("back", true)
  43.     button.toggleButton("C-On")
  44.     button.toggleButton("C-Off")
  45.     end
  46. end
  47.  
  48. function F2()
  49.     if (redstone.getOutput("left", true)) then
  50.     redstone.setOutput("left", false)
  51.     button.toggleButton("IOff")
  52.     button.toggleButton("I-On")
  53.     else
  54.     redstone.setOutput("left", true)
  55.     button.toggleButton("I-Off")
  56.     button.toggleButton("I-On")
  57.     end
  58. end
  59.  
  60. function F3()
  61.     if (redstone.getOutput("bottom", true)) then
  62.     redstone.setOutput("bottom", false)
  63.     button.toggleButton("E-On")
  64.     button.toggleButton("E-Off")
  65.     else
  66.     redstone.setOutput("bottom", true)
  67.     button.toggleButton("E-On")
  68.     button.toggleButton("E-Off")
  69.     end
  70. end
  71.  
  72. function F4()
  73.     if (redstone.getOutput("back", true)) then
  74.     redstone.setOutput("back", false)
  75.     button.toggleButton("C-On")
  76.     button.toggleButton("C-Off")
  77.     else
  78.     redstone.setOutput("back", true)
  79.     button.toggleButton("C-On")
  80.     button.toggleButton("C-Off")
  81.     end
  82. end
  83.  
  84. function F5()
  85.     if (redstone.getOutput("left", true)) then
  86.     redstone.setOutput("left", false)
  87.     button.toggleButton("I-Off")
  88.     button.toggleButton("I-On")
  89.     else
  90.     redstone.setOutput("left", true)
  91.     button.toggleButton("I-Off")
  92.     button.toggleButton("I-On")
  93.     end
  94. end
  95.  
  96. function F6()
  97.     if (redstone.getOutput("bottom", true)) then
  98.     redstone.setOutput("bottom", false)
  99.     button.toggleButton("E-On")
  100.     button.toggleButton("E-Off")
  101.     else
  102.     redstone.setOutput("bottom", true)
  103.     button.toggleButton("E-On")
  104.     button.toggleButton("E-Off")
  105.     end
  106. end
  107.  
  108. function F7()
  109.     button.toggleButton("All-Off")
  110.     sleep(0.5)
  111.     button.toggleButton("All-Off")
  112.     sleep(0.5)
  113.     button.toggleButton("All-Off")
  114.     sleep(0.5)
  115.     button.toggleButton("All-Off")
  116.     sleep(0.5)
  117.     button.toggleButton("All-Off")
  118.     sleep(0.5)
  119.     button.toggleButton("All-Off")
  120.     sleep(0.5)
  121.     redstone.setOutput("back", false)
  122.     redstone.setOutput("left", false)
  123.     redstone.setOutput("bottom", false)
  124.     fillTable()
  125. end
  126.  
  127. function F8()
  128.     button.toggleButton("All-On")
  129.     sleep(0.5)
  130.     button.toggleButton("All-On")
  131.     sleep(0.5)
  132.     button.toggleButton("All-On")
  133.     sleep(0.5)
  134.     button.toggleButton("All-On")
  135.     sleep(0.5)
  136.     button.toggleButton("All-On")
  137.     redstone.setOutput("back", true)
  138.     redstone.setOutput("left", true)
  139.     redstone.setOutput("bottom", true)
  140.     sleep(0.5)
  141.     button.toggleButton("All-On")
  142.     sleep(0.5)
  143.     button.toggleButton("C-Off")
  144.     button.toggleButton("I-Off")
  145.     button.toggleButton("E-Off")
  146.     button.toggleButton("C-On")
  147.     button.toggleButton("I-On")
  148.     button.toggleButton("E-On")
  149. end
  150.  
  151. function F9()
  152.     button.toggleButton("SELF-DESTRUCT")
  153.     sleep(0.2)
  154.     button.toggleButton("SELF-DESTRUCT")
  155.     sleep(0.2)
  156.     button.toggleButton("SELF-DESTRUCT")
  157.     sleep(0.2)
  158.     button.toggleButton("SELF-DESTRUCT")
  159.     sleep(0.2)
  160.     button.toggleButton("SELF-DESTRUCT")
  161.     sleep(0.2)
  162.     button.toggleButton("SELF-DESTRUCT")
  163.     sleep(0.2)
  164.     button.toggleButton("SELF-DESTRUCT")
  165.     sleep(0.2)
  166.     button.toggleButton("SELF-DESTRUCT")
  167.     sleep(0.2)
  168.     button.toggleButton("SELF-DESTRUCT")
  169.     sleep(0.2)
  170.     button.toggleButton("SELF-DESTRUCT")
  171.     sleep(0.2)
  172.     button.toggleButton("SELF-DESTRUCT")
  173.     sleep(0.2)
  174.     button.toggleButton("SELF-DESTRUCT")
  175.     sleep(0.2)
  176.     button.toggleButton("SELF-DESTRUCT")
  177.     sleep(0.2)
  178.     button.toggleButton("SELF-DESTRUCT")
  179.     sleep(0.2)
  180. end
  181.  
  182. fillTable()
  183. button.heading("Lighting Control System v3.1")
  184.    button.label(1,3," Chamber")
  185.    button.label(1,6," Interior")
  186.    button.label(1,9," Exterior")
  187. while true do getClick() end
Advertisement
Add Comment
Please, Sign In to add comment