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] autoButtons - automatically generate damage & healing buttons for your clicking pleasure

Vas said: Same issue here. Is there a chance to make this work with the "official" Concentration script?&nbsp; <a href="https://app.roll20.net/campaigns/scripts/13232893" rel="nofollow">https://app.roll20.net/campaigns/scripts/13232893</a> I'm not hugely interested in touching someone else's one-click repo, but I see Aaron is listed as a contributor. I'll run it past him and see what the thinks of a TokenMod observer. You're welcome to test this modified version if you wish, to see if it works. Disable your one-click version before manually installing it - also, if you grab code from pastebin, scroll right to the bottom and click the Copy icon next to the RAW Paste Data heading - the main prettified version occasionally does bad things to some punctuation. WOW! It worked!&nbsp;Auto-buttons now activate the concentration check from the manually modified script&nbsp; ( <a href="https://pastebin.com/FW59v1XV" rel="nofollow">https://pastebin.com/FW59v1XV</a> ) ! Thank you!&nbsp;
1660611856
Oosh
Sheet Author
API Scripter
Nice one, thanks for testing that. I'll see about adding it to the one-click as well.
1662874931

Edited 1664613558
Oosh
Sheet Author
API Scripter
v0.6.0 A few new features, but mostly just a tidy up. The main two changes are: Reporting hp changes: Settings menu: Features: Settings menu is in, --settings will now open a chat UI menu which links through to the template/property menus. Mouse over the setting name for a longer description. Reworked templates &amp; properties menu options, access those through --settings , or directly through --listTemplates or --listProps --help is very slightly less unhelpful than before. It now has a link to this thread! Reporting - There's a new option to enable reporting token changes in chat. This all run's through Aaron's code in TokenMod, so it should be 100% accurate in only reporting actual changes that were made. Note that choosing the "Character" option will try to find a token owner or character owner to send the report to, but will always send it to the GM as well. Turn this on or off through --settings or directly with the --report CLI command. The internal values are 'off', 'gm', 'control', 'all'. Reporting is currently just a bit of plain text - it might be possible later to pass HTML through to the output to pretty it up a little, I'll update the script if that happens Bugfixes: Buttons were not being removed cleanly when deleted while active Potential sandbox crash when buttons had corrupted math functions Remove templates command, --removeTemplate wasn't working properly Inbuilt styles could not be applied via --editButton (thanks Nick O. for the bug report) Other Changes: Restructured internal settings. Hopefully didn't break too much stuff A note on tempHP: I had a look at adding this, but I think the best solution is to integrate other scripts with TokenMod, as with the Concentration script. For example, Keith modified the tempHP script by the-usual-suspect recently, depending on how the script you want to integrate is written it's as easy as this one line: at line 105 in the tempHP script, we change this: RegisterEventHandlers = function() { on('change:token', TokenChange); }; to this: RegisterEventHandlers = function() { on('change:token', TokenChange); if (typeof(TokenMod) === 'object') TokenMod.ObserveTokenChange(TokenChange); }; The tempHP script now gets the change event from TokenMod, and does its thing, totally independent of autoButtons. Don't forget to modify Aaron's script to suit your campaign - lines 10 and 11 hold variables which are game system/campaign dependent (for example 5e is likely to need HitPointBarNum = 1 and TempHitPointsIn = 'hp_temp'
Oosh, Thank you for this script.&nbsp; I use it my 5e game with great results but am having a hell of a time adapting it to use for the Pathfinder Sheet by Roll 20.&nbsp; Is there a chance that you can create a walk-through for creating a button and identifying what is getting called?
1663034567

Edited 1663035494
Oosh
Sheet Author
API Scripter
Hi Sean - it's absolutely possible to support other sheets, however I'm not familiar with the PF sheet. I'll see if I can find someone who is - basically we need to figure out the names of all templates to watch, and the names of all template properties which can carry damage numbers. From there it's extremely easy to implement - the default buttons should work fine. If we can get it running flawlessly in your PF game, I can then add your settings to the script as a preset for PF so other users can select it with a single settings change. Basically, to get a new sheet to work, it's going to be easier to grab the newest version (0.6.0) since it has a settings UI. You'll need to: 1. Change the sheet setting from 5e to Custom in --settings 2. Click through to Templates from --settings, or do !autobut --listTemplates 3. Remove anything there (can't remember if it'll do this automatically) and add in all the roll template names which can report damage in PF 4. Click through to Properties from --settings, or do !autobut --listProps 5. Remove any 5e stuff if it has been left in there (hopefully it hasn't, really haven't played with custom stuff so far though!) and add in all the property names from each PF roll template which carry those particular types of damage (whether it's normal damage or crit damage). I'm not familiar enough with 3.5-likes to know if the 4 damage field types from 5e are enough or not. 6. Add any buttons required. This bit is easy once you've done the rest. Making sure all damage properties are caught is really sheet-specific knowledge, so I'll see if I can find anyone to assist with that. I'd also need to check if the 4 damage field types are enough - damage / crit / higher level cast / higher level cast crit. Because a roll template can potentially be rolling hidden damage, we need to make sure things like higher level cast damage are not being added in the wrong places - autoButtons has no way of knowing what is and is not visible on the roll template. If no one can help out, I should be able to figure most of it out, thought obviously it'll need to be tested in a real game to see if the calculations are working.
1663114213

Edited 1663169146
Oosh, Thank you.&nbsp; I willing to work on this until I get it right.&nbsp;&nbsp; I'm having trouble with Step 3 and the roll template names.&nbsp;&nbsp; I'm not sure how to find those.&nbsp; (EDIT.&nbsp; Template names are PC and NPC) I rolled a Critical from the NPC sheet. Now this is the code that comes up for the NPC Critical if I wanted to copy the macro. @{Necromancer of Set|whispertype} &amp;{template:npc} {{name=Quarterstaff}} {{type=attackdamage}} {{showchar=@{Necromancer of Set|rollshowchar}}} {{charname=@{Necromancer of Set|character_name}}} {{nonlethal=[[1[Nonlethal]]]}} {{attack=1}} {{roll=[[1d20cs&gt;20+0[MOD]+@{Necromancer of Set|rollmod_attack}[QUERY]]]}}{{critconfirm=[[1d20cs20+0[MOD]+@{Necromancer of Set|rollmod_attack}[QUERY]]]}}{{rolldmg1=[[1d6 + @{Necromancer of Set|rollmod_damage}[QUERY]]]}}{{rolldmg1type=Bludgeoning}}{{rolldmg1crit=[[(1d6 + 1d6) + (@{Necromancer of Set|rollmod_damage}[QUERY]*2)]]}} {{descflag=[[1]]}}{{desc=The necromancer has resorted to his quarterstaff.}} I'm hoping I'm on the right track.&nbsp; I'm not sure what else to share?&nbsp;&nbsp; Spell damage?&nbsp; Or just any inline roll that I add in a spell description? Thanks for any assistance.&nbsp; I've tried a few things, but I'm not quite understanding step 3. Sean
Oosh, I also found this which is specific to the Pathfinder by Roll 20 sheet.&nbsp; This is a list of the fields. I also found this in the Roll Templates guide specific for the sheet.
1663120675

Edited 1663127738
Oosh
Sheet Author
API Scripter
Edit - you might want to grab a fresh version before you set this up - 0.6.1 There was a minor oversight in that the script could wipe your config if that sandbox is restarted mid-configuration, in a state where autoButtons won't function. It will now prompt for a reset instead - don't click on that unless you do actually want to restore default settings (which, for 'Custom', is blank - it will just wipe your template settings). Yep, that macro text you grabbed from chat is exactly the kind of thing we need. @{Necromancer of Set|whispertype} &amp;{template:npc} {{name=Quarterstaff}} {{type=attackdamage}} {{showchar=@{Necromancer of Set|rollshowchar}}} {{charname=@{Necromancer of Set|character_name}}} {{nonlethal=[[1[Nonlethal]]]}} {{attack=1}} {{roll=[[1d20cs&gt;20+0[MOD]+@{Necromancer of Set|rollmod_attack}[QUERY]]]}}{{critconfirm=[[1d20cs20+0[MOD]+@{Necromancer of Set|rollmod_attack}[QUERY]]]}} {{rolldmg1=[[1d6 + @{Necromancer of Set|rollmod_damage}[QUERY]]]}} {{rolldmg1type=Bludgeoning}} {{rolldmg1crit=[[(1d6 + 1d6) + (@{Necromancer of Set|rollmod_damage}[QUERY]*2)]]}} {{descflag=[[1]]}}{{desc=The necromancer has resorted to his quarterstaff.}} The bolded bits are mostly what we need. First off is the &amp;{template:npc} line - that gives us the template name 'npc'. It looks like PF is a little slimmer on the roll templates than 5e, so the only other one is 'pc'. So we add those two to the templates we're watching in autoButtons. The next bolded parts give us some of the template properties we need, which are always in the form of {{ property=value }}. So one of the properties we want for normal damage is rolldmg1 , and a crit property is rolldmg1crit . So we'll start by adding those two to the Properties setup in autoButtons. It should now look like this: Easy, huh? Not quite there yet though, because this is a 3.5e system. What kind of lame character is only swinging once per round? Those two rolldmg properties are only for single attacks - the template has a bunch more for multiple attacks.... now that I look at the roll template page, some memories are coming back of helping others with PF macros before - I think all of the properties you want are (including the two we already grabbed): rolldmg1 rolldmg2 rolldmg1crit rolldmg2crit roll1dmg1 roll1dmg2 roll1dmg1crit roll1dmg2crit roll2dmg1 roll2dmg2 roll2dmg1crit roll2dmg2crit roll3dmg1 roll3dmg2 roll3dmg1crit roll3dmg2crit roll4dmg1 roll4dmg2 roll4dmg1crit roll4dmg2crit .... same pattern all the way up to roll8 , I think??? With the 'crit' ones going into the crit category in autoButtons. Happily, it looks like the 'npc' template uses all the same names, so we don't have to add another 100 property names to account for that. Then, theoretically, the default buttons should hopefully work. If you need some others, we can look at that after the basics are working. Having never played PF on Roll20 (or outside a video game, for that matter) I have no idea how spell damage is represented, and whether it's going to be caught by these properties or not.
1663170222

Edited 1663171099
Oosh, Okay, I got the buttons to work for the first attacks.&nbsp;&nbsp; For Spells, I was also able to add dmg1 to the damageFields Properties and dmg1crit to the critFields Properties which is tested and works as well. I have the following issues: 1) The first issue is secondary attacks and I think that I have to create a new button for those.&nbsp; Right now, there is not a button that represents the 2nd, 3rd, etc attacks. 2) Also, I think I would want a new button for secondary damage (rolldmg2).&nbsp; The reason for this has to do with resistances.&nbsp;&nbsp; Essentially a sword does X damage (covered) but might also do 1d6 fire for instance.&nbsp; The 1d6 may or may not apply, and should not be lumped together. So, do I need a new Category of Roll Template properties, or do I just create buttons that call up a different thing? 3) Can we make a listener for any inline roll?&nbsp; That would be VERY useful. Thank you again!&nbsp;&nbsp; Hopefully this will help you develop another type of sheet for others to use! Sean
1663172018

Edited 1663172206
Oosh
Sheet Author
API Scripter
Ah ok, that's definitely progress! Looks like everything is working as intended, the rest is down to sheet-specific stuff. I'd missed the dmg1 and dmg1crit properties. Sean R. said: 1) The first issue is secondary attacks and I think that I have to create a new button for those.&nbsp; Right now, there is not a button that represents the 2nd, 3rd, etc attacks. Also, I think I would want a new button for secondary damage (rolldmg2).&nbsp; The reason for this has to do with resistances.&nbsp;&nbsp; Essentially a sword does X damage (covered) but might also do 1d6 fire for instance.&nbsp; The 1d6 may or may not apply, and should not be lumped together. So, do I need a new Category of Roll Template properties, or do I just create buttons that call up a different thing? I think the best thing to do first, is to just get *all* damage sources working on the standard 'apply damage' button, the one with the heart. It doesn't need to be accurate in terms of resistances or anything yet, or splitting primary damage and secondary damage - we just want to make sure that button (which will grab *all* sources of non-crit damage) is actually capturing everything the different roll buttons output to chat - whether that's a PC attacking with a lettuce leaf 12 times or an NPC throwing out a metamagicked Fireball. With that in mind, did you already add the rollXdmg1 and rollXdmg2 properties, with X being from 1 to 8? My impression was that those were the roll template fields which have the damage output roll for attacks 2+. There's obviously some overlap there with the single attack fields, but that's fine - we can split them into different buttons once we're sure we're actually catching every possible damage roll. It's also worth keeping track of exactly what's doing what - since I'm not familiar with the sheet, it's a bit confusing having these three roll template properties: dmg1, rolldmg1, roll1dmg1 ... this is a horrible naming convention since they all sound like they do the same thing, and we'll need to track what the different uses are to be able to design buttons around them. Again - this is sheet-specific stuff that does need to be nutted out manually (I did this for the 5e sheet) before the buttons will make sense. Experience with the character sheet and making rolls from it is key here, as nothing can really be inferred from the property names when they're that conflated. If we can just get the default damage &amp; crit buttons to the point where, no matter which roll you perform from a pc/npc sheet, it's catching all the damage rolls, splitting that out into different buttons is fairly straight-forward. But we definitely need to know which of those parts are relevant to each roll (which you've started doing already). Hopefully that makes sense. It's important to make sure autoButtons is aware of *all* the damage properties of the roll templates before doing the buttons, otherwise we'll just have to redo the buttons. Since systems and sheets can do all kinds of weird things (the advantage mechanism of 5e-likes can be nightmarish for this kind of thing... thankfully it doesn't apply to damage!), there's no way I can write the script to 'assume' any inline rolls belong to a particular damage category with a high enough accuracy to be worth doing.
1663176839

Edited 1663181632
Oosh, Yes, I've entered them all in, and they all seem to collect.&nbsp; I'm testing all the way up to 9.&nbsp;&nbsp; So that works.&nbsp; I'm also seeing that crits add the first damage value and the crit value.&nbsp; That is calculated differently in pathfinder.&nbsp; It should only call one value or the other. (weird... I just noticed that the last 6 crit rolls were all the same!&nbsp; Take me to Vegas baby!)
1663178252
Oosh
Sheet Author
API Scripter
Excellent - so if you make a silly character with 10 attacks (or whatever the max is), and secondary damage on each attack, you're getting the right total when you hover over the buttons? It sounds like we're almost there - the custom button syntax is relatively straight-forward... it's just going to be loooooooooong because PF has so many damage fields. I don't have time to go over it right now, but tomorrow should be good! If it gets too hairy I can jump into the game and give you a hand.
Oosh, Yes, I was just editing my other post.&nbsp; It calculates correctly.&nbsp;&nbsp; Thank you for the help.&nbsp; I'll check the thread tomorrow.
1663179606
Oosh
Sheet Author
API Scripter
Ah, nice! Yep we can figure all that out... not sure if I can face down a Super Squid though...
Oosh, So I played last night and a few things came up.&nbsp; Resistances. I suppose I didn't think it though, but a LOT of creatures end up with DR 5, 10, 15, 20.&nbsp; I'm curious about creating buttons that just add those amounts.&nbsp; I think I can do this one, but I'm going to wait to hear back from you.
1663310496

Edited 1663311152
Oosh
Sheet Author
API Scripter
Not sure how far you've got, but here's a couple of example buttons. These would split the damage into all dmg1 sources and all dmg2 sources: !autobut --createButton {{name=Primary}} {{math=-(damage.dmg1 + damage.rolldmg1 + damage.roll1dmg1 + damage.roll2dmg1 + damage.roll3dmg1 + damage.roll4dmg1 + damage.roll5dmg1 + damage.roll6dmg1 + damage.roll7dmg1 + damage.roll8dmg1)}} {{content=1}} {{style=font-family: sans-serif; color: black;}} {{tooltip=Damage 1 (%)}} !autobut --createButton {{name=Secondary}} {{math=-(damage.dmg2 + damage.rolldmg2 + damage.roll1dmg2 + damage.roll2dmg2 + damage.roll3dmg2 + damage.roll4dmg2 + damage.roll5dmg2 + damage.roll6dmg2 + damage.roll7dmg2 + damage.roll8dmg2)}} {{content=2}} {{style=font-family: sans-serif; color: black;}} {{tooltip=Damage 2 (%)}} You'd then need to do the same with all the crit fields if you wanted to have all of those separated out. Damage reduction is something I'll need to think about, since it needs information not currently available to autoButtons. I might look at a syntax for adding a query on to the buttons - I'll need to do a bit of testing on that. Automating DR to any extent would be pretty difficult, so you'll likely need to calculate it manually, and enter it into the query to reduce the damage by that amount (or multiply it by that amount). edit - oh, and for the crit, if you only want the crit without the plain damage added on, just create a new crit button like: !autobut --createButton {{tooltip=Crit (%)}} {{style=crit}} {{math=-(crit.total)}} {{content='kk'}} {{name=critPF}} This will create a button styled like the default crit button, but doesn't add in damage.total like the 5e sheet
1663340785

Edited 1663351510
Oosh, Thank you so much.&nbsp; I'll play with the button commands.&nbsp;&nbsp; Also, I think I should just be able to add a button that adds 5, 10, 15, or 20 hp to the selected token.&nbsp; That would be the easiest thing that keeps it consistent over most of the DR conditions. EDIT: Here is how I made the Buttons for DR.&nbsp;&nbsp; Works great.&nbsp;&nbsp; Figured out how to bold.&nbsp; For anyone else, you would add these one at a time and then activate the buttons with: !autobut -buttons !autobut --createButton {{name=DR5}} {{math=(5)}} {{tooltip=DR5 (5)}} {{content=5}} {{style=font-family: sans-serif; color: green; font-weight: bold}} {{tooltip=DR5 (5)}} !autobut --createButton {{name=DR10}} {{math=(10)}} {{tooltip=DR10 (10)}} {{content=10}} {{style=font-family: sans-serif; color: green; font-weight: bold}} {{tooltip=DR10 (10)}} !autobut --createButton {{name=DR15}} {{math=(15)}} {{tooltip=DR15 (15)}} {{content=15}} {{style=font-family: sans-serif; color: green; font-weight: bold}} {{tooltip=DR15 (15)}} !autobut --createButton {{name=DR20}} {{math=(20)}} {{tooltip=DR20 (20)}} {{content=20}} {{style=font-family: sans-serif; color: green; font-weight: bold}} {{tooltip=DR20 (20)}}
1663358348

Edited 1663426432
Oosh, Okay, I think I have it down now.&nbsp;&nbsp; Thank you so much for helping me figure it out.&nbsp; I appreciate it so much. Below is the code that I'm using to make individual buttons (line breaks for each to separate them).&nbsp;&nbsp; But this is only through 4 attacks with a button for both Damage 1 and for Damage 2 for each attack!&nbsp; I have the buttons set up to show and reorder if necessary.&nbsp; That is all iterative attacks for PCs and NPCs. The issue seems to be:&nbsp; How many buttons do you want?!?&nbsp;&nbsp; I only want to show a few, so even showing just two attacks (with secondary damage and crits), that is 8 buttons.&nbsp; If you did all 4 attacks up to level 20, that would be 16 buttons.&nbsp; If you did ALL other PC ADDITIONAL attacks, you would add 3 more, plus 3 more for their crits (there is no field for secondary damage).&nbsp; For NPCs, you can program up to 10 attacks (all with secondary damages and crits; that 30 buttons total!). Be warned, these buttons come up for ANY template:pc or template:npc. &nbsp;&nbsp; So you are going to see them for virtually everything; rolls, skills abilities, initiative, etc.&nbsp; To combat the real estate taken in the chat, I widen the chat a bit so that I have 6 buttons showing, and I can see widening it further for 8 buttons showing at a time. That's a LOT of buttons!&nbsp; But, this is what I wanted, and I think it works well.&nbsp; Much quicker then entering damage by hand.&nbsp; And I can see so many more uses for the buttons, so long as they are attached to a specific bar. For anyone considering using this, keep in mind that this works for the PATHFINDER by ROLL20 sheet, and was not tested with the OFFICIAL PATHFINDER sheet. !autobut --createButton {{name=Atk1Dam1}} {{math=-(damage.dmg1 + damage.rolldmg1)}} {{content=1-1}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 1 - Dam 1 (%)}} !autobut --createButton {{name=Atk1Dam2}} {{math=-(damage.dmg2 + damage.rolldmg2)}} {{content=1-2}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 1 - Dam 2 (%)}} !autobut --createButton {{name=Atk2Dam1}} {{math=-(damage.roll1dmg1)}} {{content=2-1}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 2 - Dam 1 (%)}} !autobut --createButton {{name=Atk2Dam2}} {{math=-(damage.roll1dmg2)}} {{content=2-2}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 2 - Dam 2 (%)}} !autobut --createButton {{name=Atk3Dam1}} {{math=-(damage.roll2dmg1)}} {{content=3-1}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 3 - Dam 1 (%)}} !autobut --createButton {{name=Atk3Dam2}} {{math=-(damage.roll2dmg2)}} {{content=3-2}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 3 - Dam 2 (%)}} !autobut --createButton {{name=Atk4Dam1}} {{math=-(damage.roll3dmg1)}} {{content=4-1}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 4 - Dam 1 (%)}} !autobut --createButton {{name=Atk4Dam2}} {{math=-(damage.roll3dmg2)}} {{content=4-2}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 4 - Dam 2 (%)}} !autobut --createButton {{name=Atk5Dam1}} {{math=-(damage.roll4dmg1)}} {{content=5-1}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 5 - Dam 1 (%)}} !autobut --createButton {{name=Atk5Dam2}} {{math=-(damage.roll4dmg2)}} {{content=5-2}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 5 - Dam 2 (%)}} !autobut --createButton {{name=Atk6Dam1}} {{math=-(damage.roll5dmg1)}} {{content=6-1}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 6 - Dam 1 (%)}} !autobut --createButton {{name=Atk6Dam2}} {{math=-(damage.roll5dmg2)}} {{content=7-2}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 7 - Dam 2 (%)}} !autobut --createButton {{name=Atk7Dam1}} {{math=-(damage.roll6dmg1)}} {{content=7-1}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 7 - Dam 1 (%)}} !autobut --createButton {{name=Atk7Dam2}} {{math=-(damage.roll6dmg2)}} {{content=7-2}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 7 - Dam 2 (%)}} !autobut --createButton {{name=Atk8Dam1}} {{math=-(damage.roll7dmg1)}} {{content=8-1}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 8 - Dam 1 (%)}} !autobut --createButton {{name=Atk8Dam2}} {{math=-(damage.roll7dmg2)}} {{content=8-2}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 8 - Dam 2 (%)}} !autobut --createButton {{name=Atk9Dam1}} {{math=-(damage.roll8dmg1)}} {{content=9-1}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 9 - Dam 1 (%)}} !autobut --createButton {{name=Atk9Dam2}} {{math=-(damage.roll8dmg2)}} {{content=9-2}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 9 - Dam 2 (%)}} !autobut --createButton {{name=Atk10Dam1}} {{math=-(damage.roll9dmg1)}} {{content=10-1}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 10 - Dam 1 (%)}} !autobut --createButton {{name=Atk10Dam2}} {{math=-(damage.roll9dmg2)}} {{content=10-2}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 10 - Dam 2 (%)}} !autobut --createButton {{name=Att1Dam1Crit}} {{math=-(crit.dmg1crit + crit.rolldmg1crit)}} {{content=t}} {{style=font-family: pictos custom; color: red;}} {{tooltip=CritDam (%)}} !autobut --createButton {{name=Att1Dam2Crit}} {{math=-(crit.dmg2crit + crit.rolldmg2crit)}} {{content=t}} {{style=font-family: pictos custom; color: red;}} {{tooltip=CritDam (%)}} !autobut --createButton {{name=Att2Dam1Crit}} {{math=-(crit.roll1dmg1crit)}} {{content=t}} {{style=font-family: pictos custom; color: red;}} {{tooltip=CritDam (%)}} !autobut --createButton {{name=Att2Dam2Crit}} {{math=-(crit.roll1dmg2crit)}} {{content=t}} {{style=font-family: pictos custom; color: red;}} {{tooltip=CritDam (%)}} !autobut --createButton {{name=Att3Dam1Crit}} {{math=-(crit.roll2dmg1crit)}} {{content=t}} {{style=font-family: pictos custom; color: red;}} {{tooltip=CritDam (%)}} !autobut --createButton {{name=Att3Dam2Crit}} {{math=-(crit.roll3dmg2crit)}} {{content=t}} {{style=font-family: pictos custom; color: red;}} {{tooltip=CritDam (%)}} !autobut --createButton {{name=Att4Dam1Crit}} {{math=-(crit.roll3dmg1crit)}} {{content=t}} {{style=font-family: pictos custom; color: red;}} {{tooltip=CritDam (%)}} !autobut --createButton {{name=Att4Dam2Crit}} {{math=-(crit.roll3dmg2crit)}} {{content=t}} {{style=font-family: pictos custom; color: red;}} {{tooltip=CritDam (%)}} !autobut --createButton {{name=Att5Dam1Crit}} {{math=-(crit.roll4dmg1crit)}} {{content=t}} {{style=font-family: pictos custom; color: red;}} {{tooltip=CritDam (%)}} !autobut --createButton {{name=Att5Dam2Crit}} {{math=-(crit.roll4dmg2crit)}} {{content=t}} {{style=font-family: pictos custom; color: red;}} {{tooltip=CritDam (%)}} !autobut --createButton {{name=Att6Dam1Crit}} {{math=-(crit.roll5dmg1crit)}} {{content=t}} {{style=font-family: pictos custom; color: red;}} {{tooltip=CritDam (%)}} !autobut --createButton {{name=Att6Dam2Crit}} {{math=-(crit.roll5dmg2crit)}} {{content=t}} {{style=font-family: pictos custom; color: red;}} {{tooltip=CritDam (%)}} !autobut --createButton {{name=Att7Dam1Crit}} {{math=-(crit.roll6dmg1crit)}} {{content=t}} {{style=font-family: pictos custom; color: red;}} {{tooltip=CritDam (%)}} !autobut --createButton {{name=Att7Dam2Crit}} {{math=-(crit.roll6dmg2crit)}} {{content=t}} {{style=font-family: pictos custom; color: red;}} {{tooltip=CritDam (%)}} !autobut --createButton {{name=Att8Dam1Crit}} {{math=-(crit.roll7dmg1crit)}} {{content=t}} {{style=font-family: pictos custom; color: red;}} {{tooltip=CritDam (%)}} !autobut --createButton {{name=Att8Dam2Crit}} {{math=-(crit.roll7dmg2crit)}} {{content=t}} {{style=font-family: pictos custom; color: red;}} {{tooltip=CritDam (%)}} !autobut --createButton {{name=Att9Dam1Crit}} {{math=-(crit.roll8dmg1crit)}} {{content=t}} {{style=font-family: pictos custom; color: red;}} {{tooltip=CritDam (%)}} !autobut --createButton {{name=Att9Dam2Crit}} {{math=-(crit.roll8dmg2crit)}} {{content=t}} {{style=font-family: pictos custom; color: red;}} {{tooltip=CritDam (%)}} !autobut --createButton {{name=Att10Dam1Crit}} {{math=-(crit.roll9dmg1crit)}} {{content=t}} {{style=font-family: pictos custom; color: red;}} {{tooltip=CritDam (%)}} !autobut --createButton {{name=Att10Dam2Crit}} {{math=-(crit.roll9dmg2crit)}} {{content=t}} {{style=font-family: pictos custom; color: red;}} {{tooltip=CritDam (%)}}
1663358623

Edited 1663359169
Oosh, I have one more issue that maybe you can help me resolve.&nbsp; When I hit a button, then select a character, I am getting the expected results, but then I get a gm message that doesn't seem to apply.&nbsp; I changed my HPs to Bar 3 which works when I hit a button and select a token, but I think this message is locked into Bar 1 somehow.&nbsp; Here is a picture. Is there a way to fix this gm messaging? Here is a pic and also shows my current button set up.&nbsp; I'll drop some of the 5e ones soon enough.
1663373533
Oosh
Sheet Author
API Scripter
Sean R. said: Oosh, Okay, I think I have it down now.&nbsp;&nbsp; Thank you so much for helping me figure it out.&nbsp; I appreciate it so much. Below is the code that I'm using to make individual buttons (line breaks for each to separate them).&nbsp;&nbsp; But this is only through 4 attacks with a button for both Damage 1 and for Damage 2 for each attack!&nbsp; I have the buttons set up to show and reorder if necessary.&nbsp; That is all iterative attacks for PCs and NPCs. The issue seems to be:&nbsp; How many buttons do you want?!?&nbsp;&nbsp; I only want to show a few, so even showing just two attacks (with secondary damage and crits), that is 8 buttons.&nbsp; If you did all 4 attacks up to level 20, that would be 16 buttons.&nbsp; If you did ALL other PC ADDITIONAL attacks, you would add 3 more, plus 3 more for their crits (there is no field for secondary damage).&nbsp; For NPCs, you can program up to 10 attacks (all with secondary damages and crits; that 30 buttons total!). Be warned, these buttons come up for ANY template:pc or template:npc. &nbsp;&nbsp; So you are going to see them for virtually everything; rolls, skills abilities, initiative, etc.&nbsp; To combat the real estate taken in the chat, I widen the chat a bit so that I have 6 buttons showing, and I can see widening it further for 8 buttons showing at a time. That's a LOT of buttons!&nbsp; But, this is what I wanted, and I think it works well.&nbsp; Much quicker then entering damage by hand.&nbsp; And I can see so many more uses for the buttons, so long as they are attached to a specific bar. Yeah, the extra complexity of 3.5 definitely makes this a much harder fit than 5e. That said, I'll see if I can add a couple of things in to make your life easier - for starters, there are a couple of ways to reduce buttons spam. The one I'm leaning towards is an option to auto-hide any buttons where the math works out to 0 (99% of cases this means none of the properties were found - the script supplies them all as '0' to prevent the math functions crashing). This would reduce the number of buttons you see on a normal roll, and it would remove the button prompt entirely for a skill roll, since none of those damage properties would have a value. If it works the way I'm thinking it will, you won't have to hide or show buttons any more, either! I'll give this approach a quick test and see how it goes. Sean R. said: Oosh, I have one more issue that maybe you can help me resolve.&nbsp; When I hit a button, then select a character, I am getting the expected results, but then I get a gm message that doesn't seem to apply.&nbsp; I changed my HPs to Bar 3 which works when I hit a button and select a token, but I think this message is locked into Bar 1 somehow.&nbsp; Here is a picture. Is there a way to fix this gm messaging? You are 100% correct - mind must have been wandering as I did hard code bar1 in to the report template. I've patched the script to 0.6.2 if you want a quick fix for the reporting. Thanks for finding (and solving) the mistake!
1663400780

Edited 1663400801
Oosh
Sheet Author
API Scripter
Ok, I've got an experimental version here if you're interested, 0.6.5. It adds queries which will run after the main math function which adds all the damage together. It's only accessible through --createbutton and --editbutton currently. Since it runs after the main math function, you can do a final operation on it from a pop-up query, with the 4 main operators + - / * The syntax is {{query=&lt;operator&gt;|&lt;query content&gt;}}, so if you want to reduce the final result (say, for damage reduction) and the Roll20 query would be ?{Please enter DR|0} then the input for the button would be {{query=-|Please enter DR|0}} . Note that you don't need the surrounding braces or the question mark for the query content, as these need to be escaped. Currently there's no rounding possible, so multiply and divide won't work so well. So an example, to add a manual Damage Reduction popup to one of your buttons from above: !autobut --createButton {{name=Atk1Dam2}} {{math=-(damage.dmg2 + damage.rolldmg2)}} {{content=1-2}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 1 - Dam 2 (%)}} {{query=-|Damage reduction?|0}} Or, probably more useful for you since the button exists, just add it in with edit : !autobut --editButton {{name=Atk1Dam2}} {{query=-|Damage reduction?|0}} The other addition is the --autohide flag. This is also accessible straight through the !autobut --settings menu. It should default to true, and it should hide any buttons which didn't find a result in the roll. Hopefully this means you'll no longer get spammed for a skill roll (since PF doesn't have a separate template for that), and also since you've split into so many buttons, you should only be getting the buttons which found a value in the roll. It's still experimental so it isn't pushed to the main file - it's only available from the folder linked above until I get time to test it more, add some rounding options to the Query thing (useful for 5e's percentage based resistance) and whatever other bugs come up.
1663410110

Edited 1663426834
Oosh said: Yeah, the extra complexity of 3.5 definitely makes this a much harder fit than 5e. That said, I'll see if I can add a couple of things in to make your life easier - for starters, there are a couple of ways to reduce buttons spam. The one I'm leaning towards is an option to auto-hide any buttons where the math works out to 0 (99% of cases this means none of the properties were found - the script supplies them all as '0' to prevent the math functions crashing). This would reduce the number of buttons you see on a normal roll, and it would remove the button prompt entirely for a skill roll, since none of those damage properties would have a value. If it works the way I'm thinking it will, you won't have to hide or show buttons any more, either! I'll give this approach a quick test and see how it goes. Sean R. said: Oosh, I have one more issue that maybe you can help me resolve.&nbsp; When I hit a button, then select a character, I am getting the expected results, but then I get a gm message that doesn't seem to apply.&nbsp; I changed my HPs to Bar 3 which works when I hit a button and select a token, but I think this message is locked into Bar 1 somehow.&nbsp; Here is a picture. Is there a way to fix this gm messaging? You are 100% correct - mind must have been wandering as I did hard code bar1 in to the report template. I've patched the script to 0.6.2 if you want a quick fix for the reporting. Thanks for finding (and solving) the mistake! Oosh, 0.6.2 fixed the bar reporting.&nbsp; Thank you.&nbsp; I'm going to look though and test the next option. Sean EDIT: Oosh said: Ok, I've got an experimental version here if you're interested, 0.6.5. It adds queries which will run after the main math function which adds all the damage together. It's only accessible through --createbutton and --editbutton currently. Since it runs after the main math function, you can do a final operation on it from a pop-up query, with the 4 main operators + - / * The syntax is {{query=&lt;operator&gt;|&lt;query content&gt;}}, so if you want to reduce the final result (say, for damage reduction) and the Roll20 query would be ?{Please enter DR|0} then the input for the button would be {{query=-|Please enter DR|0}} . Note that you don't need the surrounding braces or the question mark for the query content, as these need to be escaped. Currently there's no rounding possible, so multiply and divide won't work so well. So an example, to add a manual Damage Reduction popup to one of your buttons from above: !autobut --createButton {{name=Atk1Dam2}} {{math=-(damage.dmg2 + damage.rolldmg2)}} {{content=1-2}} {{style=font-family: sans-serif; color: black}} {{tooltip=Atk 1 - Dam 2 (%)}} {{query=-|Damage reduction?|0}} Or, probably more useful for you since the button exists, just add it in with edit : !autobut --editButton {{name=Atk1Dam2}} {{query=-|Damage reduction?|0}} The other addition is the --autohide flag. This is also accessible straight through the !autobut --settings menu. It should default to true, and it should hide any buttons which didn't find a result in the roll. Hopefully this means you'll no longer get spammed for a skill roll (since PF doesn't have a separate template for that), and also since you've split into so many buttons, you should only be getting the buttons which found a value in the roll. It's still experimental so it isn't pushed to the main file - it's only available from the folder linked above until I get time to test it more, add some rounding options to the Query thing (useful for 5e's percentage based resistance) and whatever other bugs come up. Oosh, Excellent!&nbsp; I've installed the 0.6.5 offshoot.&nbsp; TLDR - It is awesome! To start, I'm not sure about the query use yet.&nbsp; The idea of the button is streamlining the quickness of applying the damage and speeding up gameplay.&nbsp; The query is handy, but not all of the time, and too bulky when it is not in use.&nbsp; I think the buttons that add back a static DR amount would work as my compromise.&nbsp; That said, having the feature there is definitely nice if the game gets to higher levels, where virtually everything has some built-in DR. ----------- The BIG helper is the -autohide reporting!&nbsp;&nbsp; This is amazing.&nbsp; Now I can put in all of the buttons and only the ones necessary show.&nbsp; That is HUGE for 3.5 games and offshoots.&nbsp; There are a few interesting things happening here.&nbsp; 1) All normal rolls (not identified as a crit in the attack), still roll crit damage and are reporting that, even though you would not see that in the returned attack/damage template.&nbsp;&nbsp; My assumption is that the game calls for these values regardless, and they just don't get shown when not necessary, yet the listener is picking them up.&nbsp; This is not a big deal, but I thought I'd show it to you. ( each of the arrows is pointing to the crit value that is associated with roll even if it is not be actively used) 2) The big trick with this is making sure you order all of the buttons correctly and test the order with one of the PC or NPC Button Test characters that makes and crits every roll, then go back to a normal game play mode and use it.&nbsp; I'm up to 45 used buttons in the set. ( PC Button Test - Note: Additional attacks 1-3 are roll sets 8-10) ( NPC Button Test - Note: only uses roll sets 1-9) So this is all fantastic! Here is a normal attack from a player's Monk Character with Flurry of Blows. ( So awesome!&nbsp; It only calls the buttons that have a value associated with them (but with the crits unused still reporting, again, not the end of the world.) ---------------------- So Oosh, this is awesome.&nbsp; Thank you again. 3) It makes me wonder, and I really don't know if this is possible.... but wouldn't it make sense to be able to just click on the returned damage in the original template, and just apply that to a token?&nbsp; Roll20 would be so much easier for all uses if this was a built in feature.....&nbsp; ---------- I'm going to finish writing and adding all of the possible buttons for a pathfinder game into my list.&nbsp; Maybe this helps you write up a sheet option for someone else.&nbsp; Please let me know if I can be useful in any other way!&nbsp; I really appreciate you taking time out to explain and expand your code!&nbsp; Awesome!&nbsp; I definitely owe you! Sean
1663426345

Edited 1663426897
Oosh
Sheet Author
API Scripter
Thanks for the feedback Sean. I'll address #3 first - this script is actually pinched (the idea, not the code) from another piece of software which *does* put the buttons in the roll template. That's a much cleaner way to do it, but needs to be done on the character sheet level. As you can see with a 3.5-like, that's extremely difficult to streamline with so many possible attacks and so many possible resistances. I doubt this will ever happen with a 3.5-like system on Roll20. It's a relatively straight-forward job for the 5e sheet, but that's up to Roll20 since it's an internal sheet. So... yes! Excellent suggestion, but not one I can deal with since I'm not in charge of the sheet :) Regarding crit damage - yep, you're right in your assumption. The roll button on most character sheets/systems will roll crit damage before it knows whether it needs it, and after the roll, the roll template will hide the parts that aren't required. There's no real way around that on the script side unfortunately - that needs some hand-crafted attention for each character sheet with the newer Custom Roll Parsing. This issue did come up in discussing the 5e sheet which is much simpler, but even then, trying to detect whether you should hide the crit buttons or not is extremely hard to do in a foolproof way.&nbsp; There's also the added benefit of having the crit button show up when it "shouldn't", for cases like (in 5e, can't remember the 3.5 rules) when a target is incapacitated - it's an auto crit from melee range, so rather than make someone keep rolling until they get a nat 20, or edit the attack to auto-crit, you already have the crit button there with crit damage rolled. A small compensation for the otherwise hacky method used by most character sheets :) Quick example from the 5e sheet, you can see the total damage of the attaack was only 20, but the hover text of the crit button still shows it'll do 30 damage. The damage has already been rolled and is fully visible in the chat message sent to the script sandbox: With the {{query}} thing - I'm not overly happy with how I implemented it, and I didn't think about the annoying popup. I probably should have - back when I was actually playing stuff on Roll20 and using macros, I moved away from queries because I got completely sick of dealing with the popups. So I won't be at all offended if you're finding it useless - I'll find a better way to implement it. Maybe some way of specifying some attributes to drag from the targeted character sheet (like @{selected|fire_resistance} ) and being able to use that directly in the math. I just worry about the reliablitiy of that method - it's very hit and miss on the 5e sheet, but might be more reliable on the PF sheet. If it's something clean-cut, like "fire_damage_resistance: 5", it's potentially usable by the script.
1663426741

Edited 1663427645
Oosh said: Thanks for the feedback Sean. I'll address #3 first - this script is actually pinched (the idea, not the code) from another piece of software which *does* put the buttons in the roll template. That's a much cleaner way to do it, but needs to be done on the character sheet level. As you can see with a 3.5-like, that's extremely difficult to streamline with so many possible attacks and so many possible resistances. I doubt this will ever happen with a 3.5-like system on Roll20. It's a relatively straight-forward job for the 5e sheet, but that's up to Roll20 since it's an internal sheet. So... yes! Excellent suggestion, but not one I can deal with since I'm not in charge of the sheet :) Regarding crit damage - yep, you're right in your assumption. The roll button on most character sheets/systems will roll crit damage before it knows whether it needs it, and after the roll, the roll template will hide the parts that aren't required. There's no real way around that on the script side unfortunately - that needs some hand-crafted attention for each character sheet with the newer Custom Roll Parsing. This issue did come up in discussing the 5e sheet which is much simpler, but even then, trying to detect whether you should hide the crit buttons or not is extremely hard to do in a foolproof way.&nbsp; There's also the added benefit of having the crit button show up when it "shouldn't", for cases like (in 5e, can't remember the 3.5 rules) when a target is incapacitated - it's an auto crit from melee range, so rather than make someone keep rolling until they get a nat 20, or edit the attack to auto-crit, you already have the crit button there with crit damage rolled. A small compensation for the otherwise hacky method used by most character sheets :) With the {{query}} thing - I'm not overly happy with how I implemented it, and I didn't think about the annoying popup. I probably should have - back when I was actually playing stuff on Roll20 and using macros, I moved away from queries because I got completely sick of dealing with the popups. So I won't be at all offended if you're finding it useless - I'll find a better way to implement it. Maybe some way of specifying some attributes to drag from the targeted character sheet (like @{selected|fire_resistance} ) and being able to use that directly in the math. I just worry about the reliability of&nbsp; that method - it's hit and miss on the 5e sheet. Oosh, Well, you really helped my gameplay out.&nbsp; I've tested in a variety of situation with both PCs and NPCs and it works really well.&nbsp;&nbsp; If there is anything else I can do or test please let me know.&nbsp; I posted my whole code up above in an edited post.&nbsp; What I would do is interlace the attacks and the crits so that the crit comes right after the attack; that will make ordering a lot easier.&nbsp; The symbol is used for crits is from the sheet and it just made sense that it follows the attack button it matches with.&nbsp; Anyhow, thank you again!&nbsp;&nbsp; Did I say thanks! EDIT: Hmm, I think I could use the query for DR, just have it set to a button and have different values other than the standards.&nbsp;&nbsp; There are a lot of DR 1 - 4 situations, also DR 12 occasionally. Sean
1663427644

Edited 1663427703
Oosh
Sheet Author
API Scripter
Excellent! Glad you found it helpful. I can probably add an auto-sort function in there, it would like be fairly 'dumb' though - just in ASCII order. But still, if you're naming the buttons systematically as you are, and you later added an "Att1Dmg3" into the mix, the auto sort would slot it right into where it belongs. It just wouldn't be much help with randomly named buttons, since they're not in alphabetical order. Easy to implement though if you think it would be helpful. If there's anything else you can think of to streamline the process, let me know.
Oosh said: Excellent! Glad you found it helpful. I can probably add an auto-sort function in there, it would like be fairly 'dumb' though. But still, if you're naming the buttons systematically as you are, and you later added an "Att1Dmg3" into the mix, the auto sort would slot it right into where it belongs. It just wouldn't be much help with randomly named buttons, since they're not in alphabetical order. Easy to do though if you think it would be helpful. If there's anything else you can think of to streamline the process, let me know. Oosh, Autosort could come in handy if you are building pre-loaded sheets for other systems and labeled buttons correctly.&nbsp; I only play with Pathfinder for Roll20 and 5e, but I think that this is THE tool to speed up combat.
1663727626

Edited 1663728494
Oosh
Sheet Author
API Scripter
v0.6.5 Experimental Only available from the xv0.6.5 folder , not the root repo folder. This version might still need some cleaning up, but adds some new features. It should be ready to merge to the main folder soon, and probably to 1-click from there. Features: Queries - Queries can be added to the buttons which will run when clicked (not at math function time), so the same button can be used to give different numbers. The format is {{query=&lt;operator&gt;|&lt;query string&gt;}} . So if you want to subtract a number from the result, the syntax would be: {{query=-|Lower the damage by how much?|0}} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The query string is that same as the Roll20 syntax, but without the surrounding ?{ } . So you can define a default (like above), or even define limited&nbsp;options if you prefer. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; With multiplication and division, the script will default to rounding down . If you want to round up, you can supply a plus after the operator: {{query=*+|Multiply the damage by how much, rounded up?|0}} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Finally, the keyword %%MODIFIER%% can be use to insert the final result. You can use this to display the unmodified damage in the query. Putting&nbsp;that all together, here are a couple of example buttons, one to supply a flat Damage Reduction (like Heavy Armor Master), the other to supply a percentage Damage Multiplier (like a character with Evasion + Resistance getting a 0.25 multiplier due to two lots of resistance): !autobut --createbutton {{name=drPercent}} {{math=-(damage.total)}} {{query=*|Damage Resistance multiplier? (%%MODIFIER%% damage)|0}} {{content=DR&amp;percnt;}} {{tooltip=Damage Resist &amp;percnt; (%)}} {{style=font-family:sans-serif; font-weight: bold; color: darkblue; font-size: 0.9em;}} !autobut --createbutton {{name=drFlat}} {{math=-(damage.total)}} {{query=-|Damage Resistance amount? (%%MODIFIER%% damage)|0}} {{content=DR+}} {{tooltip=Damage Resist flat (%)}} {{style=font-family:sans-serif; font-weight: bold; color: darkblue; font-size: 0.9em;}} &nbsp;&nbsp;&nbsp; To handle cases of flat damage mitigation that could exceed the damage itself (causing a negative number, and the damage to do healing) there's a new options flag, --negatives. --negatives - Can be toggled from --settings, default is off . This prevents a query from modifying the original damage below 0. In effect, this will stop healing from cause damage, and damage from causing healing, through a large query modifier being applied to the calculated damage (e.g. a Heavy Armor Master character getting hit for 2 damage). This shouldn't ever need to be turned on for 5e. --autosort - Can be toggled from --settings, default is off . This sorts the buttons by Unicode order before posting to chat. Note that this doesn't permanently change the button order (--reorderButtons still does that) but simply sorts them before posting to chat. So you can toggle this off to go back to the default order. Unicode order is 0 =&gt; A =&gt; z, or numbers, then uppercase, then lowercase letters. --autohide - Can be toggled from --settings, default is on . This will hide any button which returns a zero final result from its math function. I may expand this to allow a custom condition for hiding the button. If all buttons return a 0, the button bar will not be posted at all. Changes: createButton - newly created buttons will now be enabled (shown) by default. Todo: editButton - add an option to rename the button, to make autosort a bit more useful more default buttons! - with the new query system, I should probably add more default buttons, like Primary Damage / Primary Damage w Custom Damage Resistance etc. etc.
Really great script already. I just wonder if the "hldmg" is implemented right or if i get something wrong. To access that damage i though a damage.hldmg is the right way I try to make 3 buttons for dmg1 only, dmg2 only and "dmg1 and hldmg" only. !autobutton --editbutton {{name=LeftOnly}} {{math=-(damage.dmg1)}} !autobutton --editbutton {{name=RightOnly}} {{math=-(damage.dmg2)}} are working fine. BUT !autobutton --editbutton {{name=Uponly}} {{math=-(damage.dmg1 + damage.hldmg)}} just give the same as 1. and&nbsp; damage.hldmg only returns&nbsp; a zero.
1663834504
Oosh
Sheet Author
API Scripter
Ahh, good find. While the higher level cast properties were being added correctly to the built-in damage buttons, they weren't available to custom buttons. I've fixed it in the experimental build above only (xv0.6.5) , I'll get it merged into the main version soon. Cheers for finding that!
1664152994

Edited 1664253931
Oosh
Sheet Author
API Scripter
v0.7.0 release: Main stream now updated to v0.7.0 Features: Queries can be used to perform a final operation on results before applying to token Buttons can be cloned and renamed Loads of new 5e buttons added, existing buttons given a facelift. See this fella for details, most of them are hidden by default. Button facade redesign, there are now 3 layers of content &amp; style that can be applied Dark Mode can now be switched on Multiattack can be switched on for NPC's Allow Negatives: by default, negative values will now be ignored (preventing damage from causing healing, or vice versa) Autohide will hide buttons where no value is found (doesn't work for 5e crits due to roll template design) Changes: Two of the default buttons were renamed - this should be resolved in the upgrade path, requiring no action Added prompts for some actions, like deleting buttons from the UI New layers have been added to buttons, but won't effect existing custom buttons Buttons are now enabled upon creation, instead of hidden Numerous CSS tweaks and changes Bugfixes: Fixed bug preventing queries from working in internal buttons Fixed hldmg issue where it couldn't be used in custom buttons for 5e Fixed report - bar number was hard-coded in. Will now match the bar selected for token modification See first post for details, second post for button details on both default and custom buttons.
1664246065

Edited 1664246258
Oosh
Sheet Author
API Scripter
Is anyone having an issue with vertically misaligned buttons? I've had this screenshot reported: But have been unable to reproduce it. If anyone is getting this output (or similar) could you please let me know the browser, OS and screen resolution? Ta. Edit - for reference, it should look like this:
1664327288

Edited 1664327314
Oosh
Sheet Author
API Scripter
v0.7.2 A couple of minor fixes and tweaks. -repo Changes: Version number now reported at the top of the --settings menu "Image Icons" setting added to --settings menu. This will render the button labels as images instead of fonts, which will fix font alignment issues on MacOS / ChromeOS. Default is off It is also possible to use your own images as button labels, by passing {{content=&lt;img src=" myImageURL "/&gt;}} to either --createButton or --editButton
1664419189

Edited 1664419966
I'm getting this problem where it's stacking the old buttons on&nbsp; top of the new ones and I can't figure out why I still don't know why it happened but I fixed it, I just deleted the script and then put it back in
1664455368

Edited 1664455472
Oosh
Sheet Author
API Scripter
That's a really interesting screenshot... do you remember which version you upgraded from? It looks like you got a bunch of updates at once - the CSS movement, the new icons, and the fix so the correct attack name shows up instead of the NPC name (swarm of rats). I'm hoping the double post of the button bar was just from a sandbox ghost, where you get the previous script&nbsp; still firing for some time after restarting. If there's any other issues let me know - an uninstall will likely fix it. edit - another thing with that screenshot.... looks like the bump CSS looks a bit weird in dark mode, where it cuts into the previous post. I'll have to look into that, but it might be worth enabling dark mode in the --settings menu to make it look a bit less weird.
Oosh said: That's a really interesting screenshot... do you remember which version you upgraded from? It looks like you got a bunch of updates at once - the CSS movement, the new icons, and the fix so the correct attack name shows up instead of the NPC name (swarm of rats). I'm hoping the double post of the button bar was just from a sandbox ghost, where you get the previous script&nbsp; still firing for some time after restarting. If there's any other issues let me know - an uninstall will likely fix it. edit - another thing with that screenshot.... looks like the bump CSS looks a bit weird in dark mode, where it cuts into the previous post. I'll have to look into that, but it might be worth enabling dark mode in the --settings menu to make it look a bit less weird. I don't remember off the top of my head but yeah I'm pretty sure it was a ghost, especially since deleting the script and starting over fixed it.&nbsp; Yes once I got everything working I put it into dark mode.
1665446321

Edited 1665446527
Sorry if this has already been asked but I have searched and could not find a solution.&nbsp; Every time I run this script (v.0.7.2) it deletes all values in Bar 1(green). I have not modified anything and have the pre-requisite TokenMod installed.&nbsp; Ideally, I would like to have Bar 3(red) affected instead but when I type --settings I do not get the settings option.&nbsp;&nbsp;
1665479184

Edited 1665479258
Oosh
Sheet Author
API Scripter
Hrmmm.... is everything in every token's bar1 being deleted? This definitely isn't something the script should do. Additionally, if --settings isn't working then it sounds like either the script has failed or the entire sandbox is down. Which other scripts do you have installed (a screenshot of the scripts tabs is good, as it roughly shows install order). Also, do other scripts respond to CLI commands, like !token-mod --help ? Are there any errors in the sandbox log? And just a sanity check - you're typing !autobutton --settings to bring up the settings menu?
1665485759
timmaugh
Pro
API Scripter
I think there's an issue with the latest TokenMod release that can account for the lost values in your linked bars. Reverting to the previous version in the one-click has been the workaround until Aaron runs the bug down.
1665492293
Oosh
Sheet Author
API Scripter
Ah, thanks Tim. That doesn't account for the --settings UI not working, though.... you can use the cli to change the bar with this though: !autobutton --bar 3
for some reason i added another compendium book full of monster tokens, but whenever i try to attack and use the auto button it just rolls to hit and nothing else but on the first book i had all those monster work and roll damage as well?
1665954106
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
cody s. said: for some reason i added another compendium book full of monster tokens, but whenever i try to attack and use the auto button it just rolls to hit and nothing else but on the first book i had all those monster work and roll damage as well? Hi Cody! That is a behavior you can change on your campaign settings page. Your monsters are defaulting to not roll hit and damage at the same time. You could change each one on their settings tab, but the best way is to change the default on the Campaign Settings Page for your campaign, then launch the game, go to the Miscellaneous section under the settings tab (gear icon in the right hand tab), and choose Apply Default Settings. Choose that setting to change from the provided list and apply. There is a thin, easy-to-miss progress bar. You will have to wait for it to complete, and it may take a few minutes if you have added a large number of creatures.
1668362711

Edited 1668362773
Hi everyone, I love that you added reporting! But the way it is currently set up I can't really set it to public without spoiling how much HP a monster has. It's one thing to say "the monster is looking pretty beat up and bloodied" but it's totally different to say "the monster now has 80 HP left" which kind of ruins the stakes/tension. Is there any way to change how the reporting is done?&nbsp; This is currently how it is reporting:&nbsp; 13 damage was dealt&nbsp; : (Tarrasque) 93HP -&gt; 80HP Instead, would it be possible to have it reported like:&nbsp; (Tarrasque) damaged for 13 HP Or if you are healing the token:&nbsp; &nbsp; (Tarrasque) healed for 13 HP Slightly different wording and syntax but still conveys the same exact information.
1668378038
Oosh
Sheet Author
API Scripter
I can definitely look at that when I get a moment - I'll see what I can do in terms of allowing some customisation instead of making a hard-coded change, as some people might like the way it currently works - it's a little more robust as a private log in its current state.
Oosh said: I can definitely look at that when I get a moment - I'll see what I can do in terms of allowing some customisation instead of making a hard-coded change, as some people might like the way it currently works - it's a little more robust as a private log in its current state. Thank you so much! I appreciate your time and help.
Strange, went to try and add this code to a new game I was starting today and it doesnt seem to be allowing me to paste the code into the API. Just doesn't work as if its too long. Something change with the new updates?
1672447639
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
GreyTheDM said: Strange, went to try and add this code to a new game I was starting today and it doesnt seem to be allowing me to paste the code into the API. Just doesn't work as if its too long. Something change with the new updates? Make sure that you are pressing the "Raw" button on the repo and only copying the text of the script itself.
Good suggestion, but that appears to not work as well. It seems to be the number of code lines. I can copy individual lines but when I try to copy the whole thing just nothing happens. If I try to copy it 100 lines at a time it seems to work, but not sure if this is a glitch.
1672699822
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
GreyTheDM said: Good suggestion, but that appears to not work as well. It seems to be the number of code lines. I can copy individual lines but when I try to copy the whole thing just nothing happens. If I try to copy it 100 lines at a time it seems to work, but not sure if this is a glitch. That's a strangeness. I regularly copy and paste entire scripts, many, many times that size.