Advertisement
Guest User

Untitled

a guest
Aug 15th, 2013
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.34 KB | None | 0 0
  1. net = peripheral.wrap("left")
  2. bridge = peripheral.wrap("bottom")
  3.  
  4. --methods = net.callRemote("me_access_terminal_2","listMethods")
  5.  
  6. local t = "me_access_terminal_2"
  7.  
  8. while true do
  9.  
  10.   local m = peripheral.wrap("top")
  11.  
  12.   m.clear() -- clear monitor
  13.   bridge.clear() -- clear OPglasses
  14.  
  15.   -- variables
  16.   totalbytes = net.callRemote(t,"getTotalBytes")
  17.   usedbytes = net.callRemote(t,"getUsedBytes")
  18.   freebytes = net.callRemote(t,"getFreeBytes")
  19.   remainingtypes = net.callRemote(t,"getRemainingItemTypes")
  20.   totaltypes = net.callRemote(t,"getTotalItemTypes")
  21.   usedtypes = net.callRemote(t,"getStoredItemTypes")
  22.  
  23.  
  24.   m.setCursorPos(2,1)
  25.   m.setTextScale(1)
  26.   m.write("ME Storage Status")
  27.  
  28.   m.setCursorPos(4,2)
  29.   m.write(freebytes.." Bytes free of "..totalbytes.." Bytes")
  30.  
  31.   m.setCursorPos(4,3)
  32.   m.write(remainingtypes.." ItemTypes free of "..totaltypes.." ItemTypes")
  33.  
  34.  
  35.   --ByteCalc [[
  36.   cc1 = usedbytes / totalbytes
  37.   cc2 = cc1 * 100
  38.   cc2 = math.ceil(cc2)
  39.  
  40.   aaa1 = totalbytes - freebytes
  41.   aaa2 = aaa1 / totalbytes
  42.   aaa3 = aaa2 * 100
  43.   aaa3 = math.ceil(aaa3)
  44.   --ByteCalc End
  45.  
  46.   --TypeCalc [[
  47.   cc3 = usedtypes / totaltypes
  48.   cc4 = cc3 * 100
  49.   cc4 = math.ceil(cc4)
  50.  
  51.   ccc1 = totaltypes - remainingtypes
  52.   ccc2 = ccc1 / totaltypes
  53.   ccc3 = ccc2 * 100
  54.   ccc3 = math.ceil(ccc3)
  55.    --TypeCalc End
  56.  
  57.   text1 = bridge.addText(5,5,freebytes.." Bytes free of "..totalbytes.." Bytes",0xFFFFFF)
  58.   text1.setText(freebytes.." Bytes free of "..totalbytes.." Bytes")
  59.   text1.setScale(0.7)
  60.  
  61.   box1 = bridge.addBox(3,11,102,7,0x000000,0.8)
  62.   box2 = bridge.addBox(4,12,100,5,0xFFFFFF,0.2)
  63.   box3 = bridge.addBox(4,12,aaa3,5,0x3399FF,0.8)
  64.   txtp1 = bridge.addText(107,12,aaa3.."%",0xFFFFFF)
  65.  
  66.   text2 = bridge.addText(5,25,remainingtypes.." ItemTypes free of "..totaltypes.." ItemTypes",0xFFFFFF)
  67.   text2.setText(remainingtypes.." ItemTypes free of "..totaltypes.." ItemTypes")
  68.   text2.setScale(0.7)
  69.  
  70.   box4 = bridge.addBox(3,31,102,7,0x000000,0.8)
  71.   box5 = bridge.addBox(4,32,100,5,0xFFFFFF,0.2)
  72.   box6 = bridge.addBox(4,32,ccc3,5,0x3399FF,0.8)
  73.   txtp2 = bridge.addText(107,32,ccc3.."%",0xFFFFFF)
  74.  
  75.   --FIX for layer issues...
  76.   box1.setZIndex(1)
  77.   box2.setZIndex(2)
  78.   box3.setZIndex(3)
  79.  
  80.   box4.setZIndex(1)
  81.   box5.setZIndex(2)
  82.   box6.setZIndex(3)
  83.  
  84.   text1.setZIndex(100)
  85.  
  86.   sleep(1.0)
  87.  
  88. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement