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

[Script] Token Action Maker v.0.2.7

I don't think the NPC statblock is the issue, since I am doing this exclusively with monsters who all have the NPC statblock enabled. Tried with a black bear and while the message said the actions had been created, nothing happened. BUT ... I've already used the stock black bear in my game (my druid's wild shape), so I'm going to try a monster I've never pulled from the Compendium before.  Ok, so it works on a generic werebear (though it doesn't truncate the button names, as I thought it was supposed to). Strange. Maybe something about the monster setup macro I use is messing with !sortta (though not affecting !ta). I'm also using the TokenNameNumber script. !token-mod --set represents|"?{Monster}" !token-mod {{ --on showname light_hassight showname --off isdrawing --set name|"@{selected|character_name} %%NUMBERED%%" bar2_link|npc_ac bar3_link|hp_temp aura2_color|#980000 defaulttoken }}
1591715337
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It shouldn't affect anything, since I also use a rename step for TokenNameNumber in my setup macro.
1591715373
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Token Action Maker is now available in One Click install.
Is it called something else? I'm not seeing it the One Click Install
1592174310

Edited 1592174560
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
There was an error (mine), because I didn't specifically ask &nbsp;for it to be in one click. It's in the Roll20 repo, but with any luck should be in the One-Click with the next merge on Tuesday. For the time being, the official code is here:&nbsp; <a href="https://github.com/Roll20/roll20-api-scripts/tree/master/Token-Action-Maker" rel="nofollow">https://github.com/Roll20/roll20-api-scripts/tree/master/Token-Action-Maker</a>
1592342807
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It's going to be one more week for One-Click. I missed a hoop to jump through and forgot to validate the script.json. Live and learn.
Is it possible to modify the 'spells' - or rather add an variant of that - option to show only spells, that are marked as prepared? How could one access the states of spells in the first place, is there an repeating-attribute?
1592479659
David M.
Pro
API Scripter
Keithcurtis thank you for reviving this and bringing it to our attention. Neat script!&nbsp;
Norman V. said: Is it possible to modify the 'spells' - or rather add an variant of that - option to show only spells, that are marked as prepared? How could one access the states of spells in the first place, is there an repeating-attribute? Definitely seconding this feature request if it's possible!
1592497927
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
That's probably doable. In the meantime, there's a much more powerful solution available using the Universal Chat Menus script and this Spell Filter macro .
Oh, thanks for showing that script to us! "!chatmenu" together with this macro here ... <a href="https://app.roll20.net/forum/permalink/8697797/" rel="nofollow">https://app.roll20.net/forum/permalink/8697797/</a> (it's within the same thread as you mentioned) ... is just exactly what I had in mind :-)
Hi Keith! I have a question which you probably can answer quickly: I use the attack scripts generated by the character sheet (DnD 5E OGL) quite often. Your !token-action is really useful! Especially for all the NPCs and creatures. But I need them to be slightly modified in order to work with a script of mine (which I am currently working on). To be more precisely: I want to have "attacking @{target|token_id}" added to the description, this is a trigger for my event listener. How can I change the scripts that the sheet is generating automatically? Do I have to change the whole sheet (never done that)?
1593098440
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hmm, I think you would need to change the sheet, or the definition in your listener. The script doesn't write the code for actions and attacks, it just calls the pre-written sheet macro. You could write into a copy of token action maker additional code that gets applied to each button so it contains that phrase, but then each button would essentially be running multiple lines of macro code. This would obviously be undesirable for other users.
Yes , that would be an unfavourable solution. Also, I would not participate in updates of your script or the sheet itself. Then, I think, I will try to create a script, that can check all (selected) tokens for their ability macros and do the approbiate modifications. Well ..., do you think that is possible?
1593105138
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It still sounds like you will be programming for the sheet code. Currently, an ability created by this script looks something like this: %{-M75T6LgbyQcOxBM39aj|repeating_npcaction_-M75T7K7CzDqip7cJbER_npc_action} or %{Kobold|repeating_npcaction_-M75T7K7CzDqip7cJbER_npc_action} ...depending on the settings. That's basically the same command that the sheet generates. You would still need to dip into sheet code at some point. What is the script you are writing meant to accomplish?
Hm, yes, that's not what I can modify. Is there a way to read the chat messages after such commands were issued? I mean that text that comes up when you press cursor up ... The script is my version of auto damage: The event listener waits for chat messages with "attacking" followed by an token_id. It examines the message, and creates one to four buttons, depending on the roll values: Crit damage yes/no (x) 2nd damage yes/no. The buttons are linked to the script applydamage (slightly modified). In most cases I just need to use one of the buttons and the damage is applied to the target. Simple, but it's my very first project :-) I think it works now as I intended, so the next task would be to change the attack templates of all creatures. But if that is too difficult, as it looks like now, I can just do that manually when I prepare the next session. That's not too much work at once :-)
1593122285
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I do not know enough about how the chat works from the POV of the API to give a useful answer. I can ask around and see what I can find out.
1593124099
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
So you just need to add that to the description? You could easily just type it in the description field of the action. This could be automated by chatSetAttr, or you could write a pretty basic script that would look at all descriptions for actions and keep them updated with that line every time an attribute was changed for the repeating section (only way to know when a repeating section has been created). Something like this snippet: on('change:attribute',(obj,prev)=&gt;{ if(!/^repeating_attack/.test(obj.get('name'))){ return; } let description = findObjs({ type:'attribute', characterid:obj.get('characterid'), name:obj.get('name').replace(/(repeating_attack_[^_]+_).+/,"$1atk_desc") })[0]; log(description); if(description){ if(!/attacking @{target|token_id}/.test(description.get('current'))){ description.set({current:`${description.get('current')}\nattacking @{target|token_id}`}); } }else{ createObj('attribute',{ characterid:obj.get('characterid'), name:obj.get('name').replace(/(repeating_attack_[^_]+_).+/,"$1atk_desc"), current:'attacking @{target|token_id}' }) } });
1593383678
David M.
Pro
API Scripter
My GM is having the same exact problem as Jay R. posted a couple weeks ago:&nbsp; the !ta &nbsp;command works, but !sortta returns text saying that the actions were created, while no abilities were actually created. Did anybody ever get to the bottom of this? Using version 0.3.0 grabbed from the Github today, running Chrome (I forgot to ask him about extensions), tested on a standard Kobold from the Monster Manual. FWIW, I have the same version of the script installed in my game, and it seems to work fine. Although now that I think about it, I don't have the MM purchased in my game, so only using it on SRD monsters, if that matters.
1593384681

Edited 1593384986
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I am unable to reproduce this. I turned off all compendium sources and deleted the kobold from my game so I could pull in a standard SRD kobold, and made sure I was running the code freshly pulled from the git. Testing with !sortta creates the sorted token action buttons. Are you using the standard&nbsp;D&amp;D 5th Edition by Roll20 Sheet?
1593390032
David M.
Pro
API Scripter
Yes, Std 5e Sheet by Roll20 both in my personal game (where it works) and my GM's game (partially functional as described). It's strange.
1593396752
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Is your GM running on a non-supported browser, or maybe using some third-party extension? I'm not sure if those would have an impact. Maybe if your gm tried installing and testing on a brand new game?
Hi Scott! I resigned to do it manually, which is not really much, as long as I won't do the whole MM at once ;-) But still, your idea is quite helpful. I think I will modify it to just have it work on a selected token. Thank you! Scott C. said: So you just need to add that to the description? You could easily just type it in the description field of the action. This could be automated by chatSetAttr, or you could write a pretty basic script that would look at all descriptions for actions and keep them updated with that line every time an attribute was changed for the repeating section (only way to know when a repeating section has been created). Something like this snippet: on('change:attribute',(obj,prev)=&gt;{ if(!/^repeating_attack/.test(obj.get('name'))){ return; } let description = findObjs({ type:'attribute', characterid:obj.get('characterid'), name:obj.get('name').replace(/(repeating_attack_[^_]+_).+/,"$1atk_desc") })[0]; log(description); if(description){ if(!/attacking @{target|token_id}/.test(description.get('current'))){ description.set({current:`${description.get('current')}\nattacking @{target|token_id}`}); } }else{ createObj('attribute',{ characterid:obj.get('characterid'), name:obj.get('name').replace(/(repeating_attack_[^_]+_).+/,"$1atk_desc"), current:'attacking @{target|token_id}' }) } });
1593438570
David M.
Pro
API Scripter
@Keith, I'll have him check for browser extensions (he's using Chrome, like I am). I only mentioned SRD vs compendium(MM) because of what Jay R. posted on Jun 8, who was having the same problem as my GM. Jay R. commented that it worked on a "generic" werebear, I wasn't sure if he meant a non-compendium werebear or not. My personal game (I am GM) is SRD only (everything works, including !sortta), while on my GM's PC (different campaign) we only tried on MM creatures (!ta works, but not !sortta). I'll see if my GM can try with SRD only, as well as your suggestion to try it on a new game, or possibly another browser. I'm assuming it works for others on compendium npcs, though, since that is probably the majority of the script users? Really scratching my head as to why merely prepending the "a-" or "al-" to the repeating attack names would cause the issues, especially with no error .&nbsp; Thanks for the suggestions. Hopefully I can get to the bottom of this, because it is an awesome script that I know will help accelerate combats his game.
1593438776
GiGs
Pro
Sheet Author
API Scripter
You should compare scripts between yours and your GMs campaign. If there's a difference, one of them might be interacting in some subtle way.
1593440909
David M.
Pro
API Scripter
Thanks GiGs. Good thought, but I'm thinking it's unlikely in this case due to how it was installed. I used remote login software to get on his PC and install it myself. First I copied the js from my script library and pasted directly into his. Then after seeing the problem behavior I copied directly from the Github, with no change in behavior. Same version, 0.3.0. I guess I could get back on and run it through text comparison s/w, but seems unlikely considering the above?
1593442952
GiGs
Pro
Sheet Author
API Scripter
I wasnt suggesting there's a difference in the copies of TAC. But if one of you has a different&nbsp; script installed that the other doesnt have installed, that may be the reason why Token Action Creator is behaving differently. It's a long-shot, but Ive seen it happen before (I'm sure Keith remembers). The best way to rule this out would be to disable all scripts except Token Action Creator, and test both !ta and !sortta to see if they work properly. Do this in both campaigns.
1593445913
David M.
Pro
API Scripter
Ah, got it. Good point. Will try.
I just have to express that this script is wonderful.&nbsp; Saves me SO much time.&nbsp; Thanks for the hard work!&nbsp; Saves me from doing the hard work.&nbsp; :)
I'm probably an idiot here, but whenever I install this (and I REALLY want to use it) I get an "Error downloading scripts (probably no scripts exist for campaign.)" Exactly how big an idiot am I being here?
1593727910
GiGs
Pro
Sheet Author
API Scripter
Are installing it from the One-Click Library? That is bugged at the moment. For a lot of scripts, you have click the Import button, not the Add Script&nbsp; button. Apparently this has been an issue for a couple of weeks, and doesnt reflect well on roll20 at all that they havent fixed it.
David M. said: @Keith, I'll have him check for browser extensions (he's using Chrome, like I am). I only mentioned SRD vs compendium(MM) because of what Jay R. posted on Jun 8, who was having the same problem as my GM. Jay R. commented that it worked on a "generic" werebear, I wasn't sure if he meant a non-compendium werebear or not. My personal game (I am GM) is SRD only (everything works, including !sortta), while on my GM's PC (different campaign) we only tried on MM creatures (!ta works, but not !sortta). I'll see if my GM can try with SRD only, as well as your suggestion to try it on a new game, or possibly another browser. I'm assuming it works for others on compendium npcs, though, since that is probably the majority of the script users? Really scratching my head as to why merely prepending the "a-" or "al-" to the repeating attack names would cause the issues, especially with no error .&nbsp; Thanks for the suggestions. Hopefully I can get to the bottom of this, because it is an awesome script that I know will help accelerate combats his game. Popping in to say thanks for looking into this, David. I honestly hadn't thought about MM werebear vs. SRD werebear, and I'll try to check that out when I have some time.
1593749422
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
GiGs said: Are installing it from the One-Click Library? That is bugged at the moment. For a lot of scripts, you have click the Import button, not the Add Script&nbsp; button. Apparently this has been an issue for a couple of weeks, and doesnt reflect well on roll20 at all that they havent fixed it. This is indeed the situation. Like a number of recently added scripts, (including this one, and another of mine, Rest and Recovery) the One Click install is broken. It will import fine, but then you lose auto updates. It is being looked at. :/
1593791011
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Now that the bug that has been keeping One-Click scripts from installing properly has been fixed by the devs, this script is now finally and truly available for quick and easy installation and updating.
Jay R. said: David M. said: @Keith, I'll have him check for browser extensions (he's using Chrome, like I am). I only mentioned SRD vs compendium(MM) because of what Jay R. posted on Jun 8, who was having the same problem as my GM. Jay R. commented that it worked on a "generic" werebear, I wasn't sure if he meant a non-compendium werebear or not. My personal game (I am GM) is SRD only (everything works, including !sortta), while on my GM's PC (different campaign) we only tried on MM creatures (!ta works, but not !sortta). I'll see if my GM can try with SRD only, as well as your suggestion to try it on a new game, or possibly another browser. I'm assuming it works for others on compendium npcs, though, since that is probably the majority of the script users? Really scratching my head as to why merely prepending the "a-" or "al-" to the repeating attack names would cause the issues, especially with no error .&nbsp; Thanks for the suggestions. Hopefully I can get to the bottom of this, because it is an awesome script that I know will help accelerate combats his game. Popping in to say thanks for looking into this, David. I honestly hadn't thought about MM werebear vs. SRD werebear, and I'll try to check that out when I have some time. So I did some checking today, and I am now unable to reproduce the bug I had earlier. I tried with a few monsters from the MM, and a couple from Mordenkainen's Tome of Foes. No issues: !sortta worked fine. One thing I noticed is that I've been using MM monsters, not SRD monsters. I don't seem to have any SRD monsters available no matter what kind of monster I search for in the Compendium. Whatever monster I search for lists either MM or Mordenkainen as the source. I can only assume now that my earlier bug had to do with a VTT setting (I still use the VTT enhancement, but have a lot of its settings turned off), or with a script which is either no longer in use in my game or has been updated. If I encounter this bug again, I'll be sure to post here.
1593805786
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
To check against SRD content, you can now just temporarily turn off all purchased compendiums in game settings. Nice tool. Roll20 doesn't get enough credit when they introduce a new feature that just works.
keithcurtis said: To check against SRD content, you can now just temporarily turn off all purchased compendiums in game settings. Nice tool. Roll20 doesn't get enough credit when they introduce a new feature that just works. I had no idea that feature even existed! Thanks, I'll check it out later. I'm also just happy we finally have feat support in the Charactermancer!
1593807778
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It's only been around for less than a month.
1594199537

Edited 1594199600
keithcurtis said: I do not know enough about how the chat works from the POV of the API to give a useful answer. I can ask around and see what I can find out. Hi Keith! Did you got any feedback? As I wrote in my answer to&nbsp; Scott, I can do it all manually, but still it intrigues me to know. How could one expand the code like EDIT: I better open a new thread ... do not answer here %{Kobold|repeating_npcaction_-M75T7K7CzDqip7cJbER_npc_action} into the expanded code like @{Veteran|wtype}&amp;{template:npcaction} {{attack=1}} {{damage=1}} {{dmg1flag=1}}&nbsp; @{Veteran|npc_name_flag} {{rname=Longsword (One-Handed)}} {{r1=[[@{Veteran|d20}+(5+0)]]}} @{Veteran|rtype}+(5+0)]]}} {{dmg1=[[1d8 + 3+0]]}} {{dmg1type=slashing}} {{dmg2=[[+0]]}} {{dmg2type=}} {{crit1=[[1d8+0]]}} {{crit2=[[+0]]}} {{description=y} @{Veteran|charname_output} ? You wrote that there are macros called, can I do it myself?
1594222492
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Just to be clear the answer from Scott was the result from my asking around.
keithcurtis said: Just to be clear the answer from Scott was the result from my asking around. Oh, I see. :-) Thank you, again! Looks promising, but doesn't work here yet as I wrote in the other thread ( How to expand code into inline rolling code manually? ). I thought this issue does not belong to your Token Action thread :-) Thanks!
Okay, so I just found this little beauty and I love it. It's going to save so much work. I do have one question, I'm sorry if anyone has mentioned something like this already, but is there any way, potentially, to have the traits of a pc be treated similarly to the way the spells are treated? Meaning the pc would have a single "Traits" button that whispered a list of traits to them in chat.&nbsp; I agree that traits on a pc tends to be a lot so having a single button for each one can become overwhelming quickly, but a quick way to look at your own list could be nice.&nbsp; &lt;3 This combined with Rest and Recovery is really helping me streamline things. Thank you.
1594592318
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thank you. I gave my attention to Supernotes this weekend, but I'll be spending more time on this script soon.
1594594429
David M.
Pro
API Scripter
FYI, finally got together with my GM to troubleshoot the !sortta problem we were having two weeks ago. Think we have it figured out. He is running the Sunless Citadel module, which apparently had all kinds of problems with the monsters/npcs that came with the module. They put out a patch, but looks like it didn't fix everything. When he calls !sortta on one of the npc tokens that came with the module, it does not create the token actions. However, when a monster from the compendium itself is used, it works. I swear we tried it on random compendium monsters before, but maybe I was just smoking crack. Either way, looks like we got to the bottom of it. Thanks to all for the earlier troubleshooting efforts!&nbsp;
David M. said: FYI, finally got together with my GM to troubleshoot the !sortta problem we were having two weeks ago. Think we have it figured out. He is running the Sunless Citadel module, which apparently had all kinds of problems with the monsters/npcs that came with the module. They put out a patch, but looks like it didn't fix everything. When he calls !sortta on one of the npc tokens that came with the module, it does not create the token actions. However, when a monster from the compendium itself is used, it works. I swear we tried it on random compendium monsters before, but maybe I was just smoking crack. Either way, looks like we got to the bottom of it. Thanks to all for the earlier troubleshooting efforts!&nbsp; Good to know your troubles have been resolved! I'm now wondering if maybe I didn't have the same issue myself -- running !sortta on a module monster rather than on something direct from the compendium.
Jay R. said: David M. said: FYI, finally got together with my GM to troubleshoot the !sortta problem we were having two weeks ago. Think we have it figured out. He is running the Sunless Citadel module, which apparently had all kinds of problems with the monsters/npcs that came with the module. They put out a patch, but looks like it didn't fix everything. When he calls !sortta on one of the npc tokens that came with the module, it does not create the token actions. However, when a monster from the compendium itself is used, it works. I swear we tried it on random compendium monsters before, but maybe I was just smoking crack. Either way, looks like we got to the bottom of it. Thanks to all for the earlier troubleshooting efforts!&nbsp; Good to know your troubles have been resolved! I'm now wondering if maybe I didn't have the same issue myself -- running !sortta on a module monster rather than on something direct from the compendium. Ran into the same !sortta issue a couple nights ago, with a drow and a drow elite warrior. I am really starting to think that the problem may be the Monster Setup macro I run on my monsters. I ran that first, then ran Token Action Maker, and got the issue. I'll check again.
Feature request for Token Action Maker: the option to truncate the text of the "Leader Variant" and "Button Recharge" abilities, both of which take up too much space on the token action menu. The Veteran of Geryon, for example, has both abilities, and their action menu is a hot mess as a result. :)
1596349170
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Those are both good suggestions. I'll work them in.
Hi.&nbsp; This is top 3 scripts that I use!&nbsp; So I understand that Roll20 has made a new action type-&nbsp; npcfullatk.&nbsp; I'm not versed in coding, so I definitely rely on API scripters to know the ins and outs of this stuff.&nbsp; Will this change affect Token Action Maker?&nbsp; I'm already having issues with some actions that have an attack roll but do not do damage no longer showing the description.&nbsp; I noticed this thread ( <a href="https://app.roll20.net/forum/post/9038037/npc-actions-other-than-attacks-will-not-show-in-chat/?pageforid=9038828#post-9038828" rel="nofollow">https://app.roll20.net/forum/post/9038037/npc-actions-other-than-attacks-will-not-show-in-chat/?pageforid=9038828#post-9038828</a> ) &nbsp;about it under Bug Reports and they are addressing it, but made me think about all of my macros made with Token Action Maker going forward.
1596654228
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
We'll see what happens when the dust settles. In most cases, the action created is just a reference to the built-in sheet button, so whatever they come up with should be the same as just pushing the button on the sheet.