Advertisement
Guest User

Untitled

a guest
Oct 24th, 2015
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. local component = require("component")
  2. local cell = component.tile_thermalexpansion_cell_resonant_name
  3. local rs = component.redstone
  4. local sides = require("sides")
  5. local term = requrie("term")
  6.  
  7. local stored = cellgetEnergyStored()/80000000
  8. local turnOn = 0.1
  9. local turnOff = 0.9
  10.  
  11. local y
  12. do
  13. local x
  14. x,y = term.getCursor()
  15. end
  16.  
  17. local function PowerSupply()
  18. if stored <= turnOn and rs.getOutput(sides.left) == 0 then
  19. rs.setOutput(sides.left,15)
  20. elseif stored >= turn off and rs.getOutput(sides.left) == 15 then
  21. rs.setOutput(sides.left,0)
  22. end
  23.  
  24.  
  25. local state
  26. if rs.getOutput(sides.left) == 15 then
  27. state = "On"
  28. else
  29. state = "Off"
  30. end
  31.  
  32.  
  33. term.clearLine()
  34. term.write("Generator state: "..state.."\n")
  35. term.clearLine()
  36. term.write("Stored Energy: "..stored*80000000.."\n")
  37. term.clearLine()
  38. term.write("Energy Percentage: "..stored.."\n")
  39.  
  40. end
  41.  
  42.  
  43. while true do
  44. PowerSupply()
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement