Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Problem with an Attack Macro

I'm trying my hand at creating my first macro for Roll 20 5e but I have an issue with an error


could it be the Vicious Mockery


/em uses @{Sligh Da Miser|repeating_attack_$0_atkname} to attack

@{selected|wtype}&{template:simple} {{name=Weapon Spell Attack}} ?{Attack

  | repeating_attack_$0_atkname,          {{rname=️repeating_attack_$0_atkname}}       @{wtype}&{template:atkdmg} {{mod=@{repeating_attack_$0_atkbonus}}} {{rname=@{repeating_attack_$0_atkname}}} {{r1=[[@{repeating_attack_$0_hidden_r1base}@{halflingluck}cs>@{repeating_attack_$0_atkcritrange}@{repeating_attack_$0_hidden_atkbonus}]]}} @{repeating_attack_$0_hidden_r2base}@{halflingluck}cs>@{repeating_attack_$0_atkcritrange}@{repeating_attack_$0_hidden_atkbonus}]]}} @{repeating_attack_$0_atkflag} {{range=@{repeating_attack_$0_atkrange}}} @{repeating_attack_$0_dmgflag} {{dmg1=[[@{repeating_attack_$0_hidden_dmg1}]]}} {{dmg1type=@{repeating_attack_$0_hidden_dmg1type}}} @{repeating_attack_$0_dmg2flag} {{dmg2=[[@{repeating_attack_$0_hidden_dmg2}]]}} {{dmg2type=@{repeating_attack_$0_hidden_dmg2type}}} {{crit1=[[@{repeating_attack_$0_hidden_crit1}]]}} {{crit2=[[@{repeating_attack_$0_hidden_crit2}]]}} @{repeating_attack_$0_saveflag} {{desc=@{repeating_attack_$0_atk_desc}}} @{repeating_attack_$0_hldmg} @{repeating_attack_$0_spelllevel} ammo=@{repeating_attack_$0_ammo} @{charname_output}

  | repeating_attack_$1_atkname,          {{rname=repeating_attack_$1_atkname}}         @{wtype}&{template:atkdmg} {{mod=@{repeating_attack_$1_atkbonus}}} {{rname=@{repeating_attack_$1_atkname}}} {{r1=[[@{repeating_attack_$1_hidden_r1base}@{halflingluck}cs>@{repeating_attack_$1_atkcritrange}@{repeating_attack_$1_hidden_atkbonus}]]}} @{repeating_attack_$1_hidden_r2base}@{halflingluck}cs>@{repeating_attack_$1_atkcritrange}@{repeating_attack_$1_hidden_atkbonus}]]}} @{repeating_attack_$1_atkflag} {{range=@{repeating_attack_$1_atkrange}}} @{repeating_attack_$1_dmgflag} {{dmg1=[[@{repeating_attack_$1_hidden_dmg1}]]}} {{dmg1type=@{repeating_attack_$1_hidden_dmg1type}}} @{repeating_attack_$1_dmg2flag} {{dmg2=[[@{repeating_attack_$1_hidden_dmg2}]]}} {{dmg2type=@{repeating_attack_$1_hidden_dmg2type}}} {{crit1=[[@{repeating_attack_$1_hidden_crit1}]]}} {{crit2=[[@{repeating_attack_$1_hidden_crit2}]]}} @{repeating_attack_$1_saveflag} {{desc=@{repeating_attack_$1_atk_desc}}} @{repeating_attack_$1_hldmg} @{repeating_attack_$1_spelllevel} ammo=@{repeating_attack_$1_ammo} @{charname_output}

  | repeating_attack_$2_atkname,          {{rname=repeating_attack_$2_atkname}}         @{wtype}&{template:atkdmg} {{mod=@{repeating_attack_$2_atkbonus}}} {{rname=@{repeating_attack_$2_atkname}}} {{r1=[[@{repeating_attack_$2_hidden_r1base}@{halflingluck}cs>@{repeating_attack_$2_atkcritrange}@{repeating_attack_$2_hidden_atkbonus}]]}} @{repeating_attack_$2_hidden_r2base}@{halflingluck}cs>@{repeating_attack_$2_atkcritrange}@{repeating_attack_$2_hidden_atkbonus}]]}} @{repeating_attack_$2_atkflag} {{range=@{repeating_attack_$2_atkrange}}} @{repeating_attack_$2_dmgflag} {{dmg1=[[@{repeating_attack_$2_hidden_dmg1}]]}} {{dmg1type=@{repeating_attack_$2_hidden_dmg1type}}} @{repeating_attack_$2_dmg2flag} {{dmg2=[[@{repeating_attack_$2_hidden_dmg2}]]}} {{dmg2type=@{repeating_attack_$2_hidden_dmg2type}}} {{crit1=[[@{repeating_attack_$2_hidden_crit1}]]}} {{crit2=[[@{repeating_attack_$2_hidden_crit2}]]}} @{repeating_attack_$2_saveflag} {{desc=@{repeating_attack_$2_atk_desc}}} @{repeating_attack_$2_hldmg} @{repeating_attack_$2_spelllevel} ammo=@{repeating_attack_$2_ammo} @{charname_output}

  | repeating_attack_$3_atkname,          {{rname=️repeating_attack_$3_atkname}}         @{wtype}&{template:atkdmg} {{mod=@{repeating_attack_$3_atkbonus}}} {{rname=@{repeating_attack_$3_atkname}}} {{r1=[[@{repeating_attack_$3_hidden_r1base}@{halflingluck}cs>@{repeating_attack_$3_atkcritrange}@{repeating_attack_$3_hidden_atkbonus}]]}} @{repeating_attack_$3_hidden_r2base}@{halflingluck}cs>@{repeating_attack_$3_atkcritrange}@{repeating_attack_$3_hidden_atkbonus}]]}} @{repeating_attack_$3_atkflag} {{range=@{repeating_attack_$3_atkrange}}} @{repeating_attack_$3_dmgflag} {{dmg1=[[@{repeating_attack_$3_hidden_dmg1}]]}} {{dmg1type=@{repeating_attack_$3_hidden_dmg1type}}} @{repeating_attack_$3_dmg2flag} {{dmg2=[[@{repeating_attack_$3_hidden_dmg2}]]}} {{dmg2type=@{repeating_attack_$3_hidden_dmg2type}}} {{crit1=[[@{repeating_attack_$3_hidden_crit1}]]}} {{crit2=[[@{repeating_attack_$3_hidden_crit2}]]}} @{repeating_attack_$3_saveflag} {{desc=@{repeating_attack_$3_atk_desc}}} @{repeating_attack_$3_hldmg} @{repeating_attack_$3_spelllevel} ammo=@{repeating_attack_$3_ammo} @{charname_output}

 }

I have one error

TypeError: Cannot read property 'substring' of undefined

Light Crossbow

Dagger

Vicious Mockery

Eldritch Blast


April 15 (5 years ago)
Ziechael
Forum Champion
Sheet Author
API Scripter

That error usually comes from not defining where the attributes are being called from, have you set this up as a character ability or as a collections macro (if the latter then you need to specify a character either by hardcoding '@{Bob|attribute}' or using @{selected|... or @{target|... to use a token, that token also needs to 'represent' a journal).

April 15 (5 years ago)

Edited April 15 (5 years ago)

I see it in the Macro's area, "In Bar", the character token is selected 

the code has this @{Sligh Da Miser

does it have to be in each ability?

The Token is controlled by a character in the journal and the token is selected


I have grabbed other users Marcos, Skill Checks, Saving Throws, Stat Checks, etc.. all work, but trying to get the macro for attacks and damage

Install the Universal Chat Menu API and use this macro; no more need to fix things when they level up! 

!chatmenu @{selected|character_id} {template:npcaction}{{rname=@{selected|character_name}}}{{description=CHATMENU}} --separator: |  --title:Attacks --repeating_attack|atkname|attack


Here is for Cantrips and Spells as well

Cantrips:

!chatmenu @{selected|character_id} {template:npcaction}{{rname=@{selected|character_name}}}{{description=CHATMENU}} --separator: |  --title: Cantrips --repeating_spell-cantrip|spellname|spell

Spells:

!chatmenu @{selected|character_id} {template:npcaction}{{rname=@{selected|character_name}}}{{description=CHATMENU}} --separator: |  --title: Level 1 Spells --repeating_spell-1|spellname|spell

(for spells make separate macros for each level by changing the "spell-1" to "spell-[level]"; just insert number accordingly. 

and a bonus Traits:

!chatmenu @{selected|character_id} {template:npcaction}{{rname=@{selected|character_name}}}{{description=CHATMENU}} --separator: |  --title:Traits --repeating_npctrait|name|desc= --title:Actions --repeating_npcaction|name|npc_action --title:Traits --repeating_traits|name|output