This post has been closed. You can still view previous posts, but you can't post any new replies.

Setting a chat box to be seen by the GM only

1528918003
Hi everyone, I want to know if it's possible to have a chat box and what it output to be seen by the GM only. Currently, I have this macro that create a chat box like this in the chat: It is set-up with /w gm so only me (the gm) see it, but when I click on one of the options, the "gm only" get lost: Here is the macro: /w gm #wisp &{template:PTU}{{title=@{selected|Move1_Name}}}{{Note:=Select Character Token, then press.}}{{[Physical (No Target)](! %{selected|Move1AtkPhys})=[Physical (Targeted)](! %{selected|Move1AtkPhys_tar})}}{{[Special (No Target)](! %{selected|Move1AtkSpec})=[Special (Targeted)](! %{selected|Move1AtkSpec_tar})}}{{[Status (No Target)](! %{selected|Move1AtkStat})=[Status (Targeted)](! %{selected|Move1AtkStat_tar})}}{{[Back](! #Int)=}} Does someone has a suggestion to make this work? Also, If you have something to make all rolls made by the gm as hidden, I'm more than interested! Searched for it and found nothing.
1528918164
The Aaron
Pro
API Scripter
You'd need to include the /w gm in your individual commands: [Physical (No Target)](!
/w gm %{selected|Move1AtkPhys})
1528920644
OK, erm, something is happening. The macro comes from the google docs Roll20 Macro PTU And in this, the macro is with those "&13": As soon as I save the macro and open it again, it comes back like this: #wisp &{template:PTU}{{title=@{selected|Move1_Name}}}{{Note:=Select Character Token, then press.}}{{[Physical (No Target)](! %{selected|Move1AtkPhys})=[Physical (Targeted)](! %{selected|Move1AtkPhys_tar})}}{{[Special (No Target)](! %{selected|Move1AtkSpec})=[Special (Targeted)](! %{selected|Move1AtkSpec_tar})}}{{[Status (No Target)](! %{selected|Move1AtkStat})=[Status (Targeted)](! %{selected|Move1AtkStat_tar})}}{{[Back](! #Int)=}} Any idea what the hell does that? Formatting I guess?
1528921215
The Aaron
Pro
API Scripter
So, it stems from the fact that adding the 
 is a hack to get functionality that wasn't originally available.  It fools the system into believing you are sending an API command (what these were intended for), when you are actually sending a general purpose command.  The 
 is a return, encoded so the chat doesn't see it "the first time", so it can be expanded when you run the actual command. I say all that to say that with macros, those special characters get expanded when you go to edit them, so you have to put them back in, or manage the editing in some external location and just copy the results over each time you want to change them. This does NOT happen with character abilities, so people often recommend that you create a dummy character to use instead. You can mark the abilities as appearing on the macro bar, and editing doesn't loose the HTML Entities.  An added benefit is the ability to share the character with other players, and move it between games.
1528921708

Edited 1528922323
I see, so if this was in an API, it would not lose those &13 ? There is actually an API that comes with thoses macros: PTU API If I was to replace all the " "/w "+playername+" by "/w "gm", would that work? I was trying to work only with the macro but it seems I will have to rely on that.
1528925212
The Aaron
Pro
API Scripter
API Command Buttons follow this syntax: [Label](Command) where Command is an API Command, which must begin with a !, so: [Do Thing](!some-command some arguments) What the hack does is lets you pass something like this: ! /w gm something So you are actually running an api command, it just happens to do nothing: ! You could actually define an API command for that, which could cause some problems. =D In the case of an API Command button sending API commands, you wouldn't need the 
, unless you were chaining several API commands: [Do Several Things](!command the first
!command the second) which would send: !command the first !command the second when you click the button, two separate API commands. For that script, I'd suggest just adding: playername = playerIsGM(msg.playerid) ? 'gm' : playername; after each of the if (playername.indexOf(" ")!==-1) blocks: on("chat:message", function(msg) { if (msg.type == "api" && msg.content.indexOf("!PTU") !== -1 &&!(msg.hasOwnProperty("selected"))){ var playername = getObj("player",msg.playerid).get("_displayname"); if (playername.indexOf(" ")!==-1){ playername = playername.substring(0,playername.indexOf(" ")); } playername = playerIsGM(msg.playerid) ? 'gm' : playername; sendChat("PTUInt API", "/w "+playername+" Please select a token.");   } else if (msg.type == "api" && msg.content.indexOf("!PTU")!==-1){ var playername = getObj("player",msg.playerid).get("_displayname"); if (playername.indexOf(" ")!==-1){ playername = playername.substring(0,playername.indexOf(" ")); } playername = playerIsGM(msg.playerid) ? 'gm' : playername; var tok = getObj("graphic",msg.selected[0]._id).get("represents"); That should make it whisper to the GM if the player activating it is a GM, otherwise it whispers to the player. If you do want it to always go to the GM, just change the var playername = stuff  (underlined above) to this:  var playername = 'gm';
1528926149

Edited 1529399753
Ouuh Fancy! :D I can (and will) work with that. Thanks a lot for your help!  I will post the API script if I get it to work as intended for any fellow player of PTU.
1529399738

Edited 1529399808
var playername = 'gm'; works well but the attack rolls  are still displayed as all chat , I checked all the sendchat command and nothing seems to send the attack roll: If I go back in the chat, the command sent is: ! %{selected|Move1AtkSpec} But what I need is for the API to send /w gm %{selected|Move1AtkSpec} How do I find the line that ditactes the chat command for the attack roll ?
1529406902
Actually what you need is to change your Move1AtkSpec  macro to whisper it's template output
1529407508

Edited 1529407544
Well, it's an API so I can't write  /w gm !PTUInt And after !PTUInt I just click in the chat. What do you mean?
1529412657
The Aaron
Pro
API Scripter
I posted in your other thread.. Might work?
1529413658
OK, I'm continuing on the other thread then ^^ https://app.roll20.net/forum/post/6501243/transforming-an-api-for-rolling-only-to-the-gm