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

Writing a batch of macros at once

1574586880

Edited 1574586952
I need to write about 20 macros and I'm looking for a way to avoid that.  I've written each one in a word processor, but initiating a macro, opening it, naming it, copying the script, pasting it in, and closing the macro, seems like a lot of repetitive work that should be automated.  Is there a script for that?  I'd prefer these be in the macro tab, but I could use a character sheet to contain them if that's easier. Thanks for any help!
1574629682
GiGs
Pro
Sheet Author
API Scripter
I dont know if there is a script already to do this, but it's possible to create one. I would suggest moving your scripts into a text file, or even a spreadsheet. A word processor might apply smart formatting to your macros which makes it harder for a script to interpret the code properly. Can you post here a couple of the macros here so we can see how to handle them to make a script for them?
GiGs, thanks for the help.  I know I should be using BBEdit, but I was lazy and opened the first thing to hand. Anyway, the plan is the item saving throw table as a sort of macro flow chart: click on the item save macro to get a menu from which to (1) choose the substance, which leads to a menu from which to (2) choose the attack form which (3) calls the saving throw roll. The first macro that creates the first menu (see below) is done and added, and then I created all the macros of the second type, and the first set from the third type.  Then I realized how much I was going to dislike typing them all in, and I lost some enthusiasm. This is the initial macro to start the whole thing: /w @{selected|token_name} &{template:2Edefault}{{Choose material:}}{{[Bone or Ivory](! #SAVE-BONE) [Cloth](! #SAVE-CLOTH) [Glass](! #SAVE-GLASS) [Leather](! #SAVE-LEATHER) [Metal](! #SAVE-METAL) [Oil](! #SAVE-OIL) [Paper](! #SAVE-PAPER) [Potion](! #SAVE-POTION) [Pottery](! #SAVE-POTTERY) [Rock](! #SAVE-ROCK) [Rope](! #SAVE-ROPE) [Wood, thick](! #SAVE-WOOD-THICK) [Wood, thin](! #SAVE-WOOD-THIN)}} Then for each button in step one, a macro like this: SAVE-BONE /w &{template:2Edefault}{{Bone or Ivory vs }}{{[ACID](! #SAVE-BONE-ACID) [CRUSHING-BLOW](! #SAVE-BONE-CRUSHING-BLOW) [DISINTEGRATION](! #SAVE-BONE-DISINTEGRATION) [FALL](! #SAVE-BONE-FALL) [MAGICAL-FIRE](! #SAVE-BONE-MAGICAL-FIRE) [NORMAL-FIRE](! #SAVE-BONE-NORMAL-FIRE) [COLD](! #SAVE-BONE-COLD) [LIGHTNING](! #SAVE-BONE-LIGHTNING) [ELECTRICITY](! #SAVE-BONE-ELECTRICITY)}} Then for each of *those* buttons: SAVE-BONE-ACID /w gm &{template:2Esave}{{savevs=Acid}} {{character=Bone or Ivory}}{{savetarget=11}}{{saveroll=[[d20?{Please enter Situational Modifiers to the current Saving Throw Roll (including the mathematical operator)|+0}]]}}
1574690993
The Aaron
Roll20 Production Team
API Scripter
I might suggest doing these on a character rather than a macro. Macros have an annoying expansion issue with html entities, and characters can be moved between games easily whereas macros cannot.  Also, I have a script that will create abilities on a character pretty easily, which I can get to you later tonight. 
Sounds perfect, thanks.  I was thinking they're easier to copy to another campaign on a character sheet too.
1576003146
The Aaron
Roll20 Production Team
API Scripter
Ok, sorry for the delay.&nbsp; Here is the script I was thinking of:&nbsp; <a href="https://app.roll20.net/forum/post/1067109/script-charutils-a-collection-of-utilities-for-manipulating-character-data" rel="nofollow">https://app.roll20.net/forum/post/1067109/script-charutils-a-collection-of-utilities-for-manipulating-character-data</a>