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 .
×

[Script] Supernotes 0.3.0 - Now With a Quick Menu, More Templates, Bug Fixes, and more

1790277981

Edited 1790278734
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
(Roll20 closes threads after a few months of inactivity, so this is a fresh thread replacing the original .) This update adds a couple of new commands and templates, plus a thorough cleanup pass under the hood. Full docs are below; here's what's new up top. New in 0.3.0: New: --menu command. Whispers a clickable button menu of every option for the selected token(s), so you don't have to remember or retype flags. GMs see both the GM-only buttons and the player-facing buttons; players only see their own. New: --card command. Combines the token's image and its GM notes into a single report. If the notes don't already contain a picture, the token's own image is used automatically. New: webp support. Images work correctly now whether they're old-style .png/.jpg uploads or Roll20's newer auto-converted .webp images, cache-busted links included. New templates: dark55 and light55 . Styles that complement the D&D 5.5e (2024) sheet's dark and light modes. New: Configuration now also toggles the 'Make Handout' button and Dark Mode , alongside the existing 'Send to Players' footer toggle. New: Headers in notes and bios now pick up the color of whatever template you're using , instead of always showing Roll20's default heading color. New: Help now lives in its own handout instead of dumping everything into chat. Full Documentation 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 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. Commands !gmnote - whispers the note to the GM !pcnote - sends the note to all players !selfnote - whispers to the sender of the command Arguments --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 the 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 text set on the selected token. This option does not require the token to have an associated character. --tokenimage - Pulls the token's own image (not the character's avatar). This option does not require the token to have an associated character. --card (New) - Combines the token's image and its GM notes into a single report. If the notes don't already contain a picture, the token's own image is used automatically. --menu (New) - Whispers a clickable button menu covering every option above, for the selected token(s), so you don't have to remember or retype flags. If you're the GM, you'll see a row of GM-only buttons plus a row of player-facing buttons; players only see the player-facing row. --notitle - This option suppresses the title in the chat output. It's useful for showing an image or note to a player without clueing them in on what it's about — for instance, revealing an image of a monster without revealing its name. Example: !pcnote --image --notitle will pull the first of any images from the token's associated character sheet and send it to chat without a title. Like the other arguments here (--id, --handout, --template, etc.), --notitle can go anywhere in the command — none of them need to be in a particular 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 associated 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, now via its own handout. --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, the 'Make Handout' button, and Dark Mode. Special Syntax: ----- (5 dashes in a row) indicates that anything appearing after this line should only be displayed on a !gmnote command. In this way, a GM could have public information in a note, but keep certain information secret — even if that same note is later sent to the table with !pcnote. Examples: !pcnote --bio will send the contents of the selected character's bio to the chat for all players to see. !gmnote --charnote will whisper the character's GM notes to the GM !gmnote --menu will whisper a clickable menu of every available option for the selected token Templates Any Supernotes command can receive a template argument, allowing you to choose from between more than 25 custom templates that should cover most common genres. You can of course, continue to use any of the supported sheet roll templates: Default, D&D 5th Edition by Roll20, 5e Shaped, Pathfinder by Roll20, Pathfinder Community, Pathfinder 2e by Roll20, Starfinder, and Call of Cthulhu 7th Edition by Roll20. Templates can be accessed by adding --template|templatename anywhere in the message, along with any of the standard Supernotes arguments — it doesn't need to come right after the base command. Examples: !gmnote --template|crt !pcnote --template|notebook --bio !pcnote --template|faraway --tokenimage All templates can use the "Send to Players" and "Make Handout" buttons at the bottom, though any note used to create a handout will use the default styling of a Roll20 handout. The text editor is too finicky otherwise and will result in better display across platforms and devices. I have tried to use web-safe fonts throughout (Mod scripts cannot use Google Fonts). All templates (including roll templates) convert buttons to inline buttons, to eliminate the "Big Pink Button" syndrome, and headers now pick up the color of whichever template you're using. List of Templates generic - Just the facts, ma'am. Nothing fancy here. dark - As above, but in reverse. crt - Retro greenscreen for hacking and cyberpunk. Or for reports on that xenomorph hiding on your ship. notebook - You know, for kids. Who like to ride bikes. Maybe they attend a school and fight vampires or rescue lost extraterrestrials. gothic - Classic noire horror for contending with Universal monsters or maybe contending with elder gods. apoc - Messages scrawled on a wall. Crumbling and ancient, like the world that was. scroll - High fantasy. Or low fantasy—we don't judge. lcars - For opening hailing frequencies and to boldly split infinitives that no one has split before! faraway - No animated title crawl, but still has that space wizard feel. steam - Gears and brass have changed my life. western - Return with us now to those thrilling days of yesteryear! wizard - Like the ones that live on the coast. dragon - Three-fivey goodness! gate3 - For folks who like the GOTY based on D&D. choices - A second style, suitable for the same crowd. roll20light - For when you want your notes to have the feeling of authority. roll20dark - As above, but.... dark. news - Extra! Extra! Read all about it! You can even see the ink bleeding through from the other side of the newsprint. treasure - For listing all that loot. vault - A comforting style for sheltered people. path - A style that works well with PF2 Adventure Paths. osrblue - Gygax-approved. Maybe. The graph paper even has yellowed edges. scroll2 - An alternative to scroll, thats even scrollier. roman - Bonus style! This was added in a previous version, but was only documented mid-thread. strange - Other kids who ride bikes and play D&D. dark55 (New) - A style to complement the D&D 5.5e (2024) Sheet dark mode. light55 (New) - A style to complement the D&D 5.5e (2024) Sheet light mode. Script Synergy Templates have been exposed to other scripts under the object "Supernotes_Templates". These templates can be called in ScriptCards macros. It also has good synergy with the Reporter script (also on One Click). This script will work well with the following Roll20 Tips n 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 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, whether a 'Make Handout' button appears alongside it, and whether Dark Mode is used for templates/sheets with a dark background. 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 Call of Cthulhu 7th Edition by Roll20 Changelog 0.0.5 Expanded utility of "--image" argument 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 argument 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 0.2.0 Added custom templates, and configured base script to return in-line text links instead of Roll20 Big Pink Buttons. 0.2.1 Fixed parsing bug and added two new templates - wizard and dragon 0.2.2 Minor tweaks. Corrected catch line in API_Meta 0.2.3 Minor fix to roman template 0.2.4 Added 10 new templates 0.2.6 Reworked the Help system to use its own handout 0.2.7 Added the dark55 and light55 templates for the D&D 5.5e (2024) sheet 0.2.8 Added support for webp images 0.3.0 Added the --menu command (a clickable options menu for the selected token(s)), the --card command (combines a token's image and GM notes into one report), and Make Handout/Dark Mode toggles in --config. Also includes a large cleanup and bug-fix pass under the hood.
1790277997
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Reserved