Advertisement
Guest User

redcell2

a guest
Feb 8th, 2014
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.32 KB | None | 0 0
  1. local side =...
  2. local prap =peripheral.wrap(side)
  3.  
  4. function main()
  5. if peripheral.getType(side) == "redstone_energy_cell" then
  6.  
  7.      print("Energy held is " ..prap.getEnergyStored().." MJs")
  8.      print("Input is set at " ..prap.getEnergyReceive().." MJs/t")
  9.      print("Input is at minimum " ..prap.getMinEnergyReceived().." MJs/t")
  10.      print("Input is at maximum " ..prap.getMaxEnergyReceived().." MJs/t")
  11.      print("Output is set at " ..prap.getEnergySend().." MJs/t")
  12.  
  13. else
  14.      print("No Redstone Energy Cell Detected")
  15. end
  16. end        
  17.  
  18.  
  19.  
  20. function MAIN()
  21.  
  22.     ntwk.clear()
  23.     ntwk.setCursorPos("1","1")
  24.     ntwk.write("Energy held is " ..prap.getEnergyStored().." MJs")
  25.     ntwk.setCursorPos("1","2")
  26.     ntwk.write("Input is set at "..prap.getEnergyReceive().." MJs/t")
  27.     ntwk.setCursorPos("1","3")
  28.     ntwk.write("Input is at minimum "..prap.getMinEnergyReceived().." MJs/t")
  29.     ntwk.setCursorPos("1","4")
  30.     ntwk.write("Input is at maximum "..prap.getMaxEnergyReceived().." MJs/t")
  31.     ntwk.setCursorPos("1","5")
  32.     ntwk.write("Output is set at "..prap.getEnergySend().." MJs/t")
  33. end
  34.  
  35. local mntr=monitor_3
  36. local ntwk=peripheral.wrap(mntr)
  37.  
  38. if peripheral.getType(mntr) == "monitor" then
  39.  
  40.      MAIN()
  41. else
  42.  
  43.      main()
  44.      print(peripheral.getType(mntr))
  45.      print(mntr)    
  46. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement