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 Link in Chat doesn´t work. What is wrong?

I tried to trigger a table via a macro and it works, but if I use the following Macro and to post it in the chat window, nothing happens if I click on the macro link in the chat windoiw. Did I make something wrong? The "Random-Loot" Macro alone works and the table too, but not this way. I was planning to add more macros for loot-tables to this. (I am absolute new in macro editing) &{template:default} {{name=Loot}} {{Loot= [Random-Loot](!#Random-Loot)}}
1555528298
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Try [Random-Loot](!
#Random-Loot), though you'll have to put in that !
 again if you ever open it to edit. If you make these character Abilities in a macro sheet instead of a loose macro [Random-Loot](~Random-Loot) will call another ability named Random-Loot on the same sheet. When you put buttons into a roll template that call Abilities or Macros, we call that a Chat Menu . Macro that calls another macro, (editing hassle) [Random-Loot](!
#Random-Loot) Ability that calls an ability on the same sheet [Random-Loot](~Random-Loot)
Thanks a lot!!
1555582706

Edited 1555592663
Ziechael
Forum Champion
Sheet Author
API Scripter
So this: [Random-Loot](!) is the basic syntax for an API button... slight misnomer in that it doesn't require the API to be able to use these but as standard it will run the contents of the () portion when clicked. As it begins with a '!' this sets it out as an API call (hence the name I guess), which, unless you have a script ready to look for the chat command will fail to print to chat anything that follows the ! (this can be useful for things other than API calls however). By following the '!' with the html replacement for a carriage return (
) you can force the chat to actually display/run the command when it isn't an API call. In this case the collection based macro of #Random-Loot. The key, therefore is the 
 to utilise this method for macros not held on a sheet. Hope that helps? Sleeser said: this helped to fix a problem i had myself,you see i had made macros in the collection (not on a sheet) and wanted to call them in a label but it didnt seem to work. so this fixed it but i dont understand why. i would greatly appreciate if you could explain.
1555582733
Ziechael
Forum Champion
Sheet Author
API Scripter
Oh... guess they deleted their post lol
1555592444
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
No matter, that's actually the best explanation I've heard about why that works the way it does.
1555607228
GiGs
Pro
Sheet Author
API Scripter
Great explanation. There's few things more irritating to me than people deleting their posts (sometimes even entire threads) when their question has been answered. We aren't just answering for you (the person asking the question), but also everyone who searches later with the same question.
1555608088
Andreas J.
Forum Champion
Sheet Author
Translator
GiGs said: There's few things more irritating to me than people deleting their posts (sometimes even entire threads) when their question has been answered. We aren't just answering for you (the person asking the question), but also everyone who searches later with the same question. Exactly this. And the people who manage to figure out the solution for themselves, I try to prod them to mention the solution in the thread instead of just leaving a "Nevermind, I figured it out"
1555626440
Ziechael
Forum Champion
Sheet Author
API Scripter
They can take away their posts... but they will never delete our...
1555630156
vÍnce
Pro
Sheet Author
Ziechael said: They can take away their posts... but they will never delete our... Never say Never ...