Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local envd = peripheral.find("environmentDetector")
- list_ = fs.open("allow_list.txt","r")
- list = textutils.unserialize(list_.readAll())
- list_.close()
- function has(table,compare)
- for _,b in pairs(table) do
- if b == compare then
- return true
- end
- end
- return false
- end
- open = false
- while true do
- open = false
- entities = envd.scanEntities(2) or {}
- for _,tab in pairs(entities) do
- for type,data in pairs(tab) do
- if type == "name" then
- if has(list,data) then
- print(data)
- rs.setOutput("bottom",true)
- open = true
- sleep(2 )
- end
- end
- end
- end
- if not open then
- rs.setOutput("bottom",false)
- end
- sleep()
- end
Add Comment
Please, Sign In to add comment