denvys5

EU control

Mar 29th, 2014
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. m = peripheral.wrap("top")
  2. e = m.getEUStored()
  3. s = m.getEUCapacity()
  4. p = e/s*100
  5. rs = redstone
  6. function low()
  7. print(p)
  8. if p<80 then
  9.   rs.setOutput("right", false)
  10.   rs.setOutput("left", true)
  11.  else
  12.   sleep(5)
  13.  end
  14. end
  15. --function high()
  16. --if e > 3500000 then
  17. -- rs.setOutput("left", false)
  18. -- rs.setOutput("right", true)
  19. -- else
  20. -- sleep(10)
  21. --end
  22. --end
  23.  
  24. --function main()
  25. --m.getEUStored()
  26.  
  27. while true do
  28.  rs.setOutput("right", true)
  29.  rs.setOutput("left", false)
  30.  low()
  31. --high()
  32.  sleep(10)
  33.  os.reboot()
  34. end
Advertisement
Add Comment
Please, Sign In to add comment