MMOAtlantian

Extra Utilities Solar Automation

Oct 20th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. local solar = peripheral.find("extrautils_generatorsolar")
  2. --write("test success")
  3.  
  4. energy = 0;
  5. MAX = 700000
  6. MIN = 100000
  7.  
  8. while (true)do
  9.     energy = solar.getEnergyStored()
  10.     if (energy >= MAX) then
  11.         print("switching to transmit mode")
  12.         redstone.setOutput("top", true)
  13.     end
  14.     if (energy <= MIN) then
  15.         print("switching to charge mode")
  16.         redstone.setOutput("top", false)
  17.     end
  18.     print("current energy: ")
  19.     print(energy)
  20.     print("")
  21.     sleep(2)
  22. end
Advertisement
Add Comment
Please, Sign In to add comment