edoreld

Untitled

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