Advertisement
Guest User

spegit.lua

a guest
Jan 25th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.94 KB | None | 0 0
  1. local component = require("component")
  2. local gpu = component.gpu
  3. gpu.setResolution(80,25)
  4. local gui = require("gui")
  5. local event = require("event")
  6.  
  7. gui.checkVersion(2,5)
  8.  
  9. local prgName = "spegit"
  10. local version = "v1.0"
  11.  
  12. -- Begin: Callbacks
  13. local function btn_msr_cb(guiID, buttonID)
  14.    -- Your code here
  15. end
  16.  
  17. local function btn_he1_cb(guiID, buttonID)
  18.    -- Your code here
  19. end
  20.  
  21. local function button_3_callback(guiID, buttonID)
  22.    -- Your code here
  23. end
  24.  
  25. local function btn_he3_cb(guiID, buttonID)
  26.    -- Your code here
  27. end
  28.  
  29. local function btn_he4_cb(guiID, buttonID)
  30.    -- Your code here
  31. end
  32.  
  33. local function btn_t1_cb(guiID, buttonID)
  34.    -- Your code here
  35. end
  36.  
  37. local function btn_t2_cb(guiID, buttonID)
  38.    -- Your code here
  39. end
  40.  
  41. local function button_8_callback(guiID, buttonID)
  42.    -- Your code here
  43. end
  44.  
  45. local function exitButtonCallback(guiID, id)
  46.    local result = gui.getYesNo("", "Do you really want to exit?", "")
  47.    if result == true then
  48.       gui.exit()
  49.    end
  50.    gui.displayGui(mainGui)
  51.    refresh()
  52. end
  53. -- End: Callbacks
  54.  
  55. -- Begin: Menu definitions
  56. mainGui = gui.newGui(1, 2, 79, 23, true)
  57. label_msr = gui.newLabel(mainGui, 1, 1, "Molten Salt Reactor", 0xc0c0c0, 0x0, 7)
  58. label_msr_status = gui.newLabel(mainGui, 23, 1, "Offline", 0xfc0303, 0xf, 7)
  59. btn_msr = gui.newButton(mainGui, 33, 1, "Toggle", btn_msr_cb)
  60. label_he1 = gui.newLabel(mainGui, 1, 3, "Heat Exchanger #1", 0xc0c0c0, 0x0, 7)
  61. label_he1_status = gui.newLabel(mainGui, 23, 3, "Offline", 0xc0c0c0, 0x0, 7)
  62. btn_he1 = gui.newButton(mainGui, 33, 3, "Toggle", btn_he1_cb)
  63. label_he2 = gui.newLabel(mainGui, 1, 5, "Heat Exchanger #2", 0xc0c0c0, 0x0, 7)
  64. label_he2_status = gui.newLabel(mainGui, 23, 5, "Offline", 0xc0c0c0, 0x0, 7)
  65. btn_he2 = gui.newButton(mainGui, 33, 5, "Toggle", button_3_callback)
  66. label_he3 = gui.newLabel(mainGui, 1, 7, "Heat Exchanger #3", 0xc0c0c0, 0x0, 7)
  67. label_he3_status = gui.newLabel(mainGui, 23, 7, "Offline", 0xc0c0c0, 0x0, 7)
  68. btn_he3 = gui.newButton(mainGui, 33, 7, "Toggle", btn_he3_cb)
  69. label_he4 = gui.newLabel(mainGui, 1, 9, "Heat Exchanger #4", 0xc0c0c0, 0x0, 7)
  70. label_he4_status = gui.newLabel(mainGui, 23, 9, "Offline", 0xc0c0c0, 0x0, 7)
  71. btn_he4 = gui.newButton(mainGui, 33, 9, "Toggle", btn_he4_cb)
  72. label_t1 = gui.newLabel(mainGui, 1, 11, "Turbine #1", 0xc0c0c0, 0x0, 8)
  73. label_t1_status = gui.newLabel(mainGui, 23, 11, "Offline", 0xc0c0c0, 0x0, 8)
  74. btn_t1 = gui.newButton(mainGui, 33, 11, "Toggle", btn_t1_cb)
  75. label_t2 = gui.newLabel(mainGui, 1, 13, "Turbine #2", 0xc0c0c0, 0x0, 8)
  76. label_t2_status = gui.newLabel(mainGui, 23, 13, "Offline", 0xc0c0c0, 0x0, 8)
  77. btn_t2 = gui.newButton(mainGui, 33, 13, "Toggle", btn_t2_cb)
  78. label_all = gui.newLabel(mainGui, 1, 15, "All", 0xc0c0c0, 0x0, 3)
  79. btn_all = gui.newButton(mainGui, 33, 15, "Toggle", button_8_callback)
  80. exitButton = gui.newButton(mainGui, 73, 23, "exit", exitButtonCallback)
  81. -- End: Menu definitions
  82.  
  83. gui.clearScreen()
  84. gui.setTop("Chernobyler")
  85. gui.setBottom("tech1: whats that sound? tech2: oh no.")
  86.  
  87. -- Main loop
  88. while true do
  89.    gui.runGui(mainGui)
  90. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement