Guest User

Untitled

a guest
Apr 21st, 2013
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.16 KB | None | 0 0
  1. r1 = false
  2. r2 = false
  3. r3 = false
  4. lado = "front"
  5.  
  6. function Refresh(cond, col)
  7.    local curr = rs.getBundledOutput(lado)
  8.    if cond then
  9.       rs.setBundledOutput(lado, colors.combine(curr, col))
  10.    else
  11.       rs.setBundledOutput(lado, colors.subtract(curr, col))
  12.    end
  13. end
  14.  
  15. function RefreshAll()
  16.    Refresh(r1, colors.white)
  17.    Refresh(r2, colors.orange)
  18.    Refresh(r3, colors.yellow)
  19. end
  20.  
  21. function Selection()
  22.    print("Please choose the reactors to turn on (1/2/3/all/(r)efresh:")
  23.    local btnB = read()
  24.    if btnB == "r" then
  25.       RefreshAll()
  26.    elseif btnB == "1" then
  27.       print("Reator 1")
  28.       r1 = not r1
  29.       Refresh(colors.white)
  30.    elseif btnB == "2" then
  31.       r2 = not r2
  32.       Refresh(colors.orange)
  33.    elseif btnB == "3" then
  34.       r3 = not r3
  35.       Refresh(colors.yellow)
  36.    elseif btnB == "all" then
  37.       r1 = not r1
  38.       r2 = not r2
  39.       r3 = not r3
  40.       RefreshAll()
  41.    end
  42. end
  43.  
  44. function Initialize()
  45.    while true do
  46.       term.setBackgroundColor(colors.white)
  47.       term.setTextColor(colors.black)
  48.       term.clear()
  49.       term.setCursorPos(1,1)
  50.       Selection()
  51.       sleep(0.5)
  52.    end
  53. end
  54.  
  55. Initialize()
Advertisement
Add Comment
Please, Sign In to add comment