Advertisement
WhiteFire_Sondergaar

OpenComputer table printer

May 5th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.31 KB | None | 0 0
  1. term = require("term")
  2. function tableprint (t)
  3.   local lines = 0
  4.   local res_x, res_y = component.gpu.getResolution()
  5.   for k,v in pairs(t) do
  6.     print(tostring(k) .. ": " .. tostring(v))
  7.   end
  8.   lines = lines + 1
  9.   if (lines > (res_y - 1)) then
  10.     lines = 0
  11.     term.read()
  12.   end
  13. end
  14. tp = tableprint
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement