How do I create a link within a dialog for players to click which will run code
i have found the macrolink function but that calls another macro.. I want the link to run the code itself.
EG MACRO called Heal on player token which opens a dialog within which is a clickable link to roll some dice for damage healed and another link which when clicked changes the state on the token etc
Thanks to anyone who answers
Link to run code in dialog
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: Link to run code in dialog
I'm not sure I follow. A macrolink that calls another macro is "running code." It's used for exactly what you're asking for. You click it. It runs code.
Is your Heal Macro popping an input window or a true Frame/Dialog window? You can't make clickable links in the input window... but you can in a Frame or Dialog.EG MACRO called Heal on player token which opens a dialog within which is a clickable link to roll some dice for damage healed and another link which when clicked changes the state on the token etc
http://lmwcs.com/rptools/wiki/Introduct ... and_Frames
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."
Re: Link to run code in dialog
Yes it is a proper dialog .
yes I know a macro runs code but the macro is somewhere else...not on the player token which means lots of unnecessary faff of getting the properties from the original token by the time it has bounced to a global macro and a lib macro etc.
In a simpler example; I want a clickable link on a dialog or frame that is called ROLL DICE and rolls dice.when you click it .not calls another macro to roll dice.
Hope this makes sense
yes I know a macro runs code but the macro is somewhere else...not on the player token which means lots of unnecessary faff of getting the properties from the original token by the time it has bounced to a global macro and a lib macro etc.
In a simpler example; I want a clickable link on a dialog or frame that is called ROLL DICE and rolls dice.when you click it .not calls another macro to roll dice.
Hope this makes sense
Re: Link to run code in dialog
it makes sense and its not possible, it might be if you're using jscript, as thats self contained in the frame, but if you're talking MT script, that HAS to be contained in a macro (or copy pasted straight into chat).
I guess the closest thing is that you enter some code in the frame as string e.g [r:roll(1,6)] and pass that onto a 'executeThis' macro which contains:
[r:evalMacro(arg(0))]
I guess the closest thing is that you enter some code in the frame as string e.g [r:roll(1,6)] and pass that onto a 'executeThis' macro which contains:
[r:evalMacro(arg(0))]
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS