Advertisement
Guest User

induction

a guest
Oct 21st, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. while true do
  2.   monitor = peripheral.wrap("top")
  3.   battery = peripheral.wrap("Induction Matrix_4")
  4.   storagedmax = battery.getMaxEnergy()*0.4
  5.   storaged = battery.getEnergy()*0.4
  6.   pourcent = (storaged/storagedmax)*100
  7.   input = battery.getInput()*0.4
  8.   output = battery.getOutput()*0.4
  9.  
  10.   if monitor == nil then
  11.     error("monitor disconnected")
  12.   else
  13.     monitor.clear()
  14.     monitor.setCursorPos(1, 1)
  15.   end
  16.  
  17.   if battery == nil then
  18.     error("battery disconnected")
  19.   end
  20.  
  21.   monitor.write(storagedmax)
  22.   monitor.write(" et ")
  23.   monitor.write(storaged)
  24.   monitor.write(" ")
  25.   monitor.write(pourcent)
  26.   monitor.setCursorPos(1, 2)
  27.   monitor.write(input)
  28.   monitor.write(" et ")
  29.   monitor.write(output)
  30.  
  31.   sleep(0.25)
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement