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: Creating a specific macro

Greetings all. I am new to playing traveler. I am trying very frustratingly to create a macro that... 1. Queries a Skill      &{template:Default} ?{Skill?|} Then I want to have it roll 2d6 {{[[2d6]]}} and I need it to query any modifier to add ?{Modifier?|} Im obviously new to macroing I have no idea what I am doing beyond the very very basic parts. I dont even know I am using the right lines of code for this so far I have absolutely no idea what I am doing as far as combining them. I get no error but I also get no results...  Please if any of you fine folks could find the time to help this newb out I would greatly appreciate it!
1611422728
GiGs
Pro
Sheet Author
API Scripter
Try this &{template:default} {{name=?{Skill?} }} {{roll=[[2d6+?{Modifier?|0}]] }}
Yes it worked is there a way to dress it up at all? I was thinking an editable /em? or anything you can think of. Otherwise Thank you so much!!!
I guess I was sort of close yet SO very far away... Coding/macroing is so stressful to me. so I really appreciate you responding so fast!
this one looks like this while the basic ingame one is much more advanced.    I took your macro and added the boon and bane line.
1611427062

Edited 1611427491
Hello Vayne,  I am not familiar with the sheet you are using. But once you roll something like that Leadership roll, up arrow in the chat and you will see the code it is using and then you can change the default template to the one the game uses. Then your macro will use the exact styling and have the same appearance as the ones from the sheet.  Hope this helps. Went poking around a bit, this is from the Mongoose Traveller second edition sheet: < tr > < th > < button name =" roll_Leadership " type =" roll " value =' &{template:skill-general} {{skill= Leadership }} {{character= @{character_name} }} @{ro_default_rolltype} + [[@{skilltotal-Leadership}]] @{ro_default_mod}]] }} ' > < div class =" sheet-button_header " > Leadership </ div > </ button > </ th > < th > < select type =" text " class =" sheet-input " name =" attr_skillCharacteristicDM-Leadership " value =" 0 " style =" width:95px " /> < option value =" @{mod-Strength} " data-i18n =" skillstrengthoption-u " > Strength </ option > < option value =" @{mod-Dexterity} " data-i18n =" skilldexterityoption-u " > Dexterity </ option > < option value =" @{mod-Endurance} " data-i18n =" skillenduranceoption-u " > Endurance </ option > < option value =" @{mod-Intellect} " data-i18n =" skillintellectoption-u " > Intellect </ option > < option value =" @{mod-Education} " data-i18n =" skilleducationoption-u " > Education </ option > < option value =" @{mod-Social} " data-i18n =" skillsocialoption-u " > Social </ option > </ select > </ th > < th > < input type =" number " class =" sheet-input " name =" attr_skillDM-Leadership " value =" @{skillCharacteristicDM-Leadership} " disabled =" true "/> </ th > < th > < input type =" number " class =" sheet-input " name =" attr_skilllevel-Leadership " value =" 0 " /> </ th > < th > < input type =" number " class =" sheet-input " name =" attr_skillmodifier-Leadership " value =" 0 " /> </ th > < th > < input type =" checkbox " class =" sheet-untrained " checked =" True " name =" attr_untrained-Leadership " value =" -3 "/> < span > </ span > </ th > < th > < input type =" number " class =" sheet-input " name =" attr_skilltotal-Leadership " value =" @{skillDM-Leadership} + @{skilllevel-Leadership} + @{skillmodifier-Leadership} + @{untrained-Leadership} " disabled =" true "/> </ th > < th style =" width:55px; " > </ th > </ tr > If this is the sheet you are using then the template appears to be  &{template:skill-general}. It's located at lines 1361 to 1377 of the sheet.
1611520897

Edited 1611521824
Yes Thank you I found that line.  Here is my line of code that functioned as posted above: &{template:default} {{name=?{Skill?} }} {{roll=[[2d6+?{Modifier?|0}]] }} {{Boon/Bane=[[d6]] }} Here is the line of code from the sheet &{template:skill-general} {{skill= Gambler }}  {{character= @{Terrrell Scott|character_name} }} @{Terrrell Scott|ro_default_rolltype} + [[@{Terrrell Scott|skilltotal-Gambler}]] @{Terrrell Scott|ro_default_mod}]] }}  here is what I modified my code to: &{template:skill-general} {{name=?{Skill?} }} {{Maj. Terrel Scott }}  {{roll=[[2d6+?{Modifier?|0}]] }} {{Boon/Bane=[[d6]] }} And here are the results I am confused as to what I am doing wrong. I couldnt use the @character command line as I am not using a sheet but is there a way to make it identify the user? I thouhgt there might be a /me type function??  Thanks for the help to anyone who has or will try.
1611551800

Edited 1611551812
GiGs
Pro
Sheet Author
API Scripter
If you want to use that template, you need to use the same 'keys' (the labels before the = sign). But first this line of code you posted is incorrect: &{template:skill-general} {{skill= Gambler }}  {{character= @{Terrrell Scott|character_name} }} @{Terrrell Scott|ro_default_rolltype} + [[@{Terrrell Scott|skilltotal-Gambler}]] @{Terrrell Scott|ro_default_mod}]] }}  It ends with a }} but there is no matching {{, so I cant tell what you need to add. But try this: &{template:skill-general} {{skill= ?{Skill?} }}  {{character= Maj. Terrel Scott }} {{roll=2d6+?{Mod|0}}}
1611576419

Edited 1611576539
David M.
Pro
API Scripter
<< Schendel25  said:>> Another bot? 0 games, 0 hrs, 1 post, giving MS Excel advice, lol
1611578943
GiGs
Pro
Sheet Author
API Scripter
Yes, I reported it. Definitely looks like a bot.
You're awesome. As I am sure you can tell, I am very much a novice. I have 0 coding experience I only know what I have experimented with, and when it doesn't work the advice you all have helped me with.SO it is much appreciated!! GiGs said: If you want to use that template, you need to use the same 'keys' (the labels before the = sign). But first this line of code you posted is incorrect: &{template:skill-general} {{skill= Gambler }}  {{character= @{Terrrell Scott|character_name} }} @{Terrrell Scott|ro_default_rolltype} + [[@{Terrrell Scott|skilltotal-Gambler}]] @{Terrrell Scott|ro_default_mod}]] }}  It ends with a }} but there is no matching {{, so I cant tell what you need to add. But try this: &{template:skill-general} {{skill= ?{Skill?} }}  {{character= Maj. Terrel Scott }} {{roll=2d6+?{Mod|0}}}
ok So I played with what you had and it did not work. I did add [[ ]]'s to the roll and I did get this to work fine.... &{template:skill-general} {{skill= ?{Skill?} }}  {{character= Maj. Terrel Scott }} {{roll=[[2d6+?{Modifier?|0}]]}} The Final part is I need to add a last line which is a Boon/bane Dice. Which I know is {{Boon/Bane=[[1d6]] }} However whenever I add it to the code line as such &{template:skill-general} {{skill= ?{Skill?} }}  {{character= Maj. Terrel Scott }} {{roll=[[2d6+?{Modifier?|0}]]}} {{Boon/Bane=[[d6]] }} in any sort of fashion I only manage to screw it up The only time I got this to even work is this: &{template:skill-general} {{skill= ?{Skill?} }}  {{character= Maj. Terrel Scott }} {{roll=[[2d6+?{Modifier?|0}]]Boon/Bane=[[1d6]]}} GiGs said: If you want to use that template, you need to use the same 'keys' (the labels before the = sign). But first this line of code you posted is incorrect: &{template:skill-general} {{skill= Gambler }}  {{character= @{Terrrell Scott|character_name} }} @{Terrrell Scott|ro_default_rolltype} + [[@{Terrrell Scott|skilltotal-Gambler}]] @{Terrrell Scott|ro_default_mod}]] }}  It ends with a }} but there is no matching {{, so I cant tell what you need to add. But try this: &{template:skill-general} {{skill= ?{Skill?} }}  {{character= Maj. Terrel Scott }} {{roll=2d6+?{Mod|0}}}
1611871240

Edited 1611871302
Kraynic
Pro
Sheet Author
Looking at the sheet code, around line 2611, there is a bb key (which will output the Boon/Bane text like one of your earlier screenshots).  You might try this: &{template:skill-general} {{skill= ?{Skill?} }} {{character= Maj. Terrel Scott }} {{roll=[[2d6+?{Modifier?|0}]]}} {{bb=[[d6]] }} I just switched out the Boon/Bane in your macro for bb. 
Im looking for it to have its own line, what am I doing wrong? Kraynic said: Looking at the sheet code, around line 2611, there is a bb key (which will output the Boon/Bane text like one of your earlier screenshots).  You might try this: &{template:skill-general} {{skill= ?{Skill?} }} {{character= Maj. Terrel Scott }} {{roll=[[2d6+?{Modifier?|0}]]}} {{bb=[[d6]] }} I just switched out the Boon/Bane in your macro for bb. 
1611876041
Oosh
Sheet Author
API Scripter
The sheet author dictates how the roll template is laid out - you can't do much about that, unless there's another section which defaults to a new line where you can put your boon/bane instead. You can use a CSS editor like Stylus to modify the template output, but this will only affect your browser window, the changes won't be visible to anyone else.
Oosh said: The sheet author dictates how the roll template is laid out - you can't do much about that, unless there's another section which defaults to a new line where you can put your boon/bane instead. You can use a CSS editor like Stylus to modify the template output, but this will only affect your browser window, the changes won't be visible to anyone else. The basic game template for rolling has multiple lines one for the roll and one for the Boon/bane. I just wanted to make a generic macro to roll any stat/skill with a boon or bane.  For example is i roll my Athletics roll for example here is the code from the character sheet: &{template:skill-general} {{skill= Athletics }} {{character= @{Terrrell Scott|character_name} }} @{Terrrell Scott|ro_default_rolltype} + [[@{Terrrell Scott|skilltotal-Athletics}]] @{Terrrell Scott|ro_default_mod}]] }}  We have all managed to use the template, a Query for the Skill, Modifier and now I would like to add the second line for the Boon/Bane if I can.
1611879326
Kraynic
Pro
Sheet Author
We have all managed to use the template, a Query for the Skill, Modifier and now I would like to add the second line for the Boon/Bane if I can. Yeah, that is what I thought the bb would do.  It has its own section of the roll template in the html code, so I thought just using bb as the key for that roll would be all it would take for the Boon/Bane line to print out as you are showing in the roll from the sheet.
1611879561
Oosh
Sheet Author
API Scripter
What's the content of those two Attributes in the sheet's default roll? @{Terrrell Scott|ro_default_rolltype} @{Terrrell Scott|ro_default_mod} Replacing those with their actual contents should tell you how the roll template is being used by the sheet.