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

Creating a macro visible to GM

1540969255

Edited 1540969347
Hi folks, I try to create a macro via api, works so far, but I want it to be visible only to the GM. I get the logged in player (at the time the macro runs only one player, the GM, is logged in) at the start of the script. Now I create the macro: var player=findObjs({_type:'player'})[0]; createObj("macro", { name: "Test", action: "[[d100]]", visibleto: player.get("_displayname"), playerid: player.id }); log(player.get("_displayname")) shows me the correct name, so this should work. Creates the macro, but the "visible to" box is empty. How can I make it visible only for me? Bonus question: I can set the parameter "istokenaction", but I need to set whether it is visible in the macro quickbar, is there a parameter for that?
Ah, facepalm moment... Solved it by reading the documentation more carefully. I need the ID of the player.. But any info about the bonus question?
I don't think you can change the macro bar of a player through the API. You can find out the macros in the bar by looking at the _macrobar attribute for the player, but it is Read-Only.
Thanks