

function HealBot_Comms_SendAddonMsg(addon_id, msg, aType, pName)
  if aType==1 then
    SendAddonMessage(addon_id, msg, "BATTLEGROUND" );
  elseif aType==2 then
    SendAddonMessage(addon_id, msg, "RAID" );
  elseif aType==3 then
    SendAddonMessage(addon_id, msg, "PARTY" );
  elseif aType==4 and pName then
    SendAddonMessage(addon_id, msg, "WHISPER", pName );
  end
end


function HealBot_Comms_GetChan(chan)
	if GetChannelName(chan)>0 then
		return GetChannelName(chan);
	else
		return nil;
	end
end

local tmptxt=nil
local HealBotAddonMsgType=nil
function HealBot_Comms_DebugStatus()
  HealBotAddonMsgType=HealBot_GetHealBot_AddonMsgType()
  if HealBot_PlayerDead then
    HealBot_Report_Error("HealBot_PlayerDead=true")
  else
    HealBot_Report_Error("HealBot_PlayerDead=false")
  end
  if HealBot_InnerFocus then
    HealBot_Report_Error("HealBot_InnerFocus=true")
  else
    HealBot_Report_Error("HealBot_InnerFocus=false")
  end
  if HealBot_InnerFocusTalent then
    HealBot_Report_Error("HealBot_InnerFocusTalent=true")
  else
    HealBot_Report_Error("HealBot_InnerFocusTalent=false")
  end
  HealBot_Report_Error("API:GetRealZoneText();="..GetRealZoneText())
  if HealBotAddonMsgType==1 then
    HealBot_Report_Error("SendAddonMessage=BATTLEGROUND");
  elseif HealBotAddonMsgType==2 then
    HealBot_Report_Error("SendAddonMessage=RAID");
  elseif HealBotAddonMsgType==3 then
    HealBot_Report_Error("SendAddonMessage=PARTY");
  elseif HealBotAddonMsgType==4 then
    HealBot_Report_Error("SendAddonMessage=WHISPER");
  end
  if HealBot_Config.ShowHeader[HealBot_Config.Current_Skin]==1 then
    HealBot_Report_Error("Headers=On  #cols="..HealBot_Config.numcols[HealBot_Config.Current_Skin])
  else
    HealBot_Report_Error("Headers=Off  #cols="..HealBot_Config.numcols[HealBot_Config.Current_Skin])
  end
  if HealBot_Config.SelfHeals==1 then
    tmptxt="Self=Yes  ";
  else
    tmptxt="Self=No  ";
  end
  if HealBot_Config.GroupHeals==1 then
    tmptxt=tmptxt.."Group=Yes  ";
  else
    tmptxt=tmptxt.."Group=No  ";
  end
  if HealBot_Config.TankHeals==1 then
    tmptxt=tmptxt.."Tank=Yes  ";
  else
    tmptxt=tmptxt.."Tank=No  ";
  end
  if HealBot_Config.EmergencyHeals==1 then
    tmptxt=tmptxt.."Extra=Yes:";
  else
    tmptxt=tmptxt.."Extra=No:";
  end
  if HealBot_Config.EmergIncMonitor==1 then
    tmptxt=tmptxt.."AllClasses=Yes  ";
  else
    tmptxt=tmptxt.."AllClasses=No  ";
  end
  if HealBot_Config.PetHeals==1 then
    tmptxt=tmptxt.."Pet=Yes  ";
  else
    tmptxt=tmptxt.."Pet=No  ";
  end
  if HealBot_Config.TargetHeals==1 then
    tmptxt=tmptxt.."Target=Yes";
  else
    tmptxt=tmptxt.."Target=No";
  end
  HealBot_Report_Error(tmptxt);
  HealBot_Report_Error("GetNumRaidMembers()="..GetNumRaidMembers().."  GetNumPartyMembers()="..GetNumPartyMembers())
  HealBot_Report_Error("#HealBot_CurrentSpells="..HealBot_RetNumCurrentSpells())
  HealBot_Report_Error("HealBot_UnitRange[player]="..HealBot_Action_GetUnitRange())
  HealBot_Report_Error("#HealBot_ButtonArray1="..HealBot_Action_RetButtonArraySize(1))
  HealBot_Report_Error("#HealBot_ButtonArray2="..HealBot_Action_RetButtonArraySize(2))
  HealBot_Report_Error("#HealBot_ButtonArray3="..HealBot_Action_RetButtonArraySize(3))
  HealBot_Report_Error("#HealBot_Aggro="..HealBot_RetSetAggroSize())
end

local hbcommver={}
local hbcommbonus={}
function HealBot_Comms_Info()
  if HealBot_Error:IsVisible() then
    HideUIPanel(HealBot_Error)
	return
  end
  HealBotAddonMsgType=HealBot_GetHealBot_AddonMsgType()
  HealBot_Report_Error("Current Zone="..GetRealZoneText())
  if HealBotAddonMsgType==1 then
    HealBot_Report_Error("HealBot Comms set to BATTLEGROUND");
  elseif HealBotAddonMsgType==2 then
    HealBot_Report_Error("HealBot Comms set to RAID");
  elseif HealBotAddonMsgType==3 then
    HealBot_Report_Error("HealBot Comms set to PARTY");
  elseif HealBotAddonMsgType==4 then
    HealBot_Report_Error("HealBot Comms set to WHISPER");
  end
  HealBot_Report_Error("Number of Raid Members="..GetNumRaidMembers().."  Number of Party Members="..GetNumPartyMembers())
  HealBot_Report_Error("HealBot CurrentSpells="..HealBot_RetNumCurrentSpells())
  hbcommver, hbcommbonus=HealBot_GetInfo()
  HealBot_Report_Error("-");
  for x,v in pairs(hbcommver) do
    HealBot_Report_Error(x.. " is using "..v)
  end
  for x,v in pairs(hbcommbonus) do
    HealBot_Report_Error(x.. " has "..v.." Healing Bonus")
  end
end

function HealBot_Comm_rbsum(spell, count)
  HealBot_Report_Error(spell.."="..count);
end
  