I'm trying to have my script send an attack from a character sheet to chat but it's crashing and I'm not sure why. Here is the code with all unrelated parts removed: var mimicID = "-LNGjj6sLmXPo6vTrHwa" on("chat:message", function(msg) { var charid = "character|" + mimicID; sendChat(charid, "%{Mimic.|longbow}"); }); I first made the attack in the Attacks & Spellcasting section of the Mimic. sheet. Clicking up arrow results in: @{Mimic.|wtype}&{template:atkdmg} {{mod=+5}} {{rname=Longbow}} {{r1=[[@{Mimic.|d20}cs>20 + 5[MOD]]]}} @{Mimic.|rtype}cs>20 + 5[MOD]]]}} {{attack=1}} {{range=150/600}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d8 + 3[MOD]]]}} {{dmg1type=piercing }} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[1d8[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=}} {{spelllevel=}} {{innate=}} {{globalattack=@{Mimic.|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{Mimic.|global_damage_mod_type}}} ammo= @{Mimic.|charname_output} I took that and created an ability called "longbow" and pasted in the above. If I type %{Mimic.|longbow} manually into chat it works fine. But if I try to do sendChat with that text I get the error:
For reference, the error message generated was: Could not determine result type of: [{"type":"M","expr":0},{"type":"L","text":"CRIT"}]
undefined
I'm not really sure what the error is saying, I don't see that text anywhere in the attack string. Any help would be appreciated. EDIT: The sender (first arg of sendChat) does not affect the error, nor does escaping any of the message characters. I noticed someone had a similar error when trying to do an attack without dice rolls which leads me to believe I have some configuration error in my attack but I haven't found a combination that works.