SHOW:
|
|
- or go back to the newest paste.
| 1 | local envd = peripheral.find("environmentDetector")
| |
| 2 | list_ = fs.open("allow_list.txt","r")
| |
| 3 | list = textutils.unserialize(list_.readAll()) | |
| 4 | list_.close() | |
| 5 | function has(table,compare) | |
| 6 | for _,b in pairs(table) do | |
| 7 | if b == compare then | |
| 8 | return true | |
| 9 | end | |
| 10 | end | |
| 11 | return false | |
| 12 | end | |
| 13 | open = false | |
| 14 | while true do | |
| 15 | open = false | |
| 16 | entities = envd.scanEntities(2) or {}
| |
| 17 | for _,tab in pairs(entities) do | |
| 18 | for type,data in pairs(tab) do | |
| 19 | if type == "name" then | |
| 20 | if has(list,data) then | |
| 21 | print(data) | |
| 22 | rs.setOutput("bottom",true)
| |
| 23 | open = true | |
| 24 | sleep(2 ) | |
| 25 | end | |
| 26 | end | |
| 27 | end | |
| 28 | end | |
| 29 | if not open then | |
| 30 | rs.setOutput("bottom",false)
| |
| 31 | end | |
| 32 | sleep() | |
| 33 | end |