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 .
×

Reactions - send to chat

Hi all, is there a way of opening a compendium item via a chat script? What am i trying to do: I have placed a token off an arrow on my map and I have selected reactions-send to chat. I would like it to open the compendium 'arrow' so that we could then drag it to a character sheet. Can I do this? maybe 'token action maker'
1790781708
AmadeusVF
Pro
API Scripter
Coming soon I Guess...
1790785287
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I think I have interpreted you correctly, but if you mean: "Can I send something to chat that when clicked on will open a window displaying the content of the "Arrow" entry in the Compendium?" Then yes. You can copy the url (easiest to do this from outside the game in the web version. Placing the ulr in chat will result in the compendium entry opening. But if you mean: "Can I click on something in chat that will cause the Compendium  tab to display the drag-and-droppable Compendium blob for Arrow so that I can drag it onto a character sheet?" then no. In general, Macros and Scripts cannot control the interface. AmadeusVF's screenshots of the Trinkets and Treasures Mod script show a kind of end run around the problem and might solve the issue you are seeking to solve, if not in exactly the way you described.
AmadeusVF said: Coming soon I Guess... That looks amazing, we definately want that!
keithcurtis said: I think I have interpreted you correctly, but if you mean: "Can I send something to chat that when clicked on will open a window displaying the content of the "Arrow" entry in the Compendium?" Then yes. You can copy the url (easiest to do this from outside the game in the web version. Placing the ulr in chat will result in the compendium entry opening. But if you mean: "Can I click on something in chat that will cause the Compendium  tab to display the drag-and-droppable Compendium blob for Arrow so that I can drag it onto a character sheet?" then no. In general, Macros and Scripts cannot control the interface. AmadeusVF's screenshots of the Trinkets and Treasures Mod script show a kind of end run around the problem and might solve the issue you are seeking to solve, if not in exactly the way you described. "Can I send something to chat that when clicked on will open a window displaying the content of the "Arrow" entry in the Compendium?" Then yes. You can copy the url (easiest to do this from outside the game in the web version. Placing the ulr in chat will result in the compendium entry opening. I did mean this!  but I was aiming (in this example, to get the abacus entry displayed like this: I tried copying the url but that takes me to the web site not the compendium :( Thanks for the reply. my next problem is : I want to get the character to do a perception check as well but this does not seem to work: @{selected|character_name}  Looks for secret doors /roll 1d20 + @{@{instigator_name}|wisdom_save_roll} : sorry to be a pain!
1790840182

Edited 1790840231
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
No macro or script will cause the Compendium tab to display that drag and drop blob. You can use the URL of a compendium page to put into chat a clickable link that will open a compendium entry in a window in the VTT. Here is the URL for an abacus. I have tested this as a raw chat paste, and as a reaction. Assuming you have to 2014 PHB (which looks to be the case), this should work and open up a window in the VTT that shows the entry for an abacus like the screenshot below. <a href="https://roll20.net/compendium/dnd5e/Items:Abacus/#h-Abacus" rel="nofollow">https://roll20.net/compendium/dnd5e/Items:Abacus/#h-Abacus</a> You can also wrap it in a markdown button like this: [Abacus](<a href="https://roll20.net/compendium/dnd5e/Items:Abacus/#h-Abacus" rel="nofollow">https://roll20.net/compendium/dnd5e/Items:Abacus/#h-Abacus</a>)
Thank you Keith for the help, that solution works well for me :) any ideas for the other problem?: my next problem is : I want to get the character to do a perception check as well but this does not seem to work: @{selected|character_name}&nbsp; Looks for secret doors /roll 1d20 + @{@{instigator_name}|wisdom_save_roll} I shall go and do some learning after this. BTW, i tried google AI and nearly every solution it gave me didnt work!
1790866600

Edited 1790867166
AmadeusVF
Pro
API Scripter
goatdealer said: Thank you Keith for the help, that solution works well for me :) any ideas for the other problem?: my next problem is : I want to get the character to do a perception check as well but this does not seem to work: @{selected|character_name}&nbsp; Looks for secret doors /roll 1d20 + @{@{instigator_name}|wisdom_save_roll} I shall go and do some learning after this. BTW, i tried google AI and nearly every solution it gave me didnt work! Try this @{selected|character_name}&nbsp; Looks for secret doors [[1d20+@{selected|perception_bonus}]] Or something a bit more fashionable: &amp;{template:default} {{name=@{selected|character_name}}} {{Looks for secret doors=[[1d20+@{selected|perception_bonus}]]}} Or Even better: &amp;{template:simple} {{rname=Looks for secret doors}}&nbsp; {{r1=[[1d20+@{selected|perception_bonus}]]}} {{normal=1}} {{charname=@{selected|character_name}}}
Wow, that is fantastic, thanks folks. Here is a link to a very quick video of it in action :) AsmadeusVF can i post your code on my youtube site please? So as you have been so helpful, is it possible to check it against a criteria and then say it was a success? Could I do this with &gt;13 for example? Sorry for being so cheeky..
1790886929

Edited 1790887024
AmadeusVF
Pro
API Scripter
goatdealer said: AsmadeusVF can i post your code on my youtube site please? I dont know what code, but yes. So as you have been so helpful, is it possible to check it against a criteria and then say it was a success? Could I do this with &gt;13 for example? Sorry for being so cheeky. Well, that one was particularly difficult, but it was also really fun to figure out. This is what I did. First create 2 rollable Tables. (You can use the name you want, I use 0:Check and 1:Check, Just make sure to use 0 &nbsp;and 1 , and Yes, the number should be at the beggining&nbsp; of the table name. ) Each table should contain only 1 item: - The table beginning with 0 should contain Failure - The table beginning with 1 should contain Success or the phrase it will say if it founds the door. &amp;{template:simple} {{r2=[[1t[[[{[[1d20+@{selected|perception_bonus}]],0}&gt; 13 ]]:Check]]]}} {{r1=$[[0]]}} {{rname=Looks for secret doors and it...}} {{mod=$[[2]]}} {{normal=1}} {{charname=@{selected|character_name}}} you can change the DC here Or you can use this version, which asks for the DC every time you run the macro : &amp;{template:simple} {{r2=[[1t[[[{[[1d20+@{selected|perception_bonus}]],0}&gt;?{DC}]]:Check]]]}} {{r1=$[[0]]}} {{rname=Looks for secret doors and it...}} {{mod=$[[2]]}} {{normal=1}} {{charname=@{selected|character_name}}} And finally, you'll get something like this (2014 / 2024)