Advertisement
mikebald

Energy Cube Control

Jul 19th, 2014
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.41 KB | None | 0 0
  1. local rSide = "top" -- redstone side
  2. local cSide = "left" -- cube side
  3. local mSide = "right" -- modem side
  4.  
  5. while true do
  6.   os.sleep(10)
  7.   local cube = peripheral.wrap(cSide)
  8.   local energy = cube.getEnergyStored("unknown")
  9.   rednet.open(mSide)
  10.   rednet.broadcast(energy)
  11.   rednet.close(mSide)
  12.   if energy < 30000000 then
  13.     redstone.setOutput(rSide, true)
  14.   else
  15.     redstone.setOutput(rSide, false)
  16.   end
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement