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

How do I macro an attribute without having to place a token?

I'm trying to set up a sheet to measure things like reputation ect. and I tried using @{selected|reputation} to select the sheet as well as a few other things but nothing I try works. Is there even a way to do this without making use of a token?
Oh unrelated but quick question while I'm here, is there a macro option that just quick checks the value of an attribute?
Try using the character's name (on the sheet) as a replacement for selected. I'm not sure if that works.
1538686012

Edited 1538696381
Attribute calls need a keyword  like selected, target, CHARACTER_NAME, or CHARACTER_ID. The first two (selected and target) require the use of a token to complete; selected also requires that you have access to control the token whereas target does not. The last two go straight to the character sheet for the provided CHARACTER_NAME or CHARACTER_ID; You also need to have control access of the character to use these keywords.
1538689984
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Actually, you don't need control access to make an attribute call on a character by name or ID.
1538692316

Edited 1538692364
Gen Kitty
Forum Champion
Nor do you need to control the token/character to use targeted.  You do need to be able to select the token to use selected, however. Cat in a hurry didn't fully read.  Ignore me as I repeat what others said.
1538695787
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I'm glad I'm not the only one who does that. :)
Ok sorry took me a while to get time to try it but umm still not working. I tried !ammo @{CHARACTER_ID|Reputation} ?{Whom? |Thulduktorune,Thulduktorune |Bunnyland,Bunnyland |Leane Sidhe,Leane Sidhe |Aunt Inakasys,Aunt Inakasys |} ?{How much?} reputation !ammo @{CHARACTER_NAME|Reputation} ?{Whom? |Thulduktorune,Thulduktorune |Bunnyland,Bunnyland |Leane Sidhe,Leane Sidhe |Aunt Inakasys,Aunt Inakasys |} ?{How much?} reputation !ammo @{Reputation|Reputation} ?{Whom? |Thulduktorune,Thulduktorune |Bunnyland,Bunnyland |Leane Sidhe,Leane Sidhe |Aunt Inakasys,Aunt Inakasys |} ?{How much?} reputation and I always get Character/Token id [reputation|reputation] is not valid. Please be sure you are specifying it correctly, either with @{selected|token_id} or @{selected|character_id}.
Replace Character_name with the actual name of the character sheet you intend to call If the sheets and tokens are aligned, try this: @{target|reputation} and see what happens er, reading comprehension much, Phnord? There are no tokens. So try this: !ammo @{?{Whom |Thulduktorune,Thulduktorune |Bunnyland,Bunnyland |Leane Sidhe,Leane Sidhe |Aunt Inakasys,Aunt Inakasys |}|?{What|reputation}}
I did do that, its what the third example was.  And I tried @target just now, it says click on the token on the screen but there is no token.
Or just to make sure it works right @{Bunnyland|reputation} Should give a guaranteed response, if the character Bunnyland has a value in an Attribute called reputation.
1538980757

Edited 1538980807
bunnyland isn't a character its an attribute, reputation is the character sheet.
ohhhkaaayyy... Reverse 'em.
I know the problem isn't with the variables as if I make a token for the reputation sheet I can use select or target and the macro works. I want a way to do it without using tokens.
Right... I'm just so used to having tokens I forget the other ways to do it. I believe the syntax asks for the name of the character sheet, then the attribute you wish to call. Ya gotta get 'em both exactly right or it'll throw various errors back.
I put in !ammo @{reputation|?{Whom? |Thulduktorune,Thulduktorune |Bunnyland,Bunnyland |Leane Sidhe,Leane Sidhe |Aunt Inakasys,Aunt Inakasys |}}  ?{How much?} reputation and got back No attribute was found for @{reputation|?{Whom? } 2:46AM (From Ammo): Character/Token id [reputation|Thulduktorune] is not valid. Please be sure you are specifying it correctly, either with @{selected|token_id} or @{selected|character_id}.
Sorry, I was on my way offline when I saw this, so hopefully someone else can help you more. It looks by that response that 'reputation' is not a valid character sheet name. I don't know if capitalization is required but give it a try. Make sure the sheet name and the attribute name are as accurate as possible. Good luck.
Thats not the problem. Maybe its just not possible
Or I guess its possible the API only supports token selection.
1538984965

Edited 1538985010
GiGs
Pro
Sheet Author
API Scripter
I'm pretty sure you cant put queries inside attribute names. Something like this  @{reputation|?{Whom? } just wont ever work, due to roll20's order of operations (the order in which it expands queries, extracts the value pf attributes, etc.). It looks like your earlier examples are the wrong way round. This is wrong:  @{CHARACTER_ID|Reputation} If the character name is Reputation , this should work: @{Reputation|CHARACTER_ID} Try entering in chat: /roll @{Reputation|CHARACTER_ID} and that should report the attribute correctly. I'm not sure what you are trying to do with this: !ammo @{CHARACTER_ID|Reputation} ?{Whom? |Thulduktorune,Thulduktorune |Bunnyland,Bunnyland |Leane Sidhe,Leane Sidhe |Aunt Inakasys,Aunt Inakasys |} ?{How much?} reputation Do you have attributes on the Reputation character with the names Thulduktorune, Bunnyland, etc? If you, you dont need to repeat the name within the query. Also, you have spaces before the | in each of options, which is probably what is causing it to fail. Try this: !ammo @{Reputation|character_id} ?{Whom?|Thulduktorune|Bunnyland|Leane Sidhe|Aunt Inakasys} ?{How much?} reputation For changing attributes directly, you might find it easier to use the ChatSetAttr script, in place of ammo.
1538986850

Edited 1538986959
Ziechael
Forum Champion
Sheet Author
API Scripter
You'll have to nest all the attributes as variables when wanting a range of attribute options: !ammo @{Reputation|character_id} ?{Whom?|Thulduktorune,@{Reputation|Thulduktorune}|Bunnyland,@{Reputation|Bunnyland}|Leane Sidhe,@{Reputation|Leane Sidhe}|Aunt Inakasys,@{Reputation|Aunt Inakasys}} ?{How much?}
1539022558
GiGs
Pro
Sheet Author
API Scripter
Does the ammo script need an attribute reference, or just the attribute name?
I just tried !ammo @{Reputation} ?{Whom? |Thulduktorune,Thulduktorune |Bunnyland,Bunnyland |Leane Sidhe,Leane Sidhe |Aunt Inakasys,Aunt Inakasys |} ?{How much?} reputation and got a c is undefined error also !ammo <id> <attribute> <amount> [resource name] is the syntax for the api so I have to keep it in this order.  And I have to double up on the names because the first one names the variable and the second the attribute. And sometimes the attribute is wierd. For example !ammo @{selected|token_id} ?{What Resource? |Experience Points,xp |Platinum,inventory-platinum |Gold,inventory-gold |Silver,inventory-silver |Copper,inventory-copper |Rations,repeating_inventory_0_inventory-quantity |} ?{How much?} ?{Of what? |Experience Points |Platinum |Gold |Silver |Copper |Rations |} This is the other place I use this api when dealing with individual inventories. And it works fine. I just want a way to target the sheet without the token so I can use this api to adjust things like reputation, skill challenge progress ect.
Oh can you link me that chatsetattr script?
1539031892

Edited 1539032209
GiGs
Pro
Sheet Author
API Scripter
chatsetattr is available in the one click install. But you are still making a syntax error in your query. ?{Whom? |Thulduktorune,Thulduktorune | You have spaces before the pipes, you need to remove those. With this, roll20 is looking for an attribute named "Thulduktorune " (see the space at the end) not an attribute named "Thulduktorune". Also, you dont need to repeat the names if the displayed entry and the attribute are the same. this specific example can be streamline to ?{Whom?|Thulduktorune| When the displayed value and attribute are identical, you only need to use it once. You said,  And I have to double up on the names because the first one names the variable and the second the attribute. And sometimes the attribute is wierd. This is a misunderstanding. The first one is just a display value: it is not the name of the variable. The name of the variable is bit at the start (Whom? ). When you have a pair of values separated by a comma, the first one is what appears in the dropdown box. The second is the value used. This allows you to have a dropdown like this: /roll ?{How many dice?|One,1|Two,2|Three,3}d6 When the user clicks the drop down, they'll see words: One, Two, Three. But when the macro is run, it will roll 1d6, 2d6, or 3d6. But when the displayed value and used value are the same, you don't need to list it twice. Also at the end of your query there's an unneeded pipe. This:  |Aunt Inakasys,Aunt Inakasys |}  should be: |Aunt Inakasys} Notice the removal of the spaces, the drop to a single entry, and the removal of the final pipe (the '|').
Well I put those in because the roll20 macro page said to use spaces. Removing them did not help, still says c is undefined. I'll try the other api
1539032279
GiGs
Pro
Sheet Author
API Scripter
Devlin M. said: Well I put those in because the roll20 macro page said to use spaces. Can you link the wiki where it says that? if so, it needs correcting, because its wrong.
1539032752
GiGs
Pro
Sheet Author
API Scripter
I just added the ammo script. I created a character called Reputation. I added an attribute on the character named Thulduktorune, and gave it a starting value of 0 I created this macro: !ammo @{Reputation|character_id} ?{Whom?|Thulduktorune|Any} ?{Amount|1} Reputation I ran the macro, and received this in chat: Reputation  gains 1 Reputation and has 1 remaining. Since this worked, and your efforts aren't working, I have to assume there is a failure of communication somewhere. I understand you must be frustrated, and I want to help you, but we need to figure out where our communication is going wrong. Can you describe exactly what you are trying to do?
Again, I think the problem is in the names. Either the character sheet name is incorrect, or the attribute is incorrect. I ask you to please, simply copy-paste this as shown and let us know the results: @{Reputation|Thulduktorune} Just that, nothing else.
1539044924

Edited 1539045266
actually gg's example fixed it. Putting Character ID after reputation. I thought you said that would just report the attribute and I didn't want it reported, I wanted it targeted or selected, so it could be changed. Though I thought I did try it reversed once but looking at the examples I posted it looks like I didn't.
Also for where the place is it says place a space. I guess that was just for nesting. It kind of all pools up in my head in one big puddle and I can't separate one thing from the other. <a href="https://wiki.roll20.net/Macros" rel="nofollow">https://wiki.roll20.net/Macros</a> Nesting in a Roll Query If you are nesting a macro in a Roll Query , be certain there is a space after the macro name so that it is properly recognized.
1539048514
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Nested roll queries make my head hurt. :)
1539054074
GiGs
Pro
Sheet Author
API Scripter
Devlin M. said: Also for where the place is it says place a space. I guess that was just for nesting. It kind of all pools up in my head in one big puddle and I can't separate one thing from the other. <a href="https://wiki.roll20.net/Macros" rel="nofollow">https://wiki.roll20.net/Macros</a> Nesting in a Roll Query If you are nesting a macro in a Roll Query , be certain there is a space after the macro name so that it is properly recognized. Just to clarify, you need a space there when calling another macro, after the macro name. But even if you were using nesting, your macro didnt call any other macros, so the spaces would mess things up. Anyway, glad you got it sorted!