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

Suddenly having problems with Statblock.js, an API script I have been using for over a year without issues.

I have been using an API for the last year called statblock.js to auto create statblocks for characters and monsters in the chat window. It has been working very well.&nbsp; It auto-adds all of their attacks and spells, which is SUPER convenient.&nbsp;&nbsp; <a href="https://app.roll20.net/forum/post/5740240/script-5e-ogl-statblock" rel="nofollow">https://app.roll20.net/forum/post/5740240/script-5e-ogl-statblock</a> At one point last year, changes were made on the back end, and I had to fix them by changing "desc=SPELL" to "description=SPELL", but that was easy to figure out as there was an error in the API console that told me exactly what the problem was.&nbsp; In the last couple of weeks something changed and, it now works sometimes for the players, and sometimes not.&nbsp; It usually works for the monsters, but not always.&nbsp; I am not sure why it is now unreliable as there are no errors in the API console to tell me why it is failing.&nbsp;&nbsp; When I look in the API console, and restart the console, I am not seeing it listed.&nbsp; Restarting sandbox by user request... detected currently running sandbox... restarting "Starting webworker script..." "Loading 715 translation strings to worker..." "-=&gt; TokenMod v0.8.64 &lt;=- [Fri Feb 19 2021 04:55:16 GMT+0000 (Coordinated Universal Time)]" "DeathTracker Ready! Command: !dead" "-=&gt; TokenNameNumber v0.5.12 &lt;=- [Tue Jul 25 2017 15:01:48 GMT+0000 (Coordinated Universal Time)]" "-=&gt; GroupCheck v1.12 &lt;=-" "-=&gt; GroupInitiative v0.9.35 &lt;=- [Mon Oct 12 2020 13:45:47 GMT+0000 (Coordinated Universal Time)]" "-=&gt; ChatSetAttr v1.10 &lt;=-" "-=&gt; RecursiveTable v0.2.5 &lt;=- [Fri Oct 18 2019 01:08:14 GMT+0000 (Coordinated Universal Time)]" "--&gt; PurseStrings v5.7 &lt;-- Initialized" Previously, this worked fine for both players and monsters, with only minor formatting issues for the players that I could ignore.&nbsp;&nbsp; Now it is not working for the players, and is only sometimes working for the monsters.&nbsp; Can someone help me troubleshoot why?&nbsp;
1618339273
The Aaron
Roll20 Production Team
API Scripter
That script has some serious inefficiencies.&nbsp; I'll take a look at it and see if I can get you a version that works.
When it works, it automatically generates a statblock in the chat window for each monster and character.&nbsp; I can add 1 button to a token and get access to everything that token can do with 1 click, I do not have to set it up ahead of time and I do not have to make a separate macro for each attack or spell.&nbsp; From the players standpoint, it is super simple. They click the button then make their attacks.&nbsp; It makes it super simple to run campaigns with new players.&nbsp;&nbsp; When they click the button, they see everything they are capable of doing in the chat window and click it to make their attack/save/spell. From a coding standpoint, I am not surprised it is inefficient.&nbsp; From a playing the game standpoint, it is incredibly efficient as it takes over for all other buttons.&nbsp; I can add a single button to each token (Which I can add as a game level macro and just click a button to have it auto-apply to all tokens put on the board moving forward).&nbsp; (From Statblock): Zombie Beholder Zombie AC : 15 (natural armor) HP : 93 (11d10 + 33) Speed : 0 ft., fly 20 ft. (hover) Senses : darkvision 60 ft., passive Perception 9 Languages : understands Deep Speech and Undercommon but can’t speak CR : 5 (1800 XP) STR 10 (0) Check Save DEX 8 (-1) Check Save CON 16 (3) Check Save WIS 8 (-1) Check Save INT 3 (-4) Check Save CHA 5 (-3) Check Save Acrobatics , Animal Handling , Arcana , Athletics , Deception , History , Insight , Intimidation , Investigation , Medicine , Nature , Perception , Performance , Persuasion , Religion , Sleight of Hand , Stealth , Survival Spells Traits Undead Fortitude: If damage reduces the zombie to 0 hit points, it must make a Constitution saving throw with a DC of 5 + the damage taken, unless the damage is radiant or from a critical hit. On a success, the zombie drops to 1 hit point instead. Actions NPC Actions: Bite , Eye Ray , 1. Paralyzing Ray , 2. Fear Ray , 3. Enervation Ray , 4. Disintegration Ray
1618542301
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You might want to look into&nbsp; Universal Chat Menus &nbsp;with&nbsp; 5e Menu Macros &nbsp; Although nowadays, I tend to use&nbsp; Token Action Maker .
I want to second Token Action Maker.&nbsp; Its especially awesome for players as you get their spells in token action nested buttons and I love it.&nbsp;&nbsp;
I have been testing out&nbsp; Universal Chat Menus &nbsp;with&nbsp; 5e Menu Macros for the last couple weeks. It is exactly what I am looking for, thank you very much!&nbsp; But, it is a little buggy at the moment, and I think that has to do with the recent updates to javascript.&nbsp; For the PC scripts, when playing, we are having intermittent issues with some of the attacks not working, but I am having a problem reproducing the errors outside of an actual game. Until I can identify the exact conditions that make this occur, I don't know how anyone can help.&nbsp;&nbsp; For the NPC script, I am having issues with NPC Traits. They don't work. It is 100% reproducible across all the npc characters I test.&nbsp; No ability was found for %{Orsún|repeating_npctrait_-npc_roll_output} (GM): Orsún|repeating_npctrait_-MQk6b20mziz6G2c3F-G_-npc_roll_output No ability was found for %{Orsún|repeating_npctrait_-npc_roll_output} (GM): Orsún|repeating_npctrait_-MUB6tmZSB4gdVmJQeAe_-npc_roll_output I am pretty sure I have the latest versions of the scripts listed in those links.&nbsp;&nbsp; Thanks for the fantastic suggestions and the obvious hard work that went into those scripts.&nbsp; I really appreciate it.&nbsp;
There was an update to character sheets about a month or so ago, and some things got changed, such as the repeating sections.&nbsp; For NPC Traits, the portion got changed to:&nbsp;repeating_npctrait_$0_oll_output. Then the change got rolled back or fixed and the Traits were slightly modified from the original commands.&nbsp; It looks like for some reason the script is not adding in the number identifier, as it should be: %{Orsún|repeating_npctrait_$0_npc_roll_output} So the first thing I would suggest is deleting and readding the script to make sure you have the most current code. You can also look into chat menus that don't use scripts at all .
I went and downloaded the latest script here - Universal Chat Menus - which says it is version 0.3.9 and was last edited April 20, 1 year ago.&nbsp;&nbsp; I then downloaded the latest version of the npc script linked here - 5e Menu Macros - and it says it was last updated 13 months ago.&nbsp;&nbsp; Are these the latest versions?&nbsp; if not, where am I supposed to look, it sure is not obvious if these are not them.&nbsp;
1620510490
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
GiGs created the script, and I created the macros. as far as I know, the scripts are functioning correctly, but changes in the sheet require some changes in the macros. I'll take care of that and post here momentarily.
1620510930
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Fixed . I ran all sections through a test NPC. Let me know if you see any issues.
Thank you so much, the NPC script is working perfectly now.&nbsp; It was exactly what I was looking for.&nbsp; I need to pay a lot more attention to what is causing the issues we sometimes see with the PC script.&nbsp; Maybe, it will go away now that I have solved several other issues.&nbsp;&nbsp; Again, Thank you!
OK, I have narrowed down the exact conditions under which I can get an error with the PC script. When you get a chance, can you take a look at this and see if you are able to repeat the problems on your end?&nbsp; If I click on a spell in the spell list that is an attack with an attack bonus to hit, I get an error, No ability was found for %{|repeating_attack_attack} If I click on that same spell as an attack, it works as expected.&nbsp;&nbsp; (I tried both melee and ranged and both work fine).&nbsp; In the spell list, If I click on a spell that is not an attack, it works fine. If I click on a spell that is an attack with a save, it works fine.&nbsp; If I click on a spell that is an attack with an attack bonus to hit, it does not work.&nbsp; Thank you so much! I love these scripts.&nbsp; It is so nice to drop a character on the map and they are ready to play with no further setup.&nbsp;&nbsp; This speeds my silly games up so much.&nbsp; We get to spend more time talking and laughing, and less time looking things up.&nbsp;
1621302239
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I am unable to reproduce this.
Well, then I am going to have to test further.&nbsp; I will create a new game with only these APIs in them and see if I can reproduce. In normal usage, I am using multiple APIs, so it is very possible that this is an interaction of multiple APIs going on.&nbsp;&nbsp; If it is an API thing, I might just tell the players to deal with it :)&nbsp; I can very much predict when it happens in our games and tell them to avoid it.&nbsp;&nbsp; It doesn't happen for my NPCs that I drop on the map, so its not my problem :)&nbsp; Thanks for testing!