edoreld

Untitled

Jun 8th, 2013
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.43 KB | None | 0 0
  1. local bridge = peripheral.wrap("left")
  2. local net = peripheral.wrap("back")
  3. local c = peripheral.wrap("me_controller_0")
  4.  
  5. function cl()
  6.     term.clear()
  7.     term.setCursorPos(1,1)
  8. end
  9.  
  10. local systems = {
  11.     {
  12.     ["id"] = "me_controller_0",
  13.     ["label"] = "AE System"
  14.     }
  15. }
  16.  
  17. local width = 50
  18. local offset,pxOffset = 0,0
  19.  
  20. h = fs.open("methods", "w")
  21.  local methods = textutils.serialize(c.provideCell())
  22.  h.write(methods)
  23.  h.close()
  24.  
  25. bridge.clear()
  26.  
  27. for key,value in pairs(systems) do
  28.     pxOffset = offset * 20
  29.  
  30.     value["title"] = bridge.addText(5,5 + offset,value["label"],0xC5360F)
  31.     value["title"].setScale(0.8)
  32.     value["itemstored"] = bridge.addText(5,14 + offset,"Items stored: ",0x333845)
  33.     value["itemstored"].setScale(0.7)
  34.     value["numitemsstored"] = bridge.addText(55,14 + offset,"",0xfbff00)
  35.     value["numitemsstored"].setScale(0.7)
  36.  
  37.    
  38.     offset = offset + 1
  39. end
  40.  
  41. local system
  42. local table
  43.  
  44. while true do
  45.     for i=#systems,1,-1 do
  46.         system = systems[i]
  47.         table = c.provideCell()
  48.         numItemsStored = table["storedItemCount"]
  49.         totalItems = table["totalBytes"]
  50.         system["numitemsstored"].setText(tostring(numItemsStored).."/"..tostring(totalItems))
  51.     end
  52.    
  53.     os.sleep(2)
  54. end
  55.  
  56.  cl()
  57.  
  58.  
  59.  
  60. print("Free Bytes: "..table["freeBytes"])
  61. read()
  62.  
  63. -- arguments: x, y, width, height, color, opacity
  64. -- mybox = bridge.addBox(0,0,80,40,0x0099FF,0.7)
  65.  
  66. -- arguments: x, y, text, color
  67. -- mytext = bridge.addText(10, 10, "hello!", 0xCC0000)
Advertisement
Add Comment
Please, Sign In to add comment