Suppressing blank macroLink output

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
User avatar
Venatius
Dragon
Posts: 256
Joined: Mon Feb 16, 2009 7:12 pm

Suppressing blank macroLink output

Post by Venatius »

I'm down to one last puzzle in getting a basic version of my new framework out the door, and it's not a huge deal, but it is a little ugly. So, I've got an HTML form in a frame with a checkbox to mark the output as "private". The form sends the player's input on to a "submit" macro that executes the processing. In most of these this works fine because it just executes different code that suppresses some details. However, in this case, the Private marker is intended to conceal all output. Where I run into a problem is that if Private is checked, those for whom the output is hidden still see a blank line. As best I can tell, this is because a macroLink using "all" as the target always outputs SOMETHING, even if all the actual text is hidden. (If I'm wrong in this assumption, let me know) Is there a way to circumvent or suppress this? Some half-baked ideas I've had:

* Finding a way to not use a macroLink at all, but instead just processing the macro as though with the macro roll option (so that blank output will be suppressed like in normal macro execution). No luck on this so far. When I try to simply set it this way as the form action (ex: <form action="[r, macro("ExpendSubmit@this"): ""]" method="json">), it executes the instant the form opens, so that definitely doesn't work. I've tried having it link to an "intermediate" macro whose only content is a link to the final macro via the macro roll option, but since it's still coming out of an "all" macroLink, it still outputs a blank line. (Likewise, putting it as "self" means the output is 100% suppressed for everyone else, even in a subordinate macro like that)

* Finding a way to "fork" the code so that it goes to an "all" macroLink if private isn't set and a "self" macroLink if it is. I'm at kind of a loss as to how though. The best I can manage so far is having it conditionally generate one of two different clickable macroLinks after the form is submitted, which is a pretty ugly way to do it. And sadly, the trick with using auto-executing macrolinks doesn't seem to work. For some reason they don't seem to auto-run for the person who generated them.

* Sadly, conditionally just setting the macroLink in the form action seems to be off the menu, because it has no way to "know", when the form is generated, whether Private is ticked or not.

Any thoughts? If all else fails I may just make a minimalist little message so those from whom it's hidden have something a bit more elegant than a random blank line, but I'd prefer it if they simply couldn't see anything at all when this macro is used privately.

Post Reply

Return to “Macros”