Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- r1 = false
- r2 = false
- r3 = false
- lado = "front"
- function Refresh(cond, col)
- local curr = rs.getBundledOutput(lado)
- if cond then
- rs.setBundledOutput(lado, colors.combine(curr, col))
- else
- rs.setBundledOutput(lado, colors.subtract(curr, col))
- end
- end
- function RefreshAll()
- Refresh(r1, colors.white)
- Refresh(r2, colors.orange)
- Refresh(r3, colors.yellow)
- end
- function Selection()
- print("Please choose the reactors to turn on (1/2/3/all/(r)efresh:")
- local btnB = read()
- if btnB == "r" then
- RefreshAll()
- elseif btnB == "1" then
- print("Reator 1")
- r1 = not r1
- Refresh(colors.white)
- elseif btnB == "2" then
- r2 = not r2
- Refresh(colors.orange)
- elseif btnB == "3" then
- r3 = not r3
- Refresh(colors.yellow)
- elseif btnB == "all" then
- r1 = not r1
- r2 = not r2
- r3 = not r3
- RefreshAll()
- end
- end
- function Initialize()
- while true do
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- term.clear()
- term.setCursorPos(1,1)
- Selection()
- sleep(0.5)
- end
- end
- Initialize()
Advertisement
Add Comment
Please, Sign In to add comment