RPTools.net

Discussion and Support

Skip to content

It is currently Tue Feb 20, 2018 3:01 am 






Reply to topic  [ 21 posts ]  Go to page Previous  1, 2

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Deity
 
Joined: Tue Jul 01, 2008 6:48 pm
Posts: 6237
 Post subject: Re: Macro Deletion Utility
PostPosted: Thu Jul 02, 2009 8:16 am 
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:
[code=php]


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

_________________

What I'm Working On

MapTool Tutorials:
Introduction to Tokens
Introduction to Properties
Introduction to Macro Writing
Introduction to Light and Sight


Top
 Profile  
 
User avatar  Offline
Dragon
 
Joined: Sun Jun 15, 2008 1:40 pm
Posts: 444
Location: Montréal, QC
 Post subject: Re: Macro Deletion Utility
PostPosted: Thu Jul 02, 2009 9:28 am 
Code:
// 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 ]


Top
 Profile  
 
User avatar  Offline
Site Admin
 
Joined: Mon Jun 12, 2006 12:20 pm
Posts: 12111
Location: Tampa, FL
 Post subject: Re: Macro Deletion Utility
PostPosted: Thu Jul 02, 2009 10:19 am 
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.


Top
 Profile  
 
User avatar  Offline
Giant
 
Joined: Wed Sep 08, 2010 10:41 pm
Posts: 118
Location: Boise, ID
 Post subject: Re: Macro Deletion Utility
PostPosted: Wed Sep 29, 2010 3:27 pm 
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


Top
 Profile  
 
User avatar  Offline
Demigod
 
Joined: Mon Jun 29, 2009 9:37 am
Posts: 3108
Location: Germany
 Post subject: Re: Macro Deletion Utility
PostPosted: Wed Sep 29, 2010 3:39 pm 
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:
<!--Build the input string for the tabs and checkboxes-->
[
h,foreach(uniqueGroupuniqueGroupList),CODE:
{  
   [
macroLabels listSort(json.get(macrosInGroupuniqueGroup), "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(
macroLabelmacroLabels),CODE:
   {
      [
idx getMacroIndexes(macroLabel)]
      [foreach(
indexidx): inputParams =if(if(getStrProp(getMacroProps(index),"group")=="""Top Level"getStrProp(getMacroProps(index),"group")) == uniqueGroupjson.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:
      [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)]

_________________
HELP: GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC.

most complete list of my maptool stuff


Top
 Profile  
 
User avatar  Offline
Giant
 
Joined: Wed Sep 08, 2010 10:41 pm
Posts: 118
Location: Boise, ID
 Post subject: Re: Macro Deletion Utility
PostPosted: Sat Oct 02, 2010 1:10 am 
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: 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


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 21 posts ]  Go to page Previous  1, 2

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman