Guest User

glass

a guest
Jul 17th, 2015
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.52 KB | None | 0 0
  1. glass = peripheral.wrap("right")
  2.  
  3. drum = peripheral.wrap("drum_0")
  4.  
  5. con = {
  6.   peripheral.wrap("draconic_storage_0"),
  7.   peripheral.wrap("drum_0")
  8. }
  9.  
  10. function addBox(x, y, length, width, color, opacity)
  11.   glass.addBox(x,y,length,width,color,opacity)
  12. end
  13.  
  14. function energyDisplay(x, y, color)
  15.   local curE = con[1].getEnergyStored()
  16.   local maxE = con[1].getMaxEnergyStored()
  17.   energyT = glass.addText(5,5,"Energy Core: " ..curE .."/" ..maxE .." RF", 0xFF0000)
  18.   energyT.setScale(3)
  19. end
  20.  
  21. function fluidDisplay()
  22.   local tankInfo = con[2].getTankInfo()
  23.   local contents = tankInfo[1].contents
  24.   local name = contents.rawName
  25.   local maxF = "256000"
  26.   addText(11,57,name,0xFF0000,1)
  27. end
  28.  
  29. function addText(x,y,string,color,scale)
  30.   text = glass.addText(x,y,string,color)
  31.   text.setScale(scale)
  32. end
  33.  
  34. function draw_line(x,y,length,width,color,opacity)
  35.   addBox(x,y,length,width,color,opacity)
  36. end
  37.  
  38. function start()
  39.   while true do
  40.  
  41.     local tankInfo = con[2].getTankInfo()
  42.     local contents = tankInfo[1].contents
  43.     local amount = contents.amount
  44.     samount = tostring(amount)
  45.     scap = "256000"
  46.    
  47.     if samount == nil then
  48.       samount = "0"
  49.     end
  50.            
  51.     glass.clear()
  52.     addBox(3,3,709,29,0x000000,0.8)
  53.     addBox(3,35,130,190,0x000000,0.3)
  54.     addText(7,40,"Fluid Levels",0xFF0000,2)
  55.     energyDisplay(5,2, 0xFF0000)
  56.     fluidDisplay()
  57.     draw_line(11,67,110,9,0xFF9900,1)
  58.     addText(37,67,samount .."/" ..scap, 0x000000,1)
  59.     glass.sync()
  60.     sleep(0.1)
  61.   end
  62. end
  63.  
  64. start()
Advertisement
Add Comment
Please, Sign In to add comment