rednet.open("bottom")
os.loadAPI("button")
m = peripheral.wrap("top")
m.clear()
-------------------------------------------------------------------------
function fillTable1()
button.setTable("Inne ON" , inneON , 2 ,14,3 ,5 ,colors.lime , colors.red)
button.setTable("Inne OFF" , inneOFF , 2 ,14,7 ,9 ,colors.lime , colors.red)
button.setTable("COS ON" , cosON , 2 ,14,11,13,colors.green , colors.red)
button.setTable("COS OFF" , cosOFF , 2 ,14,15,17,colors.green , colors.red)
button.setTable("test1" , test1 , 16,26,11,13,colors.lime , colors.red)
button.setTable("test2" , test2 , 16,26,15,17,colors.lime , colors.red)
button.setTable("test3" , test3 , 28,38,11,13,colors.green , colors.red)
button.setTable("test4" , test4 , 28,38,15,17,colors.green , colors.red)
button.setTable("Prev" , prev1 , 16,26,7 ,9 ,colors.magenta, colors.purple)
button.setTable("Next" , next1 , 28,38,7 ,9 ,colors.magenta, colors.purple)
button.screen()
end
-------------------------------------------------------------------------
function fillTable()
button.setTable("Swiatlo ON" , swON , 2 ,14,3 ,5 ,colors.lime , colors.red)
button.setTable("Swiatlo OFF", swOFF , 2 ,14,7 ,9 ,colors.lime , colors.red)
button.setTable("COM ON" , comON , 2 ,14,11,13,colors.green , colors.red)
button.setTable("COM OFF" , comOFF, 2 ,14,15,17,colors.green , colors.red)
button.setTable("Prev" , prev , 16,26,7 ,9 ,colors.magenta, colors.purple)
button.setTable("Next" , next , 28,38,7 ,9 ,colors.magenta, colors.purple)
button.screen()
end
-------------------------------------------------------------------------
--funkcje fillTable------------------------------------------------------
-------------------------------------------------------------------------
function swON()
button.flash("Swiatlo ON")
rednet.send(24, "swON")
rs.setOutput("back", false)
end
function swOFF()
button.flash("Swiatlo OFF")
rs.setOutput("back", true)
rednet.send(24, "swOFF")
end
function comON()
button.flash("COM ON")
rednet.send(18, "ON")
end
function comOFF()
button.flash("COM OFF")
rednet.send(18, "OFF")
end
function prev()
button.flash("Prev")
button.clearTable()
ramka()
button.label(30,5,"2")
fillTable1()
end
function next()
button.flash("Next")
button.clearTable()
ramka()
button.label(30,5,"2")
fillTable1()
end
-------------------------------------------------------------------------
--funkcje fillTable1-----------------------------------------------------
-------------------------------------------------------------------------
function inneON()
button.flash("Inne ON")
end
function inneOFF()
button.flash("Inne OFF")
end
function cosON()
button.flash("COS ON")
end
function cosOFF()
button.flash("COS OFF")
end
function prev1()
button.flash("Prev")
button.clearTable()
ramka()
button.label(30,5,"1")
fillTable()
end
function next1()
button.flash("Next")
button.clearTable()
ramka()
button.label(30,5,"1")
fillTable()
end
-------------------------------------------------------------------------
function ramka()
button.heading("Panel zdalnego sterowania men8")
button.label(1 ,2 ,"o-------------o")
button.label(1 ,3 ,"|")
button.label(1 ,4 ,"|")
button.label(16,4 ," Wybor strony ")
button.label(16,5 ," Strona: ")
button.label(1 ,5 ,"|")
button.label(1 ,6 ,"|")
button.label(1 ,7 ,"|")
button.label(1 ,8 ,"|")
button.label(1 ,9 ,"|")
button.label(15,3 ,"|")
button.label(15,4 ,"|")
button.label(15,5 ,"|")
button.label(15,6 ,"|")
button.label(15,7 ,"|")
button.label(15,8 ,"|")
button.label(15,9 ,"|")
button.label(1 ,10,"o-------------+")
button.label(1 ,11,"|")
button.label(1 ,12,"|")
button.label(1 ,13,"|")
button.label(1 ,14,"|")
button.label(1 ,15,"|")
button.label(1 ,16,"|")
button.label(1 ,17,"|")
button.label(15,11,"|")
button.label(15,12,"|")
button.label(15,13,"|")
button.label(15,14,"|")
button.label(15,15,"|")
button.label(15,16,"|")
button.label(15,17,"|")
button.label(1 ,18,"o-------------o")
button.label(16,10,"-----------o-----------o")
button.label(27,11,"|")
button.label(27,12,"|")
button.label(27,13,"|")
button.label(27,14,"|")
button.label(27,15,"|")
button.label(27,16,"|")
button.label(27,17,"|")
button.label(16,2 ,"-----------------------o")
button.label(16,18,"-----------o-----------o")
button.label(39,11,"|")
button.label(39,12,"|")
button.label(39,13,"|")
button.label(39,14,"|")
button.label(39,15,"|")
button.label(39,16,"|")
button.label(39,17,"|")
button.label(39,3 ,"|")
button.label(39,4 ,"|")
button.label(39,5 ,"|")
button.label(39,6 ,"|")
button.label(39,7 ,"|")
button.label(39,8 ,"|")
button.label(39,9 ,"|")
end
function getClick()
event,side,x,y = os.pullEvent("monitor_touch")
button.checkxy(x,y)
end
-------------------------------------------------------------------------
fillTable()
button.heading("Panel zdalnego sterowania men8")
button.label(1 ,2 ,"o-------------o")
button.label(1 ,3 ,"|")
button.label(1 ,4 ,"|")
button.label(16,4 ," Wybor strony ")
button.label(16,5 ," Strona: ")
button.label(1 ,5 ,"|")
button.label(1 ,6 ,"|")
button.label(1 ,7 ,"|")
button.label(1 ,8 ,"|")
button.label(1 ,9 ,"|")
button.label(15,3 ,"|")
button.label(15,4 ,"|")
button.label(15,5 ,"|")
button.label(15,6 ,"|")
button.label(15,7 ,"|")
button.label(15,8 ,"|")
button.label(15,9 ,"|")
button.label(1 ,10,"o-------------+")
button.label(1 ,11,"|")
button.label(1 ,12,"|")
button.label(1 ,13,"|")
button.label(1 ,14,"|")
button.label(1 ,15,"|")
button.label(1 ,16,"|")
button.label(1 ,17,"|")
button.label(15,11,"|")
button.label(15,12,"|")
button.label(15,13,"|")
button.label(15,14,"|")
button.label(15,15,"|")
button.label(15,16,"|")
button.label(15,17,"|")
button.label(1 ,18,"o-------------o")
button.label(16,10,"-----------o-----------o")
button.label(27,11,"|")
button.label(27,12,"|")
button.label(27,13,"|")
button.label(27,14,"|")
button.label(27,15,"|")
button.label(27,16,"|")
button.label(27,17,"|")
button.label(16,2 ,"-----------------------o")
button.label(16,18,"-----------o-----------o")
button.label(39,11,"|")
button.label(39,12,"|")
button.label(39,13,"|")
button.label(39,14,"|")
button.label(39,15,"|")
button.label(39,16,"|")
button.label(39,17,"|")
button.label(39,3 ,"|")
button.label(39,4 ,"|")
button.label(39,5 ,"|")
button.label(39,6 ,"|")
button.label(39,7 ,"|")
button.label(39,8 ,"|")
button.label(39,9 ,"|")
while true do
getClick()
end