Advertisement
osmarks

ExU2 Generator Manager

Dec 14th, 2019
439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.27 KB | None | 0 0
  1. local side = "back"
  2. local battery = "xu2:tilepowerbattery_0"
  3. local function energy(x) return peripheral.call(x, "getEnergyStored") / peripheral.call(x, "getEnergyCapacity") end
  4. while true do
  5.     rs.setOutput(side, energy(side) < 0.9 or energy(battery) < 0.3)
  6.     sleep(3)
  7. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement