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] Supernotes

1634069644

Edited 1682894819
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Newest thread can be found here The original thread for this script autoclosed a month or two ago. I have made some updates to it and am opening a new thread. Supernotes was expanded from a short script by the Aaron when he created his gmnotes script. I added a lot of formatting and options. And then I had the Aaron check my work. Any errors however, are on my head. This script pulls the contents from a token's GM Notes field, as well as other fields that are not usually accessible to macros. If the token represents a character, you can optionally pull in the Bio or GM notes from the character. It can also return graphics and tooltip info. The user can decide whether to whisper the notes to the GM or broadcast them to all players. There is an option to add a footer to notes whispered to the GM. This footer creates a chat button to give the option of sending the notes on to the players. Finally, you can direct the note either to chat, or to a named handout. Images, API Command Buttons, Links and most special characters should pass through without issue. Images written in the markdown form of [x](imageURL) should parse correctly in both chat and handouts. This script as written is optimized for the D&D 5th Edition by Roll20 sheet, but can be adapted for most common sheets using the Configuration command below. Supernotes available for One-Click install. Commands: !gmnote whispers the note to the GM !pcnote sends the note to all players !selfnote whispers to the sender of the command Parameters -- token Pulls notes from the selected token's gm notes field. This is optional. If it is missing, the script assumes --token. This option does not require the token to have an associated character. -- charnote Pulls notes from the gm notes field of the character assigned to a token. -- bio Pulls notes from the bio field of the character assigned to a token. -- avatar Pulls image from the avatar field of the character assigned to a token. -- image Pulls first image from the bio field of the character assigned to a token, if any exists. Otherwise returns notice that no artwork is available -- images Pulls all images from the bio field of the character assigned to a token, if any exist. Otherwise returns notice that no artwork is available -- image[number] Pulls indexed image from the bio field of the character assigned to a token, if any exist. --image1 will pull the first image, --image2 the second and so on. Otherwise returns first image if available. If no images are available, returns notice that no artwork is available -- tooltip Pulls the tooltip from a selected token. This option does not require the token to have an associated character. -- tokenimage Pulls all the image from a selected token. This option does not require the token to have an associated character. -- notitle This option suppresses the title in the chat output. It is useful for times when the GM might wish to show an image or note to the player without clueing them in wha the note is about. For instance, they may wish to reveal an image of a monster without revealing its name. This parameter can be added to any command. It is the only paramater for which this is true. Example !pcnote --image --notitle will pull the first of any images from the token's associate character sheet and send it to the chat without a title. --notitle may be added to the command in any order. -- id supply this with a token id, and the script will attempt to read the notes associated with a specific token, or the character associate with that token. There is no space between --id and the token id. Only one token id may be passed. -- handout|Handout Name| If this is present in the arguments, the note will be sent to a handout instead of chat. This can allow a note to remain usable without scrolling through the chat. It can also be used as a sort of floating palette. Notes in handouts can be updated. Running the macro again will regenerate the note. The string in between pipes will be used as the name of the note handout. If no handout by that name exists, Supernotes will create one and post a link in chat to open it. The title must be placed between two pipes. --handout|My Handout| will work. --handout|My Handout will fail. A note handout automatically creates a horizontal rule at the top of the handout. Anything typed manually above that rule will be persistent. Supernotes will not overwrite this portion. You can use this area to create Journal Command Buttons to generate new notes or to give some context to the existing note. All updates are live. -- help Displays help. -- config Returns a configuration dialog box that allows you to set which sheet's roll template to use, and to toggle the 'Send to Players' footer. Examples: !pcnote --bio  will send the contents of the selected characters bio to the chat for all players to see. !gmnote --charnote  will whisper the  character's  GMnotes to the GM This script will work well with the following Stupid Tricks (and many more): Invisible Tokens - The Notes Token (API version) Invisible Tokens - The Control Token Invisible Tokens - The Door Control Chat Menus Map Pins It also has good synergy with the Reporter script (also on One Configuration When first installed, Supernotes is configured for the default roll template. It will display a config dialog box at startup that will allow you to choose a roll template based on your character sheet of choice, as well as the option to toggle whether you want the 'Send to Players' footer button to appear. You will need to edit the code of the script if you wish to create a custom configuration, or contact keithcurtis on the Roll20 forum and request an addition. The pre-installed sheets are: Default Template D&D 5th Edition by Roll20 5e Shaped, Pathfinder by Roll20 Pathfinder Community Pathfinder 2e by Roll20 Starfinder For reference, here are the roll templates used for each sheet: Default Template const template = 'default'; const title = 'name'; const theText = ' '; D&D 5th Edition by Roll20 const template = 'npcaction'; const title = 'rname'; const theText = 'description'; 5e Shaped const template = '5e-shaped'; const title = 'title' const theText = 'text_big' Pathfinder Community const template = 'pf_generic'; const title = 'name' const theText = 'description' Pathfinder Official by Roll20 const template = 'npc'; const title = 'name' const theText = 'descflag=1}} {{desc' Pathfinder 2e by Roll20 const template = 'rolls'; const title = 'header' const theText = 'notes_show=[[1]]}} {{notes' Starfinder by Roll20 const template = 'sf_generic'; const title = 'title' const theText = 'buttons0' 0.0.5 Expanded utility of "--image" parameter 0.0.6 Added auto-configuration for most popular sheets 0.0.7 Fixed for breaking of certain accented characters and diacriticals 0.0.8 Added --notitle parameter 0.0.9 Added !selfnote 0.0.91 Improved pathfinder template usage, 0.1.0 Added the ability to use token id 0.1.1 Added Handout feature
1634069654
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Reserved.
1634069937
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Persephone wrote: The current way for the script to show a token image in chat requires a linked character. Would it be possible to get the image for a token that doesn't have a character sheet? (like for a no-stats NPC?) This function should work now. Supernotes will return token GM notes and the token image on unlinked tokens. I thought I had caught tooltips for unlinked tokens, but I'll get that in the next update.
1634070055
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Also, Stupid Supernotes Trick: !gmnote --id@{target|token_id} will let you return a token note from an unselected token. Not sure how useful that is, but someone once asked me about it.
1634070395
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
New Feature: Handouts This follows the same general syntax and behavior as Reporter does: -- handout|Handout Name|  If this is present in the arguments, the note will be sent to a handout instead of chat. This can allow a note to remain usable without scrolling through the chat. It can also be used as a sort of floating palette. Notes in handouts can be updated. Running the macro again will regenerate the note. The string in between pipes will be used as the name of the note handout. If no handout by that name exists, Supernotes will create one and post a link in chat to open it. The title must be placed between two pipes.  --handout|My Handout|  will work.  --handout|My Handout  will fail. A note handout automatically creates a horizontal rule at the top of the handout. Anything typed manually above that rule will be persistent. Supernotes will not overwrite this portion. You can use this area to create Journal Command Buttons to generate new notes or to give some context to the existing note. All updates are live. This could be combined with the trick above. Create a handout with a map pin reading Journal Command button and you can target map pins to have the handout display their note contents without spamming chat, and to allow for easier reading and viewing of pictures. Images, API Command Buttons, Links and most special characters should pass through without issue. Images written in the markdown form of [x](imageURL) and buttons written in [button_name](macro) format should parse correctly in both chat and handouts.
Hi Keith! Any chance you could remove the extra log() statements? line 32    log(sender); line 61    log('HANDOUTTITLE is ' + handoutTitle); I can submit a pull request if you'd prefer. Thanks, Jim
1635978732
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Jim R. said: Hi Keith! Any chance you could remove the extra log() statements? line 32    log(sender); line 61    log('HANDOUTTITLE is ' + handoutTitle); I can submit a pull request if you'd prefer. Thanks, Jim Shoot. I try to remember to delete those before I update. I'll submit a pull. It should be fixed by next week's merge. Sorry for the noise.
1636002383

Edited 1642654978
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Pull request submitted. EDIT: Thread has auto-closed. New thread here , with improved Reporter Synergy and privacy line to separate public and secret parts of a GMNote.
Thanks Keith!