Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- local m = peripheral.wrap("monitor_0")
- m.clear()
- function newTouchMenu()
- m.clear()
- m.setBackgroundColor(colors.black)
- m.setTextColor(colors.white)
- end
- function fillTable()
- newTouchMenu()
- button.clearTable()
- button.setTable("HouseControl", houseControl, 4,26 ,3,6)
- button.setTable("N/A", na, 4,26 ,9,12)
- button.setTable("N/A2", na2, 4,26 ,14,17)
- button.setTable("Menu", mainMenu, 2,28, 19,20)
- print("Main Menu Filled")
- button.screen()
- end
- function houseControl()
- button.flash("HouseControl")
- newTouchMenu()
- button.clearTable()
- button.setTable("Obsidian Collection", oC, 4,26 ,2,6)
- button.setTable("Energy Status", energyStatus, 4,26 ,8,12)
- button.setTable("Menu", mainMenu, 2,28, 19,20)
- button.setTable("N/A", na, 4,26 ,14,17)
- print("House Control Filled")
- button.screen()
- end
- function na()
- button.flash("N/A")
- print("I do nothing; Hurray!")
- end
- function na2()
- button.flash("N/A2")
- print("I do nothing 2; Hurray!")
- end
- function oC()
- button.toggleButton("Obsidian Collection")
- rednet.send(63, "oc")
- end
- function mainMenu()
- button.flash("Menu")
- m.clear()
- fillTable()
- -- refresh()
- end
- function energyStatus()
- button.flash("Energy Status")
- m.clear()
- sleep(.1)
- m.setCursorPos(6,10)
- m.setTextScale(1)
- m.setTextColor(colors.white)
- m.write("Loading Information")
- sleep(.5)
- m.clear()
- m.write("Loading Information.")
- sleep(.5)
- m.clear()
- m.write("Loading Information..")
- sleep(.5)
- m.clear()
- m.write("Loading Information...")
- sleep(.5)
- m.clear()
- button.clearTable()
- button.setTable("Refresh", refresh, 2,28,0,2)
- button.setTable("Menu", mainMenu, 2,28, 19,20)
- button.screen()
- m.setTextScale(1.4)
- m.setCursorPos(0,10)
- button.centerText("Power : ..en")
- m.setCursorPos(21,3)
- end
- function getPower()
- c = peripheral.wrap("right")
- while true do
- en = c.getEnergyStored("south")
- sleep(.1)
- end
- end
- function lockScreen()
- m.clear()
- button.clearTable()
- m.setTextColor(colors.red)
- m.setCursorPos(3,9)
- button.centerText("Locked")
- m.setCursorPos(6,10)
- m.write("Unlock with Digitizer")
- m.setCursorPos(3,11)
- m.write("Given by Owner EliteGaming")
- end
- local function getClick()
- while true do
- local _,_,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- end
- local function rednetReceiver()
- while true do
- local senderID, message = rednet.receive()
- if senderID == 62 then
- if message == "unlock" then
- fillTable()
- elseif message == "lock" then
- lockScreen()
- elseif message == "oc" then
- rednet.send(63, "oc")
- end
- end
- end
- end
- function refresh()
- button.flash("Refresh")
- button.screen()
- end
- fillTable()
- -- refresh()
- rednet.open("front")
- parallel.waitForAny(getClick, rednetReceiver)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement