zPandro

mekReactorHandler

Jul 18th, 2021 (edited)
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. local turbine = peripheral.wrap("right")
  2. local maxEnergy = turbine.getEnergyCapacity()
  3.  
  4. function firstCheck()
  5.     energy = turbine.getEnergy()
  6.     enrgPerc = energy * 100 / maxEnergy
  7.     if(enrgPerc < 40) then
  8.         redstone.setOutput("left", not redstone.getOutput("left"))
  9.     end    
  10. end
  11.  
  12. firstCheck()
  13. while true do
  14.     energy = turbine.getEnergy()
  15.     enrgPerc = energy * 100 / maxEnergy
  16.     if(enrgPerc > 40) then
  17.         redstone.setOutput("left", not redstone.getOutput())
  18.     end
  19. end
Add Comment
Please, Sign In to add comment