Advertisement
NolanSyKinsley

Untitled

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