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

TokenAction creator for 5e OGL sheet not working

Hello all I've been using the TokenAction creator API from Kevin and on my last session on April 5th I saw that for monsters dragged in from the compendium I cannot create macros for actions. It still creates macros for initiative rolls, checks and saving throws. It also works fine for player characters and custom NPCs. I tried also using Garrod M.'s version with the same issues. Any help would be appreciated. 
I am having the same problem. I would appreciate any solution and would be happy to supply more information as necessary. Any help would be great ... I love this macro.
Here is a link to the scripts (very old) forum thread:&nbsp; <a href="https://app.roll20.net/forum/post/5608775/script-update-tokenaction-creator-for-5e-ogl-sheet-version-2-dot-0/?pagenum=1" rel="nofollow">https://app.roll20.net/forum/post/5608775/script-update-tokenaction-creator-for-5e-ogl-sheet-version-2-dot-0/?pagenum=1</a> There is a link to the script inside the thread but here is there version I am using: var tokenAction = tokenAction || (function() { 'use strict'; var version = '0.2.5', sheetVersion = '5th Edition OGL by Roll20 2.0', checkInstall = function() { log('TokenAction v'+version+' is ready! Designed for use with the '+sheetVersion+' character sheet!'); }, getSelectedCharacters = function(selected) { return _.chain(selected) .map(function(s){ return getObj(s._type,s._id); }) .reject(_.isUndefined) .map(function(c){ return getObj('character', c.get('represents')); }) .filter(_.identity) .value(); }, createAbility = function(name, pattern, id) { var checkAbility = findObjs({_type: 'ability', _characterid: id, name: name}); if (checkAbility[0]) { checkAbility[0].set({action: pattern}); } else { createObj('ability', {name: name, action: pattern, characterid: id, istokenaction: true}); } }, createRepeating = function(name, pattern, id) { var repeatingAttrs = filterObjs(function(o){ return o.get('type')==='attribute' &amp;&amp; o.get('characterid') === id &amp;&amp; o.get('name').match(name); }); _.each(repeatingAttrs,function(attr){ var repeatingId = attr.get('name').split('_')[2], repeatingName = attr.get('current'), repeatingAction = "%{" + id + "|" + (pattern.replace(/%%RID%%/g,repeatingId)) + "}", checkAbility = findObjs({_type: 'ability', _characterid: id, name: repeatingName}); if (checkAbility[0]) { checkAbility[0].set({action: repeatingAction}); } else { createObj("ability", {name: repeatingName, action: repeatingAction, characterid: id, istokenaction: true}); } }); }, isNpc = function(id) { var checkNpc = findObjs({_type: 'attribute', _characterid: id, name: 'npc'}); if (_.isUndefined(checkNpc[0])) { return false; } else { return checkNpc[0].get('current'); } }, deleteAbilities = function(id) { var abilities = findObjs ({_type: 'ability', _characterid: id}); _.each(abilities, function(r) { r.remove(); }); }, createSpell = function(id) { var checkAbility = findObjs({_type: 'ability', _characterid: id, name: 'Spells'}), repeatingAttrs = filterObjs(function(o){ return o.get('type') === 'attribute' &amp;&amp; o.get('characterid') === id &amp;&amp; o.get('name').match(/repeating_spell-[^{(np)][\S+_[^_]+_spellname\b/); }), spellText = "", sk = [], sb = { 'Cantrips': [], '1st': [], '2nd': [], '3rd': [], '4th': [], '5th': [], '6th': [], '7th': [], '8th': [], '9th': [] }; if (!repeatingAttrs[0]) { return; } _.each(repeatingAttrs, function(s){ var level = s.get('name').split('_')[1].replace('spell-', ''), apiButton = "[" + s.get('current') + "](~repeating_spell-" + level + "_" + s.get('name').split('_')[2] + "_spell)"; if (level === "cantrip") { level = "Cantrips"; } else if (level === "1") { level = "1st"; } else if (level === "2") { level = "2nd"; } else if (level === "3") { level = "3rd"; } else if (level === "4") { level = "4th"; } else if (level === "5") { level = "5th"; } else if (level === "6") { level = "6th"; } else if (level === "7") { level = "7th"; } else if (level === "8") { level = "8th"; } else if (level === "9") { level = "9th"; } sb[level].push(apiButton); sb[level].sort(); }); sk = _.keys(sb); _.each(sk, function(e){ if (_.isEmpty(sb[e])){ sb = _.omit(sb, e); } }); sk = _.keys(sb); _.each(sk, function(e){ spellText += "**" + e + ":**" + "\n" + sb[e].join(' | ') + "\n\n"; }); if (checkAbility[0]) { checkAbility[0].set({action: "/w @{character_name} &amp;{template:atk} {{desc=" + spellText + "}}"}); } else { createObj("ability", {name: 'Spells', action: "/w @{character_name} &amp;{template:atk} {{desc=" + spellText + "}}", characterid: id, istokenaction: true}); } }, sortRepeating = function(name, pattern, id) { var repeatingAttrs = filterObjs(function(o){ return o.get('type')==='attribute' &amp;&amp; o.get('characterid') === id &amp;&amp; o.get('name').match(name); }), sorted = _.sortBy(repeatingAttrs, (o)=&gt; o.get('current')); _.each(sorted,function(attr){ var repeatingId = attr.get('name').split('_')[2], repeatingName = "a-"+attr.get('current'), repeatingAction = "%{" + id + "|" + (pattern.replace(/%%RID%%/g,repeatingId)) + "}"; if (pattern.match('npcaction-l')){ repeatingName = "al-"+attr.get('current'); } var checkAbility = findObjs({_type: 'ability', _characterid: id, name: repeatingName}); if (checkAbility[0]) { checkAbility[0].set({action: repeatingAction}); } else { createObj("ability", {name: repeatingName, action: repeatingAction, characterid: id, istokenaction: true}); } }); }, handleInput = function(msg) { var char; if (msg.type === 'api' &amp;&amp; msg.content.search(/^!ta\b/) !== -1 &amp;&amp; msg.selected) { char = _.uniq(getSelectedCharacters(msg.selected)); _.each(char, function(a) { if (isNpc(a.id) === "1") { createAbility('Init', "%{" + a.id + "|npc_init}", a.id); createAbility('Check', "@{selected|wtype}&amp;{template:npc} @{selected|npc_name_flag} @{selected|rtype}+?{Ability|Acrobatics,[[@{selected|npc_acrobatics}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_acrobatics}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|npc_acrobatics}]]]]&amp;" + "#125;&amp;" + "#125; {{rname=Acrobatics&amp;" + "#125;&amp;" + "#125; {{type=Skill&amp;" + "#125;&amp;" + "#125; |Animal Handling,[[@{selected|npc_animal_handling}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_animal_handling}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|npc_animal_handling}]]]]&amp;" + "#125;&amp;" + "#125; {{rname=Animal Handling&amp;" + "#125;&amp;" + "#125; {{type=Skill&amp;" + "#125;&amp;" + "#125; |Arcana,[[@{selected|npc_arcana}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_arcana}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|npc_arcana}]]]]&amp;" + "#125;&amp;" + "#125; {{rname=Arcana&amp;" + "#125;&amp;" + "#125; {{type=Skill&amp;" + "#125;&amp;" + "#125; |Athletics,[[@{selected|npc_athletics}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_athletics}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|npc_athletics}]]]]&amp;" + "#125;&amp;" + "#125; {{rname=Athletics&amp;" + "#125;&amp;" + "#125; {{type=Skill&amp;" + "#125;&amp;" + "#125; |Deception,[[@{selected|npc_deception}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_deception}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|npc_deception}]]]]&amp;" + "#125;&amp;" + "#125; {{rname=Deception&amp;" + "#125;&amp;" + "#125; {{type=Skill&amp;" + "#125;&amp;" + "#125; |History,[[@{selected|npc_history}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_history}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|npc_history}]]]]&amp;" + "#125;&amp;" + "#125; {{rname=History&amp;" + "#125;&amp;" + "#125; {{type=Skill&amp;" + "#125;&amp;" + "#125; |Insight,[[@{selected|npc_insight}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_insight}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|npc_insight}]]]]&amp;" + "#125;&amp;" + "#125; {{rname=Insight&amp;" + "#125;&amp;" + "#125; {{type=Skill&amp;" + "#125;&amp;" + "#125; |Intimidation,[[@{selected|npc_intimidation}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_intimidation}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|npc_intimidation}]]]]&amp;" + "#125;&amp;" + "#125; {{rname=Intimidation&amp;" + "#125;&amp;" + "#125; {{type=Skill&amp;" + "#125;&amp;" + "#125; |Investigation,[[@{selected|npc_investigation}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_investigation}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|npc_investigation}]]]]&amp;" + "#125;&amp;" + "#125; {{rname=Investigation&amp;" + "#125;&amp;" + "#125; {{type=Skill&amp;" + "#125;&amp;" + "#125; |Medicine,[[@{selected|npc_medicine}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_medicine}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|npc_medicine}]]]]&amp;" + "#125;&amp;" + "#125; {{rname=Medicine&amp;" + "#125;&amp;" + "#125; {{type=Skill&amp;" + "#125;&amp;" + "#125; |Nature,[[@{selected|npc_nature}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_nature}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|npc_nature}]]]]&amp;" + "#125;&amp;" + "#125; {{rname=Nature&amp;" + "#125;&amp;" + "#125; {{type=Skill&amp;" + "#125;&amp;" + "#125; |Perception,[[@{selected|npc_perception}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_perception}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|npc_perception}]]]]&amp;" + "#125;&amp;" + "#125; {{rname=Perception&amp;" + "#125;&amp;" + "#125; {{type=Skill&amp;" + "#125;&amp;" + "#125; |Performance,[[@{selected|npc_performance}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_performance}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|npc_performance}]]]]&amp;" + "#125;&amp;" + "#125; {{rname=Performance&amp;" + "#125;&amp;" + "#125; {{type=Skill&amp;" + "#125;&amp;" + "#125; |Persuasion,[[@{selected|npc_persuasion}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_persuasion}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|npc_persuasion}]]]]&amp;" + "#125;&amp;" + "#125; {{rname=Persuasion&amp;" + "#125;&amp;" + "#125; {{type=Skill&amp;" + "#125;&amp;" + "#125; |Religion,[[@{selected|npc_religion}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_religion}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|npc_religion}]]]]&amp;" + "#125;&amp;" + "#125; {{rname=Religion&amp;" + "#125;&amp;" + "#125; {{type=Skill&amp;" + "#125;&amp;" + "#125; |Sleight of Hand,[[@{selected|npc_sleight_of_hand}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_sleight_of_hand}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|npc_sleight_of_hand}]]]]&amp;" + "#125;&amp;" + "#125; {{rname=Sleight of Hand&amp;" + "#125;&amp;" + "#125; {{type=Skill&amp;" + "#125;&amp;" + "#125; |Stealth,[[@{selected|npc_stealth}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_stealth}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|npc_stealth}]]]]&amp;" + "#125;&amp;" + "#125; {{rname=Stealth&amp;" + "#125;&amp;" + "#125; {{type=Skill&amp;" + "#125;&amp;" + "#125; |Survival,[[@{selected|npc_survival}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_survival}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|npc_survival}]]]]&amp;" + "#125;&amp;" + "#125; {{rname=Survival&amp;" + "#125;&amp;" + "#125; {{type=Skill&amp;" + "#125;&amp;" + "#125; |Strength,[[@{selected|strength_mod}]][STR]]]&amp;" + "#125;&amp;" + "#125; {{rname=Strength&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|strength_mod}]][STR]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|strength_mod}]][STR]]]&amp;" + "#125;&amp;" + "#125; {{type=Ability&amp;" + "#125;&amp;" + "#125; |Dexterity,[[@{selected|dexterity_mod}]][DEX]]]&amp;" + "#125;&amp;" + "#125; {{rname=Dexterity&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|dexterity_mod}]][DEX]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|dexterity_mod}]][DEX]]]&amp;" + "#125;&amp;" + "#125; {{type=Ability&amp;" + "#125;&amp;" + "#125; |Constitution,[[@{selected|constitution_mod}]][CON]]]&amp;" + "#125;&amp;" + "#125; {{rname=Constitution&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|constitution_mod}]][CON]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|constitution_mod}]][CON]]]&amp;" + "#125;&amp;" + "#125; {{type=Ability&amp;" + "#125;&amp;" + "#125; |Intelligence,[[@{selected|intelligence_mod}]][INT]]]&amp;" + "#125;&amp;" + "#125; {{rname=Intelligence&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|intelligence_mod}]][INT]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|intelligence_mod}]][INT]]]&amp;" + "#125;&amp;" + "#125; {{type=Ability&amp;" + "#125;&amp;" + "#125; |Wisdom,[[@{selected|wisdom_mod}]][WIS]]]&amp;" + "#125;&amp;" + "#125; {{rname=Wisdom&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|wisdom_mod}]][WIS]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|wisdom_mod}]][WIS]]]&amp;" + "#125;&amp;" + "#125; {{type=Ability&amp;" + "#125;&amp;" + "#125; |Charisma,[[@{selected|charisma_mod}]][CHA]]]&amp;" + "#125;&amp;" + "#125; {{rname=Charisma&amp;" + "#125;&amp;" + "#125; {{mod=[[[[@{selected|charisma_mod}]][CHA]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|charisma_mod}]][CHA]]]&amp;" + "#125;&amp;" + "#125; {{type=Ability&amp;" + "#125;&amp;" + "#125;}", a.id); createAbility('Save', "@{selected|wtype}&amp;{template:npc} @{selected|npc_name_flag} @{selected|rtype}+?{Save|Strength,[[@{selected|npc_str_save}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_str_save}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[@{selected|npc_str_save}]]&amp;" + "#125;&amp;" + "#125;{{rname=Strength Save&amp;" + "#125;&amp;" + "#125; {{type=Save&amp;" + "#125;&amp;" + "#125; |Dexterity,[[@{selected|npc_dex_save}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_dex_save}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[@{selected|npc_dex_save}]]&amp;" + "#125;&amp;" + "#125;{{rname=Dexterity Save&amp;" + "#125;&amp;" + "#125; {{type=Save&amp;" + "#125;&amp;" + "#125; |Constitution,[[@{selected|npc_con_save}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_con_save}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[@{selected|npc_con_save}]]&amp;" + "#125;&amp;" + "#125;{{rname=Constitution Save&amp;" + "#125;&amp;" + "#125; {{type=Save&amp;" + "#125;&amp;" + "#125; |Intelligence,[[@{selected|npc_int_save}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_int_save}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[@{selected|npc_int_save}]]&amp;" + "#125;&amp;" + "#125;{{rname=Intelligence Save&amp;" + "#125;&amp;" + "#125; {{type=Save&amp;" + "#125;&amp;" + "#125; |Wisdom,[[@{selected|npc_wis_save}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_wis_save}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[@{selected|npc_wis_save}]]&amp;" + "#125;&amp;" + "#125;{{rname=Wisdom Save&amp;" + "#125;&amp;" + "#125; {{type=Save&amp;" + "#125;&amp;" + "#125; |Charisma,[[@{selected|npc_cha_save}]]]]&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+[[@{selected|npc_cha_save}]]]]&amp;" + "#125;&amp;" + "#125; {{mod=[[@{selected|npc_cha_save}]]&amp;" + "#125;&amp;" + "#125;{{rname=Charisma Save&amp;" + "#125;&amp;" + "#125; {{type=Save&amp;" + "#125;&amp;" + "#125;}", a.id); createRepeating(/repeating_npcaction_[^_]+_name\b/, 'repeating_npcaction_%%RID%%_npc_action', a.id); createRepeating(/repeating_npcaction-l_[^_]+_name\b/, 'repeating_npcaction-l_%%RID%%_npc_action', a.id); createSpell(a.id); } else { createAbility('Init', "%{" + a.id + "|initiative}", a.id); createAbility('Check', "@{selected|wtype}&amp;{template:simple} @{selected|rtype}?{Ability|Acrobatics, +@{selected|acrobatics_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; {{rname=Acrobatics&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|acrobatics_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|acrobatics_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; |Animal Handling, +@{selected|animal_handling_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; {{rname=Animal Handling&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|animal_handling_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|animal_handling_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; |Arcana, +@{selected|arcana_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; {{rname=Arcana&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|arcana_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|arcana_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; |Athletics, +@{selected|athletics_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; {{rname=Athletics&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|athletics_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|athletics_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; |Deception, +@{selected|deception_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; {{rname=Deception&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|deception_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|deception_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; |History, +@{selected|history_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; {{rname=History&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|history_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|history_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; |Insight, +@{selected|insight_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; {{rname=Insight&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|insight_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|insight_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; |Intimidation, +@{selected|intimidation_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; {{rname=Intimidation&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|intimidation_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|intimidation_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; |Investigation, +@{selected|investigation_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; {{rname=Investigation&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|investigation_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|investigation_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; |Medicine, +@{selected|medicine_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; {{rname=Medicine&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|medicine_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|medicine_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; |Nature, +@{selected|nature_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; {{rname=Nature&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|nature_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|nature_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; |Perception, +@{selected|perception_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; {{rname=Perception&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|perception_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|perception_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; |Performance, +@{selected|performance_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; {{rname=Performance&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|performance_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|performance_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; |Persuasion, +@{selected|persuasion_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; {{rname=Persuasion&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|persuasion_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|persuasion_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; |Religion, +@{selected|religion_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; {{rname=Religion&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|religion_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|religion_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; |Sleight of Hand, +@{selected|sleight_of_hand_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; {{rname=Sleight of Hand&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|sleight_of_hand_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|sleight_of_hand_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; |Stealth, +@{selected|stealth_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; {{rname=Stealth&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|stealth_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|stealth_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; |Survival, +@{selected|survival_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; {{rname=Survival&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|survival_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|survival_bonus}@{selected|pbd_safe} ]]&amp;" + "#125;&amp;" + "#125; |Strength, +@{selected|strength_mod}@{selected|jack_attr}[STR]]]&amp;" + "#125;&amp;" + "#125; {{rname=Strength&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|strength_mod}@{selected|jack_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|strength_mod}@{selected|jack_attr}[STR]]]&amp;" + "#125;&amp;" + "#125; |Dexterity, +@{selected|dexterity_mod}@{selected|jack_attr}[DEX]]]&amp;" + "#125;&amp;" + "#125; {{rname=Dexterity&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|dexterity_mod}@{selected|jack_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|dexterity_mod}@{selected|jack_attr}[DEX]]]&amp;" + "#125;&amp;" + "#125; |Constitution, +@{selected|constitution_mod}@{selected|jack_attr}[CON]]]&amp;" + "#125;&amp;" + "#125; {{rname=Constitution&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|constitution_mod}@{selected|jack_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|constitution_mod}@{selected|jack_attr}[CON]]]&amp;" + "#125;&amp;" + "#125; |Intelligence, +@{selected|intelligence_mod}@{selected|jack_attr}[INT]]]&amp;" + "#125;&amp;" + "#125; {{rname=Intelligence&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|intelligence_mod}@{selected|jack_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|intelligence_mod}@{selected|jack_attr}[INT]]]&amp;" + "#125;&amp;" + "#125; |Wisdom, +@{selected|wisdom_mod}@{selected|jack_attr}[WIS]]]&amp;" + "#125;&amp;" + "#125; {{rname=Wisdom&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|wisdom_mod}@{selected|jack_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|wisdom_mod}@{selected|jack_attr}[WIS]]]&amp;" + "#125;&amp;" + "#125; |Charisma, +@{selected|charisma_mod}@{selected|jack_attr}[CHA]]]&amp;" + "#125;&amp;" + "#125; {{rname=Charisma&amp;" + "#125;&amp;" + "#125; {{mod=@{selected|charisma_mod}@{selected|jack_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[ @{selected|d20} + @{selected|charisma_mod}@{selected|jack_attr}[CHA]]]&amp;" + "#125;&amp;" + "#125; } @{selected|global_skill_mod} @{selected|charname_output}", a.id); createAbility('Save', "@{selected|wtype}&amp;{template:simple} @{selected|rtype}?{Save|Strength, +@{selected|strength_save_bonus}@{selected|pbd_safe}]]&amp;" + "#125;&amp;" + "#125; {{rname=Strength Save&amp;" + "#125;&amp;" + "#125 {{mod=@{selected|strength_save_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+@{selected|strength_save_bonus}@{selected|pbd_safe}]]&amp;" + "#125;&amp;" + "#125; |Dexterity, +@{selected|dexterity_save_bonus}@{selected|pbd_safe}]]&amp;" + "#125;&amp;" + "#125; {{rname=Dexterity Save&amp;" + "#125;&amp;" + "#125 {{mod=@{selected|dexterity_save_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+@{selected|dexterity_save_bonus}@{selected|pbd_safe}]]&amp;" + "#125;&amp;" + "#125; |Constitution, +@{selected|constitution_save_bonus}@{selected|pbd_safe}]]&amp;" + "#125;&amp;" + "#125; {{rname=Constitution Save&amp;" + "#125;&amp;" + "#125 {{mod=@{selected|constitution_save_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+@{selected|constitution_save_bonus}@{selected|pbd_safe}]]&amp;" + "#125;&amp;" + "#125; |Intelligence, +@{selected|intelligence_save_bonus}@{selected|pbd_safe}]]&amp;" + "#125;&amp;" + "#125; {{rname=Intelligence Save&amp;" + "#125;&amp;" + "#125 {{mod=@{selected|intelligence_save_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+@{selected|intelligence_save_bonus}@{selected|pbd_safe}]]&amp;" + "#125;&amp;" + "#125; |Wisdom, +@{selected|wisdom_save_bonus}@{selected|pbd_safe}]]&amp;" + "#125;&amp;" + "#125; {{rname=Wisdom Save&amp;" + "#125;&amp;" + "#125 {{mod=@{selected|wisdom_save_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+@{selected|wisdom_save_bonus}@{selected|pbd_safe}]]&amp;" + "#125;&amp;" + "#125; |Charisma, +@{selected|charisma_save_bonus}@{selected|pbd_safe}]]&amp;" + "#125;&amp;" + "#125; {{rname=Charisma Save&amp;" + "#125;&amp;" + "#125 {{mod=@{selected|charisma_save_bonus}&amp;" + "#125;&amp;" + "#125; {{r1=[[@{selected|d20}+@{selected|charisma_save_bonus}@{selected|pbd_safe}]]&amp;" + "#125;&amp;" + "#125;}@{selected|global_save_mod}@{selected|charname_output}", a.id); createRepeating(/repeating_attack_[^_]+_atkname\b/, 'repeating_attack_%%RID%%_attack', a.id); createSpell(a.id); } sendChat("TokenAction", "/w " + msg.who + " Created Token Actions for " + a.get('name') + "."); }); } else if (msg.type === 'api' &amp;&amp; msg.content.search(/^!deleteta\b/) !== -1 &amp;&amp; msg.selected) { char = _.uniq(getSelectedCharacters(msg.selected)); _.each(char, function(d) { deleteAbilities(d.id); sendChat("TokenAction", "/w " + msg.who + " Deleted Token Actions for " + d.get('name') + "."); }); } else if (msg.type === 'api' &amp;&amp; msg.content.search(/^!sortta\b/) !== -1 &amp;&amp; msg.selected) { char = _.uniq(getSelectedCharacters(msg.selected)); _.each(char, function(a) { if (isNpc(a.id) === "1") { createAbility('Init', "%{" + a.id + "|npc_init}", a.id); sortRepeating(/repeating_npcaction_[^_]+_name\b/, 'repeating_npcaction_%%RID%%_npc_action', a.id); sortRepeating(/repeating_npcaction-l_[^_]+_name\b/, 'repeating_npcaction-l_%%RID%%_npc_action', a.id); createSpell(a.id); } sendChat("TokenAction", "/w " + msg.who + " Created Token Actions for " + a.get('name') + "."); }); } return; }, registerEventHandlers = function() { on('chat:message', handleInput); }; return { CheckInstall: checkInstall, RegisterEventHandlers: registerEventHandlers }; }()); on('ready',function() { 'use strict'; tokenAction.CheckInstall(); tokenAction.RegisterEventHandlers(); });
Well this doesn't fix that problem, but it does provide an alternative:&nbsp; <a href="https://app.roll20.net/forum/post/8349326/npc-statblock-chat-menu-for-d-and-d-5e-sheet-no-api-required/?pageforid=8349326#post-8349326" rel="nofollow">https://app.roll20.net/forum/post/8349326/npc-statblock-chat-menu-for-d-and-d-5e-sheet-no-api-required/?pageforid=8349326#post-8349326</a>
Thanks Patrick I still prefer having the individual token action macros come up instead of appearing in the chat but it is a nice substitute and will be using it for now and will keep looking for answers on fixing this script
1586456096
Kraynic
Pro
Sheet Author
Another option would be to search for "Universal Chat Menu" in the api forums and give that a try.&nbsp; It isn't (so far) in the api drop down list, so you would need to copy/paste the code from the forum post.&nbsp; There are examples of how people have set up that script in the thread.
Another option would be to physically make abilities for each monster.&nbsp; It would be time consuming, but permanent, involve no API and, as monsters don't generally level up, you wouldn't have to update them in the future.&nbsp; To do this, open the sheet and click anything you want like an attack, then click in chat and hit up arrow, then cut and paste the block that comes up to an "Ability" on the abilities and attributes tab of the monster's sheet.&nbsp; Then name it, save it and set as token action. It will work for attacks and initiative, I think you'd have to search for a universal one people use for saves and skill checks.
I also have had this issue for about a month now.
1586644494

Edited 1586644608
After looking around for a bit I found that keithcurtis has made an updated version of script that runs properly. Thanks keithcurtis for the help <a href="https://gist.github.com/keithcurtis1/cdf8d1a711eaed7f8311e81c48c0ee2b" rel="nofollow">https://gist.github.com/keithcurtis1/cdf8d1a711eaed7f8311e81c48c0ee2b</a>
That worked for me too! Thank you very much to Razeick and Keithcurtis for your work. Cheers!
1586740895
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I have updated the code to provide more flexibility in which buttons to create. Check out the thread here.
I installed and tested the newest version of this script and it works great! Thanks! I really appreciate your hard work ... I use this script all the time.
Thank you Keithcurtis!