fvtt-module-lmrtfy icon indicating copy to clipboard operation
fvtt-module-lmrtfy copied to clipboard

Echo out the chat message to use it in macros

Open TrikyEMF opened this issue 3 years ago • 5 comments

In order to use this module in macros more effectively, could you echo out the chat message so the result can be managed by macros?

For instance, a macro will request a 3d6 roll, and use the roll value to do something else.

Thank you!!

TrikyEMF avatar Sep 03 '21 11:09 TrikyEMF

I would also like this for writing macros as well. Getting the result from a request back into the macro would be very useful.

Little-Froggy avatar Mar 06 '22 04:03 Little-Froggy

I would like to add to this!

irbian avatar May 11 '22 21:05 irbian

I think I'll need a little bit more information on this to fully understand what it is that you need.

vtt-lair avatar Sep 02 '22 21:09 vtt-lair

I´ll put it on different terms: how can we use the result of the LMRTFY roll? for example, as input for a macro

irbian avatar Sep 02 '22 22:09 irbian

I switched to Monk's tokenbar to have this functionnality. The idea was being able to use the LMRTFY result in a macro. For instance, in the code below I use the roll result given by Monk's tokenbar to check if the macro has to apply an effect or not.

let results = await game.MonksTokenBar.requestRoll([{"token":tokenid}],{request:'save:con', dc:dc, showdc:true, silent:true, fastForward:false, 
            flavor:'Comprueba si soportas el aura venenosa', rollMode:'roll', 
            callback: () => { 
                let rollResult=results.data.flags['monks-tokenbar'][`token${tokenid}`].total;
                console.log(`Foul | Roll result=${rollResult}`);
                if (rollResult < dc) {
                    game.dfreds.effectInterface.removeEffect({ effectName: 'Foul - Poisoned', uuid: args[1].actorUuid });
                    game.dfreds.effectInterface.addEffect({ effectName: 'Foul - Poisoned', uuid: args[1].actorUuid });
                }
                else {
                    console.log("not poisoned");
                }
            }
    });

TrikyEMF avatar Sep 09 '22 09:09 TrikyEMF