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

Macro Help For Rolling Multiple Of The Same Item From A Drop-Down Menu With Roll Tables

I am trying to do a Loot macro that allows players to select a creature name, i.e. Goblin, and then select how many they want to loot. I have rollable tables set up that will automatically generate a random loot item based on the monster as shown in this sample macro: !rt[echo] /w gm ?{Monster|Abhorrent Overlord, [[1t[Loot-D]]] |Aeralist Android, [[1t[Loot-C]]] |Alligator, [[1t[Loot-A]]] |Ambitious Assassin, [[1t[Loot-C]]] } The problem here is that if the players fight let's say 10 Goblins, then they have to individually click Loot, scroll down to Goblin, and click Submit 10 times. Is there a way to make it so that they can specify the number of times to roll from the roll table associated with the monster they want to loot? I.e. !rt[echo] /w gm [[?{How many?|}t[?{Monster|Abhorrent Overlord, [[1t[Loot-D]]] |Aeralist Android, [[1t[Loot-C]]] |Alligator, [[1t[Loot-A]]] |Ambitious Assassin, [[1t[Loot-C]]] }] ]]             (This macro does not work) Please provide a sample macro if this is possible. I have API scripts available.
1755198775
Gauss
Forum Champion
Have you tried moving the how many query to replace "1" in "1t"? That is where I'd put it.  I don't know if that will work in combination with !rt or not, but it is worth a shot. 
That did not seem to work.
1755216055
Gauss
Forum Champion
SwirlySwirlyBS said: That did not seem to work. Just out of curiosity, what happens when you do something like !rt [[2t[Loot-D]]] Does it effectively roll Loot-D twice? Note: I don't remember what [echo] is for, so include it if you need to.
1755220845

Edited 1755222379
Yes, that works effectively no problem. Echo just means it echos the roll back to the player after being sent to the GM. It's so they can loot and just have it be between me and them. Here's the new macro I tried: !rt[echo] /w gm ?{Monster|Abhorrent Overlord, [[?{Number of Mobs|1}t[Loot-D]]] |Aeralist Android, [[?{Number of Mobs|1}t[Loot-C]]] |Alligator, [[?{Number of Mobs|1}t[Loot-A]]] } I also tried it this way: !rt[echo] /w gmroll ?{Monster|Abhorrent Overlord, ?{Number of Mobs|1}t[Loot-D] |Aeralist Android, ?{Number of Mobs|1}t[Loot-C] |Alligator, ?{Number of Mobs|1}t[Loot-A] }
1755222847

Edited 1755222995
Gauss
Forum Champion
You cannot put a query inside another query without some modifications. It will break the first query.  Please try something simpler to start, make sure the concept works.  Example:  !rt[echo] /w gm [[?{Number of Mobs|1}t[Loot-D]]] If that works, then we can switch to using HTML substitution to make the second-tier queries work without breaking the first query. 
Rather than embedding a query inside a query. You could change the monster query to just have the table names instead of a full roll; with the remaining parts including the how many query outside it. Such as !rt[echo] /w gm [[?{How many?|1}t[?{Monster| Abhorrent Overlord,Loot-D| Aeralist Android,Loot-C| Alligator,Loot-A| Ambitious Assassin,Loot-C}] ]]
1755267654
timmaugh
Forum Champion
API Scripter
The Metascript Toolbox has a feature just for this sort of application. It returns all of the returns rolled from a rollable table, so you can effectively get multiple novel rolls out of a single table in a single message. For instance, using this command: !&{template:default} {{name=Proof of Concept}} {{Output=[[4t[FirstNames]]].items({&nl}) }}{&simpl e} ...I can roll against my "FirstNames" table 4 times and get the output as a single message: Building off the command line Rainbow supplied, fitting this metascript solution to your game would look like: !/w gm [[?{How many?|1}t[?{Monster| Abhorrent Overlord,Loot-D| Aeralist Android,Loot-C| Alligator,Loot-A| Ambitious Assassin,Loot-C}] ]].items({&nl}) {&simple} Note that the syntax token: {&nl} ...is just a "new line" token supplied by the Toolbox. You could provide your own delimiter text between the parentheses. If you wanted the above command line in a template, you can do that like this: !/w gm &{template:default} {{name=Loot Result ( ?{How many?|1} Corpses)  }} {{Recovered=[[?{How many?}t[?{Monster| Abhorrent Overlord,Loot-D| Aeralist Android,Loot-C| Alligator,Loot-A| Ambitious Assassin,Loot-C}] ]].items({&nl}) }} {&simple}
1755272349

Edited 1755272381
Thank you all so much! Metascript Toolbox looks useful, so I just added it to my campaign. RainbowEncoder, your suggestion worked perfectly for what I was trying to do!  Resolved.