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 Question

I am writing a macro to add a number to a character's attribute. Basically the macro rolls 1d10 and then I want to add that result to the character's attribute. Is that possible ? How would I do that ?   Xargun
Not without using an api script.
To be clear if you wish to change the attribute then yes that requires the API, but if you just wanted to show the total math including the attribute that is possible.  [[1d10 + @{CHARACTER|ATTRIBUTE} ]] would be the syntax for that. 
I have several API scripts installed and know how to add a specific value to an attribute, but how would I add a variable to an attribute?  Basically they roll 1d10 and I want to add the result to an attribute. I currently have my macro rolling 1d10 and announcing the results. Then I want to add the result to the attribute.
1460259045
The Aaron
Pro
API Scripter
Can you give a more detailed description of what you want? It sounds like: You have a character (say Bob) with an attribute (say Money). Bob's owner rolls 1d10 to generate a variable amount. Do you want to... Display the amount with the attribute added: [[@{Bob|Money} + 1d10]] Add increase the value stored in the attribute by that amount (API script example): !attrib Money|[[1d10]] --@{Bob|character_id}
The Aaron said: Can you give a more detailed description of what you want? It sounds like: You have a character (say Bob) with an attribute (say Money). Bob's owner rolls 1d10 to generate a variable amount. Do you want to... Display the amount with the attribute added: [[@{Bob|Money} + 1d10]] Add increase the value stored in the attribute by that amount (API script example): !attrib Money|[[1d10]] --@{Bob|character_id} I want to do both. Basically for my Vampire game, when they hunt, they get 1d10 blood back. I want to display the amount they feed to the character who triggers the macro and add it to their attribute (CurrentBlood). I know how (as you show above) to do either, but not to do both with the same 1d10 random roll.
1460397564
The Aaron
Pro
API Scripter
You would need an API script that does the addition and also displays the result.
The Aaron said: You would need an API script that does the addition and also displays the result. Just thought of this. Could I use an attribute (say Roll) and set that = 0 and add the 1d10 and to it. Then display 'Roll' and then add 'Roll' to the CurrentBlood attribute ?  Picked up a couple Java Script books from the library so maybe I'll research that.
Xargun said: Could I use an attribute (say Roll) and set that = 0 and add the 1d10 and to it. Then display 'Roll' and then add 'Roll' to the CurrentBlood attribute ?  Picked up a couple Java Script books from the library so maybe I'll research that. Yup, that should possible. I'm going hit the JS studying, too!