Damaged

Methods info

Jul 13th, 2014
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1.  
  2.     local JSON = (loadfile "JSON.lua")()
  3.     JSON.strictTypes = true
  4. local logFile = fs.open("bee.log", "w")
  5. function log(msg)
  6.    msg = msg or ""
  7.    logFile.write(tostring(msg))
  8.    logFile.flush()
  9.    io.write(msg)
  10. end
  11. function logLine(msg)
  12.    msg = msg or ""
  13.    logFile.write(msg.."\n")
  14.    logFile.flush()
  15.    io.write(msg.."\n")
  16. end
  17.  
  18. function logTable(table)
  19.    for key, value in pairs (table) do
  20.       logLine(key .. " = " .. tostring(value))
  21.    end
  22. end
  23. m = peripheral.wrap("bottom")
  24. logLine(JSON:encode(m.getAdvancedMethodsData()))
  25.  
  26.     logFile.close()
Advertisement
Add Comment
Please, Sign In to add comment