brianMc

MC Open Computers - Computer Specs Lua Script

Apr 28th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. local com = require("component")
  2. local comp = require("computer")
  3. local term = require("term")
  4. local os = require("os")
  5. local gpu = com.gpu
  6. local w, h = gpu.getResolution()
  7.  
  8. function spacer(len)
  9.   print(string.rep("-", string.len(len)))
  10. end
  11.  
  12. term.clear()
  13. gpu.setForeground(0x00ff00)
  14.  
  15. date = "Specs - "..os.date("%I:%M | %m/%d/%y")
  16. print(date)
  17. spacer(date)
  18.  
  19. ver = _OSVERSION.." | ".._VERSION
  20. print(ver)
  21. spacer(ver)
  22.  
  23. tmem = comp.totalMemory()/1024
  24. mem = "Total Memory: "..tmem.."mb"
  25. print(mem)
  26. spacer(mem)
  27.  
  28. fmem = "Free Memory: "..math.floor(comp.freeMemory()/1024).."mb"
  29. print(fmem)
  30. spacer(fmem)
Add Comment
Please, Sign In to add comment