Advertisement
Pinkishu

Untitled

Feb 4th, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.94 KB | None | 0 0
  1. --local str = ""
  2. local tab = {}
  3.  
  4. local gpu = component.list("gpu")()
  5. local screen = component.list("screen")()
  6. component.invoke(gpu, "bind", screen)
  7. local comp = computer
  8. do
  9.   local w,h = component.invoke(gpu, "getResolution")
  10.   component.invoke(gpu, "fill", 1, 1, w, h, " ")
  11. end
  12. gpu = component.proxy(gpu)
  13.  
  14. function update()
  15. --  local free = comp.freeMemory()
  16.   gpu.set(1, 1, "Memory used: " ..  (comp.totalMemory()-comp.freeMemory()).."                   ")
  17.   gpu.set(1,2 ,"Memory free: " .. comp.freeMemory().."            ")
  18.   gpu.set(1,3,"Total: " .. #tab .. "         ")
  19. end
  20. update()
  21.  
  22. while true do
  23.   if comp.freeMemory() < 10 then
  24.     gpu.set(1, 5, "Memory low! " ..comp.freeMemory())
  25.     while comp.pullSignal() ~= "key_up" do end
  26.     gpu.set(1, 5, "                                            ")
  27.   end
  28.   --str = str .. "A"
  29.   tab[#tab+1]="A"
  30.   if (#tab % 100) == 0 then
  31.     update()
  32.     comp.pullSignal(0.05)
  33.   end
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement