Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local perilist=peripheral.getNames()
- ok,err = pcall("unloadAPI")
- local users = {1126}
- function unloadAPI()
- os.unloadAPI("zedlib")
- end
- os.loadAPI("zedlib")
- function main()
- rednet.open("right")
- for k,v in pairs(perilist) do
- if peripheral.getType(v) == "monitor" then
- local tmp = peripheral.wrap(v)
- tmp.setTextScale(2)
- local sa,sb = tmp.getSize()
- tmp.setCursorPos(1,sb)
- tmp.setBackgroundColor(colors.white)
- tmp.setTextColor(colors.red)
- tmp.clear()
- tmp.write("The Legion")
- end
- end
- while true do
- for k,v in pairs(users) do
- rednet.send(v,"200")
- end
- term.redirect(term.native())
- fileon = false
- local s,msg,p = rednet.receive(5)
- if (s == 1126) then
- if msg == "file" then
- for k,v in pairs(users) do
- rednet.send(v,"query")
- end
- local s,msg,p = rednet.receive()
- fileon = true
- if (s == 1126) then
- fime = msg
- end
- elseif msg == "clear" then
- for k,v in pairs(perilist) do
- if peripheral.getType(v) == "monitor" then
- local tmp = peripheral.wrap(v)
- tmp.setTextScale(2)
- local sa,sb = tmp.getSize()
- tmp.setCursorPos(1,sb)
- tmp.setBackgroundColor(colors.white)
- tmp.setTextColor(colors.red)
- tmp.clear()
- tmp.write("The Legion")
- end
- end
- elseif msg == "reboot" then
- os.reboot()
- end
- local zbert = 0
- for k,v in pairs(perilist) do
- if peripheral.getType(v) == "monitor" then
- zbert = zbert + 1
- if msg ~= "clear" then
- local tmp = peripheral.wrap(v)
- tmp.setTextScale(3)
- tmp.setBackgroundColor(colors.red)
- tmp.setTextColor(colors.white)
- tmp.setCursorPos(1,1)
- tmp.clear()
- tmp = ""
- term.redirect(peripheral.wrap(v))
- if fileon == true then
- f = fs.open(fime,"r")
- local msgtable = f.readAll()
- f.close()
- print(msgtable)
- else
- print(msg)
- end
- else
- print("Bonjour")
- end
- end
- end
- if zbert == 0 then
- error("NO SCREENS WERE DETECTED")
- end
- else
- print("garbage")
- end
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement