Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --TODO : Add monitor handling Process
- -- API : https://pastebin.com/HRbMF1Eg
- os.loadAPI("button")
- function fillTable()
- button.setTable("Wither Skeletons", witherskeletons, 3, 23, 3, 7)
- button.setTable("Exit Program", exitProg, 25, 45, 21, 25)
- button.screen()
- end
- function getClick()
- event, siude, x, y = os.pullEvent("monitor_touch")
- button.checkxy(x, y)
- end
- function witherskeletons()
- button.toggleButton("Wither Skeletons")
- rednet.broadcast("wither", "ControlComp")
- end
- function exitProg()
- error("Program Terminated")
- end
- sides = peripheral.getNames()
- modemhere = false
- monitorhere = false
- monitoramount = 0
- monitors = {}
- for i = 1,#sides do
- thistype = peripheral.getType(sides[i])
- if thistype == "modem" then
- print("Modem Found ! Connecting !")
- rednet.open(sides[i])
- modemhere = true
- end
- if thistype == "monitor" then
- print("Monitor found ! Connecting !")
- m = peripheral.wrap(sides[i])
- monitorhere = true
- if monitoramount == 0 then
- monitoramount = 1
- m = peripheral.wrap(sides[i])
- else
- print("Already one monitor attached ! Ignoring !")
- end
- end
- end
- if not modemhere then error("No Modem found ! Please connect one !") end
- if not monitorhere then error("No Monitor found ! Please connect one !") end
- rednet.host("ControlComp","ControlComp")
- m.clear()
- fillTable()
- button.heading("Base Control Panel")
- while true do
- getClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement