if not term.isColor() then
  print("Advanced computer required")
  error()
end

local sides = peripheral.getNames()
local cloakingCore
for _, side in pairs(sides) do
  os.sleep(0)
  local deviceType = peripheral.getType(side)
  if deviceType == "warpdriveCloakingCore" then
    cloakingCore = peripheral.wrap(side)
  end
end

if cloakingCore == nil or cloakingCore.isInterfaced() ~= true then
  term.setBackgroundColor(colors.red)
  term.setTextColor(colors.white)
  print("No Cloaking core detected")
else
  cloakingCore.enable(true)
  os.sleep(1)
  local isValid, message = cloakingCore.getAssemblyStatus()
  if isValid then
    term.setBackgroundColor(colors.lime)
    term.setTextColor(colors.blue)
    print("Cloaking is enabled")
  else
    term.setBackgroundColor(colors.red)
    term.setTextColor(colors.white)
    print(message)
    term.setBackgroundColor(colors.black)
    term.setTextColor(colors.white)
    print()
    print("In each of the 6 directions, you need to place exactly 2 Cloaking coils, for a total of 12 coils.")
    print("The 6 inner coils shall be exactly one block away from the core.")
    print("The cloaking field will extend 5 blocks past the outer 6 coils.")
    print("Power consumption scales with the amount of cloaked blocks.")
  end
end

term.setBackgroundColor(colors.black)
term.setTextColor(colors.white)
print()
