function l()
print("")
end
function cl()
term.setCursorPos(1,1)
term.clear()
end
function lane()
print("Control Panel Alpha 0.7")
l()
end
local function addoutput(sside, ...)
local c = colors.combine(rs.getBundledOutput(sside), ...)
rs.setBundledOutput(sside, c)
end
local function removeoutput(sside, ...)
local c = colors.subtract(rs.getBundledOutput(sside), ...)
rs.setBundledOutput(sside, c)
end
function outputanaus(testside)
input = io.read()
if input == "1" and rs.testBundledInput(testside, 1) then
removeoutput(testside, 1)
elseif input == "2" and rs.testBundledInput(testside, 2) then
removeoutput(testside, 2)
elseif input == "3" and rs.testBundledInput(testside, 4) then
removeoutput(testside, 4)
elseif input == "4" and rs.testBundledInput(testside, 8) then
removeoutput(testside, 8)
elseif input == "5" and rs.testBundledInput(testside, 16) then
removeoutput(testside, 16)
elseif input == "6" and rs.testBundledInput(testside, 32) then
removeoutput(testside, 32)
elseif input == "7" and rs.testBundledInput(testside, 64) then
removeoutput(testside, 64)
elseif input == "8" and rs.testBundledInput(testside, 128) then
removeoutput(testside, 128)
elseif input == "9" and rs.testBundledInput(testside, 256) then
removeoutput(testside, 256)
elseif input == "10" and rs.testBundledInput(testside, 512) then
removeoutput(testside, 512)
elseif input == "11" and rs.testBundledInput(testside, 1024) then
removeoutput(testside, 1024)
elseif input == "12" and rs.testBundledInput(testside, 2048) then
removeoutput(testside, 2048)
elseif input == "13" and rs.testBundledInput(testside, 4096) then
removeoutput(testside, 4096)
elseif input == "14" and rs.testBundledInput(testside, 8192) then
removeoutput(testside, 8192)
elseif input == "15" and rs.testBundledInput(testside, 16384) then
removeoutput(testside, 16384)
elseif input == "16" and rs.testBundledInput(testside, 32768) then
removeoutput(testside, 32768)
elseif input == "1" then
addoutput(testside, 1)
elseif input == "2" then
addoutput(testside, 2)
elseif input == "3" then
addoutput(testside, 4)
elseif input == "4" then
addoutput(testside, 8)
elseif input == "5" then
addoutput(testside, 16)
elseif input == "6" then
addoutput(testside, 32)
elseif input == "7" then
addoutput(testside, 64)
elseif input == "8" then
addoutput(testside, 128)
elseif input == "9" then
addoutput(testside, 256)
elseif input == "10" then
addoutput(testside, 512)
elseif input == "11" then
addoutput(testside, 1024)
elseif input == "12" then
addoutput(testside, 2048)
elseif input == "13" then
addoutput(testside, 4096)
elseif input == "14" then
addoutput(testside, 8192)
elseif input == "15" then
addoutput(testside, 16384)
elseif input == "16" then
addoutput(testside, 32768)
elseif input == "q" then
sleep(0.5)
return menu()
end
end
end
end
function testoutput(testside)
while true do
cl()
print("(q) Menu")
if rs.testBundledInput(testside, colors.white) then
print("White : (1) AN")
else
print("White : Aus")
end
if rs.testBundledInput(testside, colors.orange) then
print("Orange : (2) AN")
else
print("Orange : Aus")
end
if rs.testBundledInput(testside, colors.magenta) then
print("Magenta : (3) AN")
else
print("Magenta : Aus")
end
if rs.testBundledInput(testside, 8) then
print("LightBlue: (4) AN")
else
print("LightBlue: Aus")
end
if rs.testBundledInput(testside, colors.yellow) then
print("Yellow : (5) AN")
else
print("Yellow : Aus")
end
if rs.testBundledInput(testside, colors.lime) then
print("Lime : (6) AN")
else
print("Lime : Aus")
end
if rs.testBundledInput(testside, colors.pink) then
print("Pink : (7) AN")
else
print("Pink : Aus")
end
if rs.testBundledInput(testside, colors.gray) then
print("Gray : (8) AN")
else
print("Gray : Aus")
end
if rs.testBundledInput(testside, 256) then
print("LightGray: (9) AN")
else
print("LightGray: Aus")
end
if rs.testBundledInput(testside, colors.cyan) then
print("Cyan : (10) AN")
else
print("Cyan : Aus")
end
if rs.testBundledInput(testside, colors.purple) then
print("Purple : (11) AN")
else
print("Purple : Aus")
end
if rs.testBundledInput(testside, colors.blue) then
print("Blue : (12) AN")
else
print("Blue : Aus")
end
if rs.testBundledInput(testside, colors.brown) then
print("Brown : (13) AN")
else
print("Brown : Aus")
end
if rs.testBundledInput(testside, colors.green) then
print("Green : (14) AN")
else
print("Green : Aus")
end
if rs.testBundledInput(testside, colors.red) then
print("Red : (15) AN")
else
print("Red : Aus")
end
if rs.testBundledInput(testside, colors.black) then
print("Black : (16) AN")
else
print("Black : Aus")
end
sleep(1)
outputanaus(testside)
sleep(1.5)
return testoutput(testside)
end
end
function status()
cl()
lane()
print("Output Seite waehlen")
l()
print("(1) back")
print("(2) right")
print("(3) left")
print("(4) top")
print("(5) bottom")
while true do
local e1, p1 = os.pullEvent()
if e1 == "char" and p1 == "1" then
testoutput("back")
elseif e1 == "char" and p1 == "2" then
testoutput("right")
elseif e1 == "char" and p1 == "3" then
testoutput("left")
elseif e1 == "char" and p1 == "4" then
testoutput("top")
elseif e1 == "char" and p1 == "5" then
testoutput("bottom")
end
end
end
function menu()
cl()
lane()
print("(a) Status AN/AUS")
while true do
if event == "char" and param == "a" then
status()
end
end
end
menu()