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

[Help] Whisper to player info in a API command button?

is there a way to use the API button to have it whisper to a player and not the Gm? [@{selected|repeating_traits_$0_name}](/w "@{selected|character_name}" ~selected|repeating_traits_$0_output)
1528850132
Ziechael
Forum Champion
Sheet Author
API Scripter
Move the whisper outside of the button: /w "@{selected|character_name}" [@{selected|repeating_traits_$0_name}](~selected|repeating_traits_$0_output)
Ziechael said: Move the whisper outside of the button: /w "@{selected|character_name}" [@{selected|repeating_traits_$0_name}](~selected|repeating_traits_$0_output) Sorry, I meant I wanted the output to be whispered, once you clicked the button. I already have it outside for the list of Traits. 
1528852127
The Aaron
Pro
API Scripter
Try: [@{selected|repeating_traits_$0_name}](!
/w "@{selected|character_name}" ~selected|repeating_traits_$0_output)
The Aaron said: Try: [@{selected|repeating_traits_$0_name}](!
/w "@{selected|character_name}" ~selected|repeating_traits_$0_output) The " seem to create a break in the link. I have also tired Changing out the @ for @ which cleans up the link but gives the same results.
1528873136
The Aaron
Pro
API Scripter
Weird to have a Unicode @ in there. I just copied from earlier. The real takeaway is the !
 in front of the /w
1528899975
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
The problem is that you were using an ability command button originally, not an API command button. You can't add things to an ability command button. Try this: [@{selected|repeating_traits_$0_name}](!
/w "@{selected|character_name}" %{@{selected|character_name}|repeating_traits_$0_output})
Scott C. said: The problem is that you were using an ability command button originally, not an API command button. You can't add things to an ability command button. Try this: [@{selected|repeating_traits_$0_name}](!&#13;/w "@{selected|character_name}" &#37;{@{selected|character_name}|repeating_traits_$0_output}) Still the same result: Unrecognized command: /w Below is the link that it created.&nbsp; Once the " is there it seems to stop and thing after that in the link. It will create a good link without them, but it always goes to the GM. <a href="https://app.roll20.net/editor/!/w" rel="nofollow">https://app.roll20.net/editor/!/w</a>
If its the quote symbol then let's html encode the quotes shall we? I've tried this in my game and at least I'm not getting the error you mentioned above. [@{selected|repeating_traits_$0_name}](!&#13;/w &#34;@{selected|character_name}&#34; &#37;{@{selected|character_name}|repeating_traits_$0_output}) Hope this helps, Florian
1528911428
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Heh, the forum's hunger for html strikes again! here's that with the html showing properly: [@{selected|repeating_traits_$0_name}](!&amp;#13;/w &amp;#34;@{selected|character_name}&amp;#34; &amp;#37;{@{selected|character_name}|repeating_traits_$0_output}) Also, make sure you are saving this as a character ability and not as a global macro. The global macro editor shares the forum's hunger for html entities when you open and resave the macro.
Scott C. said: Heh, the forum's hunger for html strikes again! here's that with the html showing properly: [@{selected|repeating_traits_$0_name}](!&#13;/w &#34;@{selected|character_name}&#34; &#37;{@{selected|character_name}|repeating_traits_$0_output}) Also, make sure you are saving this as a character ability and not as a global macro. The global macro editor shares the forum's hunger for html entities when you open and resave the macro. That worked. Now is there a way to make it show up as just text like the other links instead of the box?
1528920509
The Aaron
Pro
API Scripter
Not "out of the box".&nbsp; You can do it with some roll templates on some character sheets.&nbsp; Depends on what you're using.
The Aaron said: Not "out of the box".&nbsp; You can do it with some roll templates on some character sheets.&nbsp; Depends on what you're using. Weird, but not surpising.&nbsp; So is it the fact that it is a strait shot with the ~ in&nbsp;[@{selected|repeating_traits_$0_name}](~selected|repeating_traits_$0_output) that makes it just text?
1528921426
The Aaron
Pro
API Scripter
It's the fact that the "URL" starts with a !, so it gets the formatting of an API Command Button instead of a link.&nbsp; I'm not sure what formatting rules Ability Command buttons ("URL" starts with ~) get.&nbsp; An actual URL that starts with http:// or https:// will get formatted as plain text, unless it ends in .png, .jpg, or .gif (mostly sure on that last one) in which case it will be formatted as an image.
The Aaron said: It's the fact that the "URL" starts with a !, so it gets the formatting of an API Command Button instead of a link.&nbsp; I'm not sure what formatting rules Ability Command buttons ("URL" starts with ~) get.&nbsp; An actual URL that starts with http:// or https:// will get formatted as plain text, unless it ends in .png, .jpg, or .gif (mostly sure on that last one) in which case it will be formatted as an image. Thank you for the information.
1528924787
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
The ability command buttons are formatted as text by the OGL roll templates, api command buttons are not. It's something I've raised with Steve in the past.
Scott C. said: The ability command buttons are formatted as text by the OGL roll templates, api command buttons are not. It's something I've raised with Steve in the past. Ok that would explain why that is one of the sheets I am trying this with.