Advertisement
Guest User

startup

a guest
Nov 24th, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. local modem = peripheral.wrap("right")
  2. local peripheralList = peripheral.getNames()
  3.  
  4.  
  5. local Bat1Max = 1
  6. local Bat1Amount = 1
  7. for index = 1,#peripheralList do
  8.   if string.find(peripheralList[Index],"cofh_thermalexpansion_energycell_2") then
  9.     Bat1 = peripheral.wrap(peripheralList[Index])
  10.     Bat1Max = Bat1.getMaxEnergyStored("unknown")
  11.     print("Energycell on wired modem: ",peripheralList[Index]," connected")
  12.   end
  13. end
  14.  
  15. while true do
  16.   if peripheral.isPresent("cofh_thermalexpansion_energycell_2") then
  17.     Bat1Amount = Bat1.getEnergyStored("unknown")
  18.   end
  19. if Bat1Amount < 48000000 then
  20.   rs.setOutput("front",true)
  21. else
  22.   rs.setOutput("front",false)
  23. end
  24.  
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement