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 Update] ChatSetAttr 1.8 – now with inline command support

Hi - I was hoping you may be able to help with a query I have, which I posted here . I'll post it here too for reference: I'm hoping for a little bit of help. I know that I can do this on a 'global scale' in the roll20 game menu somewhere, but I'm trying to create a short macro, using ChatsSetAttr that will update some of the settings for selected NPC's. - This is for the Roll20 5e OLG Sheet. Set selected NPC's to: Roll Queries:   "Query Advantage" Whisper Rolls to DM:   Never NPC Name in Rolls:   Hide Could anyone help me out with the correct code for this please? Thanks!
1554314356
Jakob
Sheet Author
API Scripter
Oh, that's fun . From the linked thread, it looks like you want to set it to {{query=1}} ?{Advantage?|Normal Roll,&#123&#123normal=1&#125&#125 &#123&#123r2=[[0d20|Advantage,&#123&#123advantage=1&#125&#125 &#123&#123r2=[[@{d20}|Disadvantage,&#123&#123disadvantage=1&#125&#125 &#123&#123r2=[[@{d20}} including all the escapes? I'm sure that's possible, but it's a pain in the ass to actually write out. You also have to write it all in line because of how roll20 parses the braces (which you could escape, but let's not get crazy...). The following will maybe work. It might also break chat output, I have no idea. This has also made me realize that some interesting replacers are missing which would make this less of a pain to write. !setattr --rtype#{{query=1}} \ques{Advantage?\|Normal Roll,&#123&#123normal=1&#125&#125 &#123&#123r2=\lbrak\lbrak0d20\|Advantage,&#123&#123advantage=1&#125&#125 &#123&#123r2=\lbrak\lbrak\at{d20}\|Disadvantage,&#123&#123disadvantage=1&#125&#125 &#123&#123r2=\lbrak\lbrak\at{d20}} --sel Of course, you can combine it with the other two in one command if you want to.
1554315013
Jakob
Sheet Author
API Scripter
Oh, and mandatory disclaimer, put this into an ability, not a global macro, because global macros mess up the HTML entities.
1554315441
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thanks Jakob, as you could tell from the other thread, I was pretty sure it was possible, I'd just cringe away from trying to work it out.
1554400466

Edited 1554432701
Hi everyone, i want to create macros for adding Spells to a NCP-Char. I'am using ChatSetAttr and the OGL Sheet. At first everything worked fine for me: !setattr {{ --sel --repeating_spell-cantrip_-CREATE_spellname|Donnerschlag --repeating_spell-cantrip_-CREATE_spellschool|evocation --repeating_spell-cantrip_-CREATE_spellcastingtime|1 Aktion --repeating_spell-cantrip_-CREATE_spellrange|1,5m --repeating_spell-cantrip_-CREATE_spelloutput|ATTACK --repeating_spell-cantrip_-CREATE_spelldamage|1d6 --repeating_spell-cantrip_-CREATE_spellsave|Strength --repeating_spell-cantrip_-CREATE_spellsavesuccess|Kein Schaden --repeating_spell-cantrip_-CREATE_spelldamagetype|Schall --repeating_spell-cantrip_-CREATE_spell_damage_progression|Cantrip Dice --repeating_spell-cantrip_-CREATE_includedesc|on --repeating_spell-cantrip_-CREATE_spellcomp_materials|' ' --repeating_spell-cantrip_-CREATE_spellduration|Unmittelbar --repeating_spell-cantrip_-CREATE_innate|' ' --repeating_spell-cantrip_-CREATE_spelldescription|Du erzeugst an Deiner Position einen lauten Ton, der bis zu 30m weit hörbar ist. Jede Kreatur in Reichweite muss einen Konstitutionsrettungswurf ablegen. Bei einem misslungenem Rettungswurf erleidet die Kreatur 1W6 Schallschaden. --repeating_spell-cantrip_-CREATE_spellathigherlevels|Der Schaden des Zaubers steigt um 1W6, wenn Du die 5. Stufe (2W6), die 11. Stufe (3W6) und die 17. Stufe (4W6) erreichst. }} My problem is, that i am not able to identify the value or syntax to influence the checkboxes (ritual, concentration, components,...) I found the following parts in the html-code of the OGL: <input type="checkbox" name="attr_spellritual" value="{{ritual=1}}"> . . <input type="checkbox" name="attr_spellcomp_v" value="{{v=1}}" checked="checked"> After two days of try and error... --repeating_spell-cantrip_-CREATE_spellcomp_v|'v=1' --repeating_spell-cantrip_-CREATE_spellcomp_v|"v=1" --repeating_spell-cantrip_-CREATE_spellcomp_v|"{{v=1}}" --repeating_spell-cantrip_-CREATE_spellcomp_v|'{{v=1}}' --repeating_spell-cantrip_-CREATE_spellcomp_v|0 --repeating_spell-cantrip_-CREATE_spellcomp_v|1 --repeating_spell-cantrip_-CREATE_spellcomp_v|off --repeating_spell-cantrip_-CREATE_spellcomp_v|on,... i hope someone can push me in the right direction. Greetings Dirk
Hi again. I am still not able to bring my spellcreation macro to work. Here is how the actual macro looks like: !setattr {{ --sel --repeating_spell-cantrip_-CREATE_spellname|testspell_eng --repeating_spell-cantrip_-CREATE_spellschool|evocation --repeating_spell-cantrip_-CREATE_spellcastingtime|1 action --repeating_spell-cantrip_-CREATE_spellrange|60 feet --repeating_spell-cantrip_-CREATE_spelltarget|A creature within range --repeating_spell-cantrip_-CREATE_spell_ability|spell --repeating_spell-cantrip_-CREATE_spelloutput|ATTACK --repeating_spell-cantrip_-CREATE_spellattack|Ranged --repeating_spell-cantrip_-CREATE_spelldamage|1d8 --repeating_spell-cantrip_-CREATE_spelldamagetype|Cold --repeating_spell-cantrip_-CREATE_spell_damage_progression|Cantrip Dice --repeating_spell-cantrip_-CREATE_spellduration|Instantaneous --repeating_spell-cantrip_-CREATE_includedesc|off --repeating_spell-cantrip_-CREATE_spelldescription|Description test spell 1 --repeating_spell-cantrip_-CREATE_spellathigherlevels|Further description test spell 1. }} After using the macro the spell appears in the char sheet (OGL) and is clickable. When i click the spell only the description is going to the chat. No dice is rolled. It seem that the spell is not recognized as an atack spell. On the sheet it look identical to a drag and drop 'Ray of Frost' which will roll dice when clicked. I checked the config and the option for sheet workers is 'ON'. Any idea what is missing? Or is it really not possible like Kyle mentioned in another Thread? -------------------------------------------------------------------------------------------------- Kyle G. said: I believe I have found the issue. In short, I'm not sure what you want is possible. The sheet workers for the character sheet ensure only users can trigger specific sheet workers, such as creating an attack from a spell. Line 6480,  if(eventinfo.sourceType && eventinfo.sourceType === "sheetworker") {return;} , in the sheet worker completes the sheet worker before changes are made. I believe this line is to prevent other sheet workers within the sheet from calling each other and creating a infinite loop. It unfortunately also prevents other apis from calling this specific function as well. I could be entirely mistaken as this was just a coarsely look, but I remember at some point in the past that their was a distinction between sheetworkers and api for event source types. If so, then this likely isn't the issue. -------------------------------------------------------------------------------------------
1555994437
Jakob
Sheet Author
API Scripter
Hi Dirk, have you gotten the checkboxes to work? About the issue in your second post, it looks like this bug is the reason that this does not work (the sheet worker for spelloutput uses evenInfo.newValue). I wouldn't hold my breath waiting for Roll20 to fix it, however... I think have reported this before and they just ignored it.
Jakob said: Hi Dirk, have you gotten the checkboxes to work? About the issue in your second post, it looks like this bug is the reason that this does not work (the sheet worker for spelloutput uses evenInfo.newValue). I wouldn't hold my breath waiting for Roll20 to fix it, however... I think have reported this before and they just ignored it. Hi Jacob,  thx for the reply and the info about the known bug. i put the checkbox problem on a lower priority because of the whole 'macro-will-not-work-like-i-think' thing;).