Advertisement
Guest User

startup

a guest
Aug 22nd, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.66 KB | None | 0 0
  1. mon = peripheral.wrap("monitor_3")
  2. enp = peripheral.wrap("tile_enderio_blockcapacitorbank_name_2")
  3. mep = peripheral.wrap("appeng_me_tilecontroller_2")
  4. mon.clear()
  5. redstone.setOutput("right", true)
  6. while true do
  7. rdtn = mep.countOfItemType(331, 0)
  8. en = enp.getEnergyStored("right")
  9. enmx = enp.getMaxEnergyStored("right")
  10. percent = en/enmx
  11. percent = percent*100
  12. potentrd = rdtn * 1600000
  13.  
  14. local percentc
  15. if percent >= 80 then
  16.   percentc = colors.lime
  17. elseif percent >=50 then
  18.   percentc = colors.yellow
  19. elseif percent < 50 then
  20.   percentc = colors.red
  21. end
  22. mon.setTextColor(colors.white)
  23. mon.setCursorPos(1,1)
  24. mon.clearLine()
  25. mon.write("Power:")
  26. mon.setTextColor(percentc)
  27. mon.setCursorPos(8, 1)
  28. mon.write(percent.."%")
  29. mon.setTextColor(colors.white)
  30. mon.setCursorPos(1,3)
  31. mon.write("Total Power:")
  32. mon.setCursorPos(1,4)
  33. mon.clearLine()
  34. mon.write(en.."/"..enmx)
  35. mon.setCursorPos(1,6)
  36. mon.write("Potential Power in Redstone:")
  37. mon.setCursorPos(1,7)
  38. mon.clearLine()
  39. mon.write(potentrd.."RF")
  40. mon.setCursorPos(1,9)
  41. mon.write("Power Income:")
  42. mon.setCursorPos(1,10)
  43. mon.clearLine()
  44. if redstone.getInput("left") == true then
  45.   redstone.setOutput("back", false)
  46.   redstone.setOutput("right", false)
  47.   mon.write("No Input")
  48. elseif redstone.getInput("top") == true then
  49.   mon.write("Redstone Generators & Reactor")
  50.   redstone.setOutput("back", true)
  51.   redstone.setOutput("right", true)
  52. elseif percent < 25 then
  53.   mon.write("Redstone Generators & Reactor")
  54.   redstone.setOutpu("right", true)
  55.   redstone.setOutput("back", true)
  56. elseif percent > 25 then
  57.   mon.write("Reactor")
  58.   redstone.setOutput("right", true)
  59.   redstone.setOutput("back", false)
  60. end
  61. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement