Macro Deletion Utility

These are tools and utilities that make it easier to run games. This includes Lib: macro tokens dropped into MapTool to manage the game, a conversion file for CharacterTool to allow use in MapTool, or just about anything else you can think of -- except graphics with macros and anything specific to a particular campaign framework. Those are already covered by the Tilesets subforum and the Links and External Resources forum.

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

User avatar
Rumble
Deity
Posts: 6235
Joined: Tue Jul 01, 2008 7:48 pm

Re: Macro Deletion Utility

Post by Rumble »

biodude wrote:
RPTroll wrote:You guys rock. Thanks for sharing.
Ditto.

Do you mind if I ask a totally naïve question?
How do you get the code in your posts to get all that coloured syntax? It doesn't do it for everyone, but all you macro-gurus seem to have it in your posts. Just curious.

If you say code=php in the code tag:

Code: Select all

[code=php]
It will highlight it using the php syntax highlighter, which is pretty good for maptool purposes.

User avatar
biodude
Dragon
Posts: 444
Joined: Sun Jun 15, 2008 2:40 pm
Location: Montréal, QC

Re: Macro Deletion Utility

Post by biodude »

Code: Select all

// Cool
[ reply = "Thanks" + Again ]
 
:wink:
"The trouble with communicating is believing you have achieved it"
[ d20 StatBlock Importer ] [ Batch Edit Macros ] [ Canned Speech UI ] [ Lib: Math ]

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Macro Deletion Utility

Post by Azhrei »

Yeah, I wanna find some way to make that the default.

Ideally we'd have our own syntax highlighter for "mtmacro" and that would be the default. In the near-term I may be able to make "mtmacro" an alias for "php" and then tell the browser to use that by default when inserting a CODE block. That way if a syntax highlighter is ever written in the future, it'll automatically use that syntax for older posts.

User avatar
Doc_Waldo
Giant
Posts: 108
Joined: Wed Sep 08, 2010 11:41 pm
Location: Boise, ID

Re: Macro Deletion Utility

Post by Doc_Waldo »

I understand this was posted a long time ago, but is there a way to have a "kill all macro's" selection. I downloaded the macro and it ran great, but I had to go through each page and select each check bar, and with your framework, which is wonderful, it takes a while. I am hoping to just hit one button and strip ALL macro's. If this is possible, I would very grateful if you can let me know what I need to do. Thanks.
--DOC

User avatar
CoveredInFish
Demigod
Posts: 3104
Joined: Mon Jun 29, 2009 10:37 am
Location: Germany
Contact:

Re: Macro Deletion Utility

Post by CoveredInFish »

Its easy to change the code so that all macros are checked (to be deleted) by default.
Edit the "DeleteMacros" macro.

Look for this part:

Code: Select all

<!--Build the input string for the tabs and checkboxes-->
[h,foreach(uniqueGroup, uniqueGroupList),CODE:
{  
   [macroLabels = listSort(json.get(macrosInGroup, uniqueGroup), "N+")]
   [h:inputParams = json.append(inputParams, "group_"+roll.count+"|"+uniqueGroup+"||TAB")]
   [h:inputParams = json.append(inputParams, ".|<html><b>Select the Macros you wish to delete. Note: There is no undo!</b></html>||LABEL|SPAN=TRUE")]
   [foreach(macroLabel, macroLabels),CODE:
   {
      [idx = getMacroIndexes(macroLabel)]
      [foreach(index, idx): inputParams =if(if(getStrProp(getMacroProps(index),"group")=="", "Top Level", getStrProp(getMacroProps(index),"group")) == uniqueGroup, json.append(inputParams, "macro_"+index+"|0|<html>"+macroLabel+" "+if(getStrProp(getMacroProps(index),"tooltip")=="", "(no tooltip available)", "("+getStrProp(getMacroProps(index),"tooltip")+")")+"</html>|CHECK"), inputParams)]
   }]
}] 
Change the 0 to a 1 in this line:

Code: Select all

      [foreach(index, idx): inputParams =if(if(getStrProp(getMacroProps(index),"group")=="", "Top Level", getStrProp(getMacroProps(index),"group")) == uniqueGroup, json.append(inputParams, "macro_"+index+"|0|<html>"+macroLabel+" "+if(getStrProp(getMacroProps(index),"tooltip")=="", "(no tooltip available)", "("+getStrProp(getMacroProps(index),"tooltip")+")")+"</html>|CHECK"), inputParams)]
That zero ...
[foreach(index, idx): inputParams =if(if(getStrProp(getMacroProps(index),"group")=="", "Top Level", getStrProp(getMacroProps(index),"group")) == uniqueGroup, json.append(inputParams, "macro_"+index+"|0|<html>"+macroLabel+" "+if(getStrProp(getMacroProps(index),"tooltip")=="", "(no tooltip available)", "("+getStrProp(getMacroProps(index),"tooltip")+")")+"</html>|CHECK"), inputParams)]

User avatar
Doc_Waldo
Giant
Posts: 108
Joined: Wed Sep 08, 2010 11:41 pm
Location: Boise, ID

Re: Macro Deletion Utility

Post by Doc_Waldo »

Perfect. I posted in another area, and Allasmask put together the following code for a macro that simple strips without any selection:

<!-- get and delete all macros -->
[H: allMacros = getMacros("json")]
[H, foreach(macro,allMacros), code: {
[H: macroList = getMacroIndexes(macro)]
[H, foreach(index,macroList): removeMacro(index)]
}]
<!-- get and delete all properties -->
[H: allProperties = getMatchingProperties(".*","json")]
[H, foreach(prop,allProperties): resetProperty(prop)]
<!-- after this you can customize your token -->
[H: setPropertyType("basic")]
[H: setAllStates(0)]
<!-- but there other things you cant do like setting "portrait" image or some token permissions -->

The topic is at: http://forums.rptools.net/viewtopic.php?f=4&t=16259

With the combo of these two macro's, I am set. Thanks you.

I did pose a question in the other forum, is there a way to "convert" a toke/monster from one framework to another? Thanks for the help CoveredInFish, I do appreciate it.
--DOC

Post Reply

Return to “Drop-In Macro Resources”