Advertisement
SythsGod

Little Test Code

Mar 5th, 2014
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. bridge = peripheral.wrap("left")
  2.  
  3. bridge.clear()
  4.  
  5. width = 200
  6. x = 0
  7. capacity = 40000000
  8. amount = 0
  9. msg = ""
  10. message = ""
  11. value = 0
  12. mfsu0e = 1
  13. mfsu2e = 1
  14.  
  15. local storageUnits = {
  16.    {
  17.                  ["id"] = "mfsu_0",
  18.                  ["name"] = "Main Energy"
  19.    }
  20. }
  21. local offset = 0
  22. for key, storageUnit in pairs(storageUnits) do
  23.   pxOffset = offset * 20
  24.   storageUnit["label"] = bridge.addText(4, 4 + pxOffset, storageUnit["name"], 0x000000)
  25.   storageUnit["bar"] = bridge.addBox(4, 14 + pxOffset, 0, 5, 0xCC0000, 0.9)
  26. --  storageUnit["bar"].setZIndex(2)
  27.   storageUnit["bg"] = bridge.addBox(4, 14 + pxOffset, width, 5, 0x000000, 0.5)
  28.   offset = offset + 1
  29. end
  30.  
  31. while true do
  32.   for i=#storageUnits,1,-1 do
  33.             widht = 200
  34.             storageUnit = storageUnits[i]
  35.                   storageUnit["bar"].setWidth(width / capacity * amount)
  36.                   write("W"..tostring(widht))
  37.                   write("C"..tostring(capacity))
  38.                   write("A"..tostring(amount))
  39.   end
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement