Advertisement
soulgriever

ME MFSU Monitor

Dec 12th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. --Load Charts API
  2. os.loadAPI("/apis/charts")
  3. os.loadAPI("/apis/ic2")
  4. os.loadAPI("/apis/tools")
  5. --Load Peripherals
  6. mon = peripheral.find("monitor")
  7. mon.setTextScale(1)
  8.  
  9. rednet.open("back")
  10. --Start Program
  11.  
  12. while true do
  13.  local id, msg, protocol = rednet.receive("ME-MFSU")
  14.  local t = textutils.unserialize(msg)
  15.  
  16.  charge = tonumber(t[3])
  17.  term.redirect(mon)
  18.  tools.clear()
  19.  
  20.  
  21.  if charge > 70 then
  22.   charts.lineColor("",2,5,16,stored,capacity,colors.green,colors.white,false)
  23.  end
  24.  if charge <= 70 and charge > 45 then
  25.   charts.lineColor("",2,5,16,stored,capacity,colors.yellow,colors.white,false)
  26.  end
  27.  if charge <= 45 then
  28.   charts.lineColor("",2,5,16,stored,capacity,colors.red,colors.white,false)
  29.  end
  30.  
  31.  
  32.  tools.line(-13,-2)
  33.  term.write("MFSU Charge:")
  34.  tools.line(-9,3)
  35.  term.write(tostring(tools.round(charge, 0)))
  36.  term.write("%")
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement