Advertisement
Demos_

MinecraftLua_CoreCmd

Jan 22nd, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.67 KB | None | 0 0
  1. -- CmdDCore
  2.  
  3. -- DEBUG
  4. DEBUG = true
  5.  
  6. if DEBUG then
  7.     print("[DEBUG] Start of cmdCore")
  8. end
  9. rednetHostname = "cmdCore"
  10. rednet.open("bottom")
  11. rednetProtocol = "core"
  12. rednetTimeout = 40
  13. rednet.host(rednetProtocol,rednetHostname)
  14.  
  15. hostnameComp = "compCore"
  16.  
  17. core = peripheral.wrap("top")
  18.  
  19.  
  20.  
  21. function GetInfo()
  22.     if DEBUG then
  23.         print("[DEBUG] Start of GetInfo")
  24.     end
  25.     v = {}
  26.     v[1] = core.getEnergyStored()
  27.     v[2] = core.getMaxEnergyStored()
  28.     v[3] = core.getTransferPerTick()
  29.     SendInfo(v)
  30. end
  31.  
  32. function SendInfo(pV)
  33.     if DEBUG then
  34.         print("[DEBUG] Start of SendInfo pV = ",pV)
  35.     end
  36.     rednet.broadcast(pV,rednetProtocol)
  37. end
  38.  
  39. while true do
  40.     GetInfo()
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement