astonish01

Coreo skyfactory energy

Nov 29th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function round(num, idp)
  2.   local mult = 10^(idp or 0)
  3.   return math.floor(num * mult + 0.5) / mult
  4. end
  5. cell = peripheral.wrap('left')
  6. while true do
  7. if round(cell.getEnergyStored()/80000000*100,2) <= 20 then
  8. redstone.setOutput('right',true)
  9. end
  10. if round(cell.getEnergyStored()/80000000*100,2) >= 80 then
  11. redstone.setOutput('right',false)
  12. end
  13. sleep(60)
  14. end
Add Comment
Please, Sign In to add comment