I have an elaborate code for my combat macros using powercards. When I test it with the macro box open or by pasting it in the chat window the macro/powercard works amazing. When I use it from a button on another powercard or launch it from the d20 button by the macro in my macro library it fills the chat window with the code as if it is in a powercard. Am I doing something wrong? My other macros and powercards are working fine. Here is the code. !power {{
--bgcolor|#1c4587
--erowbg|#cfe2f3
--orowbg|#b6d7a8
--name|@{selected|token_name} Attacks @{target|token_name}
--leftsub|@{selected|WeaponName_1}
--?? @{selected|Off} == 0 AND @{selected|Charge} == 0 AND @{selected|Call} == 0 ?? Maneuver:|Standard
--?? @{selected|Off} == 3 AND @{selected|Charge} == 0 AND @{selected|Call} == 0 ?? Maneuver:|Offensive Focus
--?? @{selected|Off} == 0 AND @{selected|Charge} == 2 AND @{selected|Call} == 0 ?? Maneuver:|Charge
--?? @{selected|Off} == 3 AND @{selected|Charge} == 2 AND @{selected|Call} == 0 ?? Maneuver:|Offensive Focus, Charge
--?? @{selected|Off} == 0 AND @{selected|Charge} == 0 AND @{selected|Call} == 8 ?? Maneuver:|Called Shot
--?? @{selected|Off} == 0 AND @{selected|Charge} == 2 AND @{selected|Call} == 8 ?? Maneuver:|Called Shot, Charge
--?? @{selected|Off} == 3 AND @{selected|Charge} == 2 AND @{selected|Call} == 8 ?? Maneuver:|Offensive Focus, Called Shot, Charge
--Attack:|[[ [$Atk] 1d20 +@{selected|bth} +@{selected|WeaponHitMod_1} +@{selected|WeaponHitMagic_1} +@{selected|WeaponHitMisc_1} +@{Selected|Off} -@{selected|Call} ]]
--?? @{target|Dodge} == 4 ?? alterbar4|_target|@{target|token_id} _bar|1 _amount|-4 _show|all
--?? @{target|Dodge} == 4 ?? api_setattr|_name @{target|token_name} _set _Dodge|0 _silent
--?? @{target|DodgeNumber} == 1 ?? alterbar5|_target|@{target|token_id} _bar|1 _amount|-2 _show|all
--?? @{target|DodgeNumber} == 3 ?? api_setattr|_name @{target|token_name} _set _DodgeNumber|2 _silent
--?? @{target|DodgeNumber} == 2 ?? api_setattr|_name @{target|token_name} _set _DodgeNumber|1 _silent
--?? @{target|DodgeNumber} == 1 ?? api_setattr|_name @{target|token_name} _set _DodgeNumber|0 _Dodge|0 _silent
--?? $Atk >= @{target|A.C.} AND $Atk.base <> 20 AND $Atk.base <> 1 AND @{selected|Call} == 0 ?? Hit: | You have hit @{target|token_name} for [[ [$Dmg] @{selected|WeaponDmg_1} + @{selected|WeaponDmgMisc_1} + @{selected|WeaponDmgMagic_1} + @{selected|WeaponDmgMod_1} +@{selected|Charge} ]] Hit Points of Damage!
--?? $Atk >= @{target|A.C.} AND $Atk.base <> 20 AND $Atk.base <> 1 AND @{selected|Call} == 8 ?? Hit: | You have hit @{target|token_name} with a **Called Shot** for [[ [$CallDmg] @{selected|WeaponDmg_1} +@{selected|WeaponDmg_1} + @{selected|WeaponDmgMisc_1} + @{selected|WeaponDmgMagic_1} + @{selected|WeaponDmgMod_1} +@{selected|Charge} ]] Hit Points of Damage!
--?? $Atk.base == 20 AND @{selected|Call} == 0 ?? Critical Hit: | You have hit @{target|token_name} with a **Critical** for [[ [$CritDmg] @{selected|WeaponDmg_1} + @{selected|WeaponDmg_1} + @{selected|WeaponDmgMisc_1} + @{selected|WeaponDmgMagic_1} + @{selected|WeaponDmgMod_1} +@{selected|Charge} ]] Hit Points of Damage!
--?? $Atk.base == 20 AND @{selected|Call} == 8 ?? Critical Called Shot: | You have hit @{target|token_name} with a **Critical Called Shot ** for [[ [$CritCall] @{selected|WeaponDmg_1} + @{selected|WeaponDmg_1} + @{selected|WeaponDmg_1} + @{selected|WeaponDmgMisc_1} + @{selected|WeaponDmgMagic_1} + @{selected|WeaponDmgMod_1} +@{selected|Charge} ]] Hit Points of Damage!
--?? $Atk < @{target|A.C.} AND $Atk.base <> 1 ?? Miss: | You have missed @{target|token_name}!
--?? $Atk >= @{target|A.C.} AND $Atk.base <> 20 AND $Atk.base <> 1 AND @{selected|Call} == 0 ?? alterbar6|_target|@{target|token_id} _bar|2 _amount|-[^Dmg] _show|all
--?? $Atk.base == 20 AND @{selected|Call} == 0 ?? alterbar7|_target|@{target|token_id} _bar|2 _amount|-[^CritDmg] _show|all
--?? $Atk >= @{target|A.C.} AND $Atk.base <> 20 AND $Atk.base <> 1 AND @{selected|Call} == 8 ?? alterbar8|_target|@{target|token_id} _bar|2 _amount|-[^CallDmg] _show|all
--?? $Atk.base == 20 AND @{selected|Call} == 8 ?? alterbar9|_target|@{target|token_id} _bar|2 _amount|-[^CritCall] _show|all
--?? $Dmg >= @{target|bar2} AND $Atk >= @{target|A.C.} ?? api_token-mod|_ids @{target|token_id} _ignore-selected _set statusmarkers|dead
--?? $CritDmg >= @{target|bar2} AND $Atk.base == 20 ?? api_token-mod|_ids @{target|token_id} _ignore-selected _set statusmarkers|dead
--?? @{selected|Call}Dmg >= @{target|bar2} AND $Atk.base <> 20 AND $Atk.base <> 1 AND @{selected|Call} == 8 ?? api_token-mod|_ids @{target|token_id} _ignore-selected _set statusmarkers|dead
--?? $CritCall >= @{target|bar2} AND $$Atk.base == 20 AND @{selected|Call} == 8 ?? api_token-mod|_ids @{target|token_id} _ignore-selected _set statusmarkers|dead
}}