this is aliasmasks cup of t. However I havent' seen him here for a while, usually he's quite active though.
The only way I can help you with is suggesting an entirely different approach, with the use of a virtual menu...: http://forums.rptools.net/viewtopic.php?f=8&t=16304
creating macros with a macro
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
Re: creating macros with a macro
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
-
- Kobold
- Posts: 13
- Joined: Thu Aug 04, 2011 3:11 pm
Re: creating macros with a macro
Thanks, though I don't think that works for what I'm trying to do.
I mean, there are a few workaround ideas for what I'm trying to do, so I'll just try one of those.
I mean, there are a few workaround ideas for what I'm trying to do, so I'll just try one of those.
Re: creating macros with a macro
As a test, I dropped a token on to the map and renamed it test. I then impersonated the token by right clicking and selecting Impersonate. In the chat I typed:TheyCallMeTomu wrote:Urghlefurgle.
I hate necroing old threads, but I couldn't find any other references on the forums after a search, so try not to burn the witch for thread necromancy. Anyway:
So I appear to be having the opposite problem; I'm not having issues creating macros with a macro, but I'm having difficulty modifying a property of a macro that already exists.
Relevant code:
Everything works EXCEPT the applyToSelected part. I've tried it with "applyToSelected=1" with "applyToSelected=true", "applyToSelected=true;" ... am I doing something wrong here or what? I've hit a number of "OH! That's what's wro-" moments that immediately turn into "well that doesn't help at all."Code: Select all
[h:setMacroProps(getMacroButtonIndex(),"sortBy=XDaily")] [h:setMacroProps(getMacroButtonIndex()+1,"applyToSelected=true;")] [h:setMacroProps(getMacroButtonIndex()+1,"sortBy=XDaily")] [h:setMacroCommand(getMacroButtonIndex()+1,' [getMacroProps(getMacroButtonIndex())] ')]
Code: Select all
[setMacroProps("test","applyToSelected=1")]
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
-
- Kobold
- Posts: 13
- Joined: Thu Aug 04, 2011 3:11 pm
Re: creating macros with a macro
It works for other things though. I'm able to successfully set the command of getMacroButtonIndex()+1.
What I'm doing is I'm creating a series of "Spell Slot" macros, each of which will call on a library macro based on either the name of the spell slot macro, or an input. The called macro then affects an adjacent macro (that I explicitly created in sequential order, just to make sure that the indexes line up) to set the command so that any state toggles or secondary attacks can be utilized.
Unfortunately, the apply to selected aspect doesn't seem to work, so instead I've gone for a workaround that involves the primary spell slot macros ALWAYS being unchecked whereas the secondaries are always checked, and using the button color in order to determine which macro to run (the primary or the secondary, with the adjacent macros just being state toggles).
What I'm doing is I'm creating a series of "Spell Slot" macros, each of which will call on a library macro based on either the name of the spell slot macro, or an input. The called macro then affects an adjacent macro (that I explicitly created in sequential order, just to make sure that the indexes line up) to set the command so that any state toggles or secondary attacks can be utilized.
Unfortunately, the apply to selected aspect doesn't seem to work, so instead I've gone for a workaround that involves the primary spell slot macros ALWAYS being unchecked whereas the secondaries are always checked, and using the button color in order to determine which macro to run (the primary or the secondary, with the adjacent macros just being state toggles).
Re: creating macros with a macro
The macro index is not a static number and can change for several reasons. So, even if its index is 1 more than another macro at one time, it could change. That's why you should either use the name on the macro or get the index value.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
-
- Kobold
- Posts: 13
- Joined: Thu Aug 04, 2011 3:11 pm
Re: creating macros with a macro
Not an option; the exercise is designed such that I can call on macros on the basis of the button names.
What exactly would cause the index numbers to change, for any given token?
Basically, my set up is like this:
Level 17 slot, Level 17 Slot Secondary, Level 23 slot, Level 23 slot secondary.
I want both the Level 17 slot button and the Level 23 slot button, each of which can have names that change on a regular basis, to be able to call on the same set of different library macros. The library macro will change the name of the secondary buttons (along with the names of the slot buttons), but the same macro has to be able to be used by each of the three slots, so I have to have notation for the secondary slot that's relative (ala getMacroButtonIndex()+1).
What exactly would cause the index numbers to change, for any given token?
Basically, my set up is like this:
Level 17 slot, Level 17 Slot Secondary, Level 23 slot, Level 23 slot secondary.
I want both the Level 17 slot button and the Level 23 slot button, each of which can have names that change on a regular basis, to be able to call on the same set of different library macros. The library macro will change the name of the secondary buttons (along with the names of the slot buttons), but the same macro has to be able to be used by each of the three slots, so I have to have notation for the secondary slot that's relative (ala getMacroButtonIndex()+1).