guitarplayer616

check ores

Jan 11th, 2022 (edited)
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.27 KB | None | 0 0
  1. local sArg = ... or "ore"
  2. p = peripheral.wrap("top")
  3. tbl = p.scan(8)
  4.  
  5. local str = ""
  6. for i,v in pairs(tbl) do
  7.   if v.name:find(sArg) then
  8.     str = str .. v.name .. "\n"
  9.   end
  10. end
  11.  
  12. local h = io.open("result", "w")
  13. h:write(str)
  14. h:close()
  15.  
  16. shell.run("edit result")
Add Comment
Please, Sign In to add comment