Search found 444 matches

by biodude
Thu Apr 08, 2010 7:50 am
Forum: Macros
Topic: Moving Token- Code Problem. Please help. Thanks.
Replies: 4
Views: 401

Re: Moving Token- Code Problem. Please help. Thanks.

You are also missing a closing bracket on the IF option (I do this all the time). So ...

This line

Code: Select all

[r: if( floor( number / 2 )==( number / 2 ), code: {


should be like this

Code: Select all

[r, if( floor( number / 2 )==( number / 2 ) ), code: {

:D
by biodude
Wed Apr 07, 2010 10:43 pm
Forum: Macros
Topic: Tables & JSONs & Loops ... Oh MY!
Replies: 7
Views: 458

Re: Tables & JSONs & Loops ... Oh MY!

I just noticed another error in your code in your second WHILE loop: your if condition was a hybrid between the roll option ( IF ) and the if function. Perfectly understandable, but they are different. You likely would have received an error message for that, too. While I was at it, I edited your co...
by biodude
Wed Apr 07, 2010 10:30 pm
Forum: Macros
Topic: Tables & JSONs & Loops ... Oh MY!
Replies: 7
Views: 458

Re: Tables & JSONs & Loops ... Oh MY!

...[h, while(intRow < 26 && startval  !=  json.get(table("TimeValueProgression",intRow), lookwhat)):  intRow = intRow + 1]...  The problem is that you have nested function calls (i.e. a function within a function) within your WHILE roll option. The error message in this event is terribly UN...
by biodude
Wed Apr 07, 2010 10:19 pm
Forum: Macros
Topic: trouble with custom, user-defined functions
Replies: 8
Views: 515

Re: trouble with custom, user-defined functions

can I do this in a macro: [h: GetTV("10","NumberValue","6","NumberValue","1")][h: LookupResult = macro.return][r: "Number should be 1000:" + (LookupResult)]  You can do this, but it will only work as expected if the macro defined as GetTV() act...
by biodude
Wed Mar 31, 2010 9:49 am
Forum: Macros
Topic: Error executing getName there is no impersonated token
Replies: 11
Views: 1366

Re: Error executing getName there is no impersonated token

If you have no impersonated token, then this will fail even if you have selected tokens. 2 possible solutions (& suggestions): 1. you can pass a specific token ID to getName(), which will return what you want, regardless of the Impersonated Token. 2. (This is what I do in my custom statsheet th...
by biodude
Mon Mar 29, 2010 11:56 am
Forum: MapTool
Topic: Max function question and to-hit/damage macro
Replies: 14
Views: 709

Re: Max function question and to-hit/damage macro

Oh, heh, never thought of that! Max() and min() can take more than 2 arguments, but can't accept lists or JSON arrays as arguments...[/quote] Which is why I wrote a math.list() custom function to apply functions that normally take multiple arguments to a list / array (like max, sum, etc.). I like yo...
by biodude
Sat Mar 27, 2010 4:19 pm
Forum: Macros
Topic: Changing Macro Variables Through Other Macros
Replies: 6
Views: 534

Re: Changing Macro Variables Through Other Macros

ok ... I think what you are trying to do is rather advanced (I would personally hesitate to try, although I have entertained the notion, before my brain said 'uh, are you crAZY?!' ). The good news is, I also think there is a far simpler way of achieving what you want. First, to answer your question:...
by biodude
Sat Mar 27, 2010 3:57 pm
Forum: Macros
Topic: Trig and Maptools
Replies: 40
Views: 9676

Re: Trig and Maptools

determining if a number is even or odd is a common task, but also fairly trivial:

Code: Select all

[H: evenOrOdd = if( floor( number / 2 )==( number / 2 ) , "even", "odd" )] 

which is why I don't think anyone has ever written an entire UDF for it. Would such a thing be useful to people?
by biodude
Sat Mar 27, 2010 10:35 am
Forum: Macros
Topic: Trig and Maptools
Replies: 40
Views: 9676

Re: Trig and Maptools

Someone, or perhaps a lot of someones, should develop a Lib:Math token to share. Well, since you asked ... Lib-Math-1.3b56.rptok I included all the trig & math functions in this thread: ⋅ pi ⋅ degrees ⋅ radians ⋅ sine ⋅ cosine ⋅ factor...
by biodude
Thu Mar 25, 2010 5:23 pm
Forum: Macros
Topic: Link tokens to tables
Replies: 33
Views: 2031

Re: Link tokens to tables

Your code is set up to do something very strange: the first macro draws a frame, and if the current token has the correct property type, it calls another macro that also draws a frame with the same name . I would recommend changing the onChangeSelection href to just reload the same macro (and provid...
by biodude
Wed Mar 24, 2010 12:15 pm
Forum: Macros
Topic: Link tokens to tables
Replies: 33
Views: 2031

Re: Link tokens to tables

you know, you don't even need a lib token - just reference campaign macro in your token property. This is, after all, a campaign map. Lib Tokens are best used for "mechanics" and things that can be moved from campaign to campaign (if you want this for other campaigns, then it might make se...
by biodude
Tue Mar 23, 2010 10:54 pm
Forum: Macros
Topic: Drop-Down List in a Frame
Replies: 22
Views: 1370

Re: Drop-Down List in a Frame

Thank you biodude, I have tried your code however when I click on the send button it asks me for token.name and race. It then sends what ever was the value in the input pops to the player selected. The token.name and race should come from the token selected where the macro call was triggered. Right...
by biodude
Tue Mar 23, 2010 5:36 pm
Forum: Macros
Topic: Link tokens to tables
Replies: 33
Views: 2031

Re: Link tokens to tables

Am I making any sense? Are you as excited about the possibilities as I am? Actually, I'm not sure I'm following - updating what? Do you just mean using the onChangeSelection to update the frame just by selecting the token, rather than having to run a macro? Exactly. I wasn't sure what the desired b...
by biodude
Tue Mar 23, 2010 5:32 pm
Forum: Macros
Topic: Drop-Down List in a Frame
Replies: 22
Views: 1370

Re: Drop-Down List in a Frame

Unlike the input function, frames & dialogs do not interrupt (pause) macro execution. They draw the frame, and then keep on chugging. To use the frame & dialog roll options, you have to change the way you structure your information flow. So, in your code, the first time the frame is drawn, i...
by biodude
Tue Mar 23, 2010 3:20 pm
Forum: Macros
Topic: Table Row Numbers -> Can they be negative?
Replies: 2
Views: 255

Re: Table Row Numbers -> Can they be negative?

Totally. You can even have ranges of negative numbers ( -10--5 would be '-10 to -5'). Who knew?
MapTool rocks.

Go to advanced search