Page 1 of 1

Spurious output from macros with comments - known issue?

Posted: Wed Nov 08, 2017 7:08 pm
by Phergus
So the following macro code produces the correct output on the GM's and macro-clicker's chat but also produces blank output lines on all the other clients.

Code: Select all

<!-- foo -->
[s,g,r:1d100]
This also happens with just the 's' roll option or just the 'g' roll option.

Take out the comment and it works as expected.

Is this a known issue? If so, is there a workaround?

MT versions 1.4.0.5 and 1.4.1.7.

Re: Spurious output from macros with comments - known issue?

Posted: Wed Nov 08, 2017 9:32 pm
by Full Bleed
Phergus wrote:So the following macro code produces the correct output on the GM's and macro-clicker's chat but also produces blank output lines on all the other clients.

Code: Select all

<!-- foo -->
[s,g,r:1d100]
This also happens with just the 's' roll option or just the 'g' roll option.

Take out the comment and it works as expected.

Is this a known issue? If so, is there a workaround?

MT versions 1.4.0.5 and 1.4.1.7.
You need to hide the comment.

Code: Select all

[h: "<!-- foo -->"]
http://lmwcs.com/rptools/wiki/Introduct ... o#Comments

Re: Spurious output from macros with comments - known issue?

Posted: Wed Nov 08, 2017 9:58 pm
by aliasmask
Better yet, use UDFs, hide output and use broadcast for output.

My starter token has all the basics for creating UDFs for you: http://forums.rptools.net/viewtopic.php ... er#p267681

Re: Spurious output from macros with comments - known issue?

Posted: Thu Nov 09, 2017 9:19 am
by Phergus
Full Bleed wrote:You need to hide the comment.

Code: Select all

[h: "<!-- foo -->"]
http://lmwcs.com/rptools/wiki/Introduct ... o#Comments
Thanks FB. :lol: Hide the hidden output by hiding it. I should have expected that. :lol:

Too bad the documentation on the wiki doesn't just say that HTML comments create spurious output so don't use them.
In contrast, in MapTool's macro language, anything between the comment tags is hidden from chat, but if you embed macro commands in there, they will be executed.

Re: Spurious output from macros with comments - known issue?

Posted: Thu Nov 09, 2017 9:30 am
by Phergus
aliasmask wrote:Better yet, use UDFs, hide output and use broadcast for output.
Not sure that addresses the issue that even if I hide all output in a macro a single HTML comment will produce a line of empty output to all clients. My goal is to have comments in my macro code and apparently the documentation is flat wrong.
aliasmask wrote:My starter token has all the basics for creating UDFs for you: http://forums.rptools.net/viewtopic.php ... er#p267681
Thanks. I'll look over your stuff.

Re: Spurious output from macros with comments - known issue?

Posted: Thu Nov 09, 2017 12:17 pm
by aliasmask
Html comments still produces output. If you go to the chat log you would see the blank lines are actually your html comments. But since they are not shown in text, you don't see anything.

Re: Spurious output from macros with comments - known issue?

Posted: Thu Nov 09, 2017 6:45 pm
by Phergus
Well that explains why the chat log files are so big.

For every line of of actual chat output there are 10 or so lines of HTML comment plus all the HTML formatting code.

Your recommendation about UDFs was because they can produce no output at all if the ignoreOutput flag is set to true?

You'll have to forgive my ignorance about the macro functions as even though I have been using MapTool for 12 years I rarely used macros until a couple years ago. Until four weeks ago I had never saved a chat log let alone looked at one.

Thanks AM.